/* =====================================================================
   田源供应链 · 设计系统
   Western minimalist flat · restrained (pure white + amber accent)
   ===================================================================== */
:root {
  /* Palette (OKLCH) */
  --bg: oklch(1 0 0);
  --surface: oklch(0.977 0.004 80);
  --surface-2: oklch(0.957 0.006 80);
  --ink: oklch(0.17 0.008 70);
  --muted: oklch(0.46 0.012 70);
  --faint: oklch(0.55 0.010 70);
  --primary: oklch(0.62 0.115 65);
  --primary-strong: oklch(0.49 0.10 55);
  --primary-soft: oklch(0.94 0.03 75);
  --accent: oklch(0.58 0.11 152);
  --accent-soft: oklch(0.94 0.02 152);
  --info: oklch(0.56 0.10 252);
  --info-soft: oklch(0.94 0.02 252);
  --warning: oklch(0.60 0.12 85);
  --warning-soft: oklch(0.95 0.03 85);
  --danger: oklch(0.58 0.16 25);
  --danger-soft: oklch(0.95 0.02 25);
  --border: oklch(0.91 0.003 80);
  --border-strong: oklch(0.83 0.004 80);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;

  /* Scale */
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-md: 0.875rem;
  --t-base: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.25rem;
  --t-2xl: 1.5rem;
  --t-3xl: 1.75rem;

  /* Shape & spacing */
  --r: 12px;
  --r-sm: 8px;
  --r-pill: 999px;
  --sidebar-w: 250px;
  --topbar-h: 64px;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06), 0 1px 6px oklch(0.2 0.01 60 / 0.04);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--primary-soft); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.pad { padding: 16px; }
.tone-up { color: var(--accent); }
.tone-down { color: var(--danger); }
.tone-warn { color: var(--warning); }
.is-right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Scrollbar (subtle, system) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* Shared icon */
.icon { display: inline-block; vertical-align: -0.18em; flex: none; color: currentColor; }
.icon--16 { width: 16px; height: 16px; }

/* Focus */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* =====================================================================
   Layout
   ===================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50;
  transition: transform 0.25s var(--ease);
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--topbar-h); padding: 0 14px 0 18px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.brand__mark svg { width: 22px; height: 22px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__text strong { font-size: 1rem; letter-spacing: -0.01em; }
.brand__text span { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.sidebar__collapse { display: grid; }

.nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav__group { margin-top: 6px; }
.nav__group:first-child { margin-top: 0; }
.nav__label { font-size: var(--t-xs); color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 10px 6px; }
.nav__item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; transition: background 0.16s var(--ease), color 0.16s var(--ease); position: relative; }
.nav__item:hover { background: var(--surface-2); color: var(--ink); }
.nav__item .nav__icon { color: var(--muted); width: 19px; height: 19px; }
.nav__item.is-active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav__item.is-active .nav__icon { color: var(--primary); }
.nav__item.is-active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }

.sidebar__foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.user-chip:hover { background: var(--surface-2); }
.user-chip__meta { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.user-chip__meta strong { font-size: var(--t-md); }
.user-chip__meta span { font-size: var(--t-xs); color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot--on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 24px; background: oklch(1 0 0 / 0.86); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--border); }
.topbar__menu { display: none; }
.topbar__crumbs { display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--muted); min-width: 0; flex: 1; }
.crumb { white-space: nowrap; }
a.crumb:hover { color: var(--ink); }
.crumb.is-current { color: var(--ink); font-weight: 600; }
.crumb__sep { color: var(--border-strong); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.search { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); width: 300px; transition: border-color 0.16s var(--ease), background 0.16s var(--ease); }
.search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.search input { border: none; outline: none; background: none; width: 100%; color: var(--ink); font-size: var(--t-sm); }
.search input::placeholder { color: var(--muted); }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background 0.16s var(--ease), color 0.16s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; font-weight: 650; flex: none; }
.topbar__avatar { cursor: pointer; }

