/* =====================================================================
   NUYU theme v1 — from the design handoff (design/handoff_v1/设计规范.md, 2026-11-08).
   Loaded LAST, so it wins over styles.css and tw.css without touching either.
   Warm white ground, deep ink, one teal for action; apricot only marks "waiting for you".
   ===================================================================== */
:root {
  --primary: #087F73; --primary-pressed: #066459; --primary-hover: #077568; --primary-soft: #E8F6F1; --primary-line: #CDE6DC;
  --accent: #F4DFB6;
  --background: #FAFAF7; --surface: #FFFFFF; --subtle: #F0F3F0; --icon-bg: #EEF4EF;
  --text: #182C29; --text-secondary: #586B65; --text-tertiary: #66776F;
  --border: #DCE5DF;
  --success: #23704F; --success-bg: #E8F4EC;
  --warning: #78551F; --warning-bg: #FAF1DF;
  --danger: #AF3939; --danger-bg: #FCEEEE;
  --disabled-bg: #E9EDE9; --disabled-text: #66776F;
  --radius-sm: 6px; --radius-input: 10px; --radius-card: 16px; --radius-panel: 20px;
  --shadow-popover: 0 8px 28px rgba(24, 44, 41, .12); --shadow-modal: 0 16px 48px rgba(24, 44, 41, .18);

  /* The old names, pointed at the new palette: everything already written with them follows. */
  --bg: var(--background); --bg-soft: var(--background); --bg-card: var(--surface); --bg-tint: var(--subtle); --bg-tint-2: #E5ECE6;
  --border-fine: var(--border); --border-dk: #C7D3CB; --line: var(--border);
  --ink-1000: var(--text); --ink-900: var(--text); --ink-800: var(--text); --ink-700: #2F433F; --ink-600: var(--text-secondary);
  --ink-500: var(--text-secondary); --ink-400: var(--text-tertiary); --ink-300: #C7D3CB; --ink-200: var(--border);
  --brand: var(--primary); --brand-600: var(--primary-hover); --brand-700: var(--primary-pressed);
  --brand-tint: var(--primary-line); --brand-tint2: var(--primary-soft); --brand-glow: rgba(8, 127, 115, .14);
  --ok: var(--success); --ok-bright: var(--success); --ok-tint: var(--success-bg);
  --warn: var(--warning); --warn-bright: var(--warning); --warn-tint: var(--warning-bg);
  --danger-bright: var(--danger); --danger-tint: var(--danger-bg);
  --info: var(--primary); --info-tint: var(--primary-soft);
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 16px; --r-xl: 20px;
  --sh-1: none; --sh-2: none; --sh-3: var(--shadow-popover);
}

