:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --surface-hover: #f3f5f7;
  --ink: #172033;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #3659d9;
  --brand-hover: #2d4fc7;
  --brand-soft: #eef2ff;
  --green: #16835f;
  --green-soft: #ecfdf3;
  --orange: #d97706;
  --orange-soft: #fff7ed;
  --red: #c93636;
  --red-soft: #fff1f1;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .14);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; background: var(--bg); }
body { margin: 0; min-width: 320px; max-width: 100%; overflow-x: clip; background: var(--bg); color: var(--ink); font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
:focus-visible { outline: 3px solid rgba(54, 89, 217, .24); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); padding: 24px 14px 16px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; overflow: hidden; box-shadow: 0 2px 6px rgba(54,89,217,.18); }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; }
.brand span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.nav-list { display: grid; gap: 3px; min-height: 0; overflow-y: auto; }
.nav-section-label { padding: 0 11px 7px; color: var(--muted-2); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.nav-item { width: 100%; min-height: 42px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; display: flex; align-items: center; gap: 11px; color: var(--muted); cursor: pointer; text-align: left; transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item em { margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #eef0f3; font-size: 10px; font-style: normal; text-align: center; }
.nav-item.active em { background: #dce4ff; }
.data-safety-entry { width: 100%; margin-top: auto; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-subtle); display: grid; grid-template-columns: 28px 1fr 16px; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.data-safety-entry:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.data-safety-entry > span:first-child { color: var(--brand); }
.data-safety-entry strong, .data-safety-entry small { display: block; }
.data-safety-entry strong { font-size: 12px; }
.data-safety-entry small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.data-safety-entry > span:last-child svg { width: 14px; color: var(--muted-2); }
.user-card { margin-top: 10px; padding: 12px 7px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e8ecf8; color: var(--brand); font-size: 12px; font-weight: 700; }
.avatar-user { background: var(--brand); color: #fff; }
.user-card div:nth-child(2) { min-width: 0; }
.user-card strong, .user-card span { display: block; white-space: nowrap; }
.user-card strong { font-size: 12px; }
.user-card span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.user-card .icon-button { margin-left: auto; }

.main-content { width: calc(100% - var(--sidebar)); max-width: 1672px; min-width: 0; min-height: 100vh; margin-left: var(--sidebar); padding: 30px clamp(24px, 3vw, 48px) 64px; }
.topbar { min-height: 65px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.topbar h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 700; }
.page-description { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.search-trigger { width: 190px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.search-trigger:hover { border-color: var(--line-strong); }
.search-trigger kbd { margin-left: auto; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-subtle); color: var(--muted-2); font-size: 10px; }
.button { min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.button-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.button-light { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.button-light:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.button-soft { background: var(--brand-soft); color: var(--brand); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--surface-hover); color: var(--ink); }
.button-danger { border-color: var(--red); background: var(--red); color: #fff; }
.button-danger:hover { border-color: #a92d2d; background: #a92d2d; }
.button-danger-quiet { border-color: #f5bcbc; background: var(--surface); color: var(--red); }
.button-danger-quiet:hover { border-color: var(--red); background: var(--red-soft); }
.full { width: 100%; }
.icon-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: var(--surface-hover); color: var(--ink); }
.mobile-menu { display: none; float: left; margin: -3px 9px 0 0; }

.page { display: none; animation: page-in .18s ease; }
.page.active { display: block; }
#page-customers { min-width: 0; max-width: 100%; overflow: hidden; }
@keyframes page-in { from { opacity: .3; transform: translateY(3px); } }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { min-height: 45px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-header h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.35; }
.section-kicker { color: var(--muted-2); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.panel-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.text-button { min-height: 32px; padding: 0 4px; border: 0; background: transparent; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.text-button:hover { color: var(--brand-hover); }
.text-button svg { width: 14px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { min-width: 0; min-height: 118px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-align: left; box-shadow: var(--shadow-sm); }
.metric-card-link { width: 100%; cursor: pointer; }
.metric-card-link:hover { border-color: #b9c5f5; background: #fcfcff; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.metric-icon.orange { background: var(--orange-soft); color: var(--orange); }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon svg { width: 16px; }
.metric-value { margin-top: 10px; font-size: 25px; line-height: 1.15; font-weight: 700; }
.metric-foot { min-width: 0; margin-top: 8px; color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-link-hint { color: var(--brand); opacity: 0; display: inline-flex; align-items: center; white-space: nowrap; transition: opacity .15s ease; }
.metric-card:hover .metric-link-hint, .metric-card:focus-visible .metric-link-hint { opacity: 1; }
.metric-link-hint svg { width: 12px; }

.dashboard-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.primary-dashboard { grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr); align-items: stretch; }
.lower-dashboard { grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(220px, .78fr)); }
.task-panel, .quick-panel, .activity-panel, .distribution-panel, .agenda-panel, .payment-list-panel, .insight-grid > .panel { padding: 20px; }
.task-item { min-height: 68px; padding: 11px 0; border-top: 1px solid #eef0f3; display: flex; align-items: center; gap: 11px; }
.task-item:first-child { border-top: 0; }
.task-overdue { background: linear-gradient(90deg, var(--red-soft), transparent 34%); }
.task-type-icon { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.task-type-icon svg { width: 15px; }
.task-check { width: 22px; height: 22px; flex: 0 0 auto; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: #fff; display: grid; place-items: center; cursor: pointer; }
.task-check:hover { border-color: var(--brand); }
.task-check.done { border-color: var(--green); background: var(--green); }
.task-check svg { width: 13px; }
.task-main { min-width: 0; flex: 1; cursor: pointer; }
.task-main strong, .task-main span { display: block; }
.task-main strong { font-size: 13px; }
.task-main span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.task-title-line { display: flex; align-items: center; gap: 7px; }
.task-title-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-source { width: fit-content; margin: 0 !important; padding: 2px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand) !important; font-size: 9px !important; font-weight: 600; white-space: nowrap; }
.task-time { text-align: right; white-space: nowrap; }
.task-time strong, .task-time span { display: block; }
.task-time strong { font-size: 11px; }
.task-time span { margin-top: 4px; font-size: 10px; }
.task-actions { display: flex; align-items: center; gap: 5px; }
.task-actions .button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.completed-actions { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.completed-actions summary { color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.completed-action { padding: 9px 2px 0; display: flex; align-items: flex-start; gap: 8px; color: var(--green); }
.completed-action > span { width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; }
.completed-action svg { width: 11px; }
.completed-action div { min-width: 0; }
.completed-action strong, .completed-action div span { display: block; }
.completed-action strong { color: var(--ink-2); font-size: 11px; }
.completed-action div span { margin-top: 2px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intent-text.intent-hot { color: var(--red); }
.intent-text.intent-warm { color: var(--orange); }
.intent-text.intent-cold { color: var(--blue); }
.empty-mini { min-height: 80px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 12px; }
.empty-mini strong { color: var(--ink); font-size: 13px; }
.empty-mini span { margin-top: 4px; }
.pipeline-total { margin-bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pipeline-total span { color: var(--muted); font-size: 11px; }
.pipeline-total strong { display: block; margin-top: 2px; font-size: 20px; }
.pipeline-funnel { display: grid; gap: 6px; }
.funnel-stage { width: 100%; min-height: 45px; padding: 0; border: 0; border-radius: 7px; background: transparent; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.funnel-stage:hover { background: var(--surface-hover); }
.funnel-bar { width: var(--funnel-width); min-width: 105px; height: 28px; padding: 0 10px; border-radius: 5px; background: color-mix(in srgb, var(--funnel-color) 13%, white); border-left: 3px solid var(--funnel-color); display: flex; align-items: center; justify-content: space-between; }
.funnel-bar b { font-size: 11px; }
.funnel-bar em { font-size: 11px; font-style: normal; font-weight: 700; }
.funnel-meta { flex: 1; color: var(--muted); font-size: 10px; white-space: nowrap; }
.activity-row { min-height: 62px; padding: 10px 0; border-top: 1px solid #eef0f3; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; cursor: pointer; }
.activity-row:first-child { border-top: 0; }
.activity-row:hover strong { color: var(--brand); }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.activity-row strong, .activity-row div span { display: block; }
.activity-row strong { font-size: 12px; }
.activity-row div span { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-row > span { color: var(--muted-2); font-size: 10px; }
.level-ring-layout { min-height: 145px; display: flex; align-items: center; gap: 20px; }
.level-ring { width: 92px; height: 92px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; position: relative; }
.level-ring:after { content: "客户"; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); color: var(--muted); display: grid; place-items: end center; padding-bottom: 18px; font-size: 9px; }
.level-ring strong { z-index: 1; padding-bottom: 8px; font-size: 18px; }
.level-legend { min-width: 0; flex: 1; display: grid; gap: 5px; }
.level-legend button { width: 100%; min-height: 34px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 11px; cursor: pointer; }
.level-legend button:hover { background: var(--surface-hover); }
.level-legend i { width: 7px; height: 7px; border-radius: 50%; }
.level-legend span:nth-child(2) { color: var(--ink-2); text-align: left; }
.level-legend span:last-child { color: var(--muted); font-weight: 600; }

.page-toolbar { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: flex-end; gap: 8px; }
.customer-toolbar { flex-wrap: wrap; }
.filter-search { width: 238px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; align-items: center; gap: 8px; }
.customer-keyword-search { flex: 1 1 250px; max-width: 310px; }
.address-search { width: 190px; }
.remark-search { width: 170px; }
.filter-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,89,217,.12); }
.filter-search svg { color: var(--muted); }
.filter-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-control { display: grid; gap: 4px; }
.filter-control label { color: var(--muted); font-size: 10px; font-weight: 600; }
.compact-select { height: 38px; min-width: 112px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--surface); color: var(--ink-2); font-size: 12px; }
.compact-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,89,217,.12); }
.clear-filters { min-height: 38px; }
.toolbar-spacer { flex: 1; }
.stage-filter-chip { height: 30px; padding: 0 8px; border: 1px solid #c7d2fe; border-radius: 6px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; gap: 5px; font-size: 11px; cursor: pointer; }
.stage-filter-chip[hidden] { display: none; }
.stage-filter-chip svg { width: 12px; }
.result-bar { min-height: 34px; padding: 0 4px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; }
.result-bar > div { display: flex; align-items: center; gap: 9px; }
.result-bar span:first-child { color: var(--ink-2); font-weight: 600; }
.bulk-select-trigger { min-height: 28px; padding: 0 7px; font-size: 10px; }
.bulk-action-bar { min-height: 54px; margin-bottom: 10px; padding: 8px 10px 8px 14px; border: 1px solid #c7d2fe; border-radius: var(--radius); background: var(--brand-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bulk-action-bar[hidden] { display: none; }
.bulk-action-bar > div { display: flex; align-items: center; gap: 8px; }
.bulk-action-bar strong { color: var(--brand); font-size: 12px; }
.bulk-action-bar span { color: var(--muted); font-size: 10px; }
.bulk-action-bar .button { min-height: 34px; }
.customer-table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; contain: inline-size; }
.customer-table { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; }
.customer-table th { height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); color: var(--muted); font-size: 10px; font-weight: 600; text-align: left; white-space: nowrap; }
.customer-table th:nth-child(1) { width: 175px; }
.customer-table th:nth-child(2) { width: 100px; }
.customer-table th:nth-child(3) { width: 105px; }
.customer-table th:nth-child(4) { width: 145px; }
.customer-table th:nth-child(5) { width: 105px; }
.customer-table th:nth-child(6), .customer-table th:nth-child(7), .customer-table th:nth-child(8) { width: 72px; }
.customer-table th:nth-child(9) { width: 105px; }
.customer-table th:nth-child(10) { width: 88px; }
.customer-table th:nth-child(11) { width: 92px; }
.customer-table th:nth-child(12) { width: 145px; }
.customer-table th:last-child { width: 36px; }
.customer-table td { height: 64px; padding: 9px 12px; border-bottom: 1px solid #eef0f3; color: var(--ink-2); font-size: 13px; vertical-align: middle; }
.customer-table tbody tr { cursor: pointer; }
.customer-table tbody tr.selected { background: #f7f8ff; box-shadow: inset 3px 0 var(--brand); }
.customer-table tbody tr:last-child td { border-bottom: 0; }
.customer-table tbody tr:hover { background: #fafbff; }
.customer-heading, .customer-primary-cell { display: flex; align-items: center; gap: 9px; }
.selection-check { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; cursor: pointer; }
.selection-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.company-cell { min-width: 0; }
.company-cell strong { display: block; color: var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-cell { min-width: 0; display: flex; align-items: center; gap: 7px; }
.contact-cell .avatar { width: 28px; height: 28px; }
.contact-cell strong { min-width: 0; color: var(--ink-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-cell { display: block; font-size: 11px; font-weight: 500; }
.address-cell { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remark-cell { max-width: 100%; min-height: 23px; padding: 3px 7px; border-radius: 5px; background: var(--green-soft); color: var(--green); display: inline-block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.level-badge, .intent-badge, .stage-badge { min-height: 24px; padding: 3px 7px; border-radius: 5px; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.level-badge { background: #f2f4f7; color: var(--ink-2); }
.grade-S { background: #ede9fe; color: #6d28d9; }
.grade-A { background: #eef2ff; color: #4338ca; }
.grade-B { background: #eff6ff; color: #1d4ed8; }
.grade-C { background: #f2f4f7; color: var(--muted); }
.intent-hot { background: var(--red-soft); color: var(--red); }
.intent-warm { background: var(--orange-soft); color: var(--orange); }
.intent-cold { background: var(--blue-soft); color: var(--blue); }
.stage-badge { background: #f2f4f7; color: var(--muted); }
.stage-badge:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stage-contacted { background: var(--blue-soft); color: var(--blue); }
.stage-interested, .stage-quoted { background: var(--orange-soft); color: var(--orange); }
.stage-won { background: var(--green-soft); color: var(--green); }
.stage-lost { background: var(--red-soft); color: var(--red); }
.recent-note { display: -webkit-box; color: var(--muted); font-size: 10px; line-height: 1.45; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.muted-cell { color: var(--muted) !important; }
.overdue { color: var(--red) !important; font-weight: 600; }
.row-action-cell { padding-left: 4px !important; padding-right: 4px !important; }
.row-action { color: var(--muted-2); }
.empty-state { display: none; padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state > span { color: var(--muted-2); }
.empty-state > span svg { width: 30px; height: 30px; }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0 0 16px; font-size: 12px; }

.page-action-row { min-height: 40px; margin: -4px 0 14px; display: flex; justify-content: flex-end; align-items: center; }
.reminder-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.reminder-summary-card { min-height: 76px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 5px auto 1fr; align-items: center; gap: 11px; }
.reminder-summary-card i { width: 5px; height: 40px; border-radius: 3px; }
.reminder-summary-card strong, .reminder-summary-card span { display: block; }
.reminder-summary-card strong { font-size: 20px; line-height: 1; }
.reminder-summary-card span { margin-top: 4px; color: var(--ink-2); font-size: 11px; }
.reminder-summary-card small { color: var(--muted); font-size: 10px; text-align: right; }
.reminder-groups { display: grid; gap: 14px; }
.reminder-group { padding: 18px; }
.reminder-group-head { margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.reminder-group-head h3 { margin: 0; font-size: 15px; }
.reminder-overdue .reminder-group-head h3 { color: var(--red); }
.reminder-today .reminder-group-head h3 { color: var(--orange); }
.reminder-tomorrow .reminder-group-head h3 { color: #527ab8; }
.reminder-week .reminder-group-head h3 { color: var(--green); }
.reminder-group-head span { min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #f2f4f7; color: var(--muted); font-size: 10px; text-align: center; }
.reminder-card-list { display: grid; gap: 8px; }
.reminder-item { min-height: 122px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 4px 38px minmax(250px, 1fr) 95px auto; align-items: center; gap: 12px; overflow: hidden; }
.reminder-accent { align-self: stretch; background: var(--brand); }
.reminder-overdue .reminder-accent { background: var(--red); }
.reminder-today .reminder-accent { background: var(--orange); }
.reminder-tomorrow .reminder-accent { background: #527ab8; }
.reminder-week .reminder-accent { background: var(--green); }
.reminder-info { min-width: 0; padding: 12px 0; cursor: pointer; }
.reminder-title { display: flex; align-items: center; gap: 7px; }
.reminder-title strong { font-size: 13px; }
.reminder-title span { color: var(--muted); font-size: 11px; }
.reminder-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.reminder-info p { margin: 7px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-action { display: block; margin-top: 3px; color: var(--ink-2); font-size: 11px; }
.reminder-value { text-align: right; }
.reminder-value strong, .reminder-value span { display: block; }
.reminder-value strong { font-size: 13px; }
.reminder-date { margin-top: 6px; color: var(--muted); font-size: 10px; }
.reminder-actions { padding-right: 12px; display: grid; gap: 4px; }
.reminder-actions .button { min-height: 30px; padding: 0 8px; font-size: 10px; }
.reminder-actions svg { width: 13px; }

.opportunity-metrics { margin-bottom: 16px; }
.opportunity-overview-grid { margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(310px, .58fr); gap: 16px; }
.opportunity-funnel-panel, .priority-opportunity-panel { padding: 20px; }
.opportunity-funnel { display: grid; grid-template-columns: repeat(5, minmax(115px, 1fr)); align-items: end; gap: 7px; }
.opportunity-funnel-stage { min-width: 0; height: calc(80px + var(--step) * 9px); padding: 11px; border: 1px solid var(--line); border-top: 3px solid var(--stage-color); border-radius: 7px; background: var(--surface-subtle); display: flex; flex-direction: column; justify-content: space-between; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.opportunity-funnel-stage:hover { border-color: #acb9ed; background: #fafbff; transform: translateY(-2px); }
.opportunity-funnel-stage.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(54,89,217,.08); }
.opportunity-funnel-main, .opportunity-funnel-detail { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.opportunity-funnel-main b { font-size: 11px; }
.opportunity-funnel-main strong { font-size: 19px; }
.opportunity-funnel-detail { align-items: flex-end; color: var(--muted); font-size: 9px; }
.opportunity-funnel-detail span:last-child { text-align: right; }
.opportunity-lost-summary { grid-column: 1 / -1; min-height: 44px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.opportunity-lost-summary:hover { border-color: var(--red); background: var(--red-soft); }
.opportunity-lost-summary span, .opportunity-lost-summary b, .opportunity-lost-summary small { display: block; }
.opportunity-lost-summary b { color: var(--ink-2); font-size: 11px; }
.opportunity-lost-summary small { margin-top: 1px; font-size: 9px; }
.opportunity-lost-summary strong { color: var(--red); font-size: 15px; }
.priority-opportunity { min-height: 49px; padding: 7px 0; border-top: 1px solid #eef0f3; display: grid; grid-template-columns: 20px minmax(0,1fr) auto 30px; align-items: center; gap: 8px; }
.priority-opportunity:first-child { border-top: 0; }
.priority-rank { width: 20px; height: 20px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.priority-info { min-width: 0; cursor: pointer; }
.priority-info strong, .priority-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-info strong { font-size: 11px; }
.priority-info span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.priority-opportunity > span:nth-child(3) { color: var(--muted); font-size: 9px; white-space: nowrap; }
.priority-opportunity .icon-button { width: 30px; height: 30px; }
.opportunity-toolbar { margin-bottom: 10px; }
.toolbar-result { color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.opportunity-stage-tabs { display: none; margin-bottom: 10px; gap: 6px; overflow-x: auto; }
.opportunity-stage-tabs button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.opportunity-stage-tabs button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.opportunity-stage-tabs span { min-width: 18px; padding: 0 4px; border-radius: 9px; background: #eef0f3; font-size: 9px; text-align: center; }
.opportunity-board-panel { padding: 18px; overflow: hidden; }
.filter-state { padding: 4px 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 10px; }
.kanban { display: grid; grid-template-columns: repeat(var(--visible-columns, 5), minmax(235px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { display: none; min-height: 410px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f8; }
.kanban-column.stage-visible { display: block; }
.kanban-head { padding: 2px 2px 9px; }
.kanban-head-button { width: 100%; min-height: 34px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.kanban-head-button:hover { background: rgba(255,255,255,.85); }
.kanban-head-button div { display: flex; align-items: center; gap: 6px; }
.kanban-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--column-color); }
.kanban-head strong { font-size: 11px; }
.kanban-head span { color: var(--muted); font-size: 9px; }
.kanban-card-list { display: grid; gap: 8px; }
.opportunity-card { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); }
.opportunity-card:hover { border-color: #aebbea; }
.opp-card-head { display: flex; justify-content: space-between; gap: 8px; }
.opp-card-head > div { min-width: 0; }
.opp-card-head strong, .opp-card-head span { display: block; }
.opp-card-head > div strong { font-size: 12px; }
.opp-card-head > div span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.opp-card-head > strong { font-size: 12px; white-space: nowrap; }
.opp-tags { margin-top: 9px; display: flex; gap: 5px; }
.opportunity-card h4 { margin: 9px 0 4px; font-size: 11px; }
.opportunity-card p { min-height: 30px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.opp-next { margin-top: 9px; padding: 8px; border-radius: 5px; background: var(--surface-subtle); }
.opp-next span, .opp-next strong { display: block; }
.opp-next span { color: var(--muted-2); font-size: 8px; }
.opp-next strong { margin-top: 2px; font-size: 9px; }
.opp-card-foot { margin-top: 9px; padding-top: 9px; border-top: 1px solid #eef0f3; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.opp-card-foot > span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.opp-card-foot label { color: var(--muted); font-size: 8px; display: flex; align-items: center; gap: 4px; }
.opp-card-foot select { width: 76px; height: 28px; padding: 0 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink-2); font-size: 9px; cursor: pointer; }
.lost-opportunities { margin-top: 12px; padding: 0 18px; }
.lost-opportunities summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.lost-opportunities summary::marker { color: var(--muted); }
.lost-opportunities summary span:first-child { display: flex; align-items: baseline; gap: 8px; }
.lost-opportunities summary strong { font-size: 12px; }
.lost-opportunities summary small { color: var(--muted); font-size: 9px; }
.lost-opportunities summary > span:last-child { min-width: 24px; padding: 2px 6px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 10px; text-align: center; }
#lostOpportunityList { padding-bottom: 12px; }
#lostOpportunityList > button { width: 100%; min-height: 48px; padding: 8px; border: 0; border-top: 1px solid #eef0f3; background: transparent; display: grid; grid-template-columns: 1fr auto 18px; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
#lostOpportunityList > button:hover { background: var(--surface-hover); }
#lostOpportunityList strong, #lostOpportunityList small { display: block; }
#lostOpportunityList strong { font-size: 11px; }
#lostOpportunityList small { color: var(--muted); font-size: 9px; }
#lostOpportunityList > button > span:nth-child(2) { color: var(--muted); font-size: 10px; }

.schedule-layout { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr); gap: 18px; align-items: start; }
.weekly-plan-panel { padding: 20px; }
.weekly-targets { display: grid; gap: 9px; }
.weekly-target-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); }
.weekly-target-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.weekly-target-top span { color: var(--muted); }
.weekly-target-top strong { font-size: 12px; }
.progress-track { height: 6px; margin-top: 10px; border-radius: 6px; background: #e8ebef; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--brand); }
.embedded-calendar { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.calendar-head { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.calendar-head > div { display: flex; align-items: center; gap: 4px; }
.calendar-head svg { color: var(--muted); }
.calendar-month-picker { width: 132px; height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 600; text-align: center; }
.calendar-month-picker:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,89,217,.12); }
.calendar-today-button { min-height: 30px; padding: 0 7px; border: 0; border-radius: 5px; background: transparent; color: var(--brand); font-size: 10px; cursor: pointer; }
.calendar-today-button:hover { background: var(--brand-soft); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-grid span, .calendar-grid button { aspect-ratio: 1; border-radius: 6px; color: var(--muted); display: grid; place-items: center; font-size: 10px; }
.calendar-grid button { padding: 0; border: 1px solid transparent; background: transparent; cursor: pointer; }
.calendar-grid button:hover { border-color: var(--line-strong); background: var(--surface-hover); color: var(--ink); }
.calendar-grid .weekday { aspect-ratio: auto; height: 22px; color: var(--muted-2); font-size: 9px; }
.calendar-grid .today { box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand); font-weight: 700; }
.calendar-grid .has-event { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.calendar-grid .selected { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: none; }
.calendar-grid .blank { visibility: hidden; }
.agenda-date { margin: 17px 0 7px; color: var(--muted); font-size: 10px; font-weight: 600; }
.agenda-date:first-child { margin-top: 0; }
.agenda-item { min-height: 68px; margin-top: 6px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.agenda-item:hover { background: var(--surface-hover); }
.agenda-item.agenda-done { opacity: .72; }
.agenda-time { width: 40px; color: var(--brand); font-size: 11px; font-weight: 700; }
.agenda-line { width: 2px; align-self: stretch; border-radius: 2px; background: var(--brand); }
.agenda-info { min-width: 0; flex: 1; }
.agenda-info strong, .agenda-info span { display: block; }
.agenda-info strong { font-size: 12px; }
.agenda-info span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.agenda-title { display: flex; align-items: center; gap: 7px; }
.agenda-title .action-source { margin-top: 0; }
.agenda-status { color: var(--green); display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; }
.agenda-status svg { width: 13px; }
.agenda-item > .button { min-height: 32px; padding: 0 9px; font-size: 10px; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.review-editor, .review-archive { padding: 20px; }
.review-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.review-form > .button { grid-column: 1 / -1; justify-self: end; }
.review-field label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.review-field textarea { width: 100%; min-height: 126px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); color: var(--ink); outline: 0; resize: vertical; font-size: 12px; line-height: 1.6; }
.review-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,89,217,.12); }
.review-item { padding: 12px 0; border-top: 1px solid #eef0f3; cursor: pointer; }
.review-item:first-child { border-top: 0; }
.review-item strong, .review-item span { display: block; }
.review-item strong { font-size: 11px; }
.review-item span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.payment-list-panel { margin-top: 4px; }
.payment-row { min-height: 66px; padding: 10px 2px; border-top: 1px solid #eef0f3; display: flex; align-items: center; gap: 11px; }
.payment-row:first-child { border-top: 0; }
.payment-info { min-width: 0; flex: 1; }
.payment-info strong, .payment-info span, .payment-amount strong, .payment-amount span { display: block; }
.payment-info strong { font-size: 12px; }
.payment-info span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.payment-amount { text-align: right; }
.payment-amount strong { color: var(--green); font-size: 13px; }
.payment-amount span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.insight-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.bar-chart { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 24px; align-items: center; gap: 9px; font-size: 11px; }
.bar-track { height: 8px; border-radius: 5px; background: #edf0f3; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; }
.donut-layout { display: flex; align-items: center; gap: 22px; }
.donut { width: 116px; height: 116px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut:after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut strong { z-index: 1; font-size: 18px; }
.source-legend { min-width: 0; flex: 1; display: grid; gap: 8px; }
.source-legend div { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.source-legend i { width: 7px; height: 7px; border-radius: 50%; }
.source-legend span:last-child { margin-left: auto; color: var(--muted); }

.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(16,24,40,.36); opacity: 0; visibility: hidden; transition: .2s ease; }
.backdrop.show { opacity: 1; visibility: visible; }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 70; width: min(500px, 100%); padding: 30px; background: var(--surface); transform: translateX(102%); transition: .24s ease; overflow-y: auto; box-shadow: var(--shadow-lg); }
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 18px; right: 18px; }
.drawer-profile { padding-right: 40px; display: flex; align-items: center; gap: 13px; }
.drawer-profile .avatar { width: 50px; height: 50px; font-size: 16px; }
.drawer-profile h2 { margin: 0; font-size: 21px; }
.drawer-profile p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.drawer-badges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.drawer-actions { margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drawer-actions button { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); color: var(--brand); display: grid; place-items: center; align-content: center; gap: 4px; cursor: pointer; }
.drawer-actions button:hover { border-color: #bdc7e8; background: var(--brand-soft); }
.drawer-actions span { color: var(--ink-2); font-size: 10px; }
.info-grid { margin: 16px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-block { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); }
.info-block span, .info-block strong { display: block; }
.info-block span { color: var(--muted); font-size: 10px; }
.info-block strong { margin-top: 4px; font-size: 12px; }
.span-2 { grid-column: span 2; }
.timeline-title { margin: 0 0 14px; font-size: 14px; }
.timeline { margin-left: 5px; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 20px 18px; }
.timeline-item:before { content: ""; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline-item strong { font-size: 11px; }
.timeline-item p { margin: 5px 0; color: var(--ink-2); font-size: 11px; line-height: 1.6; }
.timeline-item span { color: var(--muted-2); font-size: 10px; }
.drawer-danger-zone { margin-top: 12px; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drawer-danger-zone strong, .drawer-danger-zone span { display: block; }
.drawer-danger-zone strong { color: var(--red); font-size: 11px; }
.drawer-danger-zone span { margin-top: 2px; color: var(--muted); font-size: 9px; }

.modal { position: fixed; inset: 0; z-index: 80; padding: 24px; background: rgba(16,24,40,.42); display: grid; place-items: center; opacity: 0; visibility: hidden; transition: .18s ease; }
.modal.open { opacity: 1; visibility: visible; }
.modal-card { width: min(700px, 100%); max-height: calc(100vh - 48px); padding: 25px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; transform: translateY(6px); transition: .18s ease; }
.modal.open .modal-card { transform: none; }
.modal-small { width: min(480px, 100%); }
.delete-confirm-card { text-align: center; }
.delete-confirm-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.delete-confirm-card h2 { margin: 0; font-size: 19px; }
.delete-confirm-card > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.delete-confirm-card > p strong { color: var(--ink); }
.delete-impact { margin-top: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.delete-impact span { color: var(--muted); font-size: 9px; }
.delete-impact b { display: block; margin-top: 3px; color: var(--ink); font-size: 15px; }
.delete-backup-note { padding: 10px; border-radius: 7px; background: var(--orange-soft); color: var(--orange) !important; display: flex; align-items: center; gap: 7px; text-align: left; }
.delete-backup-note svg { flex: 0 0 auto; width: 15px; }
.delete-confirm-card .form-actions { justify-content: center; }
.modal-header { margin-bottom: 21px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-header h2 { margin: 3px 0 0; font-size: 20px; }
.modal-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.one-col { grid-template-columns: 1fr; }
.form-grid.action-time-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid label > span { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; background: var(--surface); color: var(--ink); font-size: 12px; }
.form-grid input, .form-grid select { height: 40px; padding: 0 10px; }
.form-grid textarea { padding: 10px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(54,89,217,.12); }
.form-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.next-action-divider { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.next-action-divider span, .next-action-divider small { display: block; }
.next-action-divider span { color: var(--ink); font-size: 12px; font-weight: 700; }
.next-action-divider small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.review-drilldown-card { width: min(640px, 100%); }
.review-drilldown-list { display: grid; gap: 8px; }
.review-drilldown-item { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.review-drilldown-item:hover { border-color: #bdc7e8; background: var(--surface-hover); }
.review-drilldown-item > div { min-width: 0; flex: 1; }
.review-drilldown-item strong, .review-drilldown-item span { display: block; }
.review-drilldown-item strong { font-size: 12px; }
.review-drilldown-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.review-drilldown-item p { margin: 7px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.55; }
.review-drilldown-item > span { flex: 0 0 auto; color: var(--muted); }
.review-drilldown-item > span svg { width: 15px; }
.import-drop { min-height: 190px; padding: 26px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.import-drop.dragging { border-color: var(--brand); background: var(--brand-soft); }
.import-drop > span { color: var(--brand); }
.import-drop > span svg { width: 29px; height: 29px; }
.import-drop strong { margin-top: 8px; font-size: 13px; }
.import-drop p { margin: 5px 0 14px; color: var(--muted); font-size: 11px; }
.import-preview { margin-top: 13px; overflow-x: auto; }
.import-status { padding: 10px 12px; border-radius: 7px; background: var(--green-soft); color: var(--green); font-size: 11px; }
.import-file-summary { margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); }
.import-file-summary strong { display: block; font-size: 12px; }
.import-file-summary div { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.import-file-summary span { padding: 6px; border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 10px; text-align: center; }
.import-file-summary b { display: block; margin-top: 2px; color: var(--ink); font-size: 14px; }
.import-preview table { width: 100%; min-width: 560px; margin-top: 9px; border-collapse: collapse; font-size: 10px; }
.import-preview th, .import-preview td { padding: 7px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.settings-grid { display: grid; gap: 8px; }
.settings-grid section { min-height: 74px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 11px; }
.settings-grid section > span:first-child { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.settings-grid section div { min-width: 0; flex: 1; }
.settings-grid strong, .settings-grid p { display: block; margin: 0; }
.settings-grid strong { font-size: 12px; }
.settings-grid p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-ready { color: var(--green); font-size: 11px; font-weight: 700; }
.cloud-sync-card { width: min(720px, 100%); }
.cloud-notice { margin-bottom: 18px; padding: 13px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; display: flex; align-items: flex-start; gap: 10px; }
.cloud-notice > span { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.cloud-notice svg { width: 16px; }
.cloud-notice strong, .cloud-notice p { display: block; margin: 0; }
.cloud-notice strong { font-size: 12px; }
.cloud-notice p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.cloud-notice a { display: inline-flex; margin-top: 7px; color: var(--brand); font-size: 10px; font-weight: 700; text-decoration: none; }
.cloud-notice a:hover { text-decoration: underline; }
.cloud-form-message { min-height: 18px; margin-top: 10px; color: var(--red); font-size: 11px; }
.cloud-form-message.success { color: var(--green); }
.cloud-login-actions { margin-top: 10px; }
.cloud-verify-panel { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); }
.cloud-verify-panel > label { display: grid; gap: 7px; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.cloud-verify-panel .form-actions { margin-top: 10px; }
.cloud-account-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); display: flex; align-items: center; gap: 11px; }
.cloud-account-card > div { min-width: 0; flex: 1; }
.cloud-account-card strong, .cloud-account-card p { display: block; margin: 0; }
.cloud-account-card strong { font-size: 12px; }
.cloud-account-card p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.cloud-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.cloud-status-dot.synced { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.cloud-status-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.cloud-conflict { margin-top: 12px; padding: 12px; border-left: 3px solid var(--orange); border-radius: 6px; background: var(--orange-soft); }
.cloud-conflict strong, .cloud-conflict p { display: block; margin: 0; }
.cloud-conflict strong { color: var(--orange); font-size: 11px; }
.cloud-conflict p { margin-top: 3px; color: var(--ink-2); font-size: 10px; }
.cloud-sync-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cloud-action-button { min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--brand); display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.cloud-action-button:hover { border-color: #bdc7e8; background: var(--brand-soft); }
.cloud-action-button > span { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 7px; background: var(--brand-soft); display: grid; place-items: center; }
.cloud-action-button svg { width: 16px; }
.cloud-action-button div { min-width: 0; }
.cloud-action-button strong, .cloud-action-button small { display: block; }
.cloud-action-button strong { color: var(--ink); font-size: 12px; }
.cloud-action-button small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.cloud-sync-meta { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cloud-sync-meta span { color: var(--muted); font-size: 10px; }
.cloud-settings-entry .status-ready { white-space: nowrap; }
.command-modal { position: fixed; inset: 0; z-index: 90; padding-top: 13vh; background: rgba(16,24,40,.38); display: flex; justify-content: center; opacity: 0; visibility: hidden; transition: .16s ease; }
.command-modal.open { opacity: 1; visibility: visible; }
.command-card { width: min(560px, calc(100% - 30px)); height: fit-content; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.command-input { height: 58px; padding: 0 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.command-input input { width: 100%; border: 0; outline: 0; font-size: 13px; }
.command-input kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; }
.command-results { max-height: 350px; padding: 7px; overflow-y: auto; }
.command-result { padding: 9px; border-radius: 7px; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.command-result:hover { background: var(--surface-hover); }
.command-result div:nth-child(2) { min-width: 0; flex: 1; }
.command-result strong, .command-result span { display: block; }
.command-result strong { font-size: 12px; }
.command-result span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; padding: 10px 14px; border-radius: 8px; background: #172033; color: #fff; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 7px; font-size: 11px; transform: translate(-50%, 16px); opacity: 0; visibility: hidden; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast svg { width: 14px; }

@media (max-width: 1500px) and (min-width: 601px) {
  .customer-table th:nth-child(12), .customer-table td:nth-child(12) { display: none; }
}

@media (max-width: 1180px) {
  .main-content { padding-left: 24px; padding-right: 24px; }
  .primary-dashboard { grid-template-columns: 1fr; }
  .lower-dashboard { grid-template-columns: 1fr 1fr; }
  .activity-panel { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-toolbar .toolbar-spacer { display: none; }
  .customer-toolbar .filter-search { flex: 1 1 260px; }
  .reminder-item { grid-template-columns: 4px 38px minmax(220px, 1fr) 90px; }
  .reminder-actions { grid-column: 3 / -1; padding: 0 12px 12px 0; display: flex; justify-content: flex-end; }
  .opportunity-overview-grid { grid-template-columns: 1fr; }
  .priority-opportunity-panel #priorityOpportunities { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .opportunity-toolbar .toolbar-spacer { display: none; }
  .opportunity-toolbar .filter-search { flex: 1 1 260px; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow-lg); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .main-content { width: 100%; margin-left: 0; }
  .mobile-menu { display: grid; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd { display: none; }
  .schedule-layout, .review-layout, .insight-grid { grid-template-columns: 1fr; }
  .metric-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opportunity-funnel { overflow-x: auto; grid-template-columns: repeat(5, 145px); padding: 2px 0 6px; }
  .opportunity-lost-summary { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .main-content { padding: 18px 14px 44px; }
  .topbar { min-height: 60px; margin-bottom: 18px; align-items: flex-start; }
  .topbar h1 { font-size: 21px; }
  .page-description { max-width: 240px; font-size: 11px; }
  .top-actions { gap: 5px; }
  #addFollowupBtn { display: none; }
  #addCustomerBtn { width: 38px; padding: 0; font-size: 0; }
  .button { min-height: 38px; }
  .metric-grid, .metric-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-value { font-size: 21px; }
  .metric-foot { display: block; }
  .metric-link-hint { display: none; }
  .dashboard-grid { gap: 12px; margin-bottom: 12px; }
  .lower-dashboard { grid-template-columns: 1fr; }
  .activity-panel { grid-column: auto; }
  .task-panel, .quick-panel, .activity-panel, .distribution-panel, .agenda-panel, .payment-list-panel, .insight-grid > .panel { padding: 15px; }
  .panel-header { min-height: 40px; }
  .panel-header h3 { font-size: 15px; }
  .section-kicker { font-size: 9px; }
  .task-item { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 8px 10px; }
  .task-time { grid-column: 2; display: flex; justify-content: space-between; text-align: left; }
  .task-time span { margin: 0; }
  .task-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .funnel-stage { align-items: flex-start; flex-direction: column; gap: 3px; padding: 4px; }
  .funnel-bar { min-width: 120px; }
  .funnel-meta { padding-left: 2px; white-space: normal; }
  .level-ring-layout { min-height: 122px; gap: 15px; }
  .level-ring { width: 82px; height: 82px; }
  .page-toolbar { padding: 10px; align-items: stretch; }
  .customer-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .customer-toolbar .filter-search, .customer-toolbar .filter-control:first-of-type { grid-column: 1 / -1; width: 100%; max-width: none; }
  .filter-control { min-width: 0; }
  .compact-select { width: 100%; min-width: 0; }
  .clear-filters { grid-column: 1 / -1; }
  .customer-toolbar > .button:not(.clear-filters) { min-width: 0; padding: 0 7px; font-size: 11px; }
  .customer-toolbar #toolbarAddCustomerBtn { grid-column: 1 / -1; }
  .result-bar span:last-child { display: none; }
  .result-bar > div { width: 100%; justify-content: space-between; }
  .bulk-action-bar { align-items: stretch; flex-direction: column; }
  .bulk-action-bar > div { justify-content: space-between; }
  .bulk-action-bar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .customer-table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; contain: none; }
  .customer-table { min-width: 0; table-layout: auto; border-collapse: separate; border-spacing: 0 9px; }
  .customer-table thead { display: none; }
  .customer-table tbody { display: grid; gap: 10px; }
  .customer-table tr { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .customer-table td { height: auto; padding: 0; border: 0; display: block; font-size: 12px; }
  .customer-table td:before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 10px; font-weight: 600; }
  .customer-table .company-cell strong { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  .customer-table td:first-child { grid-column: 1 / -1; padding-right: 30px; }
  .customer-primary-cell { align-items: flex-start; }
  .customer-table td:first-child:before, .customer-table .row-action-cell:before { display: none; }
  .customer-table td:nth-child(4), .customer-table td:nth-child(5), .customer-table td:nth-child(9), .customer-table td:nth-child(12) { grid-column: 1 / -1; }
  .customer-table .address-cell { white-space: normal; }
  .customer-table .remark-cell { white-space: normal; }
  .customer-table .recent-note { -webkit-line-clamp: 1; }
  .row-action-cell { position: absolute; top: 12px; right: 8px; }
  .reminder-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .reminder-summary-card { min-height: 72px; padding: 10px; grid-template-columns: 4px 1fr; gap: 8px; }
  .reminder-summary-card small { display: none; }
  .reminder-group { padding: 13px; }
  .reminder-item { padding: 12px; grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
  .reminder-accent { position: absolute; }
  .reminder-info { padding: 0; }
  .reminder-value { grid-column: 1 / -1; display: flex; justify-content: space-between; text-align: left; }
  .reminder-value .reminder-date { margin: 0; }
  .reminder-actions { grid-column: 1 / -1; padding: 3px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reminder-actions .button { padding: 0 4px; }
  .calendar-head { gap: 5px; }
  .calendar-month-picker { width: 124px; }
  .calendar-today-button { padding: 0 5px; font-size: 9px; }
  .opportunity-overview-grid { gap: 12px; }
  .opportunity-funnel-panel, .priority-opportunity-panel { padding: 15px; }
  .opportunity-funnel { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .opportunity-funnel-stage { width: calc(100% - var(--step) * 12px); height: auto; min-height: 66px; margin-left: calc(var(--step) * 12px); }
  .opportunity-lost-summary { grid-column: auto; }
  .priority-opportunity-panel #priorityOpportunities { display: block; }
  .opportunity-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .opportunity-toolbar .filter-search { grid-column: 1 / -1; width: 100%; }
  .opportunity-toolbar .filter-control { min-width: 0; }
  .opportunity-toolbar .filter-control:nth-of-type(3) { grid-column: 1 / -1; }
  .opportunity-toolbar .clear-filters { grid-column: 1 / -1; }
  .opportunity-toolbar .toolbar-result { grid-column: 1 / -1; padding: 3px; }
  .opportunity-stage-tabs { display: flex; }
  .opportunity-board-panel { padding: 14px; }
  .opportunity-board-panel .panel-header { align-items: flex-start; }
  .kanban { display: block; overflow: visible; }
  .kanban-column, .kanban-column.stage-visible { display: none; min-height: 0; }
  .kanban-column.mobile-active { display: block; }
  .opportunity-card { padding: 14px; }
  .opp-card-head > div strong { font-size: 13px; }
  .opp-card-foot select { width: 96px; height: 34px; }
  .lost-opportunities { padding: 0 14px; }
  .lost-opportunities summary span:first-child { display: block; }
  .drawer-danger-zone { align-items: flex-start; flex-direction: column; }
  .drawer-danger-zone .button { width: 100%; }
  .delete-impact { grid-template-columns: repeat(2,1fr); }
  .review-form { grid-template-columns: 1fr; }
  .review-form > .button { justify-self: stretch; }
  .agenda-item .stage-badge { display: none; }
  .agenda-item { align-items: flex-start; flex-wrap: wrap; }
  .agenda-info { flex-basis: calc(100% - 66px); }
  .agenda-item > .button, .agenda-status { margin-left: 52px; }
  .donut-layout { align-items: flex-start; flex-direction: column; }
  .source-legend { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .modal { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 92vh; padding: 21px 18px; border-radius: 14px 14px 0 0; }
  .import-file-summary div { grid-template-columns: repeat(2, 1fr); }
  .cloud-sync-actions { grid-template-columns: 1fr; }
  .cloud-account-card { align-items: flex-start; flex-wrap: wrap; }
  .cloud-account-card .button { width: 100%; }
  .cloud-sync-meta { align-items: stretch; flex-direction: column; }
  .cloud-sync-meta .button { width: 100%; }
  .drawer { width: 100%; padding: 24px 18px; }
  .drawer-actions { gap: 6px; }
  .drawer-actions button { min-height: 56px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 18px; max-width: calc(100% - 28px); }
}

@media (max-width: 370px) {
  .metric-grid, .metric-grid.compact { grid-template-columns: 1fr; }
  .top-actions #globalSearch { display: none; }
  .customer-toolbar { grid-template-columns: 1fr; }
  .customer-toolbar > *, .customer-toolbar .filter-control { grid-column: 1 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
