/* MyyAcc theme, 2026-12-01. One layer over the older sheets: a deep navy side bar, a quiet grey canvas,
   white surfaces with hairlines, and one blue for the things you can press.
   Loaded after the page sheets and before app-mobile.css, so phones keep their own touch layout.
   The side bar colours are the --side-* values: change those five to get a light side bar back. */
:root {
  --blue: #2f5fe6; --blue-dark: #2149c4; --blue-light: #eef3ff; --blue-line: #c9d7fb;
  --ink: #1a2236; --ink-2: #3a4459; --muted: #687385; --faint: #8a94a6;
  --line: #e3e8ee; --line-soft: #eef1f5; --bg: #f6f8fa; --surface: #fff; --surface-2: #f8fafc;
  --navy: #0a2540;
  --ok: #0b7a4b; --ok-bg: #dcf5e7; --warn: #8f5200; --warn-bg: #fdf0c8; --bad: #c0123c; --bad-bg: #fde8ee;
  --info: #1f4fd0; --info-bg: #e5ecff; --idle: #545f73; --idle-bg: #ebeef2;
  --radius: 10px; --radius-s: 6px;
  --shadow-1: 0 1px 1px rgba(10,37,64,.03), 0 1px 3px rgba(10,37,64,.05);
  --shadow-2: 0 2px 5px rgba(10,37,64,.07), 0 10px 28px rgba(10,37,64,.10);
  --ring: 0 0 0 3px rgba(47,95,230,.24);
  --side-bg: #0a2540; --side-ink: rgba(255,255,255,.74); --side-strong: #fff;
  --side-hover: rgba(255,255,255,.07); --side-active: rgba(255,255,255,.13); --side-line: rgba(255,255,255,.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- base ---------- */
body { color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.app-body { background: var(--bg); }
a { color: var(--blue); }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: #cfdcff; }
.muted { color: var(--muted); }

/* ---------- side bar ---------- */
.sidebar { background: var(--side-bg); border-right: 0; color: var(--side-ink); padding: 18px 10px 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sidebar .brand-lockup { padding: 2px 12px 16px; border-bottom: 0; }
.sidebar .brand-lockup img { width: 138px; }
.sidebar .brand-lockup small { color: rgba(255,255,255,.5); font-size: 10.5px; letter-spacing: 1.5px; }
.sidebar nav.workspace-nav a { min-height: 34px; padding: 6px 12px; margin: 1px 0; gap: 10px; border-radius: 7px; color: var(--side-ink); font-size: 13px; font-weight: 500; }
.sidebar nav.workspace-nav a .icon { width: 16px; height: 16px; opacity: .82; }
.sidebar nav.workspace-nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.sidebar nav.workspace-nav a.active { background: var(--side-active); color: var(--side-strong); font-weight: 600; box-shadow: inset 2px 0 0 #7ea2ff; }
.sidebar nav.workspace-nav a.active .icon { opacity: 1; }
.sidebar .workspace-nav .nav-divider { margin: 10px 12px; background: var(--side-line); }
.sidebar .workspace-nav .nav-group { margin: 1px 0; }
.sidebar .workspace-nav .nav-group > summary { min-height: 34px; padding: 6px 12px; gap: 10px; border-radius: 7px; color: var(--side-ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.sidebar .workspace-nav .nav-group > summary .icon { width: 16px; height: 16px; opacity: .82; }
.sidebar .workspace-nav .nav-group > summary:hover { background: var(--side-hover); color: var(--side-strong); }
.sidebar .workspace-nav .nav-group[open] > summary { color: var(--side-strong); font-weight: 600; }
.sidebar .workspace-nav .nav-group > summary::after { width: 5px; height: 5px; opacity: .6; }
.sidebar .workspace-nav .nav-group-links { margin: 1px 0 6px 19px; padding-left: 8px; border-left: 1px solid var(--side-line); }
.sidebar nav.workspace-nav .nav-group-links a { min-height: 31px; padding: 5px 11px; margin: 1px 0; font-size: 13px; border-radius: 6px; }
.sidebar .workspace-nav .nav-hint { display: none; }
.sidebar nav.workspace-nav a .nav-badge, .sidebar nav.workspace-nav a .nav-count { display: inline-flex; align-items: center; justify-content: center; flex: none; width: auto; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: auto; border-radius: 9px; background: #ff5a5f; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.sidebar .sidebar-note { border-top: 1px solid var(--side-line); color: rgba(255,255,255,.55); padding: 12px 10px 0; font-size: 11.5px; }
.sidebar .sidebar-note small { color: rgba(255,255,255,.4); font-size: 10.5px; }
.sidebar :focus-visible { outline-color: #9db8ff; }

/* ---------- top bar ---------- */
.topbar { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.6) blur(10px); backdrop-filter: saturate(1.6) blur(10px); }
.topbar-brand { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.breadcrumb-divider { color: #c4cbd6; }
.current-location { color: var(--ink); font-size: 13px; font-weight: 600; }
.topbar-search { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--faint); transition: border-color .12s, box-shadow .12s, background .12s; }
.topbar-search:focus-within { background: #fff; border-color: var(--blue); box-shadow: var(--ring); }
.topbar-search input[type=search] { font-size: 13px; color: var(--ink); outline: 0; box-shadow: none; }
.topbar-search input[type=search]::placeholder { color: var(--faint); }
.topbar-search button { color: var(--faint); }
.role { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 11.5px; padding: 2px 10px; }
.user-avatar { background: var(--navy); color: #fff; font-weight: 600; }
.username { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.text-button { color: var(--muted); font-size: 13px; }
.text-button:hover { color: var(--blue); }
.workspace-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.workspace-footer a { color: var(--muted); }

/* ---------- headings ---------- */
.page-heading h1 { color: var(--ink); font-weight: 700; letter-spacing: -.3px; }
.page-heading p { color: var(--muted); font-size: 13px; }
h2 { letter-spacing: -.1px; }
.eyebrow { color: var(--blue); }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.panel-heading h2 { font-size: 15px; font-weight: 650; color: var(--ink); }
.panel-heading p { color: var(--muted); font-size: 12.5px; }
.stat, .metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.stat > span, .metric-label { color: var(--muted); font-size: 12.5px; }
.stat > strong, .metric-card > strong { color: var(--ink); font-weight: 650; letter-spacing: -.5px; }
.stat p, .metric-card p { color: var(--faint); font-size: 12px; }
.stat > strong small, .metric-card strong small { font-size: 12px; color: var(--muted); }
.stat.accent { background: var(--navy); border-color: var(--navy); box-shadow: var(--shadow-1); }
.stat.accent > span, .stat.accent p { color: rgba(255,255,255,.72); }
.stat.accent > strong { color: #fff; }
a.metric-card:hover { border-color: var(--blue-line); background: #fff; box-shadow: var(--shadow-2); }
.metric-blue { background: #fff; }
.metric-label .icon { background: var(--blue-light); color: var(--blue); }

/* ---------- tables ---------- */
table { font-size: 13px; }
th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--line-soft); color: var(--ink); }
td small { color: var(--muted); font-size: 12px; }
tbody tr:hover > td { background: #fafbfd; }
td.numeric, th.numeric { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.button { border-radius: var(--radius-s); font-size: 13px; font-weight: 600; letter-spacing: 0; background: var(--blue); border-color: var(--blue); color: #fff;
  box-shadow: 0 1px 1px rgba(10,37,64,.14), 0 2px 5px rgba(47,95,230,.20), inset 0 1px 0 rgba(255,255,255,.14); transition: background .12s, box-shadow .12s, border-color .12s, transform .06s; }
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button:active { transform: translateY(1px); box-shadow: 0 1px 1px rgba(10,37,64,.12); }
.button.secondary { background: #fff; color: var(--ink); border-color: #d5dbe3; box-shadow: 0 1px 1px rgba(10,37,64,.05); }
.button.secondary:hover { background: var(--surface-2); border-color: #c3cbd6; color: var(--ink); }
.button:focus-visible { outline: 0; box-shadow: var(--ring); }
.button[disabled], .button:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
.subtle-link { font-size: 13px; font-weight: 600; }

/* ---------- forms ---------- */
input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range])), select, textarea {
  border: 1px solid #d5dbe3; border-radius: var(--radius-s); background-color: #fff; color: var(--ink);
  box-shadow: 0 1px 1px rgba(10,37,64,.04); transition: border-color .12s, box-shadow .12s; }
input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range])):hover, select:hover, textarea:hover { border-color: #c0c8d4; }
input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range])):focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--ring); outline: 0; }
input::placeholder, textarea::placeholder { color: #9aa3b2; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }
.field > label, label { color: var(--ink); }
.field small, .help { color: var(--muted); }

/* ---------- badges ---------- */
.badge { border-radius: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; background: var(--idle-bg); color: var(--idle); }
.badge.published { background: var(--info-bg); color: var(--info); }
.badge.partial { background: var(--warn-bg); color: var(--warn); }
.badge.settled { background: var(--ok-bg); color: var(--ok); }
.badge.draft { background: var(--idle-bg); color: var(--idle); }

/* ---------- notices and messages ---------- */
.notice { background: #f3f6ff; border: 1px solid #d9e3fb; border-left: 3px solid var(--blue); border-radius: 8px; color: var(--ink-2); }
.message { border-radius: 8px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-1); }
.message.success { background: #eefaf3; border-color: #bfe8d0; color: #0a5c3a; }
.message.error { background: #fff1f4; border-color: #f6c5d0; color: #99102f; }
.message.warning { background: #fff8e1; border-color: #f1dc9c; color: #7a4700; }
.message.info { background: #f3f6ff; border-color: #d9e3fb; color: #1d3f9e; }

/* ---------- dashboard ---------- */
.welcome-card { background: var(--navy); border-color: var(--navy); border-radius: var(--radius); box-shadow: var(--shadow-1);
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(92,133,255,.38) 0%, rgba(92,133,255,0) 55%), radial-gradient(90% 120% at 0% 100%, rgba(0,212,255,.14) 0%, rgba(0,212,255,0) 60%); }
.welcome-kicker { color: rgba(255,255,255,.6); }
.welcome-copy h2 { color: #fff; }
.welcome-copy p { color: rgba(255,255,255,.72); }
.welcome-tag { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.86); }
.period-chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.dashboard-shell .panel-heading p, .trend-totals span, .chart-legend, .status-legend li > span, .calendar-panel small, .todo-items small, .aside-overline { color: var(--muted); }
.trend-totals b, .status-legend b, .todo-items b, .calendar-panel b { color: var(--ink); }
.chart-line.incoming, .donut-segment.published { stroke: #4f7df0; }
.chart-point.incoming { stroke: #4f7df0; }
.legend-dot.incoming, .legend-dot.published { background: #4f7df0; }
.chart-line.outgoing, .donut-segment.settled { stroke: #14b8a6; }
.chart-point.outgoing { stroke: #14b8a6; }
.legend-dot.outgoing, .legend-dot.settled { background: #14b8a6; }
.donut-segment.partial { stroke: #f0b429; }
.legend-dot.partial { background: #f0b429; }
.chart-area { fill: #e8eeff; }
.chart-axis { fill: var(--faint); }
.donut-number { fill: var(--ink); }
.donut-caption { fill: var(--muted); }
.todo-items strong { color: var(--ink); }
.aside-link { color: var(--blue); border-top-color: var(--line-soft); font-weight: 600; }
.shortcut-grid a { color: var(--ink-2); }
.mini-avatar { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.workspace-tip { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------- filter buttons: one look for every row of them ---------- */
.bill-filter-group button, .loan-filter-group button, .loan-filter-group a, .fixed-filter-group button, .docs-tabs a, .docs-kinds a,
.currency-tab, .filter-chips a, .bank-type-filters a {
  border: 1px solid #d5dbe3; border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 1px rgba(10,37,64,.04); transition: border-color .12s, background .12s, color .12s; }
.bill-filter-group button:hover, .loan-filter-group button:hover, .loan-filter-group a:hover, .fixed-filter-group button:hover, .docs-tabs a:hover,
.docs-kinds a:hover, .currency-tab:hover, .filter-chips a:hover, .bank-type-filters a:hover { border-color: #b9c3d1; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.bill-filter-group button[aria-pressed="true"], .loan-filter-group button[aria-pressed="true"], .loan-filter-group a[aria-current],
.fixed-filter-group button[aria-pressed="true"], .docs-tabs a.on, .docs-kinds a.on, .currency-tab.active, .filter-chips a[aria-current], .bank-type-filters a[aria-current] {
  background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); font-weight: 650; box-shadow: none; }
.bill-filter-group button b { color: var(--faint); font-weight: 600; }
.bill-filter-group button[aria-pressed="true"] b { color: var(--blue); }
.bill-filter-group > span, .bill-filter-search { color: var(--muted); font-size: 12.5px; }
.bill-filter-sum { color: var(--ink-2); font-size: 13px; }
.bill-filter-reset, .loan-filter-reset { font-size: 13px; }

.loan-filter-group button b, .loan-filter-group a b, .loan-filter-group a span, .fixed-filter-group button b { color: var(--faint); }
.loan-filter-group button[aria-pressed="true"] b, .loan-filter-group a[aria-current] b, .loan-filter-group a[aria-current] span,
.fixed-filter-group button[aria-pressed="true"] b { color: var(--blue); }
.loan-filter-group > span, .fixed-filter-group > span { color: var(--muted); font-size: 12.5px; }

.docs-tabs a b, .docs-kinds a b { color: var(--faint); }
.docs-tabs a.on b, .docs-kinds a.on b { color: var(--blue); }
@media (min-width: 901px) {
  .bill-filter-group button, .loan-filter-group button, .loan-filter-group a, .fixed-filter-group button, .docs-tabs a, .docs-kinds a,
  .currency-tab, .filter-chips a, .bank-type-filters a { min-height: 30px; padding: 3px 12px; }
}

/* ---------- figures ---------- */
td, .numeric, .stat > strong, .metric-card > strong, h2, h3 { font-variant-numeric: tabular-nums; }
.amount-context { background: #f3f6ff; border: 1px solid #d9e3fb; border-left: 3px solid var(--blue); border-radius: 8px; color: var(--ink-2); font-size: 13px; }

/* 总公司往来账: the three weekly figures side by side */
@media (min-width: 901px) {
  .week-check .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 16px; }
  .week-check .detail-grid > div { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
  .week-check .detail-grid > div > p { margin: 0 0 2px; color: var(--muted); font-size: 12.5px; }
  .week-check .detail-grid > div > h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
  .week-check .detail-grid > div > b { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--warn); }
  .week-check > h3 { margin-top: 4px; }
}

/* ---------- the big amount on a bill ---------- */
.bill-banner { background: var(--navy); border-radius: var(--radius); box-shadow: var(--shadow-1);
  background-image: radial-gradient(120% 160% at 100% 0%, rgba(92,133,255,.40) 0%, rgba(92,133,255,0) 55%), radial-gradient(80% 120% at 0% 100%, rgba(0,212,255,.12) 0%, rgba(0,212,255,0) 60%); }

/* ---------- the agent's own big number, and the profile card ---------- */
.ah-hero, .agent-view .bill-hero, .me-card { background: var(--navy); box-shadow: var(--shadow-2);
  background-image: radial-gradient(120% 160% at 100% 0%, rgba(92,133,255,.42) 0%, rgba(92,133,255,0) 55%), radial-gradient(80% 120% at 0% 100%, rgba(0,212,255,.12) 0%, rgba(0,212,255,0) 60%); }
.ah-hero.due, .agent-view .bill-hero.due { background: linear-gradient(135deg, #0a6f4d, #16a06f); box-shadow: var(--shadow-2); }
.ah-hero.clear, .agent-view .bill-hero.clear { background: linear-gradient(135deg, #4d5a72, #74819a); }

/* ---------- pickers above a list: one slim row ---------- */
.week-step { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.filters { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.filters label { color: var(--muted); }
@media (min-width: 901px) {
  .week-step { padding: 3px 14px; }
  .filters { padding: 10px 14px; align-items: center; }
  .filters label { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12.5px; }
  .filters label input, .filters label select { margin-top: 0; flex: 1; min-width: 0; }
  .amount-context { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; padding: 8px 14px; margin-bottom: 12px; }
  .amount-context p { margin: 0; }
}

/* ---------- the red fold of risky actions ---------- */
.danger-menu summary { border-color: #f1c4cd; border-radius: var(--radius-s); background: #fff; color: var(--bad); font-size: 13px; font-weight: 600; box-shadow: 0 1px 1px rgba(10,37,64,.05); cursor: pointer; }
.danger-menu summary:hover { background: #fff5f7; }
.danger-menu a { color: var(--bad); }
@media (min-width: 901px) {
  .danger-menu { margin-top: 4px; }
  .danger-menu summary { min-height: 32px; padding: 4px 12px; }
  .welcome-card { min-height: 124px; padding: 16px 24px; }
  .workspace-art { width: 200px; height: 124px; margin: -10px -4px -10px 4px; }
  .welcome-copy h2 { font-size: 22px; margin: 6px 0 4px; }
  .welcome-copy p { margin-bottom: 9px; line-height: 1.6; }
}

/* ---------- step bars ---------- */
.bill-next li.now b, .work-steps li.now b { background: var(--blue); border-color: var(--blue); }

/* ---------- loans: a list where every row is late should not be a wall of red ---------- */
.loan-remind-card { border-color: var(--line); border-radius: 8px; }
.loan-remind-card.due, .loan-remind-card.overdue { background: #fff; border-color: var(--line); box-shadow: inset 3px 0 0 #e5484d; }
.loan-badge { border-radius: 5px; font-weight: 600; }
.loan-badge.due, .loan-badge.overdue { background: var(--bad-bg); color: var(--bad); }
.loan-stat-alert { background: #fff; border-color: #f3c1c9; }
.loan-next.soon, .loan-next.due, .loan-next.overdue { background: #fff; }

/* ---------- small type: nothing under 11.5px on a desktop screen ---------- */
@media (min-width: 901px) {
  body { font-size: 14px; }
  .topbar { height: 52px; min-height: 52px; }
  .page-heading h1 { font-size: 22px; }
  th { padding: 8px 14px; }
  td { padding: 8px 14px; }
  .button { min-height: 32px; padding: 4px 13px; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]), select, textarea { font-size: 13.5px; }
  .dashboard-heading p, .welcome-copy p { font-size: 13px; }
  .welcome-kicker, .welcome-kicker > span { font-size: 11px; }
  .welcome-tag { font-size: 12px; padding: 3px 9px; }
  .metric-label { font-size: 12.5px; }
  .metric-card p, .metric-card strong small { font-size: 12px; }
  .dashboard-shell .panel-heading h2 { font-size: 15px; }
  .dashboard-shell .panel-heading p { font-size: 12px; }
  .trend-totals span, .chart-legend, .chart-legend small { font-size: 12px; }
  .chart-data summary, .chart-data th, .chart-data td { font-size: 12px; }
  .status-legend li { font-size: 13px; }
  .status-legend small { font-size: 11.5px; }
  .todo-items b { font-size: 13px; }
  .todo-items small, .aside-overline { font-size: 11.5px; }
  .aside-link { font-size: 12.5px; }
  .shortcut-grid a { font-size: 12px; }
  .calendar-panel b { font-size: 13px; }
  .calendar-panel small, .calendar-panel > p { font-size: 11.5px; }
  .dashboard-table th { font-size: 12px; padding: 8px 16px; background: var(--surface-2); }
  .dashboard-table td { padding: 9px 16px; }
  .dashboard-table td small { font-size: 11.5px; }
  .dashboard-table .badge { font-size: 11.5px; padding: 2px 8px; }
  .dashboard-table .subtle-link { font-size: 12.5px; }
  .dashboard-shell .table-wrap table.dashboard-table { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) { .button, .topbar-search, input, select, textarea { transition: none; } }
@media print { .sidebar { background: #fff; } }

/* =====================================================================================================================
   2026-12-02: glow, motion and pictures. The owner asked for the feel of a high-end AI console: more images and icons,
   light effects, movement. Tables and forms stay calm; the effects sit on the frame around them (side bar, greeting,
   big amounts, buttons, cards). Everything that moves is switched off under prefers-reduced-motion at the end.
   ===================================================================================================================== */
:root { --violet: #6b5cff; --cyan: #22c8ee; --ai: linear-gradient(90deg, #2f5fe6 0%, #6b5cff 55%, #22b8ee 100%); }

/* ---------- side bar: a slow glow behind the menu, a lit edge on the open page ---------- */
.sidebar { background: radial-gradient(120% 30% at 100% 0%, rgba(47,95,230,.36) 0%, rgba(47,95,230,0) 62%), radial-gradient(110% 30% at 100% 100%, rgba(107,92,255,.30) 0%, rgba(107,92,255,0) 64%), var(--side-bg); }
.sidebar::before { content: ''; position: fixed; z-index: -1; left: -70px; top: 34%; width: 240px; height: 240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(34,200,238,.20) 0%, rgba(34,200,238,0) 66%); animation: theme-drift 24s ease-in-out infinite alternate; }
@keyframes theme-drift { from { transform: translate3d(0,-120px,0); } to { transform: translate3d(30px,180px,0); } }
.sidebar nav.workspace-nav a.active { background: linear-gradient(90deg, rgba(126,162,255,.30), rgba(126,162,255,.10)); box-shadow: inset 2px 0 0 #7ee0ff, 0 0 0 1px rgba(126,162,255,.16), 0 6px 18px rgba(4,16,40,.35); }
.sidebar nav.workspace-nav a, .sidebar .workspace-nav .nav-group > summary { transition: background .15s, color .15s, transform .15s; }
.sidebar nav.workspace-nav a:hover .icon, .sidebar .workspace-nav .nav-group > summary:hover .icon { opacity: 1; color: #9fe7ff; }
.workspace-nav .nav-group-links a .icon { width: 15px; height: 15px; }
.sidebar nav.workspace-nav .nav-group-links a { gap: 9px; }
.sidebar .brand-lockup img { filter: drop-shadow(0 0 10px rgba(94,170,255,.28)); }

/* ---------- top bar: a thin line of light under it ---------- */
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none; opacity: .7;
  background: linear-gradient(90deg, rgba(47,95,230,0) 0%, #2f5fe6 22%, #6b5cff 50%, #22c8ee 78%, rgba(34,200,238,0) 100%); }
.user-avatar { background: linear-gradient(135deg, #2f5fe6, #6b5cff); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(107,92,255,.35); }

/* ---------- buttons ---------- */
.button:where(:not(.secondary)) { background: linear-gradient(90deg, #2f5fe6 0%, #5a5cf2 100%); border-color: transparent; background-origin: border-box;
  box-shadow: 0 1px 1px rgba(10,37,64,.14), 0 4px 12px rgba(72,96,240,.30), inset 0 1px 0 rgba(255,255,255,.18); }
.button:where(:not(.secondary)):hover { background: linear-gradient(90deg, #2a55dc 0%, #4f50e6 100%); border-color: transparent; box-shadow: 0 1px 1px rgba(10,37,64,.14), 0 8px 20px rgba(72,96,240,.42), inset 0 1px 0 rgba(255,255,255,.2); }
.button .icon { color: currentColor; }

/* ---------- the dark blocks: a fine grid and a light that drifts across ---------- */
.welcome-card, .bill-banner, .ah-hero, .agent-view .bill-hero, .me-card, .stat.accent { position: relative; overflow: hidden; isolation: isolate; }
.welcome-card::before, .bill-banner::before, .ah-hero::before, .agent-view .bill-hero::before, .me-card::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 100%); mask-image: linear-gradient(100deg, transparent 20%, #000 100%); }
.welcome-card::after, .bill-banner::after, .ah-hero::after, .agent-view .bill-hero::after, .me-card::after, .stat.accent::after { content: ''; position: absolute; z-index: -1; top: -60%; left: -30%; width: 46%; height: 220%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(126,200,255,.34), rgba(126,200,255,0)); animation: theme-sweep 11s ease-in-out infinite alternate; }
@keyframes theme-sweep { from { transform: translate3d(0,0,0); } to { transform: translate3d(240%,0,0); } }
.ah-hero.due::after, .ah-hero.clear::after, .agent-view .bill-hero.due::after, .agent-view .bill-hero.clear::after { background: radial-gradient(closest-side, rgba(255,255,255,.22), rgba(255,255,255,0)); }
.welcome-copy h2 { background: linear-gradient(90deg, #fff 0%, #cfe0ff 60%, #9fe7ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.workspace-art { object-fit: contain; filter: drop-shadow(0 14px 26px rgba(0,10,30,.45)); animation: theme-float 6s ease-in-out infinite alternate; }
@keyframes theme-float { from { transform: translateY(3px); } to { transform: translateY(-7px); } }

/* ---------- dashboard: generated icons, cards that lift, a chart that draws itself ---------- */
.metric-card { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--ai); opacity: .0; transition: opacity .18s; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--blue-line); }
.metric-card:hover::before { opacity: 1; }
.metric-art { display: block; flex: none; margin: -6px -4px -8px 0; }
.metric-art img { display: block; width: 40px; height: 40px; filter: drop-shadow(0 6px 10px rgba(47,95,230,.25)); transition: transform .25s ease; }
.metric-card:hover .metric-art img { transform: translateY(-2px) scale(1.08) rotate(-3deg); }
.shortcut-icon.art, .todo-icon.art { background: none; border-radius: 0; overflow: visible; }
.shortcut-icon.art { width: 46px; height: 46px; }
.shortcut-icon.art img { display: block; width: 46px; height: 46px; filter: drop-shadow(0 6px 10px rgba(47,95,230,.22)); transition: transform .25s cubic-bezier(.2,.8,.2,1.4); }
.shortcut-grid a:hover .shortcut-icon.art img { transform: translateY(-4px) scale(1.1); }
.todo-icon.art { width: 34px; height: 34px; }
.todo-icon.art img { display: block; width: 34px; height: 34px; }
.chart-line { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: theme-draw 1.6s .15s ease-out forwards; }
.chart-line.outgoing { animation-delay: .35s; }
@keyframes theme-draw { to { stroke-dashoffset: 0; } }
.chart-area, .chart-point { animation: theme-fade .6s 1.1s ease-out backwards; }
.status-donut { animation: theme-spin-in .9s cubic-bezier(.2,.7,.2,1) backwards; transform-origin: 50% 50%; }
@keyframes theme-spin-in { from { opacity: 0; transform: rotate(-70deg) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes theme-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- panels and cards ---------- */
.stat { transition: transform .18s ease, box-shadow .18s ease; }
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.badge.published::before, .badge.partial::before, .badge.settled::before { }
tbody tr { transition: background .12s; }
.subtle-link, td a { transition: color .12s; }

/* ---------- empty and dead-end states get a picture ---------- */
.empty:has(> h3)::before { content: ''; display: block; width: 118px; height: 118px; margin: 0 auto 6px; background: url("brand/art/empty.64ae780bdb0b.webp") center / contain no-repeat; animation: theme-float 5s ease-in-out infinite alternate; }
.empty.all-done:has(> h3)::before { background-image: url("brand/art/done.443b14677340.webp"); }
.empty:has(> h3) .empty-icon { display: none; }
.state-page { text-align: center; padding-top: 36px; padding-bottom: 40px; }
.state-page .state-art { display: block; width: 132px; height: 132px; margin: 0 auto 10px; animation: theme-float 5s ease-in-out infinite alternate; }
.state-page h1 { font-size: 22px; }
.state-page p { color: var(--muted); }
.auth-card.standalone.state-page { max-width: 440px; margin: 8vh auto 0; }

/* ---------- pages arrive softly (desktop; no transform, so fixed bars inside a page never jump) ---------- */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .workspace > * { animation: theme-fade .28s ease-out backwards; }
  .workspace > :nth-child(2) { animation-delay: .04s; }
  .workspace > :nth-child(3) { animation-delay: .08s; }
  .workspace > :nth-child(4) { animation-delay: .12s; }
  .workspace > :nth-child(n+5) { animation-delay: .16s; }
}
@media (min-width: 901px) {
  .workspace-art { width: 250px; height: 144px; margin: -14px 0 -14px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar::before, .welcome-card::after, .bill-banner::after, .ah-hero::after, .agent-view .bill-hero::after, .me-card::after, .stat.accent::after,
  .workspace-art, .chart-line, .chart-area, .chart-point, .status-donut, .empty:has(> h3)::before, .state-page .state-art { animation: none !important; }
  .chart-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  .metric-card, .metric-art img, .shortcut-icon.art img, .stat { transition: none; }
}

/* ---------- 中文 / EN ---------- */
.lang-switch { display: inline-flex; flex: none; margin: 0; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.lang-switch button { min-width: 38px; min-height: 24px; padding: 1px 9px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--blue-dark); box-shadow: 0 1px 2px rgba(10,37,64,.14); cursor: default; }
.lang-switch.on-dark { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); }
.lang-switch.on-dark button { color: rgba(255,255,255,.72); }
.lang-switch.on-dark button:hover { color: #fff; }
.lang-switch.on-dark button[aria-pressed="true"] { background: rgba(255,255,255,.92); color: #0a2540; }
.lang-switch.in-drawer { margin: 14px 16px 4px; align-self: flex-start; }
.me-row.me-lang { cursor: default; }
.me-row.me-lang .lang-switch { margin-left: auto; }
.me-row.me-lang .lang-switch button { min-height: 32px; min-width: 48px; font-size: 13px; }
@media (max-width: 900px) { .user-actions > .lang-switch { display: none; } }   /* phones: the drawer and 我的 › 设置 carry it */

/* English runs longer than Chinese: let the tight places breathe */
html[lang="en"] .sidebar nav.workspace-nav a, html[lang="en"] .sidebar .workspace-nav .nav-group > summary { font-size: 12.5px; line-height: 1.25; }
html[lang="en"] .sidebar nav.workspace-nav .nav-group-links a { font-size: 12.5px; }
html[lang="en"] .sidebar .brand-lockup small { letter-spacing: .6px; }
html[lang="en"] .eyebrow, html[lang="en"] .login-page .login-eyebrow { letter-spacing: 1.2px; }
html[lang="en"] .button { letter-spacing: 0; }
html[lang="en"] th { white-space: normal; }
html[lang="en"] .shortcut-grid a { line-height: 1.25; }
html[lang="en"] .app-tabbar a, html[lang="en"] .tabbar a { font-size: 10.5px; letter-spacing: 0; }

/* the other language of a bill, beside its download buttons */
.bill-other-language { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px dashed #c9d3e0; border-radius: var(--radius-s); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bill-other-language a { font-weight: 600; }
