:root {
  --bg: #F8F9FC;
  --surface: #FFFFFF;
  --surface2: #F1F3F9;
  --border: #E2E5EF;
  --text: #0F172A;
  --text2: #64748B;
  --text3: #94A3B8;
  --primary: #4338CA;
  --primary-light: #6366F1;
  --primary-bg: rgba(67,56,202,0.05);
  --green: #059669;
  --green-bg: rgba(5,150,105,0.06);
  --amber: #D97706;
  --amber-bg: rgba(217,119,6,0.06);
  --red: #DC2626;
  --red-bg: rgba(220,38,38,0.05);
  --blue: #2563EB;
  --blue-bg: rgba(37,99,235,0.06);
  --radius: 14px;
  --sidebar-w: 260px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03);
  --shadow: 0 4px 20px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.icon-svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── LOGIN ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #EEF2FF 0%, #F8F9FC 50%, #F1F3F9 100%); }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 56px 48px; width: 420px; text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.06); }
.login-logo { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.login-logo span { color: var(--primary); }
.login-sub { color: var(--text2); font-size: 13px; margin-bottom: 36px; }
#login-form input { width: 100%; padding: 13px 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); margin-bottom: 16px; outline: none; transition: border-color .2s; }
#login-form input:focus { border-color: var(--primary); background: #fff; }
#login-form button { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; transition: all .2s; }
#login-form button:hover { background: #3730A3; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ── APP LAYOUT ── */
html, body { overflow-x: hidden; }
.app { display: flex; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 100; }
.sidebar-logo { font-size: 17px; font-weight: 700; padding: 28px 24px 24px; letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.sidebar-logo span { color: var(--primary); }
.sidebar-logo .logo-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-bg); color: var(--primary); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 16px 20px; background: var(--surface2); border-radius: 12px; transition: background .2s; }
.sidebar-user:hover { background: var(--primary-bg); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text2); margin-top: 1px; }
.nav-menu { list-style: none; margin-top: 8px; flex: 1; overflow-y: auto; padding: 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin: 3px 0; border-radius: 10px; color: var(--text2); cursor: pointer; font-size: 13.5px; font-weight: 500; transition: all .2s; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-icon { width: 22px; display: flex; align-items: center; justify-content: center; opacity: 0.6; }
.nav-item.active .nav-icon { opacity: 1; }
.sidebar-footer { padding: 20px 16px; border-top: 1px solid var(--border); }
.btn-logout { width: 100%; padding: 9px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text2); font-size: 13px; transition: all .2s; }
.btn-logout:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

/* ── MAIN ── */
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 36px 40px; min-width: 0; max-width: calc(100vw - var(--sidebar-w)); }
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.page-date { font-size: 13px; color: var(--text3, var(--text2)); font-weight: 500; }

/* ── BUTTONS ── */
.btn-primary { padding: 8px 18px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; transition: all .2s; }
.btn-primary:hover { border-color: var(--text); background: var(--surface2); }
.btn-secondary { padding: 8px 18px; background: var(--surface); color: var(--text2); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; transition: all .2s; }
.btn-secondary:hover { border-color: var(--text3); color: var(--text); }
.btn-danger { padding: 8px 18px; background: var(--surface); color: var(--red); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; transition: all .2s; }
.btn-danger:hover { border-color: var(--red); background: var(--red-bg); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 7px; }

/* ── DASHBOARD CARDS ── */
.dashboard-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: all .2s; }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card .card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.stat-card .label { font-size: 12px; color: var(--text2); margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 32px; font-weight: 800; letter-spacing: -1.5px; color: var(--text); line-height: 1; }
.stat-card .change { font-size: 12px; margin-top: 10px; font-weight: 600; }
.stat-card .change.up { color: var(--green); }
.stat-card .change.down { color: var(--red); }
.stat-card.alert { border-color: var(--red); background: var(--red-bg); }

/* ── PANELS ── */
.dashboard-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 24px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.panel-header { font-size: 14px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; color: var(--text); }
.panel-header .view-all { font-size: 12px; font-weight: 500; color: var(--primary); cursor: pointer; text-decoration: none; }

