:root {
  --ink: #172523;
  --muted: #6d7774;
  --soft-muted: #98a29f;
  --canvas: #f3f0e8;
  --surface: #fffdf8;
  --surface-soft: #ebe7dc;
  --line: #ded9cd;
  --brand: #183b38;
  --brand-2: #275a53;
  --mint: #dfece6;
  --gold: #e0ad52;
  --gold-soft: #f7e8c9;
  --coral: #d96a4e;
  --coral-soft: #f7dfd7;
  --blue: #587fa4;
  --blue-soft: #e2ebf2;
  --purple: #735b87;
  --purple-soft: #ebe3ef;
  --shadow: 0 16px 45px rgba(28, 44, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(28, 44, 40, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --sidebar: 248px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20;
  display: flex; flex-direction: column; padding: 24px 16px 18px;
  color: #f7f4ec; background:
    radial-gradient(circle at 30% 0%, rgba(118, 162, 143, .23), transparent 36%),
    linear-gradient(170deg, #1c4541 0%, #142f2d 62%, #102825 100%);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #f3c978; color: var(--brand); font-weight: 900; box-shadow: inset 0 -4px 0 rgba(24,59,56,.14); }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: .08em; }
.brand-copy small { display: block; margin-top: 3px; color: rgba(255,255,255,.56); font-size: 11px; letter-spacing: .09em; }

.workspace-switch { position: relative; margin-bottom: 18px; }
.workspace-button { width: 100%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); color: white; border-radius: 14px; padding: 11px 12px; display: flex; align-items: center; gap: 9px; cursor: pointer; text-align: left; transition: .2s ease; }
.workspace-button:hover { background: rgba(255,255,255,.13); }
.workspace-dot { width: 9px; height: 9px; border-radius: 99px; background: #f3c978; box-shadow: 0 0 0 4px rgba(243,201,120,.12); }
.workspace-button span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.workspace-button .chevron { color: rgba(255,255,255,.54); font-size: 11px; }
.workspace-menu { position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 6px; background: #fffdf8; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 50; }
.workspace-option { width: 100%; border: 0; background: transparent; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 9px; }
.workspace-option:hover, .workspace-option.active { background: var(--mint); }
.workspace-option small { display: block; color: var(--muted); margin-top: 2px; }

.nav-label { padding: 12px 10px 7px; color: rgba(255,255,255,.42); font-size: 10px; letter-spacing: .16em; }
.nav-list { display: grid; gap: 3px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.7); border-radius: 12px; padding: 10px 11px; display: flex; gap: 11px; align-items: center; cursor: pointer; text-align: left; transition: .18s ease; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #f3c978; }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; font-size: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; }
.nav-item.active .nav-icon { border-color: rgba(243,201,120,.55); background: rgba(243,201,120,.12); color: #f3c978; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 99px; text-align: center; font-size: 10px; color: var(--brand); background: #f3c978; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 8px 0; }
.sidebar-status { display: flex; gap: 9px; align-items: center; color: rgba(255,255,255,.56); font-size: 11px; line-height: 1.5; }
.status-pulse { width: 8px; height: 8px; border-radius: 50%; background: #83c7a6; box-shadow: 0 0 0 4px rgba(131,199,166,.1); }
.sidebar-signout { margin: 11px 0 0 17px; padding: 0; border: 0; background: none; color: rgba(255,255,255,.5); font-size: 10px; cursor: pointer; }
.sidebar-signout:hover { color: #fff; }

.main { grid-column: 2; min-width: 0; padding: 0 32px 48px; }
.topbar { height: 76px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 10; background: rgba(243,240,232,.9); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(222,217,205,.7); }
.topbar-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.topbar-spacer { flex: 1; }
.search-box { position: relative; width: min(330px, 32vw); }
.search-box input { width: 100%; border: 1px solid var(--line); background: rgba(255,253,248,.7); border-radius: 12px; padding: 10px 14px 10px 36px; outline: none; transition: .2s; }
.search-box input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(39,90,83,.1); background: var(--surface); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--soft-muted); font-size: 12px; }
.avatar { width: 37px; height: 37px; border-radius: 12px; background: var(--gold-soft); color: #8a5d17; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 1px solid #ead5ac; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 99px; background: rgba(255,253,248,.72); border: 1px solid var(--line); color: var(--muted); font-size: 9px; white-space: nowrap; }
.sync-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--soft-muted); }
.sync-pill.synced span { background: #52a879; box-shadow: 0 0 0 3px rgba(82,168,121,.12); }
.sync-pill.syncing span { background: var(--gold); animation: pulse 1s infinite; }
.sync-pill.error { color: #a84833; background: var(--coral-soft); border-color: #efc8bd; }
.sync-pill.error span { background: var(--coral); }
.mobile-menu { display: none; border: 0; background: var(--surface); border-radius: 10px; padding: 8px 10px; cursor: pointer; }

.content { max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 28px 0 24px; }
.eyebrow { color: var(--coral); font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; }
h1 { margin: 0; font-family: "Microsoft YaHei UI", sans-serif; font-size: clamp(27px, 3vw, 40px); line-height: 1.16; letter-spacing: -.04em; }
.page-head p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); cursor: pointer; transition: .18s ease; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn.primary { color: white; background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--gold-soft); border-color: #ead2a2; color: #7d5313; }
.btn.ghost { background: transparent; }
.btn.danger { color: #a74737; background: #fff6f3; border-color: #efcec6; }
.btn.small { padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; cursor: pointer; display: grid; place-items: center; }

.grid { display: grid; gap: 18px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-height: 142px; padding: 20px; border: 1px solid rgba(222,217,205,.92); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; width: 84px; height: 84px; right: -25px; bottom: -28px; border-radius: 50%; background: var(--tint, var(--mint)); opacity: .7; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.trend { font-size: 10px; padding: 4px 7px; border-radius: 99px; background: var(--mint); color: var(--brand-2); font-weight: 700; }
.trend.warn { background: var(--coral-soft); color: #a84833; }
.metric-value { font-size: 32px; margin-top: 16px; font-weight: 800; letter-spacing: -.05em; }
.metric-detail { color: var(--soft-muted); font-size: 11px; margin-top: 7px; }

.dashboard-grid { margin-top: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px 14px; }
.panel-title { margin: 0; font-size: 15px; }
.panel-subtitle { margin-top: 5px; color: var(--muted); font-size: 11px; }
.panel-body { padding: 6px 22px 22px; }
.text-link { border: 0; background: none; color: var(--brand-2); padding: 0; cursor: pointer; font-weight: 800; font-size: 11px; }

.job-list { display: grid; gap: 11px; }
.job-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(130px, 1fr) 74px; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid #eeeae1; }
.job-row:first-child { border-top: 0; }
.job-name { display: flex; gap: 11px; align-items: center; font-size: 13px; font-weight: 800; }
.priority-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); flex: 0 0 auto; }
.priority-dot.high { background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.priority-dot.low { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.job-meta { color: var(--muted); font-size: 10px; margin-top: 4px; font-weight: 500; }
.progress-track { height: 7px; background: #ece8df; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--brand-2); }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 6px; }
.job-action { text-align: right; }

.funnel { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 32px; align-items: center; gap: 10px; }
.funnel-label { font-size: 11px; color: var(--muted); }
.funnel-bar { height: 20px; border-radius: 7px; background: #efece4; overflow: hidden; }
.funnel-fill { height: 100%; min-width: 8px; border-radius: inherit; background: linear-gradient(90deg, var(--brand-2), #6f9f8e); }
.funnel-value { font-size: 11px; font-weight: 800; text-align: right; }

.task-list { display: grid; }
.task { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 13px 0; border-top: 1px solid #eeeae1; align-items: start; }
.task:first-child { border-top: 0; }
.task-check { appearance: none; width: 18px; height: 18px; border: 1.5px solid #aeb8b4; border-radius: 6px; cursor: pointer; position: relative; margin-top: 1px; }
.task-check:checked { background: var(--brand-2); border-color: var(--brand-2); }
.task-check:checked::after { content: "✓"; color: white; position: absolute; font-size: 12px; left: 3px; top: -1px; }
.task.done .task-copy { text-decoration: line-through; color: var(--soft-muted); }
.task-copy { font-size: 12px; line-height: 1.55; }
.task-copy small { display: block; color: var(--soft-muted); margin-top: 2px; }
.task-time { color: var(--coral); background: var(--coral-soft); border-radius: 7px; padding: 4px 7px; font-size: 9px; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { color: var(--soft-muted); font-size: 10px; text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #eeeae1; font-size: 11px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--mint); color: var(--brand-2); font-weight: 800; }
.person-name { font-weight: 800; }
.person-note { color: var(--soft-muted); font-size: 9px; margin-top: 3px; }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 4px 8px; background: var(--surface-soft); color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.tag.green { background: var(--mint); color: var(--brand-2); }
.tag.gold { background: var(--gold-soft); color: #8a5d17; }
.tag.coral { background: var(--coral-soft); color: #a84833; }
.tag.blue { background: var(--blue-soft); color: #426887; }
.tag.purple { background: var(--purple-soft); color: var(--purple); }

.filterbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filterbar select, .filterbar input { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 9px 11px; outline: none; color: var(--ink); font-size: 11px; }
.filterbar input { min-width: 210px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); background: #e9e5dc; border-radius: 12px; }
.segmented button { border: 0; background: transparent; padding: 7px 11px; border-radius: 9px; cursor: pointer; font-size: 11px; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 800; box-shadow: 0 3px 10px rgba(28,44,40,.08); }
.filter-spacer { flex: 1; }

.kanban-wrap { overflow-x: auto; padding: 2px 2px 22px; margin: 0 -2px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 13px; min-width: max-content; }
.kanban-column { width: 270px; background: rgba(232,228,218,.66); border: 1px solid var(--line); border-radius: 17px; padding: 12px; min-height: 480px; transition: .15s; }
.kanban-column.drag-over { border-color: var(--brand-2); background: var(--mint); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.column-title { font-size: 12px; font-weight: 800; }
.column-count { min-width: 22px; text-align: center; padding: 3px 6px; background: var(--surface); border-radius: 99px; font-size: 9px; color: var(--muted); }
.kanban-cards { display: grid; gap: 9px; }
.candidate-card { background: var(--surface); border: 1px solid #ddd8cd; border-radius: 14px; padding: 13px; box-shadow: 0 4px 14px rgba(28,44,40,.04); cursor: grab; }
.candidate-card:active { cursor: grabbing; }
.candidate-card.dragging { opacity: .42; }
.candidate-top { display: flex; align-items: flex-start; gap: 9px; }
.candidate-top .person-avatar { flex: 0 0 auto; }
.candidate-main { flex: 1; min-width: 0; }
.candidate-main strong { font-size: 12px; }
.candidate-main p { margin: 5px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidate-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.candidate-next { margin-top: 11px; border-top: 1px solid #eeeae1; padding-top: 9px; font-size: 9px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.candidate-next b { color: var(--coral); font-weight: 700; }
.empty-column { padding: 25px 10px; text-align: center; color: var(--soft-muted); font-size: 10px; border: 1px dashed #d5d0c5; border-radius: 12px; }

.script-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.script-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); position: relative; }
.script-card.best { border-color: #d9bd83; box-shadow: 0 12px 32px rgba(185,132,49,.12); }
.best-ribbon { position: absolute; right: 14px; top: 14px; color: #845512; background: var(--gold-soft); border-radius: 99px; padding: 4px 8px; font-size: 9px; font-weight: 800; }
.script-name { font-size: 15px; font-weight: 800; margin: 0; }
.script-job { color: var(--muted); font-size: 10px; margin-top: 6px; }
.script-content { margin: 17px 0; padding: 14px; min-height: 122px; background: #f5f2ea; border-radius: 12px; color: #53605d; font-size: 11px; line-height: 1.75; }
.script-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mini-metric { background: var(--mint); border-radius: 11px; padding: 10px; }
.mini-metric span { display: block; color: var(--muted); font-size: 9px; }
.mini-metric strong { display: block; margin-top: 4px; font-size: 18px; }
.script-actions { display: flex; gap: 7px; margin-top: 14px; }
.script-actions .btn { flex: 1; }

.insight { display: flex; gap: 13px; padding: 16px; border-radius: 15px; background: linear-gradient(115deg, #e4eee9, #f6efd9); border: 1px solid #d7dfd7; margin-bottom: 18px; }
.insight-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: #f3c978; display: grid; place-items: center; flex: 0 0 auto; }
.insight strong { display: block; font-size: 12px; }
.insight p { margin: 5px 0 0; font-size: 11px; color: var(--muted); line-height: 1.6; }

.settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-group { display: grid; gap: 7px; margin-bottom: 15px; }
.form-group label { font-size: 11px; font-weight: 800; }
.form-group small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 10px 11px; outline: none; color: var(--ink); font-size: 12px; transition: .18s; }
.textarea { min-height: 95px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(39,90,83,.1); }
.stage-editor { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px; min-height: 75px; border: 1px solid var(--line); border-radius: 12px; background: #f6f3eb; align-content: flex-start; }
.stage-chip { background: var(--surface); border: 1px solid #d9d4c8; border-radius: 9px; padding: 7px 9px; font-size: 10px; cursor: default; }
.stage-chip button { border: 0; background: transparent; color: var(--soft-muted); cursor: pointer; padding: 0 0 0 5px; }
.stage-add { display: flex; gap: 7px; margin-top: 9px; }
.stage-add .input { flex: 1; }

.module-hero { padding: 30px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; background: linear-gradient(125deg, #163b37, #2b6159); color: white; border-radius: var(--radius-xl); overflow: hidden; position: relative; box-shadow: var(--shadow); }
.module-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; right: -80px; top: -100px; box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.02); }
.module-hero h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.module-hero p { max-width: 620px; color: rgba(255,255,255,.66); line-height: 1.8; font-size: 12px; }
.module-hero .btn { width: fit-content; margin-top: 8px; }
.module-stat { position: relative; z-index: 1; align-self: end; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); padding: 18px; border-radius: 17px; backdrop-filter: blur(8px); }
.module-stat small { color: rgba(255,255,255,.57); }
.module-stat strong { display: block; font-size: 27px; margin-top: 7px; }
.module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
.module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; min-height: 170px; cursor: pointer; transition: .2s ease; }
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfc8b9; }
.module-card-icon { width: 39px; height: 39px; border-radius: 13px; background: var(--tint, var(--mint)); display: grid; place-items: center; font-weight: 900; color: var(--tone, var(--brand-2)); }
.module-card h3 { margin: 17px 0 7px; font-size: 14px; }
.module-count { float: right; min-width: 22px; text-align: center; padding: 3px 7px; border-radius: 99px; background: var(--tint, var(--mint)); color: var(--tone, var(--brand-2)); font-size: 10px; }
.module-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.module-card footer { margin-top: 17px; color: var(--tone, var(--brand-2)); font-size: 10px; font-weight: 800; }
.module-hero.compact { margin-bottom: 18px; padding: 24px 28px; grid-template-columns: minmax(0, 1fr) 210px; }
.module-stat span { display: block; color: rgba(255,255,255,.55); font-size: 10px; margin-top: 5px; }
.personal-wrap { margin-top: 18px; }
.personal-kanban .kanban-column { min-height: 390px; background: rgba(255,253,248,.54); }
.personal-card { background: var(--surface); border: 1px solid #ddd8cd; border-radius: 14px; padding: 13px; box-shadow: 0 4px 14px rgba(28,44,40,.04); cursor: grab; transition: .16s ease; }
.personal-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.personal-card:active { cursor: grabbing; }
.personal-card.dragging { opacity: .42; }
.personal-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.personal-card-top strong { font-size: 12px; line-height: 1.45; }
.personal-card p { margin: 8px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.personal-card-focus { margin-top: 11px; padding: 10px; border-radius: 10px; background: #f5f2ea; color: #53605d; font-size: 10px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-list { display: grid; gap: 9px; }
.idea { display: flex; gap: 12px; padding: 13px; background: #f5f2ea; border-radius: 12px; }
.idea-type { flex: 0 0 auto; }
.idea p { margin: 0; font-size: 11px; line-height: 1.6; }
.idea time { display: block; color: var(--soft-muted); font-size: 9px; margin-top: 4px; }

.mapping-typebar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mapping-typebar button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 8px 12px; cursor: pointer; font-size: 10px; transition: .18s; }
.mapping-typebar button:hover, .mapping-typebar button.active { color: white; background: var(--brand); border-color: var(--brand); }
.mapping-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 13px; }
.mapping-tab { flex: 0 0 250px; border: 1px solid var(--line); background: rgba(255,253,248,.65); border-radius: 14px; padding: 13px 14px; text-align: left; cursor: pointer; transition: .18s; }
.mapping-tab:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.mapping-tab.active { border-color: var(--brand-2); background: var(--mint); box-shadow: inset 0 0 0 1px var(--brand-2); }
.mapping-tab-type { display: inline-block; color: var(--coral); font-size: 9px; font-weight: 800; margin-bottom: 7px; }
.mapping-tab strong { display: block; font-size: 12px; }
.mapping-tab small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapping-summary { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(380px, 1.2fr) auto; align-items: center; gap: 18px; margin: 5px 0 13px; padding: 15px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); }
.mapping-summary > div:first-child span { display: block; color: var(--soft-muted); font-size: 9px; }
.mapping-summary > div:first-child strong { display: block; margin-top: 4px; font-size: 14px; }
.mapping-summary > div:first-child small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mapping-kpis { display: flex; gap: 6px; }
.mapping-kpis span { flex: 1; min-width: 72px; padding: 9px; border-radius: 10px; background: #f2efe7; color: var(--muted); font-size: 8px; text-align: center; white-space: nowrap; }
.mapping-kpis b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.mindmap-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); overflow: hidden; }
.mindmap-toolbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #faf8f2; }
.map-legend { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.legend-dot.p1 { background: var(--coral); }
.legend-dot.p2 { background: var(--gold); }
.map-zoom { display: flex; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.map-zoom .icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.mindmap-viewport { height: min(68vh, 700px); min-height: 510px; overflow: auto; background-color: #f7f4ed; background-image: radial-gradient(#d7d2c7 1px, transparent 1px); background-size: 22px 22px; }
.mindmap-board { position: relative; transform-origin: top left; transition: transform .15s ease; }
.mapping-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.map-edge { fill: none; stroke: #a7b5b0; stroke-width: 2; opacity: .72; }
.map-edge.priority-p1 { stroke: #d88772; stroke-width: 2.5; }
.map-edge.priority-p2 { stroke: #d3ae6b; }
.map-node { position: absolute; width: 210px; min-height: 76px; border: 1px solid #d9d4c8; border-left: 4px solid var(--blue); border-radius: 14px; background: rgba(255,253,248,.97); padding: 11px 12px; text-align: left; box-shadow: 0 7px 18px rgba(28,44,40,.08); cursor: grab; transition: box-shadow .16s, transform .16s; color: var(--ink); }
.map-node:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(28,44,40,.13); z-index: 3; }
.map-node.dragging { opacity: .4; cursor: grabbing; }
.map-node.priority-p1 { border-left-color: var(--coral); }
.map-node.priority-p2 { border-left-color: var(--gold); }
.map-node.priority-p3 { border-left-color: var(--blue); }
.map-node.kind-root { color: white; background: linear-gradient(145deg, var(--brand), var(--brand-2)); border-color: var(--brand); border-left-color: #f3c978; }
.map-node.kind-root small, .map-node.kind-root .map-node-type, .map-node.kind-root .map-node-footer i { color: rgba(255,255,255,.64); }
.map-node.kind-company { background: #edf4f0; }
.map-node.kind-person { background: #fffdf8; }
.map-node.kind-action { background: var(--gold-soft); border-color: #e2c78f; }
.map-node-type { display: block; margin-bottom: 4px; color: var(--soft-muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.map-node strong { display: block; font-size: 11px; line-height: 1.35; }
.map-node small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-node-footer { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(150,150,140,.18); }
.map-node-footer b { color: var(--coral); font-size: 8px; }
.map-node-footer i { color: var(--muted); font-size: 8px; font-style: normal; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); background: var(--canvas); }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 42px 54px; color: white; background: radial-gradient(circle at 15% 15%, rgba(126,178,157,.3), transparent 28%), linear-gradient(145deg, #1d4c47, #102e2b 70%); }
.auth-story::before, .auth-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.auth-story::before { width: 430px; height: 430px; right: -140px; top: -110px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.015); }
.auth-story::after { width: 230px; height: 230px; left: -110px; bottom: -80px; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: 16px; letter-spacing: .06em; }
.auth-brand span, .auth-mark { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: #f3c978; color: var(--brand); font-weight: 900; }
.auth-story-copy { position: relative; z-index: 1; max-width: 620px; }
.auth-story-copy .eyebrow { color: #f3c978; }
.auth-story-copy h1 { font-size: clamp(34px, 4.4vw, 62px); max-width: 700px; line-height: 1.12; }
.auth-story-copy p { max-width: 580px; color: rgba(255,255,255,.65); line-height: 1.9; font-size: 13px; }
.auth-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.auth-features span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 99px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.72); font-size: 10px; }
.auth-story > small { position: relative; z-index: 1; color: rgba(255,255,255,.36); }
.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(390px, 100%); }
.auth-card .auth-mark { margin-bottom: 24px; }
.auth-card h2 { margin: 0; font-size: 26px; }
.auth-card > p { margin: 8px 0 27px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 5px; }
.auth-submit:disabled { opacity: .65; cursor: wait; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 19px 0 11px; color: var(--soft-muted); font-size: 9px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-security { margin-top: 18px; color: var(--soft-muted); font-size: 9px; line-height: 1.7; text-align: center; }
.auth-error { margin-bottom: 12px; padding: 10px 11px; color: #a84833; background: var(--coral-soft); border-radius: 10px; font-size: 10px; }
.auth-notice { padding: 16px; border-radius: 14px; background: var(--gold-soft); border: 1px solid #e8ce9c; }
.auth-notice b { display: block; color: #7d5313; font-size: 12px; }
.auth-notice span { display: block; margin-top: 6px; color: #8c744d; font-size: 10px; line-height: 1.6; }
.auth-loading { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 13px; background: var(--canvas); color: var(--muted); }

@keyframes pulse { 50% { opacity: .35; transform: scale(.78); } }

.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; font-size: 16px; margin-bottom: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10,27,25,.46); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
.modal { width: min(640px, 100%); max-height: min(88vh, 780px); overflow-y: auto; background: var(--surface); border-radius: 22px; box-shadow: 0 30px 100px rgba(8,27,25,.28); animation: rise .22s ease; }
.modal.small { width: min(470px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 21px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.modal-head > div:first-child { flex: 1; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.modal-body { padding: 20px 22px; }
.modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.modal-grid .full { grid-column: 1 / -1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 21px; border-top: 1px solid var(--line); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 8px; }
.toast { background: #173936; color: white; border-radius: 13px; padding: 12px 15px; box-shadow: var(--shadow); min-width: 230px; font-size: 11px; display: flex; align-items: center; gap: 9px; animation: slideIn .2s ease; }
.toast::before { content: "✓"; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #f3c978; color: var(--brand); font-weight: 900; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 1180px) {
  :root { --sidebar: 216px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .script-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .mapping-summary { grid-template-columns: 1fr auto; }
  .mapping-kpis { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  :root { --sidebar: 264px; }
  .shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: .24s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 0 16px 38px; }
  .topbar { height: 64px; }
  .mobile-menu { display: block; }
  .search-box { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; padding: 22px 0 18px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .metrics, .script-grid, .settings-grid, .module-grid { grid-template-columns: 1fr; }
  .metric { min-height: 122px; }
  .job-row { grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr); }
  .job-action { display: none; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full { grid-column: auto; }
  .module-hero { grid-template-columns: 1fr; padding: 24px; }
  .module-stat { display: none; }
  .filter-spacer { display: none; }
  .sync-pill { display: none; }
  .mapping-summary { grid-template-columns: 1fr; }
  .mapping-kpis { grid-column: auto; grid-row: auto; overflow-x: auto; }
  .mapping-summary .segmented { width: fit-content; }
  .mindmap-viewport { min-height: 450px; }
  .map-legend { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 310px; padding: 28px 25px; }
  .auth-story-copy h1 { font-size: 32px; }
  .auth-story > small { display: none; }
  .auth-panel { padding: 35px 24px 48px; }
}
