:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --text: #172033;
  --muted: #69758b;
  --line: #e2e7ef;
  --line-strong: #d3dae6;
  --nav: #111827;
  --nav-soft: #1e293b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --success: #15803d;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 12px 32px rgba(15, 23, 42, .06);
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; background: var(--nav); color: #dce5f3; padding: 22px 16px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-size: 18px; font-weight: 800; text-decoration: none; padding: 2px 10px 24px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 7px 18px #2563eb55; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: #b9c5d8; padding: 10px 12px; border-radius: 8px; text-decoration: none; transition: .15s ease; }
.sidebar nav a > span { width: 18px; color: #8fa0b7; text-align: center; }
.sidebar nav a:hover { background: #1b2739; color: #fff; }
.sidebar nav a.active { background: #243148; color: #fff; box-shadow: inset 3px 0 var(--accent); }
.sidebar nav a.active > span { color: #78a7ff; }
.nav-section { margin: 18px 12px 5px; color: #718198; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; border-top: 1px solid #29364a; padding: 17px 11px 0; color: #9aa8bc; }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #22c55e22; }
.nav-toggle { display: none; }

.content { margin-left: 248px; min-height: 100vh; padding: 30px; }
.content > * { width: min(100%, 1600px); margin-left: auto; margin-right: auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.2; letter-spacing: -.025em; }
.page-header p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.back { display: inline-block; margin-bottom: 12px; color: var(--accent); text-decoration: none; }
h2, h3 { margin: 0; }
h2 { font-size: 17px; }
.muted, small { color: var(--muted); }
.danger-text { color: var(--danger) !important; }
.header-actions, .inline-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.header-actions form { margin: 0; }
.result-count { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-weight: 600; }
.scan-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.status-dot.status-success { background: #22c55e; }
.status-dot.status-running { background: #3b82f6; box-shadow: 0 0 0 3px #3b82f622; }
.status-dot.status-failed { background: #ef4444; }

.button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cbd3df; border-radius: 8px; background: #fff; color: #263247; padding: 7px 12px; text-decoration: none; cursor: pointer; transition: .15s ease; }
.button:hover { border-color: #aab4c3; background: #f8fafc; transform: translateY(-1px); }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 6px 14px #2563eb2b; }
.button.success { border-color: var(--success); background: var(--success); color: #fff; }
.button.danger { border-color: #fecaca; background: #fff; color: #b91c1c; }
.button.small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.wp-button { border-color: #3858d8; background: #eef2ff; color: #293da6; font-weight: 700; }
.zoho-button { border-color: #e04b4b; background: #fff1f2; color: #b4232b; font-weight: 800; }
.zoho-button:hover { border-color: #c7353d; background: #ffe4e6; color: #991b1b; }

input, select, textarea { min-height: 38px; border: 1px solid #cbd3df; border-radius: 8px; outline: none; background: #fff; color: var(--text); padding: 8px 10px; }
input:focus, select:focus, textarea:focus { border-color: #75a2fa; box-shadow: 0 0 0 3px #2563eb16; }
textarea { resize: vertical; }

.panel { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-head small { display: block; margin-top: 3px; }
.panel-head > span { color: var(--muted); font-size: 12px; }
.panel-head > a { color: var(--accent); text-decoration: none; }
.split, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { min-height: 112px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px; text-decoration: none; box-shadow: 0 5px 20px rgba(15, 23, 42, .035); }
.kpi span, .kpi small { display: block; color: var(--muted); }
.kpi strong { display: block; margin: 4px 0 1px; font-size: 29px; line-height: 1.2; }
.kpi-primary { border-color: #bfd3ff; background: linear-gradient(140deg, #fff, #eff6ff); }
.kpi-primary strong { color: var(--accent); }
.kpi-alert strong { color: var(--danger); }
.kpi-success strong { color: var(--success); }

.category-strip { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: thin; }
.category-strip > span { flex: 0 0 auto; margin-right: 3px; color: var(--muted); font-size: 12px; }
.category-strip a, .category-strip button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); padding: 7px 11px; text-decoration: none; font: inherit; cursor: pointer; }
.category-strip a:hover, .category-strip button:hover, .category-strip button.active { border-color: var(--category-color, var(--primary)); background: var(--primary-soft); }
.category-strip a i, .category-strip button i { width: 7px; height: 7px; border-radius: 50%; background: var(--category-color); }
.category-strip a strong, .category-strip button strong { color: var(--category-color, var(--primary)); }

.workbench { display: grid; grid-template-columns: minmax(390px, .78fr) minmax(560px, 1.22fr); align-items: start; gap: 18px; }
.work-queue, .work-detail-area { min-width: 0; }
.work-queue { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.queue-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.queue-head > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.queue-search { display: flex; align-items: center; gap: 7px; margin: 12px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.queue-search input { width: 100%; border: 0; box-shadow: none; padding-left: 0; }
.work-card-list { max-height: calc(100vh - 375px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.work-card { position: relative; border-bottom: 1px solid var(--line); background: #fff; padding: 15px 17px; cursor: pointer; outline: none; transition: .14s ease; }
.work-card:last-child { border-bottom: 0; }
.work-card:hover { background: #f8fafc; }
.work-card.selected { background: #f2f7ff; box-shadow: inset 3px 0 var(--accent); }
.work-card.high-attention { background: linear-gradient(90deg, #fff1f2, #fff 38%); box-shadow: inset 3px 0 #e11d48; }
.work-card.high-attention.selected { background: linear-gradient(90deg, #ffe4e6, #f2f7ff 44%); box-shadow: inset 4px 0 #e11d48; }
.work-card:focus-visible { box-shadow: inset 3px 0 var(--accent), 0 0 0 2px #93b4f5; }
.work-card-top { display: flex; align-items: center; gap: 6px; }
.work-card-top time { margin-left: auto; color: var(--muted); font-size: 11px; }
.work-card h3 { margin-top: 9px; font-size: 15px; }
.work-card .subject { margin: 2px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-card .subject.bilingual-copy { white-space: normal; }
.work-card .subject.bilingual-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card .commitment { display: -webkit-box; margin: 9px 0 11px; overflow: hidden; color: #344054; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.work-card .commitment b { color: var(--text); }
.work-card footer { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.work-card footer > span:last-child { margin-left: auto; }
.followup { color: #b45309; font-size: 11px; }
.queue-empty { padding: 55px 30px; color: var(--muted); text-align: center; }
.queue-empty strong { color: var(--text); font-size: 15px; }

.work-detail-area { position: sticky; top: 18px; }
.work-detail-area.loading { min-height: 260px; opacity: .72; pointer-events: none; }
.work-detail-area.loading::after { content: "正在加载客户事项…"; position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--muted); font-weight: 700; }
.work-detail { max-height: calc(100vh - 48px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); scrollbar-width: thin; }
.work-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 20px; }
.work-detail-head h2 { margin: 3px 0 0; font-size: 22px; }
.work-detail-head p { margin: 3px 0 0; color: var(--muted); }
.bilingual-copy > span, .bilingual-copy > small { display: block; }
.bilingual-copy > small { margin-top: 3px; color: #526079; font-size: 11px; line-height: 1.45; }
.detail-subject, .page-subject { margin-top: 4px; color: var(--muted); }
.detail-subject > small, .page-subject > small { color: #344054; }
.contact-copy-row { display: flex; align-items: center; gap: 7px; }
.copy-button, .mail-tools button, .mail-tools a { border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; padding: 4px 8px; font: inherit; font-size: 10px; line-height: 1.2; text-decoration: none; cursor: pointer; }
.copy-button:hover, .mail-tools button:hover, .mail-tools a:hover { border-color: var(--accent); color: var(--accent); }
.copy-button.copied, .mail-tools button.copied { border-color: #16a34a; background: #dcfce7; color: #166534; }
.detail-badges { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.panel-close { display: none; border: 0; background: none; color: var(--muted); font-size: 25px; }
.next-action { margin: 16px 20px; border: 1px solid #bfd3ff; border-left: 4px solid var(--accent); border-radius: 10px; background: #f5f8ff; padding: 14px 16px; }
.next-action > span { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.next-action > strong { display: block; margin-top: 5px; font-size: 16px; }
.next-action > p { margin: 6px 0 0; color: #526079; }
.next-action.large { margin: 0 0 20px; }
.next-action.large .detail-badges { justify-content: flex-start; margin-top: 14px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 16px; }
.quick-actions form { margin: 0; }
.detail-section { border-top: 1px solid var(--line); padding: 18px 20px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-title h3 { font-size: 15px; }
.section-title span { color: var(--muted); font-size: 11px; }
.promise-list { display: grid; gap: 9px; margin: 0; padding-left: 22px; }
.promise-list li { padding-left: 2px; }
.promise-list li::marker { color: var(--accent); font-weight: 800; }
.promise-list em { display: inline-block; margin-left: 8px; border-radius: 999px; background: #eef2f7; color: var(--muted); padding: 2px 7px; font-size: 10px; font-style: normal; }
.promise-list.detailed li { border-bottom: 1px solid var(--line); padding: 3px 0 11px; }
.promise-list.detailed li:last-child { border: 0; }
.promise-list.detailed small { display: block; margin-top: 4px; }
.raw-records, .full-thread { margin-top: 14px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.raw-records > summary, .full-thread > summary { color: var(--accent); cursor: pointer; font-weight: 650; }

.mail-preview-list { display: grid; gap: 10px; }
.mail-preview { border: 1px solid var(--line); border-left: 3px solid #94a3b8; border-radius: 9px; background: #fafbfc; padding: 12px; }
.mail-preview.company { border-left-color: #3b82f6; background: #f7faff; }
.mail-preview.customer { border-left-color: #64748b; }
.mail-preview.source { box-shadow: 0 0 0 2px #f59e0b33; }
.mail-preview header { display: flex; align-items: center; gap: 8px; }
.mail-preview header > span { border-radius: 999px; background: #eef2f7; color: var(--muted); padding: 2px 7px; font-size: 10px; }
.mail-preview time { margin-left: auto; color: var(--muted); font-size: 11px; }
.mail-preview pre { max-height: 220px; margin: 9px 0 0; overflow: auto; color: #39465a; font: inherit; white-space: pre-wrap; word-break: break-word; }
.mail-preview details { margin-top: 8px; }
.mail-preview details summary { color: var(--accent); cursor: pointer; font-size: 11px; }
.mail-preview details pre { max-height: 420px; }
.marker { display: inline-block; margin-top: 8px; border-radius: 5px; background: #fef3c7; color: #854d0e; padding: 3px 7px; font-size: 10px; font-weight: 700; }
.assign-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.note-form { display: grid; gap: 8px; }
.action-editor .note-form { grid-template-columns: 1fr auto; margin-top: 9px; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); background: #fafbfc; padding: 15px 20px; }
.detail-footer > span { color: var(--muted); font-size: 11px; }
.detail-placeholder { display: grid; min-height: 500px; place-content: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.detail-placeholder > span { font-size: 35px; color: #9ab7ec; }

.sentiment { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.sentiment-calm { background: #dcfce7; color: #166534; }
.sentiment-concerned { background: #fef3c7; color: #854d0e; }
.sentiment-anxious, .sentiment-angry, .sentiment-escalation_risk { background: #fee2e2; color: #991b1b; }
.chatgpt-button { border-color: #10a37f; background: #ecfdf5; color: #08745a; font-weight: 700; }
.attention-alert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid #fecaca; background: #fff1f2; color: #9f1239; padding: 11px 20px; }
.attention-alert strong, .attention-alert b { white-space: nowrap; }
.attention-alert b { font-size: 11px; }
.decision-focus { margin: 18px 20px; border: 1px solid #bfd3ff; border-left: 5px solid var(--accent); border-radius: 11px; background: #f5f8ff; padding: 16px 18px; }
.decision-focus > span { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.decision-focus h3 { margin: 5px 0 4px; font-size: 18px; }
.decision-focus p { margin: 0; color: #526079; }
.decision-focus ol { display: grid; gap: 5px; margin: 12px 0 0; padding-left: 22px; }
.decision-focus li::marker { color: var(--accent); font-weight: 800; }
.decision-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 20px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.decision-facts > div { min-width: 0; background: #fff; padding: 12px 14px; }
.decision-facts span, .decision-facts small { display: block; color: var(--muted); }
.decision-facts strong { display: block; margin: 3px 0; font-size: 15px; }
.decision-facts small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.situation-summary { margin: 0 0 15px; border-left: 3px solid var(--accent); background: #f8fafc; padding: 11px 13px; white-space: pre-wrap; }
.context-timeline { display: grid; margin: 0; padding: 0; list-style: none; }
.context-timeline li { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 10px; border-left: 2px solid var(--line); padding: 0 0 14px 16px; }
.context-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.context-timeline li::before { content: ""; position: absolute; top: 3px; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.context-timeline time { color: var(--muted); font-size: 11px; }
.context-timeline p { margin: 2px 0 0; color: #526079; }
.open-questions { margin-top: 15px; border-radius: 9px; background: #fff7ed; color: #7c2d12; padding: 12px 14px; }
.open-questions ul { margin: 7px 0 0; padding-left: 20px; }
.insight-pending { border-radius: 9px; background: #f8fafc; padding: 14px; }
.insight-pending p { margin: 5px 0 0; color: var(--muted); }
.translation-list { display: grid; gap: 10px; }
.translation-card { border: 1px solid var(--line); border-left: 4px solid #64748b; border-radius: 9px; background: #fafbfc; padding: 13px 14px; }
.translation-card.company { border-left-color: var(--accent); background: #f7faff; }
.translation-card.customer { border-left-color: #10b981; background: #f5fffa; }
.translation-card header { display: flex; justify-content: space-between; gap: 10px; }
.translation-card header time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.mail-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mail-tools a { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.translation-card p { margin: 5px 0 0; white-space: pre-wrap; }
.mail-original, .mail-translation, .mail-intent { margin-top: 10px; border-radius: 8px; padding: 10px 12px; }
.mail-original { border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.mail-original p { max-height: 190px; overflow: auto; font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.mail-translation { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a5f; }
.mail-translation p { line-height: 1.75; }
.mail-intent { background: #fff7ed; color: #7c2d12; }
.mail-original > b, .mail-translation > b, .mail-intent > b { display: block; margin-bottom: 3px; font-size: 11px; }
.translation-pending { margin-top: 9px; border-radius: 8px; background: #f8fafc; padding: 11px 12px; }
.translation-pending p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.translation-card details { margin-top: 10px; }
.translation-card summary { color: var(--accent); cursor: pointer; }
.translation-card pre { max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.conversation-links { display: grid; gap: 8px; }
.conversation-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #a7f3d0; border-radius: 9px; background: #f0fdf9; color: #065f46; padding: 11px 13px; text-decoration: none; }
.conversation-links a:hover { border-color: #34d399; }
.conversation-links a > span { display: grid; }
.conversation-links small { margin-top: 2px; }
.decision-detail > .raw-records { margin-top: 0; border-top: 1px solid var(--line); padding: 0; }
.decision-detail > .raw-records > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); padding: 16px 20px; list-style: none; }
.decision-detail > .raw-records > summary::-webkit-details-marker { display: none; }
.decision-detail > .raw-records > summary span { display: grid; }
.decision-detail > .raw-records > summary b { color: var(--accent); }
.decision-detail > .raw-records > .promise-list { padding: 0 40px 18px; }

.waiting-fold { border-top: 1px solid var(--line); }
.waiting-fold > summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; cursor: pointer; list-style: none; }
.waiting-fold > summary::-webkit-details-marker { display: none; }
.waiting-fold > summary span { display: grid; }
.waiting-fold > summary small { font-weight: 400; }
.waiting-fold > summary b { color: var(--accent); }
.waiting-list { border-top: 1px solid var(--line); background: #fafbfc; padding: 5px 10px; }
.waiting-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 7px; text-align: left; cursor: pointer; }
.waiting-list button:last-child { border-bottom: 0; }
.waiting-list button span:first-child { display: grid; }

.status-tabs { display: flex; gap: 3px; margin-bottom: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.status-tabs a { flex: 0 0 auto; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 13px; text-decoration: none; }
.status-tabs a.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
.smart-filters { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 11px; }
.filter-search { display: flex; flex: 1; min-width: 260px; align-items: center; gap: 7px; border: 1px solid #cbd3df; border-radius: 8px; color: var(--muted); padding: 0 9px; }
.filter-search input { width: 100%; border: 0; box-shadow: none; padding-left: 0; }
.more-filters { position: relative; align-self: center; }
.more-filters > summary { color: var(--accent); cursor: pointer; white-space: nowrap; }
.more-filters > div { position: absolute; z-index: 15; top: 34px; right: 0; display: grid; width: 280px; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 15px 40px #0f172a22; padding: 12px; }
.all-items-workbench .work-card-list, .customer-workbench .work-card-list { max-height: calc(100vh - 290px); }

.customer-directory { padding: 0; overflow: hidden; }
.customer-search { margin: 15px; }
.customer-list-head, .customer-list > a { display: grid; grid-template-columns: minmax(260px, 1.5fr) 80px 80px 90px 150px 25px; align-items: center; gap: 12px; }
.customer-list-head { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); padding: 9px 17px; font-size: 11px; font-weight: 700; }
.customer-list > a { border-bottom: 1px solid var(--line); padding: 12px 17px; text-decoration: none; }
.customer-list > a:hover { background: #f8fafc; }
.customer-list > a:last-child { border-bottom: 0; }
.customer-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.customer-identity > i { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border-radius: 10px; background: #e8efff; color: var(--accent); font-style: normal; font-weight: 800; }
.customer-identity > span { display: grid; min-width: 0; }
.customer-identity small { overflow: hidden; text-overflow: ellipsis; }
.customer-list > a > b { color: var(--accent); }
.customer-page-head .eyebrow { margin-top: 4px; }
.thread-archive { margin-top: 20px; }
.thread-summary { border-top: 1px solid var(--line); }
.thread-summary > summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; cursor: pointer; list-style: none; }
.thread-summary > summary::-webkit-details-marker { display: none; }
.thread-summary > summary span { display: grid; }
.thread-summary > summary b { color: var(--accent); font-size: 12px; }
.thread-summary > .mail-preview-list { padding: 0 0 15px; }

.task-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 20px; }
.task-detail-main { min-width: 0; }
.task-detail-main > .work-detail { max-height: none; margin-bottom: 20px; overflow: visible; }
.task-controls { min-width: 0; }
.sticky-card { position: sticky; top: 20px; }
.setting-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-bottom: 10px; }
.setting-form label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.setting-form select, .setting-form input { width: 100%; color: var(--text); font-size: 14px; }
.setting-form > .button { align-self: end; }
.danger-zone { margin-top: 15px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.danger-zone > summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.danger-zone form { margin-top: 9px; }
.note-form.horizontal { grid-template-columns: 1fr auto; }
.audit-panel { padding: 0; overflow: hidden; }
.audit-panel > summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; cursor: pointer; list-style: none; }
.audit-panel > summary::-webkit-details-marker { display: none; }
.audit-panel > summary span { display: grid; }
.audit-panel > summary b { color: var(--accent); }
.audit-panel[open] > summary { border-bottom: 1px solid var(--line); }
.audit-panel > .details, .audit-panel > .timeline { padding: 18px 20px; }

.badge { display: inline-block; border-radius: 999px; background: #e9edf3; color: #46546a; padding: 3px 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.priority-p0 { background: #7f1d1d; color: #fff; }
.priority-p1 { background: #dc2626; color: #fff; }
.priority-p2 { background: #f59e0b; color: #422006; }
.priority-p3 { background: #dbeafe; color: #1e40af; }
.status-overdue, .status-failed { background: #fee2e2; color: #991b1b; }
.status-waiting_internal, .status-partial_success, .status-in_progress { background: #dbeafe; color: #1e40af; }
.status-waiting_customer { background: #e5e7eb; color: #374151; }
.status-completed, .status-success { background: #dcfce7; color: #166534; }
.status-not_due, .status-pending, .status-open, .status-uncertain { background: #fef3c7; color: #854d0e; }
.status-ignored { background: #f1f5f9; color: #64748b; }

.details { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { min-width: 0; margin: 0; }
.details blockquote { margin: 0; border-left: 3px solid var(--accent); background: #f8fafc; padding: 9px 11px; }
.compact-list { display: grid; }
.compact-list > a, .setting-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); color: inherit; padding: 11px 0; text-decoration: none; }
.compact-list small { display: block; }
.timeline article { border-bottom: 1px solid var(--line); padding: 12px 0; }
.timeline article:last-child { border-bottom: 0; }
.timeline time { float: right; color: var(--muted); font-size: 11px; }
.timeline p { margin: 6px 0; white-space: pre-wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.tag { border: 1px solid var(--tag-color); border-radius: 999px; color: var(--tag-color); padding: 4px 9px; font-weight: 650; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; }
.stack-form { display: grid; gap: 8px; margin-top: 15px; }
.checkbox { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.checkbox input { min-height: auto; }
.security-note { border-left: 4px solid var(--accent); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-size: 10px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 9px; vertical-align: top; }
td small { display: block; max-width: 520px; color: var(--muted); white-space: normal; }
td a { color: #1d4ed8; text-decoration: none; }
.empty { color: var(--muted); padding: 20px; text-align: center; }
.scan-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.scan-summary dt { color: var(--muted); }
.scan-summary dd { margin: 0; }
.error-summary { display: block; max-width: 800px; color: #991b1b; white-space: pre-wrap; }

.lookup-result { width: min(620px, 100%); margin-top: 12vh; padding: 45px; text-align: center; }
.lookup-result h1 { margin: 13px 0 7px; }
.lookup-result p { margin: 0 0 22px; color: var(--muted); }
.lookup-icon { display: grid; width: 52px; height: 52px; margin: auto; place-items: center; border-radius: 50%; background: #fff7ed; color: #c2410c; font-size: 24px; font-weight: 800; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #243b64, #101827 48%); }
.login-card { display: grid; width: min(400px, calc(100% - 32px)); gap: 14px; border: 1px solid #ffffff22; border-radius: 16px; background: #fff; box-shadow: 0 25px 70px #0008; padding: 32px; }
.login-card h1, .login-card p { margin: 0; }
.login-card label { display: grid; gap: 5px; }
.alert.error { border-radius: 7px; background: #fee2e2; color: #991b1b; padding: 9px; }

@media (max-width: 1260px) {
  .workbench { grid-template-columns: minmax(350px, .85fr) minmax(480px, 1.15fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .task-detail-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 980px) {
  .sidebar { width: 215px; }
  .content { margin-left: 215px; padding: 22px; }
  .workbench { grid-template-columns: 1fr; }
  .work-card-list { max-height: none !important; }
  .work-detail-area { position: static; }
  .work-detail { max-height: none; }
  .task-detail-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .customer-list-head, .customer-list > a { grid-template-columns: minmax(230px, 1.5fr) 65px 65px 75px 120px 20px; }
}

@media (max-width: 760px) {
  .nav-toggle { position: fixed; z-index: 45; top: 12px; left: 12px; display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px; background: var(--nav); color: #fff; font-size: 20px; box-shadow: 0 5px 16px #0f172a44; }
  .sidebar { width: 245px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 30px #0f172a55; }
  .sidebar.open { transform: translateX(0); }
  .content { margin: 0; padding: 67px 14px 18px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 100px; }
  .smart-filters { flex-wrap: wrap; }
  .filter-search { flex-basis: 100%; }
  .more-filters > div { position: fixed; inset: auto 14px 14px; width: auto; }
  .workbench { display: block; }
  .work-detail-area { position: fixed; z-index: 40; inset: 0; pointer-events: none; }
  .work-detail-area:has(.work-detail.mobile-open) { pointer-events: auto; background: #0f172a66; }
  .work-detail { position: absolute; inset: 3vh 0 0; max-height: 97vh; transform: translateY(105%); border-radius: 16px 16px 0 0; transition: transform .22s ease; }
  .work-detail.mobile-open { transform: translateY(0); }
  .panel-close { display: block; position: absolute; top: 8px; right: 8px; }
  .work-detail-head { padding-top: 35px; }
  .detail-badges { justify-content: flex-start; }
  .action-editor .note-form, .note-form.horizontal { grid-template-columns: 1fr; }
  .detail-footer { align-items: stretch; flex-direction: column; }
  .customer-list-head { display: none; }
  .customer-list > a { grid-template-columns: minmax(0, 1fr) repeat(3, 40px); }
  .customer-list > a > time, .customer-list > a > b { display: none; }
  .split, .detail-grid { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; gap: 3px; }
  .details dd { margin-bottom: 9px; }
  .attention-alert { grid-template-columns: 1fr; }
  .decision-facts { grid-template-columns: 1fr; }
  .context-timeline li { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 13px; }
  .kpi strong { font-size: 25px; }
  .quick-actions .button { min-height: 34px; font-size: 12px; }
  .work-detail-head { flex-direction: column; }
  .assign-form { grid-template-columns: 1fr; }
}
