/* Furniture ERP Design System 0.1.0 — canonical reference tokens. */
:root {
  /* ---- Brand ---- */
  --emerald: #147A5C;        /* 主色 — nav, page header, primary buttons, brand marks */
  --emerald-deep: #0E5C45;   /* 深階 — hover/pressed, dark headers, sidebars */
  --emerald-light: #3FA985;  /* 淺階 — fills, chart secondaries, subtle highlights */
  --coral: #FF7A45;          /* 強調 — one or two uses per screen, never more */
  --coral-tint: #FFE7DC;     /* 選取列底色 */
  --cream: #FBF6EE;          /* 底色 — page and card ground */
  --sand: #F1EADE;           /* 斑馬列、區塊、表頭 */
  --ink: #1E2B26;            /* 文字 */
  --muted: #7C8A82;          /* 次要文字 */
  --muted-2: #8A9791;        /* 停用、待確認 */
  --white: #FFFFFF;          /* cards on cream — never the full page ground */
  --info: #2E7DB8;           /* 第四順位 accent */

  /* ---- Status: 訂單狀態 ---- */
  --order-pending: #8A9791;   /* 待確認 */
  --order-progress: #2E7DB8;  /* 備貨中 / 已出貨 */
  --order-done: #1F9D62;      /* 已完成 / 已收款 */

  /* ---- Status: 庫存水位 ---- */
  --stock-ok: #1F9D62;        /* 充足 */
  --stock-low: #E8A93C;       /* 低量 / 預購 */
  --stock-out: #D84B3A;       /* 缺貨 */

  /* ---- Status: 帳務票期 ---- */
  --due-ok: #1F9D62;          /* 未到期 */
  --due-soon: #E8A93C;        /* 將到期 */
  --due-over: #D84B3A;        /* 逾期 */

  /* ---- Semantic aliases ---- */
  --page-bg: var(--cream);
  --surface-card: var(--white);
  --surface-block: var(--sand);
  --surface-row-zebra: var(--sand);
  --surface-row-selected: var(--coral-tint);
  --surface-nav: var(--emerald);
  --surface-sidebar: var(--emerald-deep);
  --text-body: var(--ink);
  --text-secondary: var(--muted);
  --text-disabled: var(--muted-2);
  --text-on-emerald: #FFFFFF;
  --text-on-coral: #FFFFFF;
  --accent-cta: var(--coral);
  --border-hairline: #E5DCCB;   /* cream-family divider, back office */
  --border-strong: #D3C9B6;
  --focus-ring: var(--emerald);
}

:root {
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --space-9: 32px;
  --space-10: 48px;

  /* 後台 · 效率優先 */
  --dense-row-h: 32px;
  --dense-cell-x: 10px;
  --dense-control-h: 28px;
  --dense-gap: var(--space-4);
  --dense-card-pad: var(--space-5);

  /* 前台 · 清晰優先 */
  --comfy-row-h: 56px;
  --comfy-control-h: 48px;   /* tap target ≥ 44px */
  --comfy-gap: var(--space-6);
  --comfy-card-pad: var(--space-7);

  /* Radii — inferred, not specified in the source brief */
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-card-comfy: 12px;
  --radius-pill: 999px;
  --radius-slide: 0px;
}

:root {
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-num: "Noto Sans TC", Arial, Helvetica, sans-serif;

  /* Three weights only — never build hierarchy on six */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  /* Four-step scale. 頁面標題 → 區塊標題 → 內文 → 次要說明 */
  --text-page-title: 24px;
  --text-section-title: 17px;
  --text-body-size: 14px;
  --text-caption: 12px;

  /* Back office runs one step tighter */
  --text-page-title-dense: 20px;
  --text-body-dense: 13px;

  /* CJK needs air */
  --leading-body: 1.65;
  --leading-tight: 1.5;   /* titles only */
  --leading-loose: 1.7;   /* storefront long copy */
  --tracking-cjk: 0;      /* never letter-space Chinese */
}

.erp-num,
.erp-money {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-align: right;
}

:root {
  /* Back office prefers a hairline border over a shadow. */
  --shadow-none: none;
  --shadow-card: 0 1px 2px rgba(30, 43, 38, 0.05);
  --shadow-card-comfy: 0 2px 8px rgba(30, 43, 38, 0.08);
  --shadow-overlay: 0 8px 24px rgba(30, 43, 38, 0.16);
  --shadow-focus: 0 0 0 2px rgba(20, 122, 92, 0.25);
}