.content { width: 100%; max-width: 1376px; margin: 0 auto; padding: 28px 32px 72px; outline: none; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r-sm); font-size: var(--t-md); font-weight: 600; border: 1px solid transparent; transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.12s var(--ease), color 0.16s var(--ease); white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: oklch(0.24 0.009 70); }
.btn--ghost { background: #fff; border-color: var(--border-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn--soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn--soft:hover { background: oklch(0.90 0.045 75); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--sm { height: 32px; padding: 0 11px; font-size: var(--t-sm); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* =====================================================================
   Pills · chips · badges
   ===================================================================== */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; white-space: nowrap; }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok { background: var(--accent-soft); color: var(--accent); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--warn { background: var(--warning-soft); color: var(--warning); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--muted { background: var(--surface-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.chip--warn { background: var(--warning-soft); color: var(--warning); }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); display: inline-grid; place-items: center; font-size: var(--t-xs); font-weight: 700; }
.grade { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 22px; border-radius: 6px; font-size: var(--t-xs); font-weight: 700; }
.grade--A { background: var(--accent-soft); color: var(--accent); }
.grade--B { background: var(--info-soft); color: var(--info); }
.grade--C { background: var(--warning-soft); color: var(--warning); }
.role-chip, .cat-chip, .perm { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--ink); font-size: var(--t-xs); font-weight: 600; }
.perm { background: #fff; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.cat-chip { background: var(--primary-soft); color: var(--primary-strong); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.rating .icon { color: var(--warning); }

/* =====================================================================
   Page header
   ===================================================================== */
.page { animation: pagein 0.3s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--t-3xl); letter-spacing: -0.02em; }
.page-head__sub { color: var(--muted); margin-top: 6px; font-size: var(--t-sm); }
.page-head__actions { display: flex; gap: 10px; }
.page__back { margin-bottom: 18px; }
.page--narrow { max-width: 720px; }

/* =====================================================================
   Home · hero + kpi + bento
   ===================================================================== */
.home__hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 8px 0 26px; flex-wrap: wrap; }
.home__greet { font-size: var(--t-base); font-weight: 550; color: var(--muted); }
.home__date { color: var(--faint); font-weight: 500; margin-left: 6px; }
.home__title { font-size: clamp(1.75rem, 3vw, 2.35rem); letter-spacing: -0.03em; margin: 8px 0 10px; max-width: 18ch; }
.home__lead { color: var(--muted); font-size: var(--t-base); max-width: 52ch; }
.home__lead b { color: var(--ink); }
.home__hero-actions { display: flex; gap: 10px; flex: none; padding-bottom: 6px; }