/* ---- Type: Noto Sans SC, 16px body, tabular numbers ---- */
html, body { background: var(--background) !important; color: var(--text); }
body, button, input, select, textarea {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
body { font-size: 16px; line-height: 1.55; font-feature-settings: normal; }
.text-num, .row-amt, .stat-value, .tabular-nums, [style*="tabular-nums"] { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.row-amt, .stat-value { font-variant-numeric: tabular-nums; }

/* Nothing a person reads is smaller than 13px (spec: captions 13, body 15–16). */
.text-\[9px\], .text-\[9\.5px\], .text-\[10px\], .delta-pill, .vip-badge, .preview-pill,
.drill-explain-hint, .trace-desc, .stat-card-hint-arrow, .cb-eyebrow, .cb-date-line, .cb-pct, .ai-insight-eyebrow, .list-status-row, .text-\[10\.5px\], .text-\[11px\], .text-\[11\.5px\], .text-\[12px\], .text-xs { font-size: 13px !important; line-height: 1.5 !important; }
.text-\[12\.5px\], .text-\[13px\], .text-\[13\.5px\] { font-size: 14px !important; }
.text-sm { font-size: 15px !important; line-height: 1.55 !important; }

/* Tailwind colour utilities → new palette */
.text-ink-900, .text-ink-800, .text-ink-950 { color: var(--text) !important; }
.text-ink-700, .text-ink-600, .text-ink-500 { color: var(--text-secondary) !important; }
.text-ink-400, .text-ink-300 { color: var(--text-tertiary) !important; }
.text-brand-600, .text-brand-700, .text-brand-500 { color: var(--primary) !important; }
.bg-ink-50, .bg-ink-100 { background: var(--subtle) !important; }
.border-ink-100, .border-ink-200 { border-color: var(--border) !important; }
.bg-brand-600, .bg-brand-500 { background: var(--primary) !important; }

/* ---- Page headings ---- */
.section-title { font-size: 28px !important; font-weight: 700 !important; line-height: 1.3 !important; letter-spacing: 0 !important; color: var(--text) !important; }
@media (min-width: 900px) { .section-title { font-size: 32px !important; } }
.section-lede { font-size: 14px !important; color: var(--text-secondary) !important; }
.eyebrow { font-size: 13px !important; font-weight: 400 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--primary) !important; }
h2, h3 { color: var(--text); }

/* ---- Cards: 1px border, no shadow, 16px radius ---- */
.section-card, .stat-card, .attention-card, .readiness-card, .brief-section, .counsel-hero, .ai-insight-card {
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-card) !important;
  box-shadow: none !important;
}
.section-card { padding: 20px !important; }
@media (min-width: 900px) { .section-card { padding: 26px !important; } }
.section-card-gold { background: var(--primary-soft) !important; border-color: var(--primary-line) !important; }
.section-card-dark { background: var(--text) !important; }
.stat-label { font-size: 13px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-secondary) !important; font-weight: 400 !important; }
.stat-value { font-size: 25px !important; font-weight: 700 !important; color: var(--text) !important; }
.stat-hint { font-size: 13px !important; color: var(--text-tertiary) !important; }
.empty { color: var(--text-secondary) !important; font-size: 15px !important; padding: 40px 24px !important; text-align: center; }
.skeleton { background: #E8EDE7 !important; border-radius: 6px !important; }
.row { border-color: var(--border) !important; }
.row-name { font-size: 15px !important; color: var(--text) !important; }

/* ---- Buttons: 48px primary / secondary, 44px compact ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px !important; border-radius: var(--radius-input) !important;
  background: var(--surface) !important; color: var(--primary) !important; border: 1px solid var(--border) !important;
  font-size: 15px !important; font-weight: 700 !important; box-shadow: none !important; cursor: pointer;
  transition: background 100ms ease, transform 100ms ease;
}
.btn:hover { background: var(--primary-soft) !important; }
.btn:active { background: var(--primary-soft) !important; transform: translateY(1px); }
.btn.text-xs, .btn.text-\[11px\] { font-size: 14px !important; min-height: 40px; padding: 0 12px !important; }
.btn-brand, .btn-primary, .btn.btn-brand, .btn.btn-primary {
  min-height: 48px; background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important;
}
.btn-brand:hover, .btn-primary:hover { background: var(--primary-hover) !important; }
.btn-brand:active, .btn-primary:active { background: var(--primary-pressed) !important; }
.btn:disabled, .btn[disabled], button:disabled {
  background: var(--disabled-bg) !important; color: var(--disabled-text) !important; border-color: var(--disabled-bg) !important;
  transform: none !important; cursor: not-allowed;
}
:focus-visible { outline: 2px solid var(--primary) !important; outline-offset: 3px; }

/* ---- Inputs: 48px, 10px radius ---- */
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="time"], input:not([type]), select, textarea {
  border: 1px solid var(--border); border-radius: var(--radius-input); background-color: var(--surface); color: var(--text);
  font-size: 15px;
}
input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="time"], input:not([type]), select:not([multiple]) { min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 20px; height: 20px; }