/* ── KANBAN ── */
.project-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.project-tab { padding: 7px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; transition: all .2s; }
.project-tab:hover { border-color: var(--text3); color: var(--text); }
.project-tab.active { background: var(--text); color: #fff; border-color: var(--text); font-weight: 600; }
.kanban-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 32px; }
.kanban-col { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-height: 300px; }
.kanban-col-header { font-size: 13px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.kanban-col-header .count { background: var(--surface); padding: 2px 8px; border-radius: 10px; font-size: 11px; color: var(--text2); border: 1px solid var(--border); }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm); }
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.kanban-card .kc-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text2); }
.kanban-card .kc-assignee { background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.kanban-card .kc-due { color: var(--text2); }
.kanban-card .kc-due.overdue { color: var(--red); font-weight: 600; }
.priority-high { border-left: 3px solid var(--red); }
.priority-medium { border-left: 3px solid var(--amber); }
.priority-low { border-left: 3px solid var(--green); }
.kanban-card .kc-children { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.kanban-card .kc-child { font-size: 11px; color: var(--text2); padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.kanban-card .kc-child-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.kc-child-dot.pending { background: var(--text2); }
.kc-child-dot.in_progress { background: var(--amber); }
.kc-child-dot.completed { background: var(--green); }
.kc-child-dot.reviewing { background: var(--blue); }
.kc-child-dot.confirmed { background: var(--primary); }
.kanban-card .kc-actions { display: flex; gap: 6px; margin-top: 8px; }
.kanban-card .kc-btn { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; border: none; cursor: pointer; transition: opacity .15s; }
.kc-btn:hover { opacity: 0.85; }
.kc-btn-start { background: var(--amber); color: #fff; }
.kc-btn-complete { background: var(--green); color: #fff; }
.kc-btn-confirm { background: var(--primary); color: #fff; }
.kc-due-warning { color: var(--amber); font-weight: 600; }
.kc-due-overdue { color: var(--red); font-weight: 600; }
.kanban-add { width: 100%; padding: 10px; background: transparent; border: 1px dashed var(--border); border-radius: 8px; color: var(--text2); font-size: 13px; transition: all .15s; margin-top: 8px; }
.kanban-add:hover { border-color: var(--primary); color: var(--primary); }

/* ── TIMELINE ── */
.timeline { display: flex; align-items: flex-start; gap: 0; padding: 20px 0; overflow-x: auto; }
.milestone-item { display: flex; flex-direction: column; align-items: center; min-width: 140px; position: relative; }
.milestone-item:not(:last-child)::after { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.ms-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; z-index: 1; position: relative; }
.ms-dot.completed { background: var(--green); border-color: var(--green); color: #fff; }
.ms-dot.overdue { background: var(--red); border-color: var(--red); color: #fff; }
.ms-title { font-size: 12px; font-weight: 600; margin-top: 10px; text-align: center; max-width: 120px; }
.ms-date { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── METRIC SUMMARY ── */
.metric-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table tr:hover td { background: var(--surface2); }

/* ── MEMBERS GRID ── */
.members-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.member-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: var(--shadow-sm); transition: all .2s; }
.member-card:hover { box-shadow: var(--shadow); }
.member-card .avatar { width: 52px; height: 52px; font-size: 20px; margin-bottom: 12px; }
.member-card .mc-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.member-card .mc-pos { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.member-card .mc-team { font-size: 11px; color: var(--primary); background: var(--primary-bg); padding: 3px 10px; border-radius: 6px; margin-bottom: 14px; }
.member-card .mc-actions { display: flex; gap: 8px; }
.member-card.disabled { opacity: 0.5; }
.status-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.status-active { background: var(--green-bg); color: var(--green); }
.status-disabled { background: var(--red-bg); color: var(--red); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.2); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 500px; max-height: 80vh; overflow-y: auto; box-shadow: 0 12px 48px rgba(0,0,0,0.1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px 28px; }

/* ── FORM ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 11px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); outline: none; transition: all .2s; }
.form-group select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: #fff; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── DATE FILTER ── */
.date-filter { padding: 8px 32px 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-weight: 500; outline: none; transition: all .2s; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.date-filter:hover { border-color: var(--text3); }
.date-filter:focus { border-color: var(--primary); }
input.date-filter { padding: 8px 14px; background-image: none; }

/* ── REPORTS ── */
.report-status-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.report-status-chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.report-status-chip.submitted { background: var(--green-bg); color: var(--green); }
.report-status-chip.missing { background: var(--red-bg); color: var(--red); }

.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm); transition: all .2s; }
.report-card.unread { border-left: 3px solid var(--primary); }
.report-card.reviewed { border-left: 3px solid var(--green); }
.report-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.report-card-header .rc-user { font-size: 15px; font-weight: 700; }
.report-card-header .rc-date { font-size: 12px; color: var(--text2); }
.report-card-header .rc-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 6px; }
.rc-status.submitted { background: var(--amber-bg); color: var(--amber); }
.rc-status.read { background: var(--blue-bg); color: var(--blue); }
.rc-status.reviewed { background: var(--green-bg); color: var(--green); }

.report-section { margin-bottom: 12px; }
.report-section .rs-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.report-section .rs-content { font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.report-section.issues .rs-content { color: var(--amber); }

.report-comment { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.report-comment .rc-label { font-size: 11px; font-weight: 700; color: var(--green); margin-bottom: 4px; }
.report-comment .rc-text { font-size: 13px; color: var(--text2); }
.report-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── PERFORMANCE ── */
.perf-bar { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.perf-bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.perf-good { background: var(--green); }
.perf-warn { background: var(--amber); }
.perf-bad { background: var(--red); }

/* ── ROLES ── */
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm); transition: all .2s; }
.role-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.role-card-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.role-level { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--primary-bg); color: var(--primary); }
.role-system { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); }
.role-meta { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.perm-module { background: var(--surface2); border-radius: 10px; padding: 14px; }
.perm-module-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.perm-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.perm-item label { cursor: pointer; color: var(--text2); }
.perm-item input:checked + label { color: var(--text); font-weight: 500; }
.perm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-tag { font-size: 10px; padding: 2px 8px; border-radius: 4px; background: var(--primary-bg); color: var(--primary); }

/* ── GROUPS ── */
.group-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.group-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.group-card-header h3 { font-size: 16px; font-weight: 700; }
.group-members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gm-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.gm-chip.leader { border-color: var(--amber); background: var(--amber-bg); }
.gm-chip .gm-role { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.gm-chip .gm-role.leader { background: var(--amber); color: #fff; }
.gm-chip .gm-role.member { background: var(--surface); color: var(--text2); }
.gm-chip .gm-remove { margin-left: auto; color: var(--text2); cursor: pointer; font-size: 14px; }
.gm-chip .gm-remove:hover { color: var(--red); }

/* ── DASHBOARD ASSETS & FILES ── */
.dashboard-assets-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dash-asset { border-radius: 8px; overflow: hidden; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.dash-asset:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.dash-asset .da-img { width: 100%; height: 80px; object-fit: cover; display: block; }
.dash-asset .da-icon { width: 100%; height: 80px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--text2); }
.dash-asset .da-name { padding: 6px 8px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-file { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dash-file:last-child { border-bottom: none; }
.dash-file .df-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.dash-file .df-info { flex: 1; min-width: 0; }
.dash-file .df-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-file .df-meta { font-size: 11px; color: var(--text2); }
.dash-file .df-link { font-size: 11px; color: var(--green); flex-shrink: 0; }

/* ── GANTT CHART ── */
.gantt-container { overflow-x: auto; padding-bottom: 8px; }
.gantt-chart { min-width: 100%; border-collapse: collapse; }
.gantt-chart .gantt-header { display: flex; border-bottom: 2px solid var(--border); }
.gantt-chart .gantt-header-label { width: 180px; min-width: 180px; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
.gantt-chart .gantt-header-dates { display: flex; flex: 1; }
.gantt-date-cell { flex: 1; min-width: 36px; padding: 8px 0; text-align: center; font-size: 10px; color: var(--text2); border-left: 1px solid var(--border); }
.gantt-date-cell.today { background: var(--primary-bg); color: var(--primary); font-weight: 700; }
.gantt-date-cell.weekend { background: rgba(0,0,0,0.015); }

.gantt-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); min-height: 48px; }
.gantt-row:hover { background: var(--surface2); }
.gantt-row-label { width: 180px; min-width: 180px; padding: 8px 12px; font-size: 13px; font-weight: 600; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-row-label .gantt-sub { font-size: 11px; color: var(--text2); font-weight: 400; }
.gantt-row-bars { display: flex; flex: 1; position: relative; height: 48px; align-items: center; }

.gantt-bar { position: absolute; height: 26px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; min-width: 4px; transition: opacity .15s; cursor: default; text-shadow: 0 1px 2px rgba(0,0,0,0.15); letter-spacing: 0.02em; }
.gantt-bar:hover { opacity: 0.85; }
.gantt-bar.pending { background: var(--primary); opacity: 0.35; }
.gantt-bar.in_progress { background: var(--amber); }
.gantt-bar.completed { background: var(--green); }
.gantt-bar.confirmed { background: var(--primary); }
.gantt-bar.overdue { background: var(--red); }
.gantt-bar.milestone-bar { background: none; width: 24px !important; min-width: 24px; height: 24px; padding: 0; justify-content: center; }
.gantt-bar.milestone-bar::before { content: '◆'; font-size: 18px; color: var(--amber); }
.gantt-bar.milestone-bar.completed::before { color: var(--green); }
.gantt-bar.milestone-bar.overdue-ms::before { color: var(--red); }

.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); z-index: 2; opacity: 0.5; }
.gantt-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text2); }
.gantt-legend-item { display: flex; align-items: center; gap: 6px; }
.gantt-legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ── GANTT TOGGLE ── */
.gantt-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; transition: all .2s; flex-shrink: 0; color: var(--text3); }
.gantt-toggle:hover { background: var(--surface2); color: var(--text); }
.gantt-toggle.open { transform: rotate(90deg); }
.gantt-toggle svg { width: 10px; height: 10px; }
.gantt-child-row { display: none; }
.gantt-child-row.visible { display: flex; }
.gantt-row-clickable { cursor: pointer; }
.gantt-row-clickable:hover { background: var(--primary-bg) !important; }

/* ── TASK SLIDE PANEL ── */
.task-panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.15); z-index: 500; opacity: 0; transition: opacity .25s; pointer-events: none; }
.task-panel-overlay.open { opacity: 1; pointer-events: auto; }
.task-panel { position: fixed; top: 0; left: 0; bottom: 0; width: 460px; max-width: 90vw; background: var(--surface); border-right: 1px solid var(--border); box-shadow: 8px 0 32px rgba(0,0,0,0.08); z-index: 501; transform: translateX(-100%); transition: transform .3s ease; overflow-y: auto; display: flex; flex-direction: column; }
.task-panel.open { transform: translateX(0); }
.task-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.task-panel-header h3 { font-size: 16px; font-weight: 700; }
.task-panel-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 4px; }
.task-panel-close:hover { color: var(--text); }
.task-panel-body { padding: 24px; flex: 1; overflow-y: auto; }
.task-panel-status { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.task-panel-status .tp-badge { font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 8px; cursor: default; }
.tp-field { margin-bottom: 16px; }
.tp-field-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.tp-field-value { font-size: 13px; color: var(--text); }
.tp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 768px) {
  .task-panel { width: 100vw; max-width: 100vw; }
}

/* ── TAGS BAR ── */
.tag-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-chip { padding: 5px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text2); cursor: pointer; transition: all .15s; }
.tag-chip:hover, .tag-chip.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* ── KNOWLEDGE GRID ── */
.knowledge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kn-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm); }
.kn-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.kn-card .kn-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kn-card .kn-type.card { color: var(--primary); }
.kn-card .kn-type.hotspot { color: var(--red); }
.kn-card .kn-type.case { color: var(--green); }
.kn-card .kn-type.competitor { color: var(--amber); }
.kn-card .kn-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.kn-card .kn-summary { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kn-card .kn-meta { font-size: 11px; color: var(--text2); display: flex; justify-content: space-between; }
.kn-card .kn-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.kn-card .kn-tag { font-size: 10px; padding: 2px 8px; background: var(--surface2); border-radius: 4px; color: var(--text2); }

/* ── ASSET GRID ── */
.asset-tabs, .content-tabs { display: flex; gap: 0; margin-bottom: 20px; }
.asset-tab, .content-tab { padding: 10px 24px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; transition: all .15s; }
.asset-tab:first-child, .content-tab:first-child { border-radius: 10px 0 0 10px; }
.asset-tab:last-child, .content-tab:last-child { border-radius: 0 10px 10px 0; }
.asset-tab.active, .content-tab.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.asset-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm); }
.asset-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.asset-card .asset-preview { width: 100%; height: 160px; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-card .asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-card .asset-preview .file-icon { font-size: 36px; color: var(--text2); }
.asset-card .asset-info { padding: 12px; }
.asset-card .asset-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card .asset-meta { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── CONTENT GRID ── */
.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ct-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-sm); }
.ct-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.ct-card .ct-type { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 6px; }
.ct-card .ct-type.manga { color: #8b5cf6; }
.ct-card .ct-type.video { color: var(--blue); }
.ct-card .ct-type.article { color: var(--green); }
.ct-card .ct-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ct-card .ct-desc { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-card .ct-status { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.ct-status.draft { background: var(--surface2); color: var(--text2); }
.ct-status.in_progress { background: var(--amber-bg); color: var(--amber); }
.ct-status.review { background: var(--blue-bg); color: var(--blue); }
.ct-status.published { background: var(--green-bg); color: var(--green); }
.ct-card .ct-meta { font-size: 11px; color: var(--text2); margin-top: 8px; display: flex; justify-content: space-between; }

/* ── SCRIPT CARDS ── */
.script-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.script-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.script-card .sc-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.script-card .sc-source { font-size: 11px; color: var(--text2); margin-bottom: 10px; }
.script-card .sc-status { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 6px; margin-bottom: 10px; }
.sc-status.collected { background: var(--surface2); color: var(--text2); }
.sc-status.adapting { background: var(--amber-bg); color: var(--amber); }
.sc-status.adapted { background: var(--green-bg); color: var(--green); }
.script-card .sc-text { font-size: 12px; color: var(--text2); line-height: 1.7; max-height: 80px; overflow: hidden; }

/* ── GUIDELINE ── */
.guideline-list { display: flex; flex-direction: column; gap: 12px; }
.guideline-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.guideline-item .gl-section { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.guideline-item .gl-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.guideline-item .gl-content { font-size: 13px; color: var(--text2); line-height: 1.8; white-space: pre-wrap; }

/* ── SUB MODAL ── */
.sub-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.18); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 600; }
.sub-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 460px; max-height: 80vh; overflow-y: auto; box-shadow: 0 12px 48px rgba(0,0,0,0.1); }

/* ── DELIVERABLES ── */
.deliv-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.deliv-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.deliv-header label { font-size: 13px; font-weight: 700; color: var(--text); }
.deliv-actions { display: flex; gap: 6px; }
.deliv-list { display: flex; flex-direction: column; gap: 8px; }
.deliv-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; position: relative; }
.deliv-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.deliv-type { font-size: 11px; font-weight: 600; color: var(--primary); }
.deliv-title { font-size: 13px; font-weight: 600; }
.deliv-link { color: var(--primary); text-decoration: underline; }
.deliv-meta { font-size: 11px; color: var(--text2); }
.deliv-desc { font-size: 12px; color: var(--text2); flex: 1; line-height: 1.5; max-width: 280px; }
.deliv-del { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s; }
.deliv-item:hover .deliv-del { opacity: 1; }
.deliv-form { background: var(--surface2); border: 1px dashed var(--border); border-radius: 10px; padding: 16px; margin-top: 12px; }