.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease); }
.stat-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat-tile__row { display: flex; align-items: center; justify-content: space-between; }
.stat-tile__label { color: var(--muted); font-size: var(--t-sm); font-weight: 550; }
.stat-tile__icon { color: var(--faint); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface); }
.stat-tile__value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.stat-tile__value small { font-size: var(--t-xs); color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat-tile__note { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); flex-wrap: wrap; }
.stat-tile__note .muted { font-size: var(--t-xs); }
.delta { font-weight: 650; }
.delta--up { color: var(--accent); }
.delta--down { color: var(--info); }
.delta--warn { color: var(--warning); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; font-size: var(--t-xl); }
.section-link { font-size: var(--t-sm); color: var(--muted); font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.section-link:hover { color: var(--ink); }

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; grid-auto-rows: minmax(0, auto); }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; border: 1px solid var(--border); border-radius: var(--r); padding: 20px 22px; background: #fff; overflow: hidden; transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.tile:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tile--hero { grid-column: span 7; grid-row: span 2; }
.tile--hero-b { grid-column: span 5; grid-row: span 2; }
.tile--md { grid-column: span 4; }
.tile__top { display: flex; align-items: center; justify-content: space-between; }
.tile__icon { width: 42px; height: 42px; border-radius: 11px; background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.tile__icon .icon { width: 22px; height: 22px; }
.tile__go { color: var(--faint); transition: color 0.18s var(--ease), transform 0.18s var(--ease); }
.tile:hover .tile__go { color: var(--primary); transform: translateX(3px); }
.tile__body h2 { font-size: var(--t-lg); margin-bottom: 4px; }
.tile__body p { color: var(--muted); font-size: var(--t-sm); max-width: 36ch; }
.tile__chart { margin-top: 16px; }
.tile__chart-label { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 6px; }
.tile__mini-stats { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.tile__mini-stats span { display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--muted); }
.tile__mini-stats b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface); color: var(--muted); }
.tile__mini-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: auto; }
.tile__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mini-path { display: flex; align-items: center; gap: 3px; margin-top: 16px; flex-wrap: nowrap; }
.mini-path__node { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--faint); display: grid; place-items: center; flex: none; }
.mini-path__node .icon { width: 18px; height: 18px; }
.mini-path__node.is-done { background: var(--accent-soft); color: var(--accent); }
.mini-path__node.is-current { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.mini-path__line { width: 14px; height: 2px; background: var(--border); flex: 1 1 12px; }

.home__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; }
.panel--flat { box-shadow: none; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__head h3 { font-size: var(--t-base); }
.panel__link, .panel__meta { font-size: var(--t-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.panel__link:hover { color: var(--ink); }
.view-options { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.todo:last-child { border-bottom: none; }
.todo__check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; flex: none; transition: all 0.16s var(--ease); }
.todo__check .icon { width: 14px; height: 14px; }
.todo:hover .todo__check { border-color: var(--ink); }
.todo.is-done .todo__check { background: var(--accent); border-color: var(--accent); color: #fff; }
.todo.is-done .todo__text { color: var(--faint); text-decoration: line-through; }
.todo__text { flex: 1; font-size: var(--t-sm); min-width: 0; }
.todo__due { font-size: var(--t-xs); color: var(--muted); }
.todo__due.is-high { color: var(--warning); font-weight: 600; }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.activity, .todos { gap: 0; }
.activity { gap: 0; }
.activity li, .mini-activity { display: flex; gap: 12px; padding: 9px 0; align-items: flex-start; }
.activity__ico, .mini-activity__ico { width: 32px; height: 32px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; color: var(--muted); flex: none; }
.activity__ico--ok, .mini-activity__ico.tone-ok { color: var(--accent); }
.activity__ico--warn { color: var(--warning); }
.activity__ico--info { color: var(--info); }
.mini-activity__ico { width: 34px; height: 34px; }
.activity__body { flex: 1; min-width: 0; }
.activity__body p, .mini-activity p { font-size: var(--t-sm); }
.activity__body p b { font-weight: 650; }
.mini-activity { border-bottom: 1px dashed var(--border); }
.mini-activity:last-child, .mini-activity li:last-child { border-bottom: none; }

/* =====================================================================
   Dashboard
   ===================================================================== */
.dash-main { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 14px; }
.dash-main--2 { margin-top: 14px; }
.chart-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.chart-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-card__head strong { font-size: var(--t-base); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--muted); }
.legend__dot { width: 8px; height: 8px; border-radius: 2px; }
.legend__dot--a { background: var(--primary); }
.legend__dot--b { background: var(--accent); }
.chart-label { font-size: 10px; fill: var(--muted); font-family: var(--font-sans); }
.chart-card--donut { display: flex; align-items: center; justify-content: center; }
.donut-wrap { display: flex; align-items: center; justify-content: center; }
.donut { position: relative; width: 150px; height: 150px; }
.donut__value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut__value strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.donut__value span { font-size: var(--t-xs); color: var(--muted); max-width: 90px; text-align: center; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar__label { display: flex; justify-content: space-between; font-size: var(--t-sm); margin-bottom: 5px; }
.hbar__track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.stage-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.stage-bar__name { width: 48px; font-size: var(--t-sm); color: var(--muted); }
.stage-bar__track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.stage-bar__fill { display: block; height: 100%; background: var(--border-strong); border-radius: 999px; }
.stage-bar__fill.is-done { background: var(--accent); }
.stage-bar__fill.is-cur { background: var(--warning); }
.stage-bar__pct { width: 36px; text-align: right; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Toolbar · tabs · search · table
   ===================================================================== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tab { padding: 6px 14px; border-radius: 7px; font-size: var(--t-sm); font-weight: 550; color: var(--muted); transition: all 0.16s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.toolbar__right { display: flex; gap: 8px; align-items: center; }
.inline-search { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; color: var(--muted); }
.inline-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.inline-search input { border: none; outline: none; background: none; width: 180px; color: var(--ink); font-size: var(--t-sm); }
.inline-search input::placeholder { color: var(--muted); }

.panel--table, .panel--table { padding: 6px 0 0; overflow: hidden; }
.panel--table .panel__head { padding: 16px 20px 8px; margin: 0; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
thead th { text-align: left; font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--muted); padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th.is-right { text-align: right; }
tbody td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.14s var(--ease); }
tbody tr:hover { background: var(--surface); }
.row-link { cursor: pointer; }
.cell-user, .cell-goods, .cell-supplier { display: flex; align-items: center; gap: 11px; }
.cell-user div, .cell-goods div, .cell-supplier div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cell-user .avatar { width: 32px; height: 32px; }
.cell-user span, .cell-goods span, .cell-supplier span { font-size: var(--t-xs); color: var(--muted); }
.goods-thumb, .seller-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; flex: none; }
.goods-thumb .icon, .seller-mark .icon { width: 18px; height: 18px; }
.goods-thumb--lg, .seller-mark--lg { width: 46px; height: 46px; border-radius: 11px; }
.goods-thumb--lg .icon, .seller-mark--lg .icon { width: 24px; height: 24px; }
.ord-type { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.ord-type--in { background: var(--accent-soft); color: var(--accent); }
.ord-type--out { background: var(--warning-soft); color: var(--warning); }
.ord-type .icon { width: 16px; height: 16px; }

/* =====================================================================
   Detail pages
   ===================================================================== */
.detail-hero { display: flex; align-items: center; gap: 16px; padding: 6px 0 22px; flex-wrap: wrap; }
.detail-hero__ico, .detail-hero__avatar { flex: none; }
.detail-hero__info { flex: 1; min-width: 0; }
.detail-hero__info h1 { font-size: var(--t-2xl); letter-spacing: -0.02em; }
.detail-hero__status { flex: none; }
.detail-hero__actions { display: flex; gap: 9px; flex: none; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv__k { color: var(--muted); font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 7px; }
.kv__k .icon { color: var(--faint); }
.kv__v { font-weight: 550; text-align: right; }
.kv-row-cluster .kv__k { min-width: 60px; }
.flowbar { display: flex; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 22px; margin-bottom: 16px; overflow-x: auto; }
.flowbar__step { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
.flowbar__node { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex: none; }
.flowbar__step.done .flowbar__node { background: var(--accent); }
.flowbar__step.done { color: var(--ink); }
.flowbar__step.current .flowbar__node { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.flowbar__step.current { color: var(--ink); font-weight: 600; }
.flowbar__line { flex: 1; height: 2px; background: var(--border); min-width: 24px; margin: 0 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-sm); font-weight: 600; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: #fff; font-size: var(--t-md); transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.stock-gauge { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.stock-gauge__num { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Traceability
   ===================================================================== */
.select-sm { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: #fff; color: var(--muted); }
.select-sm select { border: none; background: none; color: var(--ink); font-size: var(--t-md); font-weight: 550; outline: none; cursor: pointer; }
.trace-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; }
.trace-path-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 22px 20px; }
.trace-path { display: flex; align-items: stretch; flex-direction: column; gap: 0; }
.tnode { display: flex; align-items: center; gap: 14px; padding: 14px 10px; border-radius: 10px; transition: background 0.16s var(--ease), transform 0.16s var(--ease); }
.tnode:hover { background: var(--surface); transform: translateX(3px); }
.tnode.is-active { background: var(--primary-soft); }
.tnode__dot { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--faint); display: grid; place-items: center; flex: none; }
.tnode__dot .icon { width: 22px; height: 22px; }
.tnode--done .tnode__dot { background: var(--accent-soft); color: var(--accent); }
.tnode--current .tnode__dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.tnode__meta { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.tnode__meta strong { font-size: var(--t-md); }
.tnode__en { font-size: var(--t-xs); color: var(--muted); }
.tnode__time { font-size: var(--t-xs); color: var(--faint); margin-top: 3px; }
.tnode__state { font-size: var(--t-xs); font-weight: 600; color: var(--faint); }
.tnode--done .tnode__state { color: var(--accent); }
.tnode--current .tnode__state { color: var(--warning); }
.tconnector { width: 2px; height: 16px; margin: 2px 0 2px 30px; background: var(--border); }
.trace-legend { display: flex; gap: 18px; padding: 16px 10px 4px; border-top: 1px solid var(--border); margin-top: 10px; }
.trace-legend__item { display: flex; align-items: center; gap: 7px; font-size: var(--t-xs); color: var(--muted); }
.trace-legend__dot { width: 9px; height: 9px; border-radius: 50%; }
.trace-legend__dot--done { background: var(--accent); }
.trace-legend__dot--current { background: var(--warning); }
.trace-legend__dot--pending { background: var(--border-strong); }

.stage-detail { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; min-height: 320px; }
.stage-detail__head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.stage-detail__head .stage-detail__ico { flex: none; }
.stage-detail__head > div { flex: 1; min-width: 0; }
.stage-detail__head h3 { font-size: var(--t-lg); }
.stage-detail__head .btn { margin-left: auto; }
.stage-detail__ico { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; }
.stage-detail__ico .icon { width: 22px; height: 22px; }
.stage-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.stage-detail__note { background: var(--surface); border-radius: 10px; padding: 14px 16px; }
.stage-detail__note strong { font-size: var(--t-sm); }
.stage-detail__note p { font-size: var(--t-sm); color: var(--muted); margin-top: 5px; }
.stage-detail--empty { align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.stage-detail--empty .stage-detail__ico { background: var(--surface-2); color: var(--faint); }
.stage-detail--empty h3 { margin: 14px 0 6px; color: var(--ink); }

.trace-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.trace-meta__item { display: flex; flex-direction: column; gap: 4px; }
.trace-meta__item b { font-size: var(--t-xs); color: var(--muted); font-weight: 500; }
.trace-meta__item span { font-weight: 600; }
.trace-proof { display: flex; align-items: center; gap: 14px; margin-top: 18px; background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; }
.trace-proof__badge { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.trace-proof__badge .icon { width: 22px; height: 22px; }
.trace-proof > div { flex: 1; min-width: 0; }
.trace-proof strong { font-size: var(--t-sm); }
.trace-proof p { font-size: var(--t-xs); }

/* =====================================================================
   Finance
   ===================================================================== */
.fin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fin-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; }
.fin-tile__value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.health { display: flex; align-items: center; gap: 18px; }
.health__ring { --v: 76; width: 88px; height: 88px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--v) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.health__ring::before { content: ""; width: 66px; height: 66px; border-radius: 50%; background: #fff; position: absolute; }
.health__ring { position: relative; }
.health__ring span { position: relative; font-weight: 700; font-size: 1.15rem; }
.health > div:last-child strong { font-size: var(--t-base); }
.health > div:last-child p { font-size: var(--t-sm); color: var(--muted); margin-top: 4px; }

/* =====================================================================
   Search popover
   ===================================================================== */
.search-pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px oklch(0.2 0.01 60 / 0.12); padding: 6px; z-index: 60; }
.search-pop a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; font-size: var(--t-sm); }
.search-pop a:hover { background: var(--surface); }
.search-pop a span:first-child { font-weight: 550; }

/* =====================================================================
   Search bar in pages
   ===================================================================== */

/* =====================================================================
   Module nav · toast · procurement · standards · supplier extras
   ===================================================================== */
.mnav { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 18px; flex-wrap: wrap; }
.mnav__item { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; font-size: var(--t-sm); font-weight: 550; color: var(--muted); transition: background 0.16s var(--ease), color 0.16s var(--ease); }
.mnav__item:hover { color: var(--ink); }
.mnav__item .mnav__icon { width: 16px; height: 16px; }
.mnav__item.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.mnav__item.is-active .mnav__icon { color: var(--primary); }

.toasts { position: fixed; top: 74px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 250px; max-width: 380px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 10px; font-size: var(--t-sm); box-shadow: 0 12px 30px oklch(0.2 0 0 / 0.2); opacity: 0; transform: translateY(-8px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.toast.is-show { opacity: 1; transform: none; }
.toast__ico { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: oklch(1 0 0 / 0.16); flex: none; }
.toast--warn { background: var(--warning); }
.toast--error { background: var(--danger); }

.proc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.proc-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.proc-stat__num { font-size: 1.5rem; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg__btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: var(--t-sm); background: #fff; text-align: left; transition: all 0.16s var(--ease); }
.seg__btn:hover { border-color: var(--ink); }
.seg__btn .icon { color: var(--muted); flex: none; }
.seg__btn .muted { font-size: var(--t-xs); }
.seg__btn.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.seg__btn.is-active .icon { color: var(--primary); }
.sup-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.sup-chip { display: inline-flex; align-items: center; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: var(--t-sm); font-weight: 550; background: #fff; color: var(--muted); transition: all 0.14s var(--ease); }
.sup-chip:hover { border-color: var(--ink); color: var(--ink); }
.sup-chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.sup-hint { margin-top: 8px; font-size: var(--t-xs); }

.std-list { display: flex; flex-direction: column; gap: 12px; }
.std-row { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.std-row__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.std-row__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.std-row__ico { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; flex: none; }
.std-row__title strong { font-size: var(--t-md); }
.std-row__title p { font-size: var(--t-xs); }
.std-row__actions { display: flex; align-items: center; gap: 8px; }
.std-row__nodes { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px; }
.std-row__req b { font-size: var(--t-xs); color: var(--muted); margin-right: 6px; }
.std-row__req .chip { margin-right: 6px; }

.coop-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0 0 18px; }
.coop-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.coop-tile__val { font-size: 1.15rem; font-weight: 700; margin-top: 6px; }
.quals { display: flex; flex-direction: column; gap: 10px; }
.qual { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border-radius: 9px; }
.qual__ico { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid var(--border); color: var(--primary); display: grid; place-items: center; flex: none; }
.qual__body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.qual__body strong { font-size: var(--t-sm); }
.qual__body .muted { font-size: var(--t-xs); }
.whcell { display: flex; flex-direction: column; line-height: 1.3; }
.whcell b { font-size: var(--t-sm); }
.whcell span { font-size: var(--t-xs); color: var(--muted); }
.link { color: var(--primary-strong); font-weight: 600; }
.link:hover { text-decoration: underline; }
.subtxt { font-size: var(--t-xs); color: var(--muted); }
.settle-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: 10px; padding: 14px 16px; }
.settle-box__amt { display: flex; flex-direction: column; }
.settle-box__amt strong { font-size: 1.3rem; }
.settle-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.trace-notice { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 10px 14px; font-size: var(--t-sm); margin-top: 16px; }
.trace-notice .icon { color: var(--accent); }
.card-divider { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 600; color: var(--muted); margin: 18px 0 12px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* =====================================================================
   Responsive
   ===================================================================== */
.app__backdrop { position: fixed; inset: 0; z-index: 40; background: oklch(0.1 0 0 / 0.4); opacity: 0; transition: opacity 0.2s var(--ease); }
.app.is-drawer .app__backdrop { opacity: 1; }
.app.is-drawer .sidebar { transform: translateX(0); }
.app.is-collapsed .sidebar { transform: translateX(-100%); }
.app.is-collapsed .main { margin-left: 0; }
.app.is-collapsed .topbar__menu { display: grid; }

@media (max-width: 1200px) {
  .fin-grid, .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .trace-meta { grid-template-columns: repeat(2, 1fr); }
  .proc-stats, .coop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .app.is-collapsed .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .topbar__menu { display: grid; }
  .sidebar__collapse { display: none; }
  .search { width: 220px; }
  .dash-main, .dash-main--2 { grid-template-columns: 1fr; }
  .trace-layout { grid-template-columns: 1fr; }
  .bento .tile--hero, .bento .tile--hero-b { grid-column: span 12; grid-row: auto; }
  .bento .tile--md { grid-column: span 6; }
  .content { padding: 22px 22px 64px; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .search { display: none; }
  .content { padding: 18px 16px 60px; }
  .bento { grid-template-columns: 1fr; }
  .bento *, .bento .tile { grid-column: span 1 !important; grid-row: auto !important; }
  .home__grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid, .stage-detail__grid { grid-template-columns: 1fr; }
  .fin-grid, .kpi-strip { grid-template-columns: 1fr; }
  .trace-meta { grid-template-columns: 1fr; }
  .proc-stats { grid-template-columns: 1fr; }
  .coop-grid { grid-template-columns: repeat(2, 1fr); }
  .seg { grid-template-columns: 1fr; }
  .std-row__head { flex-direction: column; align-items: flex-start; }
  .detail-hero__actions { width: 100%; }
  .detail-hero__actions .btn { flex: 1; justify-content: center; }
  .page-head { align-items: flex-start; }
  .home__title { max-width: 100%; }
}

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .page { animation: none; }
  .tile:hover { transform: none; }
}