/* ---- Tags ---- */
.tag { font-size: 13px !important; padding: 3px 8px !important; border-radius: var(--radius-sm) !important; font-weight: 400 !important; }
.tag-green { background: var(--success-bg) !important; color: var(--success) !important; }
.tag-yellow { background: var(--accent) !important; color: var(--warning) !important; }
.tag-red { background: var(--danger-bg) !important; color: var(--danger) !important; }
.tag-blue, .tag-purple { background: var(--primary-soft) !important; color: var(--primary) !important; }
.tag-mute { background: var(--subtle) !important; color: var(--text-secondary) !important; }
.chip { min-height: 36px; border-radius: 999px !important; }

/* ---- Alerts ---- */
.alert-banner, .system-alert-item { border-radius: var(--radius-input) !important; font-size: 13px !important; box-shadow: none !important; }

/* ---- Top bar: brand, search, upload, avatar. Language, help and log-out live in the avatar menu. ---- */
body > header { height: 64px !important; background: var(--background) !important; border-bottom: 1px solid var(--border) !important; backdrop-filter: none !important; }
@media (min-width: 1024px) { body > header { height: 72px !important; } }
#lang-select, #help-btn, #runtime, #topbar-context, body > header .h-3.w-px { display: none !important; }
.brand-wordmark { font-size: 24px !important; font-weight: 700 !important; letter-spacing: .12em !important; color: var(--text) !important; }
.brand-wordmark .os-suffix { display: none; }
#search-btn, #upload-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px !important; color: var(--text) !important; }
#search-btn .material-symbols-outlined, #upload-btn .material-symbols-outlined { font-size: 22px !important; }
#upload-btn span:not(.material-symbols-outlined) { display: none !important; }
body > header > div:last-child { gap: 4px !important; }
.avatar-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--primary-soft); color: var(--primary); font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-btn:hover { background: var(--primary-line); }
#account-menu { border-radius: var(--radius-panel) !important; box-shadow: var(--shadow-popover) !important; border-color: var(--border) !important; font-size: 15px !important; }
#account-menu button { min-height: 44px; }