/* ── MEMBER TASKS CHART ── */
.mt-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.mt-row:last-child { border-bottom: none; }
.mt-name { width: 80px; font-size: 13px; font-weight: 600; text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-bar-wrap { flex: 1; display: flex; height: 24px; border-radius: 4px; overflow: hidden; background: var(--surface2); }
.mt-bar { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; min-width: 0; transition: width .3s; }
.mt-bar.s-pending { background: #94a3b8; }
.mt-bar.s-in_progress { background: #d97706; }
.mt-bar.s-reviewing { background: #2563eb; }
.mt-bar.s-completed { background: #16a34a; }
.mt-bar.s-confirmed { background: #4f46e5; }
.mt-total { width: 40px; font-size: 12px; font-weight: 700; color: var(--text2); text-align: center; flex-shrink: 0; }
.mt-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text2); justify-content: center; }
.mt-legend-item { display: flex; align-items: center; gap: 4px; }
.mt-legend-dot { width: 10px; height: 10px; border-radius: 2px; }

/* ── HEATMAP ── */
.heatmap-table { border-collapse: collapse; font-size: 11px; }
.heatmap-table th { padding: 6px 4px; font-weight: 600; color: var(--text2); text-align: center; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.heatmap-table td { padding: 0; }
.heatmap-name { padding: 6px 12px 6px 0; font-weight: 600; font-size: 12px; white-space: nowrap; text-align: right; position: sticky; left: 0; background: var(--surface); }
.heatmap-cell { width: 24px; height: 24px; margin: 2px; border-radius: 3px; display: inline-block; }
.heatmap-cell.submitted { background: #16a34a; }
.heatmap-cell.missing { background: #fee2e2; }
.heatmap-cell.weekend { background: #f0f1f5; }
.heatmap-rate { padding: 6px 8px; font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; }
.heatmap-rate.good { color: #16a34a; }
.heatmap-rate.warn { color: #d97706; }
.heatmap-rate.bad { color: #dc2626; }

/* ── PERSONAL PANEL ── */
.pp-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pp-item:last-child { border-bottom: none; }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pp-dot.overdue { background: var(--red); }
.pp-dot.warning { background: var(--amber); }
.pp-dot.normal { background: var(--primary); }
.pp-dot.green { background: var(--green); }
.pp-info { flex: 1; min-width: 0; }
.pp-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-meta { font-size: 11px; color: var(--text2); margin-top: 1px; }
.pp-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }
.pp-badge.red { background: var(--red-bg); color: var(--red); }
.pp-badge.amber { background: var(--amber-bg); color: var(--amber); }
.pp-badge.blue { background: var(--blue-bg); color: var(--blue); }
.pp-badge.green { background: var(--green-bg); color: var(--green); }
.pp-empty { font-size: 12px; color: var(--text2); padding: 12px 0; text-align: center; }
.pp-alert { background: var(--red-bg); border: 1px solid var(--red); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--red); font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.pp-alert:hover { opacity: 0.9; }
.pp-remind { background: var(--amber-bg); border: 1px solid var(--amber); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--amber); font-weight: 500; margin-bottom: 12px; }
.pp-notify { background: var(--primary-bg); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.pp-notify:hover { background: var(--blue-bg); }

/* ── DEMANDS ── */
.demand-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: all .2s; }
.demand-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.demand-card .dm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.demand-card .dm-title { font-size: 15px; font-weight: 700; }
.demand-card .dm-meta { font-size: 12px; color: var(--text2); display: flex; gap: 12px; align-items: center; }
.demand-card .dm-flow { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 8px; color: var(--text2); }
.demand-card .dm-flow .dm-arrow { color: var(--border); }
.dm-priority { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.dm-priority.urgent { background: var(--red-bg); color: var(--red); }
.dm-priority.high { background: var(--amber-bg); color: var(--amber); }
.dm-priority.medium { background: var(--blue-bg); color: var(--blue); }
.dm-priority.low { background: var(--surface2); color: var(--text2); }
.dm-status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.dm-status.pending { background: var(--surface2); color: var(--text2); }
.dm-status.assigned { background: var(--amber-bg); color: var(--amber); }
.dm-status.confirmed { background: var(--blue-bg); color: var(--blue); }
.dm-status.in_progress { background: var(--amber-bg); color: var(--amber); }
.dm-status.reviewing { background: var(--blue-bg); color: var(--blue); }
.dm-status.accepted { background: var(--green-bg); color: var(--green); }
.dm-status.completed { background: var(--green-bg); color: var(--green); }
.dm-type { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.dm-type.once { background: var(--primary-bg); color: var(--primary); }
.dm-type.recurring { background: var(--green-bg); color: var(--green); }

.demand-detail-section { margin-bottom: 16px; }
.demand-detail-section .dds-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.demand-detail-section .dds-content { font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.demand-comments { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.demand-comment { padding: 8px 0; border-bottom: 1px solid var(--border); }
.demand-comment:last-child { border-bottom: none; }
.demand-comment .dc-user { font-size: 12px; font-weight: 600; }
.demand-comment .dc-time { font-size: 10px; color: var(--text2); margin-left: 8px; }
.demand-comment .dc-text { font-size: 13px; margin-top: 4px; color: var(--text2); }

/* ── DRIVE ASSETS ── */
.drive-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.drive-folder-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); }
.drive-folder-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.drive-folder-icon { font-size: 28px; flex-shrink: 0; }
.drive-folder-info { flex: 1; min-width: 0; }
.drive-folder-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-folder-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }

.drive-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.drive-file-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); transition: all .15s; }
.drive-file-card:hover { border-color: var(--primary); }
.drive-file-icon { font-size: 24px; flex-shrink: 0; width: 36px; text-align: center; }
.drive-file-info { flex: 1; min-width: 0; }
.drive-file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-file-name a { color: var(--text); }
.drive-file-name a:hover { color: var(--primary); }
.drive-file-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }
.drive-file-actions { flex-shrink: 0; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.drive-file-card:hover .drive-file-actions { opacity: 1; }

/* ── ORG CHART ── */
.org-chart-container { overflow-x: auto; padding: 20px 0; }
.org-tree { display: flex; flex-direction: column; align-items: center; }
.org-node { display: flex; flex-direction: column; align-items: center; position: relative; }
.org-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; text-align: center; min-width: 120px; box-shadow: var(--shadow-sm); position: relative; transition: all .15s; }
.org-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.org-card .org-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; margin: 0 auto 8px; }
.org-card .org-name { font-size: 14px; font-weight: 700; color: var(--text); }
.org-card .org-role { font-size: 11px; color: var(--text2); margin-top: 2px; }
.org-card .org-team { font-size: 10px; color: var(--primary); background: var(--primary-bg); padding: 2px 8px; border-radius: 4px; margin-top: 6px; display: inline-block; }
.org-card.leader { border-color: var(--primary); border-width: 2px; }
.org-card.disabled { opacity: 0.4; }

.org-children { display: flex; gap: 0; justify-content: center; position: relative; padding-top: 24px; }
.org-children::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 24px; background: var(--border); }

.org-branch { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 16px; }
.org-branch::before { content: ''; position: absolute; top: 0; width: 2px; height: 24px; background: var(--border); }
.org-branch::after { content: ''; position: absolute; top: 0; height: 2px; background: var(--border); }

.org-hline { display: flex; position: relative; }
.org-hline::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--border); }
.org-hline > .org-branch:first-child::after { left: 50%; right: 0; }
.org-hline > .org-branch:last-child::after { left: 0; right: 50%; }
.org-hline > .org-branch:not(:first-child):not(:last-child)::after { left: 0; right: 0; }
.org-hline > .org-branch:only-child::after { display: none; }

.org-connector { width: 2px; height: 24px; background: var(--border); margin: 0 auto; }

.org-group-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; text-align: center; }

.org-members { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.org-member-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.org-card.member { padding: 10px 16px; min-width: 100px; }
.org-card.member .org-avatar { width: 32px; height: 32px; font-size: 13px; margin-bottom: 4px; }
.org-card.member .org-name { font-size: 12px; }
.org-card.member .org-role { font-size: 10px; }

/* ── RESPONSIVE ── */
/* ── TABLET ── */
@media (max-width: 1024px) {
  .dashboard-cards, .metric-summary { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-grid, .content-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(3, 1fr); }
  .kanban-board { grid-template-columns: repeat(3, 1fr); }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  /* 侧边栏：默认隐藏，点击汉堡按钮展开 */
  .sidebar {
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 199; display: none;
  }
  .sidebar-overlay.open { display: block; }

  /* 顶部栏 */
  .mobile-header {
    display: flex !important;
    position: fixed; top: 0; left: 0; right: 0; height: 52px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    align-items: center; padding: 0 16px; z-index: 150;
    box-shadow: var(--shadow-sm);
  }
  .mobile-hamburger {
    width: 36px; height: 36px; background: none; border: 1px solid var(--border);
    border-radius: 8px; font-size: 18px; display: flex; align-items: center;
    justify-content: center; color: var(--text); flex-shrink: 0;
  }
  .mobile-title {
    flex: 1; text-align: center; font-size: 15px; font-weight: 700;
  }
  .mobile-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
  }

  /* 主内容 */
  .main-content {
    margin-left: 0; padding: 64px 14px 24px;
    max-width: 100vw; min-width: 0;
  }

  /* 页面标题 */
  .page-header { flex-wrap: wrap; gap: 10px; }
  .page-header h1 { font-size: 18px; width: 100%; }

  /* 统计卡片 */
  .dashboard-cards, .metric-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .card-icon { width: 32px; height: 32px; border-radius: 8px; margin-bottom: 10px; }
  .stat-card .card-icon svg { width: 16px; height: 16px; }
  .stat-card .value { font-size: 22px; }

  /* 个人面板 */
  #personal-panel { grid-template-columns: 1fr !important; }

  /* 看板 */
  .kanban-board { grid-template-columns: 1fr !important; gap: 12px; }
  .kanban-col { min-height: 100px; }

  /* 项目 tabs */
  .project-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .project-tab { white-space: nowrap; flex-shrink: 0; }

  /* 筛选栏 */
  .page-header > div { flex-wrap: wrap; }
  .date-filter, #kanban-view-filter { font-size: 12px; padding: 6px 28px 6px 10px; background-size: 12px; background-position: right 8px center; }
  input.date-filter { padding: 6px 10px; }

  /* 卡片网格 */
  .members-grid, .knowledge-grid, .content-grid { grid-template-columns: 1fr; }
  .asset-grid, .dashboard-assets-grid { grid-template-columns: repeat(2, 1fr); }
  .drive-folder-grid { grid-template-columns: repeat(2, 1fr); }
  .drive-file-grid { grid-template-columns: 1fr; }
  .script-grid { grid-template-columns: 1fr; }
  .perm-matrix { grid-template-columns: 1fr; }
  .dashboard-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* 需求卡片 */
  .demand-card .dm-header { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* 面板 */
  .panel { padding: 16px; margin-bottom: 12px; }
  .panel-header { margin-bottom: 14px; }

  /* 按钮 */
  .btn-primary, .btn-secondary { padding: 7px 14px; font-size: 12px; }

  /* 弹窗 */
  .modal { width: 95vw; max-height: 90vh; border-radius: 12px; }
  .sub-modal { width: 92vw; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 16px 20px; }

  /* 表格横向滚动 */
  .data-table { display: block; overflow-x: auto; }

  /* 甘特图 */
  .gantt-container { margin: 0 -14px; padding: 0 14px; }

  /* 组织图 */
  .org-chart-container { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
  .org-hline { flex-direction: column; align-items: center; }
  .org-branch { padding: 12px 0; }

  /* 登录页 */
  .login-box { width: 90vw; padding: 32px 24px; }

  /* 热力图 */
  .heatmap-table { font-size: 10px; }
  .heatmap-cell { width: 18px; height: 18px; }
}
