:root {
  --ink: #152822;
  --muted: #68756f;
  --line: #dde5e1;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --primary: #0d5c48;
  --primary-2: #14745b;
  --primary-soft: #e8f3ef;
  --orange: #d97706;
  --orange-soft: #fff3df;
  --red: #c2413a;
  --red-soft: #fff0ef;
  --green: #25835d;
  --shadow: 0 18px 45px rgba(17, 45, 35, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: var(--ink); background: var(--canvas); }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.app-shell { min-height: 100vh; }
.app-shell.locked { pointer-events: none; user-select: none; filter: blur(3px); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: #12352c; color: #fff; padding: 24px 16px; z-index: 20; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 28px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e2bd76; color: #12352c; font-weight: 900; font-size: 20px; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; color: #a9c0b8; margin-top: 4px; font-size: 11px; }
nav { display: grid; gap: 7px; }
.nav-item { border: 0; width: 100%; padding: 12px 14px; display: flex; gap: 12px; align-items: center; border-radius: 11px; color: #c6d8d2; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-item span { width: 20px; text-align: center; }
.sidebar-note { margin-top: auto; padding: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; }
.sidebar-note strong { font-size: 13px; }
.sidebar-note p { color: #abc1ba; font-size: 12px; line-height: 1.65; margin: 7px 0 0; }
.sidebar-account { display: grid; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-account .nav-item { padding-top: 9px; padding-bottom: 9px; font-size: 12px; }
.sidebar-account .danger-nav { color: #f3b9b5; }
.main-content { margin-left: 224px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 15; height: 70px; display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 0 34px; background: rgba(244,247,245,.93); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(210,221,216,.85); }
.global-search-wrap { display: flex; align-items: center; gap: 9px; width: min(520px, 55vw); padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.global-search-wrap input { border: 0; outline: 0; width: 100%; background: transparent; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.account-area { display: flex; align-items: center; gap: 3px; padding-left: 10px; border-left: 1px solid var(--line); }
.account-area > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.today-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.view { display: none; padding: 32px 34px 70px; max-width: 1540px; margin: 0 auto; }
.view.active { display: block; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(26px, 3vw, 36px); margin: 2px 0 8px; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow, .section-kicker { color: var(--primary-2) !important; font-size: 11px !important; letter-spacing: .15em; font-weight: 800; text-transform: uppercase; }
.primary, .secondary, .icon-button, .danger-button, .button-link { border-radius: 10px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; font-weight: 700; }
.primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(13,92,72,.18); }
.primary:hover { background: var(--primary-2); }
.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.secondary:hover { border-color: #aebdb6; }
.danger-button { color: #fff; background: var(--red); }
.danger-button:hover { background: #a9342e; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.danger-text { color: var(--red) !important; }
.small { min-height: 36px; font-size: 13px; }
.icon-button { padding: 0; min-width: 44px; background: transparent; border-color: var(--line); font-size: 20px; }
.demo-banner { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid #edcf91; background: #fff9e9; color: #79520c; border-radius: 12px; margin-bottom: 18px; font-size: 13px; }
.demo-banner span { color: #8b6d34; }
.demo-banner button { margin-left: auto; flex: 0 0 auto; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; min-height: 110px; }
.metric-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.metric-card::after { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; right: -25px; top: -25px; background: var(--primary-soft); }
.metric-card.alert::after { background: var(--red-soft); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { display: block; font-size: 28px; line-height: 1.2; margin: 7px 0 3px; font-weight: 900; letter-spacing: -.04em; }
.metric-foot { color: #8b9691; font-size: 11px; }
.focus-panel, .worklist-section, .low-priority-panel { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.section-title { margin-bottom: 16px; }
.section-title.split { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.section-title h2 { margin: 3px 0 5px; font-size: 20px; }
.section-title p { color: var(--muted); margin: 0; font-size: 13px; }
.focus-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.focus-item { display: flex; gap: 12px; align-items: center; padding: 15px; border-radius: 13px; background: #f7faf8; border: 1px solid #e7eeeb; }
.focus-number { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--primary); font-weight: 900; }
.focus-item .focus-number { color: #fff; font-size: 14px; }
.focus-item strong { display: block; font-size: 14px; }
.focus-item span { color: var(--muted); font-size: 12px; }
.focus-task { align-items: flex-start; min-width: 0; }
.focus-task-body { min-width: 0; flex: 1; }
.focus-task p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.focus-task .action-line { color: #744b06; font-weight: 800; }
.focus-task .goal-line { color: var(--ink); font-weight: 800; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.chip { min-height: 32px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); padding: 0 12px; font-size: 12px; }
.chip.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.worklist { display: grid; gap: 12px; min-height: 180px; }
.work-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.work-card.high-risk { border-left: 4px solid var(--red); }
.work-card-main { display: grid; grid-template-columns: minmax(180px, 1.2fr) 110px 130px minmax(220px, 1.4fr) auto; gap: 14px; align-items: center; padding: 16px; }
.customer-name { font-weight: 900; font-size: 15px; }
.store-line { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stage-badge, .score-badge, .action-badge, .risk-badge, .classification-badge { display: inline-flex; align-items: center; justify-content: center; width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; }
.stage-badge { color: var(--primary); background: var(--primary-soft); }
.classification-badge { color: #6a3a09; background: #fff0d6; }
.score-badge.high { color: #a24500; background: #fff1dc; }
.score-badge.medium { color: var(--primary); background: var(--primary-soft); }
.score-badge.low { color: #66716c; background: #edf1ef; }
.action-badge { color: #704b08; background: var(--orange-soft); margin-bottom: 5px; }
.risk-badge { color: var(--red); background: var(--red-soft); }
.work-why { font-size: 13px; line-height: 1.5; }
.work-why small { display: block; color: var(--muted); margin-top: 3px; }
.work-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.text-button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 7px; white-space: nowrap; }
.work-detail { display: none; grid-template-columns: repeat(4, 1fr); gap: 10px; border-top: 1px solid var(--line); padding: 15px 16px; background: #f8faf9; }
.work-card.expanded .work-detail { display: grid; }
.detail-cell { padding: 10px; border-radius: 10px; background: #fff; border: 1px solid #e7ece9; }
.detail-cell label { color: var(--muted); font-size: 11px; display: block; margin-bottom: 5px; }
.detail-cell p { margin: 0; font-size: 13px; line-height: 1.55; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 6px; }
.low-priority-panel { background: #f0f3f1; }
.low-priority-panel p { color: var(--muted); line-height: 1.7; margin: 0; }
.low-priority-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.low-priority-item { display: flex; gap: 8px; align-items: center; padding: 8px 11px; border-radius: 10px; background: #fff; border: 1px solid #dce3df; font-size: 12px; }
.low-priority-item strong { color: #4d5954; }
.low-priority-item span { color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 200px 160px auto; gap: 10px; margin-bottom: 14px; }
input, select, textarea { width: 100%; border: 1px solid #d7e0dc; border-radius: 9px; padding: 10px 11px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(20,116,91,.1); }
textarea { resize: vertical; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.customer-table { width: 100%; border-collapse: collapse; }
.customer-table th { color: var(--muted); background: #f8faf9; font-size: 11px; text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.customer-table td { padding: 14px; border-bottom: 1px solid #edf1ef; font-size: 13px; vertical-align: middle; }
.customer-table td[data-label]::before { display: none; }
.customer-table tr:last-child td { border-bottom: 0; }
.customer-table tbody tr:hover { background: #fbfcfb; }
.empty-state { padding: 50px; text-align: center; color: var(--muted); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.form-section-title { display: flex; gap: 13px; margin: 4px 0 18px; align-items: flex-start; }
.form-section-title:not(:first-child) { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.form-section-title > span { width: 31px; height: 31px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 900; }
.form-section-title h2 { margin: 1px 0 4px; font-size: 18px; }
.form-section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid label { display: grid; gap: 7px; font-size: 12px; color: #4c5d56; font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
.advanced-fields { margin-top: 25px; border: 1px solid var(--line); border-radius: 12px; padding: 0 17px 17px; }
.advanced-fields summary { padding: 15px 0; cursor: pointer; font-weight: 800; font-size: 13px; }
.followup-details { margin-top: 14px; }
.details-subtitle { margin: 5px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--primary); font-size: 12px; font-weight: 900; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 25px; }
.form-message { margin-top: 16px; padding: 12px; border-radius: 10px; color: #8b4c00; background: var(--orange-soft); font-size: 13px; line-height: 1.55; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10,28,22,.42); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 55; inset: 0 0 0 auto; width: min(720px, 94vw); background: #fff; box-shadow: var(--shadow); overflow: auto; }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 22px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 3px 0 0; }
.drawer-content { padding: 22px; }
.customer-priority { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfb; }
.customer-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.customer-hero h3 { font-size: 24px; margin: 0 0 5px; }
.customer-hero p { color: var(--muted); margin: 0; }
.score-panel { min-width: 116px; padding: 12px; border: 1px solid #ecd6ab; background: #fff9ed; border-radius: 13px; text-align: center; }
.score-panel strong { display: block; font-size: 29px; color: #a75a07; }
.score-panel span { font-size: 11px; color: #8c6b39; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.priority-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.priority-strip > div { min-width: 0; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid #e5ebe8; }
.priority-strip label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.priority-strip strong { display: block; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.next-confirmation { display: flex; gap: 9px; align-items: baseline; margin-top: 9px; padding: 11px; border-radius: 10px; color: #694008; background: var(--orange-soft); }
.next-confirmation span { flex: 0 0 auto; font-size: 11px; font-weight: 800; }
.next-confirmation strong { font-size: 12px; line-height: 1.5; }
.identity-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.suggestion-box, .action-box { padding: 15px; border-radius: 13px; margin: 13px 0; }
.suggestion-box { background: var(--orange-soft); border: 1px solid #f0d19a; }
.action-box { color: #fff; background: linear-gradient(135deg, #0d5c48, #12352c); }
.action-box h4 { margin: 0 0 6px; }
.action-box p { margin: 5px 0; color: #dcebe6; font-size: 13px; line-height: 1.55; }
.action-box .script { margin-top: 10px; padding: 11px; border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 14px 0; }
.info-item { padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.info-item label { color: var(--muted); font-size: 10px; display: block; margin-bottom: 4px; }
.info-item span { font-size: 13px; word-break: break-word; }
.drawer-section { margin-top: 24px; }
.drawer-section h4 { margin: 0 0 11px; }
.reason-list { display: grid; gap: 7px; }
.reason-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 9px; background: #f7f9f8; font-size: 12px; }
.reason-row .positive { color: var(--green); font-weight: 800; }
.reason-row .negative { color: var(--red); font-weight: 800; }
.timeline { display: grid; gap: 10px; }
.timeline-item { border-left: 3px solid #b9cec6; padding: 3px 0 3px 13px; }
.timeline-item strong { display: block; font-size: 13px; }
.timeline-item p { margin: 5px 0; line-height: 1.5; font-size: 13px; }
.timeline-item small { color: var(--muted); }
.timeline-item blockquote { margin: 7px 0; padding: 8px 10px; border-radius: 8px; color: #4d3b19; background: #fff8e8; font-size: 12px; line-height: 1.55; }
.timeline-item .need-line { color: var(--primary); font-weight: 700; }
.drawer-actions { display: flex; gap: 9px; margin: 16px 0; }
.stage-control { display: grid; grid-template-columns: auto minmax(170px, 1fr) minmax(150px, .7fr) auto; gap: 9px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.stage-control label { color: var(--muted); font-size: 12px; font-weight: 700; }
.deal-amount-control { display: grid; grid-template-columns: auto minmax(90px, 1fr); gap: 7px; align-items: center; }
.manual-score-control { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(140px, .8fr) minmax(220px, 1.5fr) auto; gap: 9px; align-items: center; margin-top: 10px; padding: 12px; border: 1px solid #eed6a9; border-radius: 11px; background: #fffaf0; }
.manual-score-control strong, .manual-score-control small { display: block; }
.manual-score-control small { color: var(--muted); margin-top: 3px; font-size: 10px; line-height: 1.4; }
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(10,28,22,.5); }
.modal-card { width: min(670px, 96vw); max-height: 94vh; overflow: auto; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.modal-card form { padding: 22px; }
.compact-modal { width: min(620px, 96vw); }
.narrow-modal { width: min(470px, 96vw); }
.narrow-modal form { display: grid; gap: 14px; }
.narrow-modal form > label { display: grid; gap: 7px; color: #4c5d56; font-size: 12px; font-weight: 700; }
.modal-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.danger-kicker { color: var(--red) !important; }
.form-grid.compact { gap: 12px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 390px; padding: 13px 16px; border-radius: 11px; color: #fff; background: #183f34; box-shadow: var(--shadow); font-size: 13px; }
.loading-block:empty::before { content: "正在整理作战数据…"; display: grid; place-items: center; min-height: inherit; color: var(--muted); }
.customer-name, .store-line, .work-why, .detail-cell, .focus-task-body, .info-item, .timeline-item, .metric-card { min-width: 0; overflow-wrap: anywhere; }
.compact-empty { padding: 22px; }
.success-box { padding: 13px; border-radius: 10px; color: #155e43; background: #eaf7f1; font-size: 13px; }

.mobile-quick-add { display: none; }
.auth-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 20% 10%, #1d5a49 0, #12352c 38%, #0c251e 100%); }
.login-card { width: min(430px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.login-brand { display: flex; gap: 13px; align-items: center; }
.login-brand h1 { margin: 2px 0 0; font-size: 24px; }
.login-card > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card > label { display: grid; gap: 7px; color: #4c5d56; font-size: 12px; font-weight: 800; }
.login-card > small { color: var(--muted); text-align: center; }
.login-button { min-height: 48px; }

.safety-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.safety-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.safety-card .section-title p { margin-top: 5px; color: var(--muted); line-height: 1.55; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.file-field { display: grid; gap: 7px; margin: 15px 0 10px; color: #4c5d56; font-size: 12px; font-weight: 800; }
.upload-label { cursor: pointer; }
.upload-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview-box { display: grid; gap: 11px; margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.preview-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.preview-stat { min-width: 0; padding: 8px; border-radius: 8px; background: #fff; text-align: center; }
.preview-stat span, .preview-stat strong { display: block; }
.preview-stat span { color: var(--muted); font-size: 10px; }
.preview-stat strong { margin-top: 3px; font-size: 18px; }
.preview-errors, .preview-warnings { padding: 11px; border-radius: 9px; font-size: 12px; line-height: 1.6; }
.preview-errors { color: #8f2b25; background: var(--red-soft); }
.preview-warnings { color: #77500a; background: var(--orange-soft); }
.preview-errors ul, .preview-warnings ul { margin: 6px 0 0; padding-left: 19px; }
.preview-rows { display: grid; gap: 6px; }
.preview-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 8px; background: #fff; font-size: 12px; }
.preview-row span { color: var(--muted); text-align: right; }
.backup-list { display: grid; gap: 8px; margin-top: 14px; }
.backup-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.backup-item strong, .backup-item span { display: block; word-break: break-all; }
.backup-item strong { font-size: 12px; }
.backup-item span { color: var(--muted); margin-top: 4px; font-size: 10px; }
.safety-notice { margin-top: 18px; padding: 16px; border: 1px solid #e4d19f; border-radius: 13px; background: #fff9e9; }
.safety-notice p { margin: 6px 0 0; color: #765c29; font-size: 12px; line-height: 1.7; }

@media (max-width: 1100px) {
  .topbar { padding-right: 20px; padding-left: 20px; }
  .global-search-wrap { width: auto; min-width: 120px; flex: 1; }
  .topbar-actions { flex: 0 0 auto; }
  .today-label, .account-area > span { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .focus-list { grid-template-columns: 1fr; }
  .safety-grid { grid-template-columns: 1fr; }
  .manual-score-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-score-control > :first-child, .manual-score-control > :nth-child(3) { grid-column: 1 / -1; }
  .work-card-main { grid-template-columns: minmax(180px, 1.2fr) 100px 120px auto; }
  .work-card-main .work-why { grid-column: 1 / -1; }
  .work-detail { grid-template-columns: repeat(2, 1fr); }
  .customer-table th:nth-child(4), .customer-table td:nth-child(4), .customer-table th:nth-child(5), .customer-table td:nth-child(5) { display: none; }
}

@media (max-width: 760px) {
  .mobile-only { display: inline-grid; place-items: center; }
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 14px; gap: 10px; }
  .global-search-wrap { width: auto; flex: 1; }
  .today-label { display: none; }
  .topbar-actions { display: none; }
  .view { padding: 22px 14px 105px; }
  .page-heading { align-items: flex-start; }
  .page-heading > button { display: none; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 4px; }
  .demo-banner button { margin: 7px 0 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 23px; }
  .focus-panel, .worklist-section, .low-priority-panel { padding: 15px; }
  .section-title.split { display: block; }
  .chip-row { justify-content: flex-start; margin-top: 12px; }
  .work-card-main { grid-template-columns: 1fr auto; }
  .work-card-main > :nth-child(3), .work-card-main > :nth-child(4) { grid-column: 1 / -1; }
  .work-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .work-detail { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1 / -1; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .customer-table, .customer-table tbody { display: block; }
  .customer-table thead { display: none; }
  .customer-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
  .customer-table td { display: block !important; padding: 0; border: 0; }
  .customer-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
  .customer-table td:nth-child(2) { grid-column: 1; }
  .customer-table td:nth-child(3) { grid-column: 2; }
  .customer-table td:nth-child(4), .customer-table td:nth-child(5), .customer-table td:nth-child(6), .customer-table td:nth-child(7) { grid-column: 1 / -1; }
  .customer-table td:last-child { grid-column: 2; grid-row: 1; }
  .form-card { padding: 17px; }
  .form-grid.three, .form-grid.two, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .customer-hero { align-items: stretch; }
  .score-panel { min-width: 95px; }
  .stage-control { grid-template-columns: 1fr; }
  .manual-score-control { grid-template-columns: 1fr; }
  .manual-score-control > :first-child, .manual-score-control > :nth-child(3) { grid-column: auto; }
  .priority-strip { grid-template-columns: 1fr; }
  .next-confirmation { align-items: flex-start; flex-direction: column; }
  .drawer { width: 100vw; max-width: 100vw; }
  .drawer-header { padding: 15px 14px; }
  .drawer-content { padding: 14px; }
  .customer-priority { padding: 13px; }
  .drawer-actions { display: grid; grid-template-columns: 1fr; }
  .identity-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .identity-actions .text-button { grid-column: 1 / -1; }
  .focus-task { display: grid; grid-template-columns: auto 1fr; }
  .focus-task > .text-button { grid-column: 2; justify-self: start; }
  .safety-card { padding: 15px; }
  .preview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-row, .backup-item { align-items: flex-start; flex-direction: column; }
  .preview-row span { text-align: left; }
  .backup-item .inline-actions { width: 100%; justify-content: flex-end; }
  .modal-wrap { padding: 8px; }
  .modal-card, .compact-modal, .narrow-modal { width: 100%; max-width: 100%; max-height: calc(100vh - 16px); }
  .modal-card form { padding: 16px 14px; }
  .auth-overlay { padding: 12px; }
  .login-card { padding: 20px 17px; border-radius: 16px; }
  .login-brand h1 { font-size: 20px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  textarea { min-height: 88px; }
  button, .button-link, .primary, .secondary, .icon-button, .danger-button, .text-button, .chip { min-height: 44px; }
  .mobile-quick-add { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 18px; border: 0; border-radius: 999px; color: #fff; background: var(--primary); box-shadow: 0 14px 35px rgba(13,92,72,.35); font-size: 20px; font-weight: 900; }
  .mobile-quick-add span { font-size: 13px; }
  .toast { right: 12px; bottom: 82px; left: 12px; max-width: none; }
}

@media (max-width: 380px) {
  .topbar { padding: 0 10px; }
  .global-search-wrap { padding: 8px 9px; }
  .view { padding-right: 10px; padding-left: 10px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 11px; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: 21px; }
  .metric-foot { font-size: 10px; line-height: 1.4; }
  .focus-panel, .worklist-section, .low-priority-panel { padding: 12px; }
  .work-card-main { gap: 9px; padding: 12px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar input { grid-column: auto; }
  .identity-actions { grid-template-columns: 1fr; }
  .identity-actions .text-button { grid-column: auto; }
  .customer-hero h3 { font-size: 20px; }
  .score-panel { min-width: 82px; padding: 9px; }
  .score-panel strong { font-size: 24px; }
}