/* ---- Desktop side rail ---- */
#left-nav { width: 216px !important; top: 64px !important; background: var(--surface) !important; border-color: var(--border) !important; padding: 24px 16px !important; }
@media (min-width: 1024px) { #left-nav { top: 72px !important; } main.lg\:ml-56 { margin-left: 216px !important; } }
main { padding-top: 64px !important; }
@media (min-width: 1024px) { main { padding-top: 72px !important; } }
.nav-item { min-height: 52px; padding: 0 14px !important; font-size: 15px !important; color: var(--text-secondary) !important; border-radius: var(--radius-input) !important; }
.nav-item .material-symbols-outlined { font-size: 22px !important; }
.nav-item:hover { background: var(--subtle) !important; color: var(--text) !important; }
.nav-item.active { background: var(--primary-soft) !important; color: var(--primary) !important; font-weight: 700 !important; box-shadow: inset 3px 0 0 var(--primary) !important; }
.nav-label { font-size: 13px !important; color: var(--text-tertiary) !important; letter-spacing: 0 !important; text-transform: none !important; min-height: 44px; }
#side-company { font-size: 15px !important; }

/* ---- Section tabs above a page ---- */
.subtab { min-height: 44px; font-size: 15px !important; color: var(--text-secondary) !important; }
.subtab.active, .subtab[aria-selected="true"] { color: var(--primary) !important; font-weight: 700 !important; box-shadow: inset 0 -2px 0 var(--primary) !important; background: none !important; }

/* ---- Phone bottom bar: 72px, 5 fixed places ---- */
#mobile-tabs { height: calc(72px + env(safe-area-inset-bottom)) !important; background: var(--surface) !important; border-top: 1px solid var(--border) !important; box-shadow: none !important; }
.mtab { font-size: 13px !important; color: var(--text-secondary) !important; gap: 2px; }
.mtab .material-symbols-outlined { font-size: 22px !important; padding: 2px 16px; border-radius: 999px; }
.mtab.active { color: var(--primary) !important; font-weight: 700 !important; }
.mtab.active .material-symbols-outlined { background: var(--primary-soft); }
@media (max-width: 1023px) {
  main { padding-bottom: 112px !important; }
  /* The side menu on a phone ends above the bottom bar, so its last row (操作记录) can be reached. */
  #left-nav { bottom: calc(72px + env(safe-area-inset-bottom)) !important; padding-bottom: 16px !important; overflow-y: auto; }
  #primary-nav { padding-bottom: 8px; }
}

/* ---- The Counsel button never covers content: smaller, above the bottom bar on a phone ---- */
#ai-launcher { background: var(--text) !important; box-shadow: var(--shadow-popover) !important; }
@media (max-width: 1023px) { #ai-launcher { bottom: calc(84px + env(safe-area-inset-bottom)) !important; right: 12px !important; padding: 0 !important; width: 48px; height: 48px; justify-content: center; }
  #ai-launcher span:not(.material-symbols-outlined) { display: none; } }

/* ---- Panels and dialogs ---- */
.drill-modal, #ai-panel { border-radius: var(--radius-panel) !important; box-shadow: var(--shadow-modal) !important; }

/* ---- 今天 (design 01) ---- */
.today-hero { background: var(--primary-soft) !important; border-color: var(--primary-line) !important; }
.today-hero-msg { font-size: 20px; font-weight: 700; line-height: 1.4; margin-top: 4px; }
.today-x { width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; margin: -8px -8px 0 0; }
.today-x:hover { background: rgba(8, 127, 115, .08); }
.today-next { display: flex !important; align-items: center; gap: 20px; text-decoration: none; color: var(--text); padding: 18px 20px !important; }
.today-next-time { font-size: 16px; color: var(--primary); font-variant-numeric: tabular-nums; min-width: 48px; }
.today-row { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.today-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 0; color: var(--text); text-decoration: none; }
.today-row-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--icon-bg); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px !important; flex: none; }

/* ---- 预约 (design 02) ---- */
.bk-bar { display: flex; align-items: center; gap: 8px; }
.bk-arrow { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.bk-today { min-height: 48px; padding: 0 12px; border: 0; background: none; font-size: 15px; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.bk-filters { display: grid; gap: 12px; }
.bk-filters[hidden] { display: none !important; }
.bk-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bk-filter-label { width: 44px; font-size: 13px; color: var(--text-secondary); }

/* ---- 客户 (design 03) ---- */
.cust-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .cust-grid { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; } }
.cust-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 899px) { .cust-totals { display: none; } }
.cust-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--border);
  background: none; cursor: pointer; color: var(--text); font: inherit; }
.cust-row:hover, .cust-row.is-on { background: var(--subtle); }
.cust-avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ---- 钱和账 first screen (design 05) ---- */
.money-hero { display: grid; gap: 24px; }
@media (min-width: 900px) { .money-hero { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: 36px; align-items: start; }
  .money-tasks { border-left: 1px solid var(--border); padding-left: 30px; } }
.money-big { font-size: 44px; font-weight: 700; line-height: 1.2; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.money-big span { font-size: 26px; color: var(--text-secondary); }
@media (min-width: 900px) { .money-big { font-size: 52px; } }
.money-split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; }
.money-split > div + div { border-left: 1px solid var(--border); padding-left: 16px; }
.money-mid { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .money-mid { font-size: 25px; } }
.money-note { display: flex; gap: 8px; align-items: center; margin-top: 18px; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  background: var(--warning-bg); color: var(--warning); font-size: 13px; text-decoration: none; }
.money-task { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 0; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; }
.money-task:hover { background: var(--subtle); }
.money-task-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--icon-bg); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px !important; }
.money-more-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 0 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  font-size: 15px; color: var(--text-secondary); }
.money-more-summary::-webkit-details-marker { display: none; }
#money-more[open] .money-more-summary .material-symbols-outlined { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
