
    @font-face {
      font-family: "Inter";
      src: url("/static/fonts/InterVariable.woff2") format("woff2");
      font-style: normal;
      font-weight: 100 900;
      font-display: swap;
    }

    :root {
      --bg: #f2f5f2;
      --surface: #ffffff;
      --surface-soft: #f8faf8;
      --ink: #15241d;
      --text: #24342c;
      --muted: #66756d;
      --line: #dce4df;
      --line-strong: #cbd7d0;
      --accent: #087a55;
      --accent-dark: #066346;
      --accent-soft: #e4f3eb;
      --warning: #a25c12;
      --warning-soft: #fff2dc;
      --danger: #9e3434;
      --shadow: 0 10px 30px rgba(23, 42, 32, 0.07);
      --radius: 18px;
    }

    * { box-sizing: border-box; }
    html { background: var(--bg); scroll-behavior: smooth; }
    body {
      margin: 0;
      min-width: 320px;
      color: var(--text);
      background:
        radial-gradient(circle at 92% 3%, rgba(8, 122, 85, 0.08), transparent 28rem),
        linear-gradient(180deg, #f7f9f7 0, var(--bg) 22rem);
      font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
      font-size: 16px;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }

    button, input { font: inherit; }
    button { cursor: pointer; touch-action: manipulation; }
    button:active { opacity: 0.82; }
    button:focus-visible, input:focus-visible, a:focus-visible {
      outline: 3px solid rgba(8, 122, 85, 0.25);
      outline-offset: 2px;
    }

    .auth-shell {
      min-height: 100vh;
      padding: 28px;
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 18% 12%, rgba(232, 165, 72, 0.18), transparent 26rem),
        radial-gradient(circle at 84% 82%, rgba(33, 31, 28, 0.08), transparent 24rem),
        var(--bg);
    }

    .auth-card {
      width: min(440px, 100%);
      padding: 30px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: var(--surface);
      box-shadow: 0 28px 70px rgba(37, 29, 20, 0.14);
    }

    .auth-card-center {
      text-align: center;
    }

    .auth-brand {
      display: flex;
      align-items: center;
      gap: 11px;
      color: var(--ink);
    }

    .auth-brand > span:last-child {
      display: grid;
      gap: 1px;
    }

    .auth-brand strong {
      font-size: 13px;
      font-weight: 750;
    }

    .auth-brand small {
      color: var(--muted);
      font-size: 8px;
      letter-spacing: 0.13em;
    }

    .auth-brand-mark {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      color: #211f1c;
      background: var(--accent);
      font-size: 13px;
      font-weight: 800;
    }

    .auth-kicker {
      margin: 28px 0 5px;
      color: var(--accent-dark);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .auth-card h1 {
      margin: 0;
      color: var(--ink);
      font-size: 28px;
      line-height: 1.2;
      letter-spacing: -0.035em;
    }

    .auth-description {
      margin: 10px 0 22px;
      color: var(--text);
      font-size: 13px;
      line-height: 1.65;
    }

    .auth-description code {
      padding: 2px 5px;
      border: 1px solid var(--line);
      border-radius: 6px;
      color: var(--ink);
      background: var(--surface-soft);
      font-size: 12px;
    }

    .auth-tabs {
      margin: 20px 0 18px;
      padding: 4px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: var(--surface-soft);
    }

    .auth-tabs button {
      min-height: 38px;
      border: 0;
      border-radius: 10px;
      color: var(--muted);
      background: transparent;
      font-size: 12px;
      font-weight: 700;
    }

    .auth-tabs button.active {
      color: var(--ink);
      background: var(--surface);
      box-shadow: 0 5px 14px rgba(37, 29, 20, 0.08);
    }

    .auth-form {
      display: grid;
      gap: 13px;
    }

    .auth-form[hidden] {
      display: none;
    }

    .auth-form label {
      display: grid;
      gap: 6px;
    }

    .auth-form label > span {
      color: var(--text);
      font-size: 11px;
      font-weight: 700;
    }

    .auth-form input {
      width: 100%;
      height: 46px;
      padding: 0 13px;
      border: 1px solid var(--line-strong);
      border-radius: 12px;
      color: var(--ink);
      background: var(--surface);
      font-size: 14px;
    }

    .auth-form .auth-remember {
      min-height: 36px;
      display: flex;
      align-items: center;
      gap: 9px;
      cursor: pointer;
    }

    .auth-form .auth-remember input {
      width: 17px;
      height: 17px;
      margin: 0;
      padding: 0;
      flex: 0 0 17px;
      accent-color: var(--accent-dark);
    }

    .auth-form .auth-remember span {
      color: var(--text);
      font-size: 12px;
      font-weight: 650;
    }

    .auth-submit {
      min-height: 46px;
      border: 1px solid var(--accent);
      border-radius: 12px;
      color: var(--accent-ink);
      background: var(--accent);
      font-size: 13px;
      font-weight: 800;
    }

    .auth-submit:disabled {
      cursor: wait;
      opacity: 0.65;
    }

    .auth-hint {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.55;
    }

    .auth-form-error {
      margin: 0;
      padding: 9px 11px;
      border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
      border-radius: 10px;
      color: var(--danger);
      background: color-mix(in srgb, var(--danger) 8%, var(--surface));
      font-size: 12px;
    }

    .auth-success-mark {
      width: 54px;
      height: 54px;
      margin: 0 auto 14px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background: var(--accent);
      font-size: 26px;
      font-weight: 800;
    }

    .auth-invite-result {
      margin: 18px 0;
      padding: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface-soft);
    }

    .auth-invite-result code {
      color: var(--ink);
      font-family: "Inter", "Cascadia Mono", monospace;
      font-size: 18px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .auth-invite-result button {
      min-height: 36px;
      padding: 0 12px;
      border: 1px solid var(--line-strong);
      border-radius: 10px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
    }

    :root[data-theme="dark"] .auth-card {
      box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
    }

    @media (max-width: 520px) {
      .auth-shell { padding: 16px; }
      .auth-card { padding: 23px 19px; border-radius: 20px; }
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      height: 76px;
      border-bottom: 1px solid rgba(203, 215, 208, 0.78);
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(16px);
    }

    .topbar-inner, .page {
      width: min(1400px, calc(100% - 64px));
      margin: 0 auto;
    }

    .topbar-inner {
      height: 100%;
      display: flex;
      align-items: center;
      gap: 36px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 226px;
    }

    .brand-mark {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      color: white;
      background: var(--ink);
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 0.08em;
      box-shadow: inset 0 -8px 16px rgba(255, 255, 255, 0.07);
    }

    .brand-copy { display: grid; line-height: 1.2; }
    .brand-copy strong { font-size: 16px; letter-spacing: 0.01em; }
    .brand-copy span { margin-top: 4px; color: var(--muted); font-size: 12px; }

    .nav {
      display: flex;
      align-items: center;
      gap: 4px;
      color: var(--muted);
      font-size: 14px;
    }

    .nav button {
      min-height: 40px;
      padding: 0 14px;
      border: 0;
      border-radius: 10px;
      color: inherit;
      background: transparent;
    }

    .nav button.active {
      color: var(--ink);
      background: var(--surface-soft);
      font-weight: 700;
    }

    .top-actions {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .logout-button {
      min-height: 40px;
      padding: 0 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
    }

    .sync-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 40px;
      padding: 0 13px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: #fff;
      font-size: 13px;
      white-space: nowrap;
    }

    .sync-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #16a36a;
      box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.1);
    }

    .members-button {
      min-height: 42px;
      padding: 0 16px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line-strong);
      border-radius: 11px;
      color: var(--ink);
      background: #fff;
      font-weight: 700;
    }

    .avatar {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background: #263b31;
      font-weight: 800;
    }

    .page { padding: 36px 0 56px; }

    .eyebrow {
      color: var(--accent);
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 0.11em;
      text-transform: uppercase;
    }

    .title-row {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 24px;
      margin-top: 7px;
    }

    h1 {
      margin: 0;
      color: var(--ink);
      font-size: clamp(30px, 3vw, 42px);
      line-height: 1.12;
      letter-spacing: -0.035em;
    }

    .subtitle {
      margin: 10px 0 0;
      color: var(--muted);
      font-size: 14px;
    }

    .source-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-end;
    }

    .pill {
      min-height: 32px;
      padding: 6px 11px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.74);
      font-size: 12px;
      white-space: nowrap;
    }

    .metrics {
      margin-top: 26px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .metric {
      min-height: 118px;
      padding: 20px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    .metric span { color: var(--muted); font-size: 13px; }
    .metric strong {
      display: block;
      margin-top: 8px;
      color: var(--ink);
      font-size: 30px;
      line-height: 1;
      letter-spacing: -0.04em;
    }
    .metric small { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }

    .metric-icon {
      width: 38px;
      height: 38px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 11px;
      color: var(--accent);
      background: var(--accent-soft);
    }

    .metric-icon.warning { color: var(--warning); background: var(--warning-soft); }
    .metric-icon.slate { color: #465a50; background: #edf1ee; }

    .content-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 26px;
      margin-top: 30px;
    }

    .section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }

    .section-head h2 {
      margin: 0;
      color: var(--ink);
      font-size: 19px;
      letter-spacing: -0.015em;
    }

    .section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

    .search-box {
      position: relative;
      width: min(280px, 40vw);
    }

    .search-box svg {
      position: absolute;
      left: 13px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
    }

    .search-box input {
      width: 100%;
      min-height: 44px;
      padding: 0 13px 0 40px;
      border: 1px solid var(--line-strong);
      border-radius: 12px;
      color: var(--text);
      background: #fff;
    }

    .search-box input::placeholder { color: #8a978f; }

    .category-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .category-card {
      min-height: 172px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      text-align: left;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      color: var(--text);
      background: rgba(255, 255, 255, 0.94);
      transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    }

    .category-card:hover {
      transform: translateY(-2px);
      border-color: var(--line-strong);
      box-shadow: var(--shadow);
    }

    .category-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
    }

    .category-icon {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      flex: 0 0 auto;
    }

    .tone-slate { color: #365166; background: #e9eff4; }
    .tone-amber { color: #936026; background: #f6eadc; }
    .tone-green { color: #087553; background: #e4f3eb; }
    .tone-cyan { color: #25727a; background: #e5f2f3; }
    .tone-rose { color: #924646; background: #f5e8e8; }
    .tone-sand { color: #776325; background: #f5f0dc; }
    .tone-violet { color: #6e5288; background: #f0eaf5; }

    .category-count {
      color: var(--muted);
      font-size: 12px;
      text-align: right;
    }

    .category-count strong {
      display: block;
      color: var(--ink);
      font-size: 18px;
    }

    .category-card h3 {
      margin: 15px 0 4px;
      color: var(--ink);
      font-size: 17px;
      line-height: 1.25;
      letter-spacing: -0.015em;
    }

    .category-card p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .category-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: auto;
      padding-top: 14px;
      color: var(--muted);
      font-size: 12px;
    }

    .category-footer strong { color: var(--ink); font-size: 13px; }

    .arrow {
      width: 27px;
      height: 27px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: var(--ink);
      background: var(--surface-soft);
    }

    .side-stack {
      display: grid;
      align-content: start;
      gap: 14px;
    }

    .backup-card {
      padding: 22px;
      border-radius: var(--radius);
      color: #f4faf7;
      background: #1c3329;
      box-shadow: var(--shadow);
    }

    .backup-card .card-kicker {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: #c9d9d0;
      font-size: 12px;
    }

    .live-pill {
      padding: 4px 8px;
      border: 1px solid rgba(174, 232, 205, 0.18);
      border-radius: 999px;
      color: #bce8d3;
      background: rgba(57, 143, 103, 0.22);
      font-size: 11px;
    }

    .backup-card h3 {
      margin: 16px 0 8px;
      color: #fff;
      font-size: 20px;
    }

    .backup-card p {
      margin: 0;
      color: #c0cec7;
      font-size: 13px;
      line-height: 1.65;
    }

    .backup-progress {
      height: 6px;
      margin-top: 20px;
      overflow: hidden;
      border-radius: 99px;
      background: rgba(255, 255, 255, 0.1);
    }

    .backup-progress::after {
      content: "";
      display: block;
      width: 78%;
      height: 100%;
      border-radius: inherit;
      background: #69d6a6;
    }

    .backup-times {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-top: 10px;
      color: #aabcb3;
      font-size: 11px;
    }

    .info-card {
      padding: 20px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.88);
    }

    .info-card h3 {
      margin: 0;
      color: var(--ink);
      font-size: 15px;
    }

    .info-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 12px 0;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
    }

    .info-row:last-child { padding-bottom: 0; border-bottom: 0; }
    .info-row strong { color: var(--ink); font-weight: 700; }

    .demo-note {
      margin-top: 24px;
      color: var(--muted);
      font-size: 12px;
      text-align: center;
    }

    /* Product detail */
    .breadcrumb {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 12px;
    }

    .breadcrumb button {
      padding: 0;
      border: 0;
      color: var(--accent);
      background: transparent;
      font-weight: 700;
    }

    .detail-title-row {
      margin-top: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }

    .detail-title {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .detail-title .category-icon {
      width: 48px;
      height: 48px;
      border-radius: 14px;
    }

    .detail-title h1 { font-size: 30px; line-height: 1.1; }
    .detail-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

    .permission-card {
      min-width: 205px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 9px;
      border: 1px solid #b9dfcd;
      border-radius: 12px;
      color: #20583e;
      background: var(--accent-soft);
    }

    .permission-card svg { flex: 0 0 auto; }
    .permission-card strong { display: block; font-size: 12px; }
    .permission-card span { display: block; margin-top: 1px; color: #527464; font-size: 10px; }

    .detail-toolbar {
      margin-top: 16px;
      padding: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.88);
    }

    .detail-toolbar .search-box { width: min(360px, 44vw); }
    .toolbar-spacer { flex: 1; }

    .filter-button {
      min-height: 36px;
      padding: 0 11px;
      border: 1px solid var(--line);
      border-radius: 9px;
      color: var(--text);
      background: #fff;
      font-size: 12px;
    }

    .product-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
      margin-top: 12px;
    }

    .product-card {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
      transition: transform 180ms ease, box-shadow 180ms ease;
    }

    .product-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow);
    }

    .product-photo {
      position: relative;
      aspect-ratio: 1.55 / 1;
      display: grid;
      place-items: center;
      overflow: hidden;
      background: #f7f7f5;
    }

    .product-photo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      padding: 6px;
    }

    .photo-placeholder {
      color: #8b9b92;
      font-size: 12px;
    }

    .stock-badge {
      position: absolute;
      top: 7px;
      right: 7px;
      min-height: 22px;
      padding: 3px 6px;
      border-radius: 999px;
      color: #35634e;
      background: rgba(232, 246, 238, 0.93);
      font-size: 10px;
      font-weight: 700;
      backdrop-filter: blur(8px);
    }

    .stock-badge.low { color: #8c4e0c; background: rgba(255, 239, 213, 0.94); }

    .product-body { padding: 10px; }

    .series {
      min-height: 15px;
      overflow: hidden;
      color: var(--muted);
      font-size: 10px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .product-card h3 {
      min-height: 36px;
      margin: 4px 0 9px;
      overflow: hidden;
      color: var(--ink);
      font-size: 13px;
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .stock-line {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 8px;
      padding-top: 9px;
      border-top: 1px solid var(--line);
    }

    .stock-line span { color: var(--muted); font-size: 10px; }
    .stock-line strong {
      display: block;
      color: var(--ink);
      font-size: 20px;
      line-height: 1;
      letter-spacing: -0.03em;
    }

    .edit-stock {
      min-height: 32px;
      padding: 0 9px;
      border: 0;
      border-radius: 8px;
      color: #fff;
      background: var(--accent);
      font-size: 11px;
      font-weight: 700;
    }

    .edit-stock:hover { background: var(--accent-dark); }

    @media (max-width: 1100px) {
      .topbar-inner { gap: 18px; }
      .nav { display: none; }
      .content-grid { grid-template-columns: 1fr; }
      .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .product-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
      margin-top: 12px;
    }
    }

    @media (max-width: 820px) {
      .topbar-inner, .page { width: min(100% - 32px, 1400px); }
      .sync-chip, .members-button span { display: none; }
      .topbar-inner { gap: 10px; }
      .brand { min-width: 0; }
      .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .product-grid {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
      margin-top: 12px;
    }
      .detail-title-row {
      margin-top: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }
      .permission-card {
      min-width: 205px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 9px;
      border: 1px solid #b9dfcd;
      border-radius: 12px;
      color: #20583e;
      background: var(--accent-soft);
    }
    }

    @media (max-width: 560px) {
      .page { padding-top: 24px; }
      .topbar { height: 68px; }
      .brand-copy span { display: none; }
      .title-row, .section-head { align-items: flex-start; flex-direction: column; }
      .source-pills { justify-content: flex-start; }
      .metrics, .category-grid, .product-grid, .side-stack { grid-template-columns: 1fr; }
      .search-box, .detail-toolbar .search-box { width: min(360px, 44vw); }
      .detail-toolbar {
      margin-top: 16px;
      padding: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.88);
    }
      .toolbar-spacer { display: none; }
      .detail-title h1 { font-size: 30px; line-height: 1.1; }
      .category-card { min-height: 160px; }
    }

    @media (prefers-reduced-motion: reduce) {
      * { scroll-behavior: auto !important; transition: none !important; }
    }
      .detail-toolbar .search-box input { min-height: 38px; }
    .detail-page { padding-top: 26px; padding-bottom: 34px; }
  
    .product-list-head {
      display: grid;
      grid-template-columns: 64px minmax(180px, 240px) minmax(240px, 1fr) 120px 92px;
      gap: 12px;
      align-items: center;
      padding: 2px 12px 8px;
      color: var(--muted);
      font-size: 11px;
    }

    .product-grid {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 0;
    }

    .product-card {
      display: grid;
      grid-template-columns: 64px minmax(180px, 240px) minmax(240px, 1fr) 120px 92px;
      gap: 12px;
      align-items: center;
      padding: 8px 12px;
      border-radius: 12px;
    }

    .product-card:hover {
      transform: none;
      border-color: var(--line-strong);
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 5px 16px rgba(23, 42, 32, 0.05);
    }

    .product-photo {
      width: 56px;
      height: 56px;
      aspect-ratio: auto;
      border-radius: 9px;
    }

    .product-photo img { padding: 3px; }
    .product-card .series { min-height: auto; font-size: 12px; }

    .product-card h3 {
      min-height: auto;
      margin: 0;
      font-size: 14px;
      line-height: 1.35;
      -webkit-line-clamp: 1;
    }

    .stock-cell {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 1px;
    }

    .stock-cell span { color: var(--muted); font-size: 10px; }
    .stock-cell strong {
      color: var(--ink);
      font-size: 20px;
      line-height: 1;
      letter-spacing: -0.03em;
    }

    .product-card .edit-stock {
      justify-self: end;
      width: 100%;
      max-width: 88px;
      min-height: 34px;
    }

    @media (max-width: 820px) {
      .product-list-head { display: none; }
      .product-grid { gap: 8px; }
      .product-card {
        grid-template-columns: 52px minmax(0, 1fr) 78px 76px;
        grid-template-areas:
          "photo series stock action"
          "photo name stock action";
        row-gap: 2px;
        padding: 8px 10px;
      }
      .product-photo { grid-area: photo; width: 44px; height: 44px; }
      .product-card .series { grid-area: series; }
      .product-card h3 { grid-area: name; }
      .stock-cell { grid-area: stock; }
      .product-card .edit-stock { grid-area: action; }
    }

    @media (max-width: 560px) {
      .product-card {
        grid-template-columns: 44px minmax(0, 1fr) 68px;
        grid-template-areas:
          "photo series stock"
          "photo name action";
      }
      .product-card .edit-stock { max-width: 64px; padding: 0 6px; font-size: 10px; }
    }
  
    .product-photo {
      background: #ffffff;
      border-radius: 0;
    }

    .product-photo img {
      background: #ffffff;
      padding: 0;
    }
  
    .quantity-group {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .quantity-cell {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1px;
      min-width: 0;
    }

    .quantity-cell span { color: var(--muted); font-size: 10px; }
    .quantity-cell strong {
      color: var(--ink);
      font-size: 20px;
      line-height: 1;
      letter-spacing: -0.03em;
      font-variant-numeric: tabular-nums;
    }

    .quantity-cell.has-pending strong { color: #9a6114; }
    .quantity-cell.has-purchase strong { color: var(--accent); }
    .quantity-cell.has-negative-stock strong { color: var(--danger); }
    .quantity-cell.has-negative-stock span::after {
      content: " · 需立即采购";
      color: var(--danger);
      font-style: normal;
      font-weight: 700;
    }

    .detail-page .product-card {
      grid-template-columns: 64px minmax(160px, 210px) minmax(180px, 1fr) minmax(300px, 340px) 92px;
    }

    .purchase-page {
      padding-top: 28px;
    }

    .purchase-title-row { align-items: flex-start; }

    .purchase-summary {
      display: flex;
      gap: 8px;
    }

    .purchase-summary span {
      min-height: 38px;
      padding: 6px 11px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--muted);
      background: #fff;
      font-size: 11px;
    }

    .purchase-summary strong {
      color: var(--ink);
      font-size: 16px;
      font-variant-numeric: tabular-nums;
    }

    .purchase-flow {
      margin-top: 18px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.8);
      font-size: 12px;
    }

    .purchase-flow span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .purchase-flow strong {
      width: 20px;
      height: 20px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background: var(--accent);
      font-size: 10px;
    }

    .purchase-flow i {
      width: 34px;
      height: 1px;
      background: var(--line-strong);
    }

    .purchase-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 12px;
    }

    .purchase-row {
      display: grid;
      grid-template-columns: minmax(230px, 1fr) 300px minmax(360px, 1.1fr);
      gap: 14px;
      align-items: center;
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
    }

    .purchase-product {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .purchase-product .product-photo {
      width: 48px;
      height: 48px;
      flex: 0 0 48px;
    }

    .purchase-meta { min-width: 0; }
    .purchase-meta h3 {
      margin: 0;
      overflow: hidden;
      color: var(--ink);
      font-size: 14px;
      line-height: 1.35;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .purchase-meta span {
      display: block;
      margin-top: 3px;
      overflow: hidden;
      color: var(--muted);
      font-size: 10px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .unit-price-button {
      min-height: 28px;
      margin-top: 3px;
      padding: 0 8px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: 1px solid var(--line);
      border-radius: 7px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 9px;
    }

    .purchase-meta .unit-price-button span {
      display: inline;
      margin: 0;
      overflow: visible;
      color: var(--muted);
      font-size: 9px;
    }

    .unit-price-button strong {
      color: var(--accent-dark);
      font-family: "Consolas", "Cascadia Mono", "SFMono-Regular", monospace;
      font-size: 10px;
      font-variant-numeric: tabular-nums;
    }

    .unit-price-button:hover strong {
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .unit-price-button:hover {
      border-color: var(--line-strong);
      background: var(--surface);
    }

    .unit-price-modal {
      width: min(460px, 100%);
    }

    .purchase-controls {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .purchase-control {
      min-width: 0;
      padding: 5px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: var(--surface-soft);
    }

    .purchase-control label {
      display: block;
      margin-bottom: 4px;
      color: var(--muted);
      font-size: 9px;
      white-space: nowrap;
    }

    .purchase-control-line {
      display: flex;
      gap: 3px;
    }

    .purchase-control input {
      width: 100%;
      min-width: 0;
      height: 30px;
      padding: 0 6px;
      border: 1px solid var(--line-strong);
      border-radius: 7px;
      color: var(--text);
      background: #fff;
      font-size: 11px;
    }

    .purchase-control button {
      min-width: 36px;
      height: 30px;
      padding: 0 6px;
      border: 0;
      border-radius: 7px;
      color: #fff;
      background: var(--accent);
      font-size: 10px;
      font-weight: 700;
    }

    .app-toast {
      position: fixed;
      left: 50%;
      top: 88px;
      bottom: auto;
      z-index: 700;
      max-width: calc(100vw - 32px);
      min-height: 52px;
      padding: 10px 16px 10px 10px;
      display: flex;
      align-items: center;
      gap: 10px;
      transform: translate(-50%, -10px);
      border: 1px solid #d8e3dc;
      border-radius: 12px;
      color: #173d2b;
      background: #fff;
      box-shadow: 0 14px 34px rgba(15, 42, 28, 0.18);
      font-size: 13px;
      font-weight: 700;
      opacity: 0;
      transition: opacity 180ms ease, transform 180ms ease;
    }

    .app-toast.visible { opacity: 1; transform: translate(-50%, 0); }

    .app-toast-icon {
      flex: 0 0 30px;
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background: #22a564;
    }

    .app-toast.error .app-toast-icon {
      background: var(--danger);
    }

    .app-toast.info .app-toast-icon {
      background: #4f739d;
    }

    .app-toast.error { border-color: #efc7c7; color: #8d2929; background: #fff; }
    .app-toast.info { border-color: #d8e3dc; color: #29465f; background: #fff; }

    @media (max-width: 1100px) {
      .purchase-row {
        grid-template-columns: minmax(210px, 1fr) 270px minmax(330px, 1fr);
      }
      .detail-page .product-card {
        grid-template-columns: 64px minmax(140px, 190px) minmax(160px, 1fr) 280px 84px;
      }
    }

    @media (max-width: 820px) {
      .detail-page .product-card {
        grid-template-columns: 52px minmax(0, 1fr) 88px;
        grid-template-areas:
          "photo series action"
          "photo name action"
          "quantities quantities quantities";
      }
      .detail-page .quantity-group { grid-area: quantities; margin-top: 4px; }
      .purchase-summary { flex-wrap: wrap; }
      .purchase-row {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      .purchase-flow { overflow-x: auto; white-space: nowrap; }
    }

    @media (max-width: 560px) {
      .quantity-cell strong { font-size: 17px; }
      .purchase-controls { gap: 4px; }
      .purchase-control { padding: 4px; }
      .purchase-control button { min-width: 32px; }
      .purchase-summary { width: 100%; }
    }
  
    .detail-page .product-card {
      grid-template-columns: 64px minmax(160px, 210px) minmax(180px, 1fr) minmax(300px, 340px) 216px;
    }

    .product-actions {
      width: 100%;
      max-width: 216px;
      justify-self: end;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 4px;
    }

    .row-action {
      min-height: 34px;
      padding: 0 5px;
      border-radius: 8px;
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
    }

    .row-action.arrival {
      border: 1px solid #a9d5c0;
      color: #176144;
      background: #edf8f2;
    }

    .row-action.inspection {
      border: 1px solid var(--accent);
      color: #fff;
      background: var(--accent);
    }

    .row-action.neutral {
      border: 1px solid var(--line-strong);
      color: var(--text);
      background: #fff;
    }

    .purchase-row {
      grid-template-columns: minmax(230px, 1fr) 300px 92px;
    }

    .purchase-entry {
      min-height: 36px;
      padding: 0 14px;
      border: 0;
      border-radius: 9px;
      color: #fff;
      background: var(--accent);
      font-size: 12px;
      font-weight: 700;
    }

    .quantity-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 200;
      padding: 20px;
      display: grid;
      place-items: center;
      background: rgba(14, 27, 21, 0.46);
      backdrop-filter: blur(4px);
    }

    .quantity-modal {
      width: min(420px, 100%);
      padding: 24px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: #fff;
      box-shadow: 0 24px 70px rgba(12, 31, 21, 0.24);
    }

    .quantity-modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
    }

    .quantity-modal-head h2 {
      margin: 5px 0 0;
      color: var(--ink);
      font-size: 26px;
      letter-spacing: -0.03em;
    }

    .quantity-modal-head p {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 12px;
    }

    .modal-close {
      width: 34px;
      height: 34px;
      flex: 0 0 34px;
      border: 1px solid var(--line);
      border-radius: 9px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 20px;
      line-height: 1;
    }

    .modal-context {
      margin-top: 18px;
      padding: 9px 11px;
      border-radius: 9px;
      color: #3f6252;
      background: var(--accent-soft);
      font-size: 11px;
    }

    .modal-field {
      display: block;
      margin-top: 16px;
    }

    .modal-field span {
      display: block;
      margin-bottom: 7px;
      color: var(--ink);
      font-size: 13px;
      font-weight: 700;
    }

    .modal-field input {
      width: 100%;
      height: 46px;
      padding: 0 13px;
      border: 1px solid var(--line-strong);
      border-radius: 10px;
      color: var(--text);
      background: #fff;
      font-size: 16px;
    }

    .inspection-quantity-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .inspection-quantity-grid .modal-field { margin-top: 16px; }

    .modal-hint {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 11px;
    }

    .modal-actions {
      margin-top: 20px;
      display: grid;
      grid-template-columns: 1fr 1.4fr;
      gap: 8px;
    }

    .modal-actions button {
      min-height: 42px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 700;
    }

    .modal-cancel {
      border: 1px solid var(--line-strong);
      color: var(--text);
      background: #fff;
    }

    .modal-confirm {
      border: 0;
      color: #fff;
      background: var(--accent);
    }

    @media (max-width: 1100px) {
      .detail-page .product-card {
        grid-template-columns: 64px minmax(140px, 190px) minmax(160px, 1fr) 280px 210px;
      }
      .purchase-row {
        grid-template-columns: minmax(210px, 1fr) 270px 88px;
      }
    }

    @media (max-width: 820px) {
      .detail-page .product-card {
        grid-template-columns: 52px minmax(0, 1fr) 196px;
        grid-template-areas:
          "photo series actions"
          "photo name actions"
          "quantities quantities quantities";
      }
      .product-actions { grid-area: actions; max-width: 196px; }
      .detail-page .quantity-group { grid-area: quantities; margin-top: 4px; }
      .row-action { min-height: 40px; }
      .purchase-row {
        grid-template-columns: 1fr 230px 82px;
      }
    }

    @media (max-width: 560px) {
      .detail-page .product-card {
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-areas:
          "photo series"
          "photo name"
          "quantities quantities"
          "actions actions";
      }
      .product-actions { max-width: none; }
      .purchase-row {
        grid-template-columns: 1fr;
        gap: 8px;
      }
      .purchase-entry { width: 100%; }
      .quantity-modal { padding: 20px; }
    }
  
    .purchase-series-list {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 14px;
    }

    .purchase-series-group {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
    }

    .purchase-series-head {
      min-height: 66px;
      padding: 11px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      border-bottom: 1px solid var(--line);
      background: #f7faf8;
    }

    .series-category {
      display: block;
      color: var(--muted);
      font-size: 10px;
    }

    .purchase-series-head h2 {
      margin: 2px 0 0;
      color: var(--ink);
      font-size: 16px;
      letter-spacing: -0.015em;
    }

    .purchase-series-head p {
      margin: 2px 0 0;
      color: var(--muted);
      font-size: 10px;
    }

    .series-submit {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .series-submit [data-series-filled] {
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
    }

    .series-submit button {
      min-height: 36px;
      padding: 0 15px;
      border: 0;
      border-radius: 9px;
      color: #fff;
      background: var(--accent);
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .purchase-series-rows .purchase-row {
      grid-template-columns: minmax(230px, 1fr) 300px 104px;
      border: 0;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      padding: 8px 14px;
    }

    .purchase-series-rows .purchase-row:last-child { border-bottom: 0; }

    .batch-input {
      display: grid;
      gap: 4px;
    }

    .batch-input span {
      color: var(--muted);
      font-size: 9px;
    }

    .batch-input input {
      width: 100%;
      height: 34px;
      padding: 0 8px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: #fff;
      font-size: 12px;
    }

    @media (max-width: 820px) {
      .purchase-series-head {
        align-items: flex-start;
        flex-direction: column;
      }
      .series-submit { width: 100%; justify-content: space-between; }
      .purchase-series-rows .purchase-row {
        grid-template-columns: 1fr 230px 92px;
      }
    }

    @media (max-width: 560px) {
      .purchase-series-rows .purchase-row {
        grid-template-columns: 1fr;
      }
      .batch-input input { height: 40px; }
    }
  
    .series-switcher {
      margin-top: 18px;
      padding: 6px;
      display: flex;
      gap: 6px;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.84);
      scrollbar-width: thin;
    }

    .series-tab {
      min-height: 38px;
      padding: 0 11px 0 14px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex: 0 0 auto;
      border: 0;
      border-radius: 9px;
      color: var(--muted);
      background: transparent;
      font-size: 12px;
      white-space: nowrap;
    }

    .series-tab:hover { background: var(--surface-soft); }

    .series-tab.active {
      color: var(--ink);
      background: #fff;
      box-shadow: 0 2px 8px rgba(23, 42, 32, 0.08);
      font-weight: 700;
    }

    .series-tab small {
      min-width: 20px;
      height: 20px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 9px;
      font-weight: 700;
    }

    .series-tab.active small {
      color: #fff;
      background: var(--accent);
    }

    .purchase-series-group[hidden] { display: none; }

    @media (max-width: 820px) {
      .series-switcher {
        margin-top: 14px;
        padding-bottom: 8px;
      }
    }
  
    .undo-button,
    .redo-button {
      min-height: 40px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--text);
      background: #fff;
      font-size: 12px;
      font-weight: 700;
    }

    .undo-button:disabled,
    .redo-button:disabled {
      cursor: not-allowed;
      opacity: 0.4;
    }

    @media (max-width: 820px) {
      .undo-button,
      .redo-button { padding: 0 10px; }
      .undo-button span,
      .redo-button span { display: none; }
    }
  
    .records-page { padding-top: 28px; }

    .record-date-list {
      margin-top: 18px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .record-date-group {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.92);
    }

    .record-date-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--line);
    }

    .record-date-head span,
    .record-series-head span {
      color: var(--muted);
      font-size: 10px;
    }

    .record-date-head h2 {
      margin: 3px 0 0;
      color: var(--ink);
      font-size: 21px;
      letter-spacing: -0.025em;
    }

    .record-date-head p,
    .record-series-head p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
    }

    .record-series-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 12px;
    }

    .record-series-group {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 12px;
    }

    .record-series-head {
      min-height: 52px;
      padding: 9px 12px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 190px 170px;
      align-items: center;
      gap: 12px;
      background: #f7faf8;
    }

    .record-series-head > div:first-child {
      min-width: 0;
    }

    .record-series-head > p {
      justify-self: end;
      text-align: right;
    }

    .record-series-head h3 {
      margin: 2px 0 0;
      color: var(--ink);
      font-size: 14px;
    }

    .record-rows { display: flex; flex-direction: column; }

    .record-row {
      min-height: 52px;
      padding: 7px 12px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 100px 78px;
      align-items: center;
      gap: 12px;
      border-top: 1px solid var(--line);
    }

    .record-row:first-child { border-top: 0; }

    .record-product {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 9px;
    }

    .record-product strong {
      overflow: hidden;
      color: var(--ink);
      font-size: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .record-thumb {
      width: 34px;
      height: 34px;
      flex: 0 0 34px;
      overflow: hidden;
      background: #fff;
    }

    .record-thumb img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .record-row time {
      color: var(--muted);
      font-size: 11px;
      font-variant-numeric: tabular-nums;
    }

    .record-quantity {
      display: flex;
      align-items: baseline;
      justify-content: flex-end;
      gap: 3px;
    }

    .record-quantity strong {
      color: var(--ink);
      font-size: 18px;
      font-variant-numeric: tabular-nums;
    }

    .record-quantity span { color: var(--muted); font-size: 10px; }

    .records-empty {
      margin-top: 20px;
      padding: 46px 24px;
      text-align: center;
      border: 1px dashed var(--line-strong);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.72);
    }

    .records-empty h2 { margin: 0; color: var(--ink); font-size: 18px; }
    .records-empty p { margin: 7px 0 16px; color: var(--muted); font-size: 12px; }
    .records-empty button {
      min-height: 38px;
      padding: 0 14px;
      border: 0;
      border-radius: 9px;
      color: #fff;
      background: var(--accent);
      font-size: 12px;
      font-weight: 700;
    }

    @media (max-width: 820px) {
      .record-date-head { align-items: flex-start; flex-direction: column; }
      .record-row { grid-template-columns: minmax(0, 1fr) 82px 68px; }
    }

    @media (max-width: 560px) {
      .record-row { grid-template-columns: minmax(0, 1fr) 68px; }
      .record-row time { grid-column: 1; font-size: 10px; }
      .record-quantity { grid-column: 2; grid-row: 1 / span 2; }
    }
  
    .record-date-group > summary,
    .record-series-group > summary {
      list-style: none;
      cursor: pointer;
    }

    .record-date-group > summary::-webkit-details-marker,
    .record-series-group > summary::-webkit-details-marker,
    .record-more > summary::-webkit-details-marker {
      display: none;
    }

    .record-date-head,
    .record-series-head {
      position: relative;
      padding-right: 34px;
    }

    .record-toggle {
      position: absolute;
      right: 12px;
      top: 50%;
      width: 8px;
      height: 8px;
      border-right: 1.5px solid var(--muted);
      border-bottom: 1.5px solid var(--muted);
      transform: translateY(-65%) rotate(45deg);
      transition: transform 180ms ease;
    }

    .record-date-group[open] > .record-date-head .record-toggle,
    .record-series-group[open] > .record-series-head .record-toggle {
      transform: translateY(-35%) rotate(225deg);
    }

    .record-row {
      grid-template-columns: minmax(0, 1fr) 100px 78px 110px 48px;
    }

    .record-price {
      min-width: 0;
      display: grid;
      justify-items: end;
      gap: 2px;
    }

    .record-price strong {
      color: var(--ink);
      font-family: "Consolas", "Cascadia Mono", "SFMono-Regular", monospace;
      font-size: 14px;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .record-price span {
      color: var(--muted);
      font-size: 9px;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .record-edit {
      min-height: 30px;
      padding: 0 7px;
      border: 1px solid var(--line-strong);
      border-radius: 7px;
      color: var(--text);
      background: #fff;
      font-size: 10px;
      font-weight: 700;
    }

    .record-more {
      border-top: 1px solid var(--line);
    }

    .record-more > summary {
      min-height: 38px;
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      background: #fbfdfc;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }

    .record-more .more-open { display: none; }
    .record-more[open] .more-collapsed { display: none; }
    .record-more[open] .more-open { display: inline; }
    .record-more[open] > summary { border-bottom: 1px solid var(--line); }

    @media (max-width: 820px) {
      .record-row { grid-template-columns: minmax(0, 1fr) 82px 68px 96px 48px; }
    }

    @media (max-width: 560px) {
      .record-row {
        grid-template-columns: minmax(0, 1fr) 70px 86px;
        grid-template-areas:
          "product quantity price"
          "time quantity edit";
      }
      .record-product { grid-area: product; }
      .record-row time { grid-area: time; font-size: 10px; }
      .record-quantity { grid-area: quantity; justify-self: end; }
      .record-price { grid-area: price; }
      .record-edit { grid-area: edit; }
    }
  
    .records-calendar-layout {
      margin-top: 18px;
      display: grid;
      grid-template-columns: 390px minmax(0, 1fr);
      gap: 16px;
      align-items: start;
    }

    .calendar-card,
    .selected-records-panel {
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.94);
    }

    .calendar-card { padding: 16px; }

    .calendar-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .calendar-arrow {
      width: 34px;
      height: 34px;
      flex: 0 0 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--ink);
      background: #fff;
      font-size: 19px;
      line-height: 1;
    }

    .calendar-selects {
      flex: 1;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .calendar-selects select {
      min-width: 0;
      height: 34px;
      padding: 0 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--text);
      background: #fff;
      font-size: 12px;
    }

    .calendar-selection-box {
      min-height: 42px;
      margin-top: 12px;
      padding: 7px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid #b9dfcd;
      border-radius: 10px;
      color: #35634e;
      background: var(--accent-soft);
    }

    .calendar-selection-box span { font-size: 10px; }
    .calendar-selection-box strong { font-size: 13px; }

    .calendar-weekdays,
    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 5px;
    }

    .calendar-weekdays {
      margin-top: 14px;
      color: var(--muted);
      font-size: 9px;
      text-align: center;
    }

    .calendar-grid { margin-top: 6px; }

    .calendar-day {
      position: relative;
      min-height: 42px;
      padding: 0;
      display: grid;
      place-items: center;
      border: 1px solid transparent;
      border-radius: 9px;
      color: var(--text);
      background: transparent;
      font-size: 12px;
    }

    .calendar-day.is-empty { pointer-events: none; }

    .calendar-day.has-records {
      border-color: #83c8a8;
      color: #176548;
      background: #f4fbf7;
      font-weight: 700;
      box-shadow: inset 0 0 0 1px rgba(8, 122, 85, 0.06);
    }

    .calendar-day.has-records small {
      position: absolute;
      top: 3px;
      right: 4px;
      min-width: 14px;
      height: 14px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      color: #fff;
      background: var(--accent);
      font-size: 8px;
      line-height: 1;
    }

    .calendar-day.is-selected {
      border-color: var(--accent);
      color: #fff;
      background: var(--accent);
      box-shadow: 0 0 0 3px rgba(8, 122, 85, 0.13);
    }

    .calendar-day.is-selected small {
      color: var(--accent);
      background: #fff;
    }

    .calendar-legend {
      margin: 12px 0 0;
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 9px;
    }

    .calendar-legend i {
      width: 10px;
      height: 10px;
      border: 1px solid #83c8a8;
      border-radius: 3px;
      background: #f4fbf7;
    }

    .selected-records-panel {
      overflow: hidden;
      min-height: 420px;
    }

    .selected-records-head {
      min-height: 76px;
      padding: 14px 47px 14px 24px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 190px 170px;
      align-items: center;
      column-gap: 12px;
      border-bottom: 1px solid var(--line);
      background: #f9fbfa;
    }

    .selected-records-head span {
      color: var(--muted);
      font-size: 10px;
    }

    .selected-records-head h2 {
      margin: 3px 0 0;
      color: var(--ink);
      font-size: 19px;
    }

    .selected-records-head p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      text-align: right;
      white-space: nowrap;
    }

    .record-price-summary {
      display: grid;
      grid-template-columns: 48px max-content;
      align-items: baseline;
      gap: 8px;
      justify-self: start;
      white-space: nowrap;
    }

    .record-price-summary > span {
      font-weight: 700;
      letter-spacing: 0.03em;
    }

    .record-price-summary > strong {
      color: var(--ink);
      font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
      font-variant-numeric: tabular-nums;
    }

    .record-price-summary > small {
      grid-column: 2;
      color: var(--warning);
      font-size: 9px;
      font-weight: 700;
    }

    .record-date-total > strong {
      font-size: 18px;
    }

    .record-series-total > strong {
      font-size: 14px;
    }

    .selected-series-list {
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .selected-day-empty {
      min-height: 320px;
      padding: 24px;
      display: grid;
      align-content: center;
      justify-items: center;
      text-align: center;
    }

    .selected-day-empty h3 { margin: 0; color: var(--ink); font-size: 16px; }
    .selected-day-empty p { margin: 7px 0 15px; color: var(--muted); font-size: 11px; }
    .selected-day-empty button {
      min-height: 36px;
      padding: 0 13px;
      border: 0;
      border-radius: 9px;
      color: #fff;
      background: var(--accent);
      font-size: 11px;
      font-weight: 700;
    }

    @media (max-width: 980px) {
      .records-calendar-layout { grid-template-columns: 1fr; }
      .calendar-card { max-width: none; }
    }

    @media (max-width: 560px) {
      .calendar-card { padding: 12px; }
      .calendar-day { min-height: 38px; }
      .selected-records-head {
        padding: 14px;
        grid-template-columns: 1fr;
        align-items: start;
        row-gap: 7px;
      }
      .selected-records-head p { text-align: left; }
      .record-series-head {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 6px;
      }
      .record-series-head > p {
        grid-column: 1 / -1;
        justify-self: start;
      }
    }
  
    .primary-page-action {
      min-height: 40px;
      padding: 0 16px;
      border: 0;
      border-radius: 10px;
      color: #fff;
      background: var(--accent);
      font-size: 12px;
      font-weight: 700;
    }

    .management-title-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .secondary-page-action {
      min-height: 40px;
      padding: 0 16px;
      border: 1px solid var(--line-strong);
      border-radius: 10px;
      color: var(--text);
      background: var(--surface);
      font-size: 12px;
      font-weight: 700;
    }

    .combo-grid {
      margin-top: 18px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .combo-card {
      padding: 12px;
      display: grid;
      grid-template-columns: 92px minmax(0, 1fr);
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.92);
    }

    .combo-card-media,
    .management-product-thumb,
    .image-preview {
      overflow: hidden;
      display: grid;
      place-items: center;
      color: var(--muted);
      background: #F8FAFC;
    }

    .combo-card-media {
      min-height: 92px;
      border-radius: 10px;
      aspect-ratio: 1;
    }

    .combo-card-media img,
    .management-product-thumb img,
    .image-preview img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .combo-card-media span,
    .management-product-thumb span,
    .image-preview span {
      font-size: 9px;
    }

    .combo-card-body { min-width: 0; }

    .combo-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .combo-card-head span {
      color: var(--muted);
      font-size: 10px;
    }

    .combo-card-head h2 {
      margin: 4px 0 0;
      color: var(--ink);
      font-size: 17px;
    }

    .combo-card-head > strong {
      color: var(--accent);
      font-size: 13px;
      white-space: nowrap;
    }

    .combo-parts {
      margin-top: 14px;
      padding-top: 12px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      border-top: 1px solid var(--line);
    }

    .combo-parts span {
      padding: 4px 7px;
      border-radius: 7px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 10px;
    }

    .combo-parts strong { color: var(--ink); }

    .combo-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 220;
      padding: 20px;
      display: grid;
      place-items: center;
      background: rgba(14, 27, 21, 0.46);
      backdrop-filter: blur(4px);
    }

    .combo-modal {
      width: min(720px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      padding: 24px;
      border-radius: 18px;
      background: #fff;
      box-shadow: 0 24px 70px rgba(12, 31, 21, 0.24);
    }

    .combo-form-grid {
      margin-top: 18px;
      display: grid;
      grid-template-columns: 1.4fr 1fr;
      gap: 10px;
    }

    .combo-form-wide { grid-column: 1 / -1; }

    .combo-form-grid label span,
    .combo-components-head > span {
      display: block;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 10px;
    }

    .combo-sku-editor {
      min-width: 0;
    }

    .combo-sku-head {
      min-height: 22px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
    }

    .combo-sku-head > span {
      color: var(--muted);
      font-size: 10px;
    }

    .combo-sku-head button,
    .combo-sku-row button {
      min-height: 26px;
      padding: 0 8px;
      border: 1px solid var(--line-strong);
      border-radius: 7px;
      color: var(--accent-dark);
      background: var(--surface);
      font-size: 10px;
      font-weight: 700;
    }

    .combo-sku-list {
      display: grid;
      gap: 6px;
    }

    .combo-sku-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
    }

    .combo-sku-row button {
      min-height: 38px;
      color: var(--danger);
    }

    .combo-form-grid input,
    .combo-component-row select,
    .combo-component-row input {
      width: 100%;
      height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: #fff;
      font-size: 12px;
    }

    .image-upload-control {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .image-preview {
      flex: 0 0 72px;
      width: 72px;
      height: 72px;
      border-radius: 10px;
      aspect-ratio: 1;
    }

    .image-upload-control input[type="file"] {
      min-width: 0;
      width: 100%;
      height: 44px;
      padding: 5px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
    }

    .image-upload-actions {
      min-width: 0;
      flex: 1;
      display: grid;
      gap: 8px;
      justify-items: start;
    }

    .image-remove-button {
      min-height: 44px;
      padding: 0 12px;
      border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
      border-radius: 8px;
      color: var(--danger);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }

    .image-remove-button:hover {
      background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    }

    .image-remove-button:focus-visible {
      outline: 2px solid var(--danger);
      outline-offset: 2px;
    }

    .combo-components-head {
      margin-top: 18px;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
    }

    .combo-components-head button {
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: #fff;
      font-size: 11px;
    }

    .combo-component-list {
      margin-top: 7px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .combo-components-empty {
      margin: 0;
      padding: 22px 14px;
      border: 1px dashed var(--line-strong);
      border-radius: 10px;
      color: var(--muted);
      text-align: center;
      background: var(--surface-soft);
    }

    .combo-component-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 88px 54px;
      gap: 6px;
      align-items: center;
    }

    .combo-component-name {
      min-width: 0;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: var(--surface-soft);
    }

    .combo-component-name strong,
    .combo-component-name span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .combo-component-name strong {
      color: var(--ink);
      font-size: 12px;
    }

    .combo-component-name span {
      margin-top: 2px;
      color: var(--muted);
      font-size: 10px;
    }

    .combo-component-row button {
      border: 1px solid #efcaca;
      border-radius: 8px;
      color: var(--danger);
      background: #fff6f6;
      font-size: 10px;
    }

    .combo-modal-actions { margin-top: 22px; }

    .combo-product-picker-backdrop {
      position: fixed;
      inset: 0;
      z-index: 260;
      padding: 20px;
      display: grid;
      place-items: center;
      background: rgba(14, 27, 21, 0.46);
      backdrop-filter: blur(4px);
    }

    .combo-product-picker {
      width: min(920px, 100%);
      max-height: calc(100vh - 40px);
      padding: 24px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-radius: 18px;
      background: #fff;
      box-shadow: 0 24px 70px rgba(12, 31, 21, 0.24);
    }

    .combo-product-picker-note {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 11px;
    }

    .combo-picker-filter {
      margin-top: 14px;
    }

    .combo-picker-filter > span {
      display: block;
      margin-bottom: 7px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }

    .combo-picker-options {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }

    .combo-picker-options button {
      min-height: 38px;
      padding: 0 13px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      cursor: pointer;
    }

    .combo-picker-options button.active {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
      font-weight: 800;
    }

    .combo-picker-options button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .combo-picker-product-list {
      min-height: 180px;
      margin-top: 14px;
      padding: 10px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-content: start;
      gap: 8px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--surface-soft);
    }

    .combo-picker-product {
      min-height: 58px;
      padding: 9px 11px;
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr) auto;
      align-items: center;
      gap: 9px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--text);
      background: var(--surface);
      cursor: pointer;
    }

    .combo-picker-product:has(input:checked) {
      border-color: var(--accent);
      background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    }

    .combo-picker-product.is-existing {
      cursor: not-allowed;
      opacity: 0.58;
    }

    .combo-picker-product input {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
    }

    .combo-picker-product-copy {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .combo-picker-product-copy strong {
      overflow: hidden;
      color: var(--ink);
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .combo-picker-product-copy span,
    .combo-picker-product-status {
      color: var(--muted);
      font-size: 10px;
    }

    .combo-picker-product-status {
      white-space: nowrap;
    }

    .combo-picker-footer {
      margin-top: 16px;
      padding-top: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-top: 1px solid var(--line);
    }

    .combo-picker-footer > span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .combo-picker-footer > div {
      display: flex;
      gap: 8px;
    }

    .combo-picker-footer button {
      min-height: 42px;
      padding: 0 16px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      font-size: 12px;
      font-weight: 700;
    }

    .combo-picker-footer .modal-confirm {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
    }

    .combo-picker-footer button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

    @media (max-width: 820px) {
      .combo-grid { grid-template-columns: 1fr; }
      .combo-form-grid { grid-template-columns: 1fr; }
      .combo-form-wide { grid-column: auto; }
      .combo-picker-product-list { grid-template-columns: 1fr; }
    }
  
    .inventory-quantity-group { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .quantity-group.no-inspection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .purchase-row .quantity-group.no-inspection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quantity-cell.has-packed strong { color: #47647a; }

    .shipment-empty {
      margin-top: 20px;
      padding: 54px 24px;
      text-align: center;
      border: 1px dashed var(--line-strong);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.75);
    }

    .shipment-empty h2 { margin: 0; color: var(--ink); font-size: 19px; }
    .shipment-empty p { margin: 7px 0 16px; color: var(--muted); font-size: 12px; }
    .shipment-empty button {
      min-height: 38px;
      padding: 0 14px;
      border: 0;
      border-radius: 9px;
      color: #fff;
      background: var(--accent);
      font-size: 12px;
      font-weight: 700;
    }

    .shipment-summary {
      margin-top: 16px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .shipment-summary span {
      min-height: 38px;
      padding: 7px 11px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: var(--muted);
      background: #fff;
      font-size: 11px;
    }

    .shipment-summary strong { color: var(--ink); font-size: 16px; }

    .country-tabs {
      margin-top: 14px;
      padding: 6px;
      display: flex;
      gap: 6px;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.84);
    }

    .country-tab {
      min-width: 112px;
      min-height: 48px;
      padding: 6px 12px;
      display: grid;
      flex: 0 0 auto;
      border: 0;
      border-radius: 9px;
      color: var(--muted);
      background: transparent;
      text-align: left;
    }

    .country-tab span { color: var(--ink); font-size: 13px; font-weight: 700; }
    .country-tab small { margin-top: 2px; font-size: 9px; }

    .country-tab.active {
      color: #fff;
      background: var(--accent);
      box-shadow: 0 4px 12px rgba(8, 122, 85, 0.16);
    }

    .country-tab.active span { color: #fff; }

    .shipment-country-panel {
      margin-top: 12px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
    }

    .shipment-country-head {
      position: relative;
      min-height: 64px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      border: 0;
      border-bottom: 1px solid var(--line);
      background: #f8faf9;
      color: inherit;
      cursor: pointer;
      transition: background-color 160ms ease, box-shadow 160ms ease;
    }

    .shipment-country-head:hover { background: var(--surface); }
    .shipment-country-toggle {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      border: 0;
      border-radius: inherit;
      background: transparent;
      cursor: pointer;
    }
    .shipment-country-toggle:focus-visible {
      outline: none;
      box-shadow: inset 0 0 0 3px rgba(8, 122, 85, 0.22);
    }

    .shipment-country-summary {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
    .shipment-country-head h2 { margin: 2px 0 0; color: var(--ink); font-size: 17px; }
    .shipment-country-head p { margin: 0; color: var(--muted); font-size: 11px; }
    .shipment-panel-toggle-copy { color: var(--muted); font-size: 10px; font-weight: 700; }
    .shipment-panel-chevron {
      width: 8px;
      height: 8px;
      border-right: 1.5px solid var(--muted);
      border-bottom: 1.5px solid var(--muted);
      transform: rotate(225deg);
      transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    .shipment-country-panel.is-collapsed .shipment-panel-chevron { transform: rotate(45deg); }

    .shipment-country-content {
      display: grid;
      grid-template-rows: 1fr;
      opacity: 1;
      transition:
        grid-template-rows 260ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 180ms ease;
    }
    .shipment-country-panel.is-collapsed .shipment-country-content {
      grid-template-rows: 0fr;
      opacity: 0;
    }
    .shipment-country-body {
      min-height: 0;
      overflow: hidden;
    }

    .shipment-action-bar {
      min-height: 48px;
      padding: 7px 12px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      border-bottom: 1px solid var(--line);
      background: #fbfdfc;
    }

    .shipment-action-bar > span { margin-right: auto; color: var(--muted); font-size: 11px; }
    .shipment-action-bar > span strong { color: var(--ink); }

    .shipment-action-bar button {
      min-height: 32px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: #fff;
      font-size: 10px;
      font-weight: 700;
    }

    .shipment-action-bar button:first-of-type {
      border-color: var(--accent);
      color: #fff;
      background: var(--accent);
    }

    .shipment-action-bar button:disabled { cursor: not-allowed; opacity: 0.4; }

    .shipment-table-head,
    .shipment-row {
      display: grid;
      grid-template-columns: 30px minmax(190px, 1fr) 78px 78px 78px 86px minmax(190px, auto);
      gap: 10px;
      align-items: center;
    }

    .shipment-table-head {
      min-height: 34px;
      padding: 0 13px;
      color: var(--muted);
      background: #f2f5f3;
      font-size: 9px;
    }

    .shipment-table-head > span:nth-child(3),
    .shipment-table-head > span:nth-child(4),
    .shipment-table-head > span:nth-child(5) {
      text-align: right;
      padding-right: 15px;
    }

    .shipment-table-head > span:nth-child(6) {
      text-align: center;
    }

    .shipment-item { border-top: 1px solid var(--line); }
    .shipment-item:first-of-type { border-top: 0; }

    .shipment-row {
      min-height: 54px;
      padding: 7px 13px;
    }

    .shipment-row input[type="checkbox"] {
      width: 15px;
      height: 15px;
      accent-color: var(--accent);
    }

    .shipment-product { min-width: 0; }
    .shipment-product strong {
      display: block;
      overflow: hidden;
      color: var(--ink);
      font-size: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .shipment-product span { color: var(--muted); font-size: 10px; }

    .shipment-quantity {
      display: flex;
      align-items: baseline;
      justify-content: flex-end;
      gap: 3px;
    }
    .shipment-quantity strong { color: var(--ink); font-size: 18px; }
    .shipment-quantity span { color: var(--muted); font-size: 10px; }
    .shipment-quantity.packed strong { color: #176548; }
    .shipment-quantity.remaining strong { color: #9a6114; }

    .shipment-status {
      min-height: 26px;
      padding: 4px 7px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      color: #8a611d;
      background: #fff4dc;
      font-size: 9px;
      font-weight: 700;
    }

    .status-packed .shipment-status { color: #176548; background: #e9f7ef; }
    .status-partial .shipment-status { color: #8a611d; background: #fff4dc; }
    .status-shipped .shipment-status { color: #52635a; background: #edf1ee; }
    .status-shipped { opacity: 0.78; }

    .shipment-row-actions {
      display: flex;
      justify-content: flex-end;
      gap: 5px;
    }

    .shipment-row-actions button {
      min-height: 32px;
      padding: 0 8px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
    }

    .shipment-match-modal {
      width: min(520px, 100%);
    }

    .shipment-packing-modal {
      width: min(680px, 100%);
    }

    .shipment-packing-list {
      margin-top: 18px;
      display: grid;
      gap: 8px;
    }

    .shipment-packing-row {
      min-height: 68px;
      padding: 12px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 120px;
      align-items: center;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--surface-soft);
    }

    .shipment-packing-copy {
      min-width: 0;
    }

    .shipment-packing-copy strong {
      display: block;
      overflow: hidden;
      color: var(--ink);
      font-size: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .shipment-packing-copy small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 10px;
    }

    .shipment-packing-input {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .shipment-packing-input input {
      width: 86px;
      height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 14px;
    }

    .shipment-packing-input em {
      color: var(--muted);
      font-size: 11px;
      font-style: normal;
    }

    .shipment-packing-actions {
      grid-template-columns: 0.8fr 1fr 1.3fr;
    }

    .auto-match-button {
      border-color: var(--accent) !important;
      color: var(--accent-dark) !important;
      background: var(--accent-soft) !important;
    }

    .shipment-match-source {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }

    .shipment-match-field {
      display: block;
      margin-top: 20px;
    }

    .shipment-match-field > span {
      display: block;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 10px;
    }

    .shipment-match-field select {
      width: 100%;
      min-height: 44px;
      padding: 0 12px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 13px;
    }

    .shipment-components { border-top: 1px dashed var(--line); }
    .shipment-components > summary {
      min-height: 30px;
      padding: 0 13px 0 53px;
      display: flex;
      align-items: center;
      color: var(--accent);
      background: #fbfdfc;
      font-size: 9px;
      cursor: pointer;
    }
    .shipment-components > div {
      padding: 8px 13px 10px 53px;
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }
    .shipment-components > div span {
      padding: 4px 6px;
      border-radius: 6px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 9px;
    }

    .demand-summary {
      margin-top: 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.9);
    }
    .demand-summary > summary {
      min-height: 42px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      color: var(--accent);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }
    .demand-summary-grid {
      padding: 0 14px 14px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .demand-summary-grid span {
      padding: 5px 7px;
      border-radius: 7px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 10px;
    }
    .demand-summary-grid strong { margin-left: 4px; color: var(--ink); }

    @media (max-width: 820px) {
      .shipment-table-head,
      .shipment-row { grid-template-columns: 26px minmax(150px, 1fr) 58px 58px 58px 74px 150px; }
      .shipment-country-head { align-items: flex-start; flex-direction: column; }
      .shipment-action-bar { justify-content: flex-start; flex-wrap: wrap; }
    }

    @media (max-width: 560px) {
      .inventory-quantity-group { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 7px; }
      .inventory-quantity-group.no-inspection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .shipment-action-bar > span { width: 100%; }
      .shipment-table-head { display: none; }
      .shipment-row {
        grid-template-columns: 24px minmax(0, 1fr) 64px;
        grid-template-areas:
          "check product quantity"
          "check status status"
          "actions actions actions";
      }
      .shipment-row > input[type="checkbox"] { grid-area: check; }
      .shipment-product { grid-area: product; }
      .shipment-quantity { grid-area: quantity; }
      .shipment-status { grid-area: status; justify-self: start; }
      .shipment-row-actions {
        grid-area: actions;
        justify-self: stretch;
        justify-content: flex-end;
      }
    }
  
    :root {
      color-scheme: light;
      --bg: #F8FAFC;
      --surface: #FFFFFF;
      --surface-soft: #EFF3F7;
      --ink: #111B26;
      --text: #253548;
      --muted: #69798B;
      --line: #D9E1E9;
      --line-strong: #B2C0D0;
      --accent: #F4B57E;
      --accent-dark: #E69C58;
      --accent-ink: #111B26;
      --accent-soft: #FDF0E4;
      --warning: #9A5F24;
      --warning-soft: #FDF0E4;
      --danger: #A64B4B;
      --shadow: 0 14px 34px rgba(17, 27, 38, 0.09);
      --topbar-bg: rgba(248, 250, 252, 0.92);
    }

    :root[data-theme="dark"] {
      color-scheme: dark;
      --bg: #111B26;
      --surface: #182430;
      --surface-soft: #1E2C3A;
      --ink: #F8FAFC;
      --text: #D7DFE8;
      --muted: #B2C0D0;
      --line: rgba(178, 192, 208, 0.18);
      --line-strong: rgba(178, 192, 208, 0.34);
      --accent: #F4B57E;
      --accent-dark: #FFD0A6;
      --accent-ink: #111B26;
      --accent-soft: rgba(244, 181, 126, 0.13);
      --warning: #F4B57E;
      --warning-soft: rgba(244, 181, 126, 0.13);
      --danger: #F0A7A7;
      --shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
      --topbar-bg: rgba(17, 27, 38, 0.92);
    }

    html, body {
      background: var(--bg);
      color: var(--text);
    }

    body {
      background:
        radial-gradient(circle at 92% 3%, rgba(244, 181, 126, 0.10), transparent 30rem),
        var(--bg);
    }

    button:focus-visible, input:focus-visible, a:focus-visible, select:focus-visible {
      outline-color: rgba(244, 181, 126, 0.55);
    }

    .topbar {
      border-bottom-color: var(--line);
      background: var(--topbar-bg);
    }

    .brand-mark {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .brand-copy span { color: var(--muted); }

    .nav button.active,
    .series-tab:hover {
      color: var(--ink);
      background: var(--surface-soft);
    }

    .sync-chip,
    .members-button,
    .undo-button,
    .redo-button,
    .theme-toggle {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface);
    }

    .sync-dot {
      background: var(--accent);
      box-shadow: 0 0 0 4px rgba(244, 181, 126, 0.16);
    }

    .avatar {
      color: var(--surface);
      background: var(--ink);
    }

    :root[data-theme="dark"] .avatar {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .theme-toggle {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      border-radius: 10px;
    }

    h1,
    .metric strong,
    .category-card h3,
    .category-footer strong,
    .section-head h2,
    .product-card h3,
    .purchase-meta h3,
    .combo-card-head h2,
    .record-product strong,
    .shipment-product strong,
    .selected-records-head h2 {
      color: var(--ink);
    }

    .metric,
    .category-card,
    .info-card,
    .product-card,
    .purchase-row,
    .purchase-series-group,
    .combo-card,
    .shipment-country-panel,
    .demand-summary,
    .calendar-card,
    .selected-records-panel,
    .record-date-group,
    .record-series-group {
      border-color: var(--line);
      background: var(--surface);
    }

    .metric-icon,
    .metric-icon.slate {
      color: var(--ink);
      background: var(--surface-soft);
    }

    .metric-icon.warning {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .category-icon[class*="tone-"] {
      color: var(--ink);
      background: var(--surface-soft);
    }

    .search-box input,
    .filter-button,
    .purchase-control input,
    .batch-input input,
    input,
    select {
      border-color: var(--line-strong);
      color: var(--text);
      background: var(--surface);
    }

    input::placeholder { color: var(--muted); opacity: 0.72; }

    .purchase-entry,
    .primary-page-action,
    .series-submit button,
    .modal-confirm,
    .shipment-empty button,
    .selected-day-empty button,
    .records-empty button,
    .shipment-action-bar button:first-of-type {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
    }

    .purchase-entry:hover,
    .primary-page-action:hover,
    .series-submit button:hover,
    .modal-confirm:hover,
    .shipment-action-bar button:first-of-type:hover {
      background: var(--accent-dark);
    }

    .series-tab.active {
      color: var(--accent-ink);
      background: var(--accent);
      box-shadow: none;
    }

    .series-tab.active small {
      color: var(--accent-ink);
      background: rgba(17, 27, 38, 0.12);
    }

    .purchase-summary span,
    .shipment-summary span,
    .calendar-selection-box,
    .modal-context {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface-soft);
    }

    .calendar-selection-box {
      border-color: rgba(244, 181, 126, 0.44);
      background: var(--accent-soft);
    }

    .calendar-day.has-records {
      border-color: var(--accent);
      color: var(--ink);
      background: var(--accent-soft);
      box-shadow: none;
    }

    .calendar-day.is-selected {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
      box-shadow: 0 0 0 3px rgba(244, 181, 126, 0.18);
    }

    .calendar-day.is-selected small {
      color: var(--accent);
      background: var(--accent-ink);
    }

    .calendar-legend i {
      border-color: var(--accent);
      background: var(--accent-soft);
    }

    .purchase-series-head,
    .record-series-head,
    .selected-records-head,
    .shipment-country-head,
    .shipment-table-head,
    .shipment-action-bar,
    .record-more > summary,
    .shipment-components > summary {
      border-color: var(--line);
      background: var(--surface-soft);
    }

    .record-row,
    .shipment-item,
    .shipment-components,
    .record-more,
    .purchase-series-rows .purchase-row {
      border-color: var(--line);
    }

    .country-tab {
      color: var(--muted);
      background: transparent;
    }

    .country-tab span { color: var(--ink); }

    .country-tab.active {
      color: var(--accent-ink);
      background: var(--accent);
      box-shadow: none;
    }

    .country-tab.active span,
    .country-tab.active small {
      color: var(--accent-ink);
    }

    .shipment-status {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .status-packed .shipment-status {
      color: var(--ink);
      background: var(--surface-soft);
    }

    .status-shipped .shipment-status {
      color: var(--muted);
      background: var(--surface-soft);
    }

    .quantity-cell.has-pending strong,
    .quantity-cell.has-packed strong {
      color: var(--muted);
    }

    .quantity-cell.has-purchase strong {
      color: var(--accent-dark);
    }

    :root[data-theme="dark"] .quantity-cell.has-purchase strong {
      color: var(--accent);
    }

    .quantity-modal,
    .combo-modal {
      border: 1px solid var(--line);
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .modal-close,
    .modal-cancel,
    .row-action.arrival,
    .row-action.neutral,
    .purchase-control {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface);
    }

    .row-action.inspection {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
    }

    .row-action.arrival {
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    .purchase-flow,
    .series-switcher,
    .country-tabs,
    .purchase-series-head {
      border-color: var(--line);
      background: var(--surface);
    }

    .demand-summary > summary,
    .shipment-components > summary,
    .record-more > summary {
      color: var(--accent-dark);
    }

    :root[data-theme="dark"] .demand-summary > summary,
    :root[data-theme="dark"] .shipment-components > summary,
    :root[data-theme="dark"] .record-more > summary {
      color: var(--accent);
    }

    .combo-parts span,
    .shipment-components > div span,
    .demand-summary-grid span {
      color: var(--muted);
      background: var(--surface-soft);
    }

    :root[data-theme="dark"] .product-photo,
    :root[data-theme="dark"] .record-thumb {
      background: #F8FAFC;
    }
  
    .detail-toolbar,
    .shipment-empty,
    .records-empty {
      border-color: var(--line);
      background: var(--surface);
    }

    .detail-toolbar .search-box input {
      border-color: var(--line-strong);
      color: var(--text);
      background: var(--surface-soft);
    }

    .permission-card {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface-soft);
    }

    .permission-card strong { color: var(--ink); }
    .permission-card span { color: var(--muted); }

    .calendar-arrow,
    .calendar-selects select {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface);
    }

    .calendar-selects option {
      color: var(--text);
      background: var(--surface);
    }

    .shipment-empty h2,
    .records-empty h2 { color: var(--ink); }
    .shipment-empty p,
    .records-empty p { color: var(--muted); }
  
    body[data-role="view"] [data-undo],
    body[data-role="view"] [data-redo],
    body[data-role="view"] [data-open-quantity],
    body[data-role="view"] [data-series-confirm],
    body[data-role="view"] .batch-input,
    body[data-role="view"] [data-new-combo],
    body[data-role="view"] [data-edit-record],
    body[data-role="view"] [data-import-shipments],
    body[data-role="view"] [data-shipment-select],
    body[data-role="view"] [data-shipment-action],
    body[data-role="view"] [data-view="access"],
    body[data-role="view"] .members-button,
    body[data-role="view"] [data-edit-price],
    body[data-role="view"] [data-edit-record],
    body[data-role="view"] .unit-price-button,
    body[data-role="view"] .unit-price-readonly,
    body[data-role="view"] .record-price,
    body[data-role="view"] .record-price-summary {
      display: none !important;
    }

    body[data-role="purchaser"] [data-undo],
    body[data-role="purchaser"] [data-redo],
    body[data-role="purchaser"] [data-open-quantity],
    body[data-role="purchaser"] [data-new-combo],
    body[data-role="purchaser"] [data-add-product],
    body[data-role="purchaser"] [data-add-series],
    body[data-role="purchaser"] [data-edit-category],
    body[data-role="purchaser"] [data-edit-series],
    body[data-role="purchaser"] [data-edit-product],
    body[data-role="purchaser"] [data-edit-defect],
    body[data-role="purchaser"] [data-series-edit-product],
    body[data-role="purchaser"] [data-series-delete-product],
    body[data-role="purchaser"] [data-edit-combo],
    body[data-role="purchaser"] [data-delete-combo],
    body[data-role="purchaser"] [data-delete-product],
    body[data-role="purchaser"] [data-delete-series],
    body[data-role="purchaser"] [data-import-combo],
    body[data-role="purchaser"] [data-import-shipments],
    body[data-role="purchaser"] [data-shipment-select],
    body[data-role="purchaser"] [data-shipment-action],
    body[data-role="purchaser"] [data-auto-match-shipments],
    body[data-role="purchaser"] [data-match-shipment],
    body[data-role="purchaser"] [data-cancel-packing],
    body[data-role="purchaser"] [data-edit-shipment-quantity],
    body[data-role="purchaser"] [data-delete-shipment],
    body[data-role="purchaser"] [data-view="access"] {
      display: none !important;
    }

    body[data-role="view"] [data-edit-product],
    body[data-role="view"] [data-edit-defect],
    body[data-role="view"] [data-edit-category],
    body[data-role="view"] [data-edit-series],
    body[data-role="view"] [data-add-series],
    body[data-role="view"] [data-series-edit-product],
    body[data-role="view"] [data-series-delete-product],
    body[data-role="view"] [data-edit-combo],
    body[data-role="view"] [data-delete-series] {
      display: none !important;
    }

    body[data-role="warehouse_manager"] .batch-input,
    body[data-role="warehouse_manager"] .series-submit,
    body[data-role="warehouse_manager"] [data-undo],
    body[data-role="warehouse_manager"] [data-redo],
    body[data-role="warehouse_manager"] [data-edit-price],
    body[data-role="warehouse_manager"] [data-edit-record],
    body[data-role="warehouse_manager"] .unit-price-button,
    body[data-role="warehouse_manager"] .unit-price-readonly,
    body[data-role="warehouse_manager"] .record-price,
    body[data-role="warehouse_manager"] .record-price-summary {
      display: none !important;
    }

    .access-create {
      margin-top: 18px;
      padding: 14px;
      display: grid;
      grid-template-columns: minmax(180px, 1fr) 150px auto;
      gap: 10px;
      align-items: end;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .access-create label span {
      display: block;
      margin-bottom: 5px;
      color: var(--muted);
      font-size: 10px;
    }

    .access-create input,
    .access-create select,
    .access-row input {
      width: 100%;
      height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 12px;
    }

    .access-list {
      margin-top: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .access-row {
      padding: 10px 12px;
      display: grid;
      grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 62px 62px;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: var(--surface);
    }

    .access-row strong { display: block; color: var(--ink); font-size: 12px; }
    .access-row span { color: var(--muted); font-size: 10px; }
    .access-row button {
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 10px;
      font-weight: 700;
    }
    .access-row.is-revoked { opacity: 0.46; }

    .access-page-summary {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 11px;
    }

    .access-invite-card {
      width: min(100%, 1120px);
      margin: 18px auto 0;
      padding: 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
      border-radius: var(--radius);
      background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface));
    }

    .access-invite-card > div:first-child {
      min-width: 0;
      display: grid;
      gap: 5px;
    }

    .access-invite-card span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
    }

    .access-invite-card strong {
      color: var(--ink);
      font-family: "Inter", "Cascadia Mono", "SFMono-Regular", monospace;
      font-size: 21px;
      letter-spacing: 0.055em;
    }

    .access-invite-card p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.55;
    }

    .access-invite-actions {
      display: flex;
      gap: 7px;
    }

    .access-invite-actions button,
    .access-row select {
      min-height: 38px;
      padding: 0 11px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
    }

    .account-row {
      grid-template-columns: minmax(160px, 0.85fr) minmax(190px, 1fr) 120px 76px;
    }

    .access-account-heading,
    .access-account-meta {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .access-account-heading strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .access-account-meta {
      color: var(--muted);
      font-size: 10px;
    }

    .access-admin-role {
      width: max-content;
      padding: 5px 8px;
      border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
      border-radius: 999px;
      color: var(--accent-dark) !important;
      background: var(--accent-soft);
      font-size: 10px !important;
      font-weight: 750;
    }

    @media (max-width: 820px) {
      .access-create { grid-template-columns: 1fr; }
      .access-row { grid-template-columns: 1fr; }
      .access-invite-card { align-items: flex-start; flex-direction: column; }
      .access-invite-actions { width: 100%; }
      .access-invite-actions button { flex: 1; }
    }

    .detail-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .product-series-list {
      margin-top: 14px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .product-series-section {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .product-series-heading {
      position: relative;
      min-height: 50px;
      padding: 9px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-bottom: 1px solid var(--line);
      border-radius: 14px 14px 0 0;
      background: var(--surface-soft);
      cursor: pointer;
      transition:
        background-color 160ms ease,
        border-bottom-color 160ms ease,
        border-radius 160ms ease;
    }

    .product-series-heading:hover {
      background: var(--surface);
    }

    .product-series-toggle {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      border: 0;
      border-radius: inherit;
      background: transparent;
      cursor: pointer;
    }

    .product-series-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: -3px;
    }

    .product-series-summary {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .product-series-heading h2 {
      margin: 0;
      color: var(--ink);
      font-size: 15px;
    }

    .product-series-heading span {
      color: var(--muted);
      font-size: 10px;
    }

    .product-series-toggle-copy {
      font-weight: 700;
    }

    .product-series-chevron {
      width: 8px;
      height: 8px;
      border-right: 1.5px solid var(--muted);
      border-bottom: 1.5px solid var(--muted);
      transform: rotate(225deg);
      transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .product-series-content {
      display: grid;
      grid-template-rows: 1fr;
      opacity: 1;
      transition:
        grid-template-rows 260ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 180ms ease;
    }

    .product-series-body {
      min-height: 0;
      overflow: hidden;
    }

    .product-series-section.is-collapsed .product-series-heading {
      border-bottom-color: transparent;
      border-radius: 14px;
    }

    .product-series-section.is-collapsed .product-series-content {
      grid-template-rows: 0fr;
      opacity: 0;
    }

    .product-series-section.is-collapsed .product-series-chevron {
      transform: rotate(45deg);
    }

    .grouped-product {
      grid-template-columns: 64px minmax(180px, 1fr) minmax(300px, 340px) 216px;
      border: 0;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
    }

    .grouped-product:last-child { border-bottom: 0; }

    .product-modal-backdrop {
      z-index: 230;
    }

    .product-modal {
      width: min(620px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      padding: 24px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .product-form-grid {
      margin-top: 18px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .product-form-grid label span {
      display: block;
      margin-bottom: 5px;
      color: var(--muted);
      font-size: 10px;
    }

    .product-form-grid input,
    .product-form-grid select {
      width: 100%;
      height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 12px;
    }

    .product-form-wide { grid-column: 1 / -1; }

    body[data-role="view"] [data-add-product] {
      display: none !important;
    }

    body[data-role="view"] [data-import-combo] {
      display: none !important;
    }

    @media (max-width: 820px) {
      .detail-actions {
        width: 100%;
        justify-content: space-between;
      }
      .grouped-product {
        grid-template-columns: 52px minmax(0, 1fr) 196px;
        grid-template-areas:
          "photo name actions"
          "quantities quantities quantities";
      }
      .product-form-grid { grid-template-columns: 1fr; }
      .product-form-wide { grid-column: auto; }
    }

    @media (max-width: 560px) {
      .detail-actions { align-items: stretch; flex-direction: column; }
      .grouped-product {
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-areas:
          "photo name"
          "quantities quantities"
          "actions actions";
      }
    }

    .metric-interactive {
      cursor: pointer;
      transition: border-color 160ms ease, box-shadow 160ms ease;
    }

    .metric-interactive:hover {
      border-color: var(--line-strong);
      box-shadow: var(--shadow);
    }

    .metric-interactive:focus-visible {
      outline: 3px solid rgba(244, 181, 126, 0.55);
      outline-offset: 2px;
    }

    .inspection-badge {
      margin-left: 7px;
      padding: 2px 6px;
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 600;
      vertical-align: middle;
    }

    .product-actions {
      grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    }

    .purchase-subseries-section + .purchase-subseries-section {
      border-top: 1px solid var(--line);
    }

    .purchase-subseries-head {
      min-height: 38px;
      padding: 7px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background: var(--surface-soft);
    }

    .purchase-subseries-head h3 {
      margin: 0;
      color: var(--ink);
      font-size: 13px;
    }

    .purchase-subseries-head span {
      color: var(--muted);
      font-size: 9px;
    }

    .low-stock-modal {
      width: min(720px, 100%);
      max-height: calc(100vh - 40px);
      overflow: hidden;
      padding: 22px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .low-stock-list {
      max-height: calc(100vh - 190px);
      margin-top: 16px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
    }

    .low-stock-row {
      min-height: 52px;
      padding: 8px 12px;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) 64px;
      align-items: center;
      gap: 10px;
      border-top: 1px solid var(--line);
    }

    .low-stock-row:first-child { border-top: 0; }

    .low-stock-copy {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .low-stock-copy strong {
      overflow: hidden;
      color: var(--ink);
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .low-stock-copy span {
      overflow: hidden;
      color: var(--muted);
      font-size: 9px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .low-stock-number {
      color: var(--accent-dark);
      font-size: 18px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    .field-label {
      display: block;
      margin-bottom: 5px;
      color: var(--muted);
      font-size: 10px;
    }

    .quality-toggle {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .quality-toggle label {
      position: relative;
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--muted);
      background: var(--surface);
      font-size: 12px;
      cursor: pointer;
    }

    .quality-toggle input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .quality-toggle label:has(input:checked) {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
      font-weight: 700;
    }

    @media (max-width: 560px) {
      .low-stock-modal { padding: 18px; }
    }

    .management-tabs {
      margin-top: 16px;
      padding: 5px;
      display: inline-flex;
      gap: 5px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: var(--surface);
    }

    .management-tabs button {
      min-height: 34px;
      padding: 0 16px;
      border: 0;
      border-radius: 8px;
      color: var(--muted);
      background: transparent;
      font-size: 12px;
    }

    .management-tabs button.active {
      color: var(--accent-ink);
      background: var(--accent);
      font-weight: 700;
    }

    .management-product-list {
      margin-top: 12px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
      align-items: start;
      gap: 12px;
    }

    .management-category,
    .management-series {
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
      overflow: hidden;
    }

    .management-category {
      container-name: management-category;
      container-type: inline-size;
    }

    .management-category > summary,
    .management-series > summary {
      min-height: 54px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      list-style: none;
      cursor: pointer;
    }

    .management-category > summary {
      min-height: 64px;
      padding: 13px 16px;
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--accent) 11%, var(--surface));
    }

    .management-series > summary {
      min-height: 50px;
      padding: 9px 12px;
    }

    .management-category > summary::-webkit-details-marker,
    .management-series > summary::-webkit-details-marker {
      display: none;
    }

    .management-summary-title {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .management-level-badge {
      flex: 0 0 auto;
      min-height: 24px;
      padding: 0 9px;
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      color: var(--accent-ink);
      background: var(--accent);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.08em;
      white-space: nowrap;
    }

    .management-level-badge.series {
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    .management-category > summary strong {
      color: var(--ink);
      font-size: 18px;
      line-height: 1.35;
    }

    .management-series > summary strong {
      color: var(--ink);
      font-size: 14px;
      line-height: 1.4;
    }

    .management-count {
      flex: 0 0 auto;
      padding: 4px 8px;
      border-radius: 999px;
      color: var(--muted);
      background: color-mix(in srgb, var(--surface) 78%, transparent);
      font-size: 11px;
      font-variant-numeric: tabular-nums;
    }

    .management-summary-actions {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      flex-wrap: wrap;
      gap: 8px;
    }

    .management-rename {
      min-height: 36px;
      padding: 0 12px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }

    .management-rename:hover {
      border-color: var(--accent);
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    .management-rename:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .label-edit-hint {
      margin: 14px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .popconfirm {
      position: fixed;
      z-index: 600;
      max-height: calc(100vh - 16px);
      padding: 14px;
      overflow: auto;
      border: 1px solid var(--line-strong);
      border-radius: 12px;
      color: var(--text);
      background: var(--surface);
      box-shadow: 0 16px 42px rgba(12, 31, 21, 0.22);
    }

    .popconfirm-title {
      color: var(--ink);
      font-size: 13px;
      font-weight: 800;
    }

    .popconfirm p {
      margin: 7px 0 12px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .popconfirm-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }

    .popconfirm-actions button {
      min-height: 38px;
      padding: 0 13px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }

    .popconfirm-actions button:disabled {
      cursor: wait;
      opacity: 0.62;
    }

    .popconfirm-actions button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .series-products-modal {
      width: min(940px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      padding: 24px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .series-products-category {
      color: var(--muted);
      font-size: 11px;
    }

    .series-products-summary {
      margin: 8px 0 16px;
      color: var(--muted);
      font-size: 12px;
    }

    .series-products-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .series-product-row {
      min-width: 0;
      padding: 10px 12px;
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) 120px 150px;
      align-items: center;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--surface);
    }

    .series-product-thumb {
      width: 72px;
      height: 72px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 11px;
      background: #F8FAFC;
    }

    .series-product-thumb img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .series-product-copy {
      min-width: 0;
    }

    .series-product-copy strong {
      display: block;
      color: var(--ink);
      font-size: 15px;
      line-height: 1.4;
    }

    .series-product-copy span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .series-product-stock {
      display: grid;
      justify-items: end;
      gap: 2px;
    }

    .series-product-stock span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 600;
    }

    .series-product-stock strong {
      color: var(--ink);
      font-size: 19px;
      font-variant-numeric: tabular-nums;
    }

    .series-product-actions {
      display: flex;
      gap: 6px;
    }

    .series-product-actions button {
      min-width: 0;
      min-height: 44px;
      padding: 0 12px;
      flex: 1;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: var(--text);
      background: var(--surface);
      font-size: 11px;
      font-weight: 700;
    }

    .series-products-empty {
      margin: 0;
      padding: 36px 16px;
      border: 1px dashed var(--line-strong);
      border-radius: 12px;
      color: var(--muted);
      text-align: center;
    }

    .management-series-list {
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .management-series-card {
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--surface-soft);
      overflow: hidden;
    }

    .management-series-open {
      min-width: 0;
      min-height: 58px;
      padding: 9px 10px 9px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      border: 0;
      color: var(--ink);
      background: transparent;
      text-align: left;
      cursor: pointer;
    }

    .management-series-open:hover {
      background: color-mix(in srgb, var(--accent) 7%, transparent);
    }

    .management-series-open:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: -2px;
    }

    .management-series-copy {
      min-width: 0;
      flex: 1;
      display: grid;
      gap: 2px;
    }

    .management-series-copy strong {
      color: var(--ink);
      font-size: 14px;
      line-height: 1.4;
    }

    .management-series-copy span {
      color: var(--muted);
      font-size: 11px;
    }

    .management-series-chevron {
      color: var(--muted);
      font-size: 24px;
      line-height: 1;
    }

    .management-series-actions {
      padding-right: 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .management-series > summary {
      background: var(--surface-soft);
      border-radius: 10px;
    }

    .management-rows { display: flex; flex-direction: column; }

    .management-row {
      min-width: 0;
      min-height: 0;
      padding: 10px 14px;
      display: grid;
      grid-template-columns: 64px minmax(0, 1fr);
      grid-template-rows: auto auto auto;
      grid-template-areas:
        "photo copy"
        "photo stock"
        "action action";
      align-items: center;
      gap: 8px 14px;
      border-top: 1px solid var(--line);
      transition: background-color 140ms ease;
    }

    .management-row:hover {
      background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    }

    .management-product-thumb {
      grid-area: photo;
      width: 64px;
      height: 64px;
      border-radius: 11px;
      aspect-ratio: 1;
    }

    .management-product-copy {
      grid-area: copy;
      min-width: 0;
    }

    .management-product-copy strong {
      display: block;
      color: var(--ink);
      font-size: 15px;
      line-height: 1.4;
    }

    .management-product-copy span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .management-stock {
      grid-area: stock;
      display: grid;
      justify-items: start;
      gap: 2px;
    }

    .management-stock span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 600;
    }

    .management-stock strong {
      color: var(--ink);
      font-size: 19px;
      line-height: 1.2;
      font-variant-numeric: tabular-nums;
    }

    .management-row button,
    .combo-card-actions button {
      min-height: 30px;
      padding: 0 7px;
      border: 1px solid var(--line-strong);
      border-radius: 7px;
      color: var(--text);
      background: var(--surface);
      font-size: 10px;
      font-weight: 700;
    }

    .management-row button {
      min-height: 44px;
      padding: 0 13px;
      font-size: 11px;
    }

    .management-row-actions,
    .combo-action-buttons {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .management-row-actions {
      grid-area: action;
      justify-content: stretch;
    }

    .management-row-actions button {
      min-width: 0;
      flex: 1;
    }

    .management-row-actions button,
    .combo-action-buttons button {
      flex: 1;
      white-space: nowrap;
    }

    .danger-action {
      border-color: color-mix(in srgb, var(--danger) 42%, transparent) !important;
      color: var(--danger) !important;
      background: color-mix(in srgb, var(--danger) 7%, var(--surface)) !important;
    }

    .combo-card-actions {
      display: grid;
      justify-items: end;
      gap: 5px;
    }

    .combo-action-buttons {
      justify-content: flex-end;
    }

    .combo-action-buttons button {
      min-width: 44px;
    }

    .delete-modal {
      width: min(460px, 100%);
    }

    .delete-modal-head {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 32px;
      align-items: start;
      gap: 12px;
    }

    .delete-modal-head h2 {
      margin: 0;
      color: var(--ink);
      font-size: 20px;
    }

    .delete-modal-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 11px;
      color: var(--danger);
      background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    }

    .delete-target {
      margin: 4px 0 0;
      color: var(--text);
      font-size: 13px;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .delete-consequence {
      margin: 18px 0 0;
      padding: 11px 12px;
      border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
      border-radius: 10px;
      color: var(--danger);
      background: color-mix(in srgb, var(--danger) 7%, var(--surface));
      font-size: 12px;
    }

    .danger-confirm {
      border-color: var(--danger) !important;
      color: #fff !important;
      background: var(--danger) !important;
    }

    :root[data-theme="dark"] .danger-confirm {
      color: #111B26 !important;
    }

    :root[data-theme="dark"] .combo-card-media,
    :root[data-theme="dark"] .management-product-thumb,
    :root[data-theme="dark"] .image-preview {
      background: #F8FAFC;
    }

    body[data-role="view"] [data-delete-product],
    body[data-role="view"] [data-delete-combo],
    body[data-role="view"] [data-delete-shipment],
    body[data-role="view"] [data-match-shipment],
    body[data-role="view"] [data-edit-price] {
      display: none !important;
    }

    .low-stock-category h3 {
      margin: 0;
      padding: 10px 12px 7px;
      color: var(--ink);
      font-size: 14px;
      background: var(--surface-soft);
    }

    .low-stock-series + .low-stock-series {
      border-top: 1px solid var(--line);
    }

    .low-stock-series h4 {
      margin: 0;
      padding: 7px 12px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 600;
    }

    @media (max-width: 560px) {
      .management-row {
        grid-template-columns: minmax(0, 1fr) 64px 48px;
      }
    }

    .status-unmatched .shipment-status {
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    .status-unmatched .shipment-product strong {
      color: var(--muted);
    }

    .shipment-fields > div span {
      display: inline-flex;
      gap: 5px;
      align-items: baseline;
    }

    .shipment-fields > div b {
      color: var(--ink);
      font-weight: 700;
    }

    .shipment-fields > div {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .shipment-fields > div span {
      align-items: flex-start;
      white-space: pre-wrap;
    }

    .product-form-grid .image-upload-control input[type="file"] {
      width: auto;
      height: 44px;
      padding: 5px;
      font-size: 11px;
    }

    .combo-form-grid input,
    .combo-component-row select,
    .combo-component-row input {
      color: var(--text);
      background: var(--surface);
    }

    .combo-component-row select option {
      color: var(--text);
      background: var(--surface);
    }

    @media (max-width: 560px) {
      .management-category > summary,
      .management-series > summary {
        align-items: flex-start;
        flex-wrap: wrap;
      }
      .management-summary-title {
        min-width: 0;
        flex: 1 1 auto;
      }
      .management-category > summary strong {
        font-size: 16px;
      }
      .management-row {
        min-height: 0;
        padding: 12px;
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        gap: 10px 12px;
        grid-template-areas:
          "photo copy"
          "stock stock"
          "action action";
      }
      .management-product-thumb { grid-area: photo; width: 56px; height: 56px; }
      .management-product-copy { grid-area: copy; }
      .management-stock {
        grid-area: stock;
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        gap: 8px;
      }
      .management-row-actions {
        grid-area: action;
        align-items: center;
        justify-content: stretch;
        flex-direction: row;
        gap: 8px;
      }
      .management-row-actions button {
        min-width: 0;
        min-height: 44px;
        flex: 1;
      }
      .combo-card { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
      .combo-card-media { min-height: 68px; }
      .management-title-actions { width: 100%; align-items: stretch; flex-direction: column; }
    }

    /* Unified navigation and palette */
    :root {
      color-scheme: light;
      --bg: #f1f3ee;
      --surface: #ffffff;
      --surface-soft: #e9ede6;
      --ink: #111416;
      --text: #26302e;
      --muted: #68746f;
      --line: #dfe4de;
      --line-strong: #cbd3cc;
      --accent: #96d85f;
      --accent-dark: #72b343;
      --accent-ink: #111416;
      --accent-soft: #e8f5de;
      --warning: #966018;
      --warning-soft: #fff1d1;
      --danger: #a74b45;
      --shadow: 0 12px 32px rgba(17, 20, 22, 0.07);
      --topbar-bg: rgba(255, 255, 255, 0.94);
      --side-rail-width: 74px;
      --side-rail-expanded: 224px;
      --side-rail-bg: #111416;
      --side-rail-soft: #1b2022;
      --topbar-height: 76px;
    }

    :root[data-theme="dark"] {
      color-scheme: dark;
      --bg: #111416;
      --surface: #191f21;
      --surface-soft: #222a2d;
      --ink: #f4f7f2;
      --text: #d6ded9;
      --muted: #a5b0aa;
      --line: rgba(207, 219, 211, 0.16);
      --line-strong: rgba(207, 219, 211, 0.32);
      --accent: #96d85f;
      --accent-dark: #b4e988;
      --accent-ink: #111416;
      --accent-soft: rgba(150, 216, 95, 0.14);
      --warning: #f4ca61;
      --warning-soft: rgba(244, 202, 97, 0.13);
      --danger: #f0a0a0;
      --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
      --topbar-bg: rgba(17, 20, 22, 0.94);
      --side-rail-bg: #0d1012;
      --side-rail-soft: #181d1f;
    }

    html,
    body {
      background: var(--bg);
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    body {
      background:
        radial-gradient(circle at 92% 3%, rgba(150, 216, 95, 0.11), transparent 31rem),
        var(--bg);
    }

    button:focus-visible,
    input:focus-visible,
    a:focus-visible,
    select:focus-visible {
      outline-color: rgba(150, 216, 95, 0.62);
    }

    .topbar {
      height: var(--topbar-height);
      border-bottom-color: var(--line);
      background: var(--topbar-bg);
    }

    .topbar-inner {
      width: min(1560px, calc(100% - 48px));
      height: 100%;
      margin: 0 auto;
      gap: 24px;
    }

    .brand {
      min-width: 0;
    }

    .brand-mark {
      color: var(--accent-ink);
      background: var(--accent);
      box-shadow: none;
    }

    .brand-copy strong,
    h1 {
      color: var(--ink);
    }

    .brand-copy span {
      color: var(--muted);
    }

    .top-actions {
      margin-left: auto;
      gap: 8px;
    }

    .sync-chip,
    .undo-button,
    .redo-button,
    .theme-toggle,
    .members-button {
      border-color: var(--line);
      color: var(--text);
      background: var(--surface);
    }

    .sync-dot {
      background: var(--accent);
      box-shadow: 0 0 0 4px rgba(150, 216, 95, 0.16);
    }

    .side-rail {
      position: fixed;
      z-index: 18;
      top: var(--topbar-height);
      bottom: 0;
      left: 0;
      width: var(--side-rail-width);
      padding: 20px 10px 14px;
      display: flex;
      flex-direction: column;
      overflow: visible;
      color: #aeb7b2;
      background:
        radial-gradient(circle at 42% 0%, rgba(150, 216, 95, 0.10), transparent 18rem),
        var(--side-rail-bg);
    }

    .side-nav {
      min-height: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 7px;
      overflow: visible;
    }

    .side-nav-item {
      position: relative;
      flex: 0 0 50px;
      width: 54px;
      min-height: 50px;
      padding: 0;
      display: grid;
      grid-template-columns: 34px;
      align-items: center;
      justify-content: center;
      overflow: visible;
      border: 0;
      border-radius: 10px;
      color: #aeb7b2;
      background: transparent;
      text-align: center;
      white-space: nowrap;
      transition: color 150ms ease, background 150ms ease;
    }

    .side-nav-item:hover {
      color: #f6f8f4;
      background: rgba(255, 255, 255, 0.055);
    }

    .side-nav-item.active {
      color: #f6f8f4;
      background: transparent;
      font-weight: 700;
    }

    .side-nav-icon {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 9px;
      background: rgba(255, 255, 255, 0.05);
    }

    .side-nav-item.active .side-nav-icon {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .side-nav-label {
      position: absolute;
      z-index: 40;
      top: 50%;
      left: calc(100% + 10px);
      width: max-content;
      max-width: 210px;
      padding: 7px 10px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      color: #f4f7f2;
      background: #1b2022;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
      font-size: 11px;
      line-height: 1.2;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translate(-4px, -50%);
      transition: opacity 140ms ease, transform 160ms ease, visibility 140ms;
    }

    .side-nav-label::before {
      content: "";
      position: absolute;
      top: 50%;
      left: -5px;
      width: 9px;
      height: 9px;
      background: #1b2022;
      transform: translateY(-50%) rotate(45deg);
    }

    .side-nav-item:hover .side-nav-label,
    .side-nav-item:focus-visible .side-nav-label {
      opacity: 1;
      visibility: visible;
      transform: translate(0, -50%);
    }

    .side-footer {
      margin-top: auto;
      padding-top: 12px;
    }

    .side-user-link {
      position: relative;
      width: 54px;
      height: 58px;
      min-height: 58px;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: visible;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      color: #f4f7f2;
      background: rgba(255, 255, 255, 0.035);
      text-align: left;
      transition: background 150ms ease;
    }

    button.side-user-link:hover {
      background: rgba(255, 255, 255, 0.07);
    }

    .side-avatar {
      flex: 0 0 34px;
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: var(--accent-ink);
      background: var(--accent);
      font-size: 11px;
      font-weight: 900;
    }

    .side-user-copy {
      position: absolute;
      z-index: 40;
      top: 50%;
      left: calc(100% + 10px);
      width: max-content;
      min-width: 138px;
      padding: 8px 10px;
      display: grid;
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      opacity: 0;
      visibility: hidden;
      background: #1b2022;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
      white-space: nowrap;
      pointer-events: none;
      transform: translate(-4px, -50%);
      transition: opacity 140ms ease, transform 160ms ease, visibility 140ms;
    }

    .side-user-copy::before {
      content: "";
      position: absolute;
      top: 50%;
      left: -5px;
      width: 9px;
      height: 9px;
      background: #1b2022;
      transform: translateY(-50%) rotate(45deg);
    }

    .side-user-link:hover .side-user-copy,
    .side-user-link:focus-visible .side-user-copy {
      opacity: 1;
      visibility: visible;
      transform: translate(0, -50%);
    }

    .side-user-copy strong {
      overflow: hidden;
      color: #f4f7f2;
      font-size: 12px;
      text-overflow: ellipsis;
    }

    .side-user-copy small {
      margin-top: 2px;
      color: #8e9893;
      font-size: 9px;
    }

    body .page {
      width: min(1400px, calc(100% - var(--side-rail-width) - 64px));
      margin-left: calc(var(--side-rail-width) + 32px);
      margin-right: auto;
      padding: 34px 0 56px;
    }

    .metric-icon.warning {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .category-card:nth-child(3n+1) .category-icon {
      background: #e8f1df;
    }

    .category-card:nth-child(3n+2) .category-icon {
      background: #f8eed1;
    }

    .category-card:nth-child(3n) .category-icon {
      background: #f8e8df;
    }

    :root[data-theme="dark"] .category-card:nth-child(3n+1) .category-icon {
      background: rgba(150, 216, 95, 0.17);
    }

    :root[data-theme="dark"] .category-card:nth-child(3n+2) .category-icon {
      background: rgba(244, 202, 97, 0.16);
    }

    :root[data-theme="dark"] .category-card:nth-child(3n) .category-icon {
      background: rgba(240, 161, 125, 0.16);
    }

    .metric strong,
    .category-footer strong,
    .quantity-cell strong,
    .management-stock,
    .shipment-quantity strong,
    .combo-card-actions > strong,
    .low-stock-number,
    .calendar-day {
      font-family: "Consolas", "Cascadia Mono", "SFMono-Regular", monospace;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
    }

    input[type="number"],
    .record-date-group small,
    .shipment-quantity span,
    .purchase-record-row time {
      font-variant-numeric: tabular-nums;
    }

    .calendar-selection-box {
      border-color: rgba(150, 216, 95, 0.48);
      background: var(--accent-soft);
    }

    .calendar-day.is-selected {
      box-shadow: 0 0 0 3px rgba(150, 216, 95, 0.18);
    }

    .metric-interactive:focus-visible {
      outline-color: rgba(150, 216, 95, 0.62);
    }

    @media (max-width: 820px) {
      :root {
        --side-rail-width: 64px;
      }
      .topbar-inner {
        width: calc(100% - 24px);
      }
      body .page {
        width: calc(100% - var(--side-rail-width) - 32px);
        margin-left: calc(var(--side-rail-width) + 16px);
        padding: 28px 0 48px;
      }
      .side-rail {
        padding-inline: 6px;
      }
      .side-nav-item {
        width: 52px;
      }
    }

    @media (max-width: 560px) {
      :root {
        --topbar-height: 68px;
        --side-rail-width: 58px;
      }
      .brand-mark {
        width: 36px;
        height: 36px;
      }
      .brand-copy strong {
        font-size: 14px;
      }
      .sync-chip {
        display: none;
      }
      .undo-button span,
      .redo-button span {
        display: none;
      }
      .top-actions {
        gap: 6px;
      }
      .side-rail {
        padding-inline: 6px;
      }
      .side-nav-item {
        width: 46px;
        padding-inline: 6px;
      }
      .side-user-link {
        width: 46px;
        padding-inline: 6px;
      }
      body .page {
        width: calc(100% - var(--side-rail-width) - 24px);
        margin-left: calc(var(--side-rail-width) + 12px);
      }
    }

    @media (min-width: 1400px) and (min-aspect-ratio: 2/1) {
      .topbar-inner {
        width: calc(100% - 48px);
        max-width: none;
      }

      body .page {
        width: calc(100% - var(--side-rail-width) - 64px);
        margin-left: calc(var(--side-rail-width) + 32px);
        margin-right: 32px;
      }

      .category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }

    @media (min-width: 2300px) and (min-aspect-ratio: 2/1) {
      .category-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
      }
    }

    .defect-page-summary {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 12px;
    }

    .defect-empty {
      margin-top: 22px;
      padding: 38px 24px;
      border: 1px dashed var(--line-strong);
      border-radius: 14px;
      background: var(--surface);
      text-align: center;
    }

    .defect-empty h2 {
      margin: 0;
      color: var(--ink);
      font-size: 18px;
    }

    .defect-empty p {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
    }

    .defect-series-section {
      margin-top: 18px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
      box-shadow: var(--shadow-soft, none);
    }

    .defect-series-head {
      min-height: 66px;
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      border-bottom: 1px solid var(--line);
      background: var(--surface-soft);
    }

    .defect-series-head > div {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .defect-series-head h2 {
      margin: 0;
      color: var(--ink);
      font-size: 18px;
    }

    .defect-series-head p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
    }

    .defect-table-head,
    .defect-table-row {
      display: grid;
      grid-template-columns: 150px minmax(220px, 1fr) 130px 110px;
      align-items: center;
      gap: 16px;
      padding: 0 18px;
    }

    .defect-table-head {
      min-height: 38px;
      color: var(--muted);
      background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
      font-size: 10px;
      font-weight: 700;
    }

    .defect-table-row {
      min-height: 54px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
    }

    .defect-table-row strong {
      color: var(--ink);
      font-size: 13px;
    }

    .defect-quantity {
      color: var(--danger);
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }

    .defect-table-row button {
      min-height: 32px;
      padding: 0 10px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface);
      font-size: 10px;
      font-weight: 700;
    }

    .shipment-demand-panel {
      margin-top: 18px;
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .shipment-demand-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 14px;
    }

    .shipment-demand-head h2 {
      margin: 0;
      color: var(--ink);
      font-size: 18px;
    }

    .shipment-demand-head p {
      margin: 5px 0 0;
      color: var(--text);
      font-size: 12px;
      line-height: 1.55;
    }

    .shipment-demand-panel {
      -webkit-font-smoothing: auto;
      text-rendering: optimizeLegibility;
    }

    .demand-category-tabs,
    .demand-series-tabs {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scrollbar-width: thin;
    }

    .demand-category-tabs {
      padding-bottom: 6px;
    }

    .demand-category-tab {
      min-height: 48px;
      padding: 7px 11px;
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      color: var(--text);
      background: var(--surface);
      transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
    }

    .demand-category-tab > strong {
      color: var(--ink);
      font-size: 13px;
      font-weight: 700;
      white-space: nowrap;
    }

    .demand-category-tab:hover {
      border-color: var(--line-strong);
      background: var(--surface-soft);
    }

    .demand-category-tab.active {
      border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
      background: var(--accent-soft);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
    }

    .demand-category-tab.active > strong {
      color: var(--ink);
    }

    .demand-category-workspace {
      margin-top: 8px;
    }

    .demand-category-pane {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .demand-series-tabs {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--surface-soft) 56%, transparent);
    }

    .demand-tab-row-label {
      padding: 0 4px 0 2px;
      color: var(--text);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.08em;
    }

    .demand-series-tab {
      min-height: 34px;
      padding: 0 12px;
      flex: 0 0 auto;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--ink);
      background: var(--surface);
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
    }

    .demand-series-tab:hover {
      border-color: var(--line-strong);
      background: var(--surface-soft);
    }

    .demand-series-tab.active {
      border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
      color: var(--ink);
      background: var(--accent-soft);
    }

    .demand-series-empty {
      margin: 0;
      padding: 34px 16px;
      color: var(--text);
      text-align: center;
      font-size: 12px;
      font-weight: 600;
    }

    .demand-product-cell {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .demand-product-media {
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border: 0;
      border-radius: 10px;
      color: var(--muted);
      background: #fff;
    }

    .demand-product-media[data-demand-product-image]:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .demand-product-media[data-demand-product-image]:hover {
      box-shadow: none;
      outline: none;
    }

    .demand-product-media img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .demand-product-media.is-image-flipped img,
    .demand-image-popover img.is-image-flipped {
      transform: rotate(180deg);
    }

    .demand-product-media > span {
      font-size: 8px;
      font-weight: 650;
    }

    .demand-product-cell > strong {
      min-width: 0;
      overflow-wrap: anywhere;
      color: var(--ink);
      font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.45;
      letter-spacing: 0.005em;
    }

    .demand-image-popover {
      position: fixed;
      z-index: 400;
      width: max-content;
      height: max-content;
      max-width: 220px;
      max-height: 220px;
      padding: 0;
      display: block;
      overflow: hidden;
      border: 1px solid var(--line-strong);
      border-radius: 14px;
      background: var(--surface);
      box-shadow: 0 18px 48px rgba(30, 24, 17, 0.22);
      pointer-events: none;
    }

    .demand-image-popover[hidden] {
      display: none;
    }

    .demand-image-popover img {
      width: auto;
      height: auto;
      max-width: 218px;
      max-height: 218px;
      display: block;
      object-fit: contain;
    }

    :root[data-theme="dark"] .demand-image-popover {
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
    }

    .demand-table-scroll {
      overflow-x: auto;
      overscroll-behavior-x: contain;
    }

    .demand-product-table {
      width: 100%;
      min-width: 680px;
      border-collapse: collapse;
      table-layout: fixed;
    }

    .demand-product-table th,
    .demand-product-table td {
      padding: 12px 16px;
      text-align: left;
    }

    .demand-product-table th {
      color: var(--text);
      background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
      font-size: 12px;
      font-weight: 750;
      letter-spacing: 0.015em;
    }

    .demand-product-table th:first-child,
    .demand-product-table td:first-child {
      width: auto;
    }

    .demand-product-table th:not(:first-child),
    .demand-product-table td:not(:first-child) {
      width: 148px;
      text-align: right;
    }

    .demand-product-table tbody tr {
      border-top: 1px solid var(--line);
      transition: background-color 140ms ease;
    }

    .demand-product-table tbody tr[data-demand-product-key] {
      cursor: pointer;
    }

    .demand-product-table tbody tr:hover {
      background: color-mix(in srgb, var(--surface-soft) 48%, transparent);
    }

    .demand-product-table tbody tr.is-context-active {
      background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
      box-shadow: inset 3px 0 0 var(--accent);
    }

    .demand-product-table tbody tr[data-demand-product-key]:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: -2px;
    }

    .demand-product-table td {
      color: var(--text);
      font-size: 12px;
      line-height: 1.45;
    }

    .demand-product-table td > strong {
      color: var(--ink);
      font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.005em;
    }

    .demand-product-table .demand-number {
      color: var(--ink);
      font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
      font-size: 13px;
      font-weight: 650;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .demand-balance {
      min-width: 86px;
      padding: 6px 10px;
      display: inline-flex;
      justify-content: center;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.01em;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .demand-balance.is-shortage {
      border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
      color: var(--danger);
      background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    }

    .demand-balance.is-surplus {
      border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    .demand-table-empty,
    .demand-unmatched-note {
      margin: 0;
      padding: 14px 12px;
      color: var(--muted);
      font-size: 11px;
    }

    .demand-unmatched-note {
      padding: 10px 0 0;
    }

    /* Unified desktop hierarchy and visual consistency */
    :root {
      --radius: 14px;
      --control-radius: 9px;
    }

    h1 {
      font-size: clamp(32px, 2.35vw, 38px);
      line-height: 1.1;
    }

    .detail-title h1 {
      font-size: 30px;
    }

    .title-row {
      align-items: center;
      margin-top: 0;
      min-height: 52px;
    }

    .content-grid,
    .record-date-list {
      margin-top: 24px;
    }

    .purchase-series-list,
    .product-series-list {
      margin-top: 12px;
    }

    .shipment-summary,
    .country-tabs,
    .series-switcher {
      margin-top: 14px;
    }

    .access-page .access-create,
    .access-page .access-list {
      width: min(100%, 1120px);
      margin-inline: auto;
    }

    .metrics,
    .category-grid,
    .management-product-list,
    .combo-grid {
      gap: 12px;
    }

    .metric {
      min-height: 108px;
      padding: 18px;
      border-radius: var(--radius);
    }

    .category-card {
      min-height: 156px;
      padding: 16px;
      border-radius: var(--radius);
    }

    .section-head {
      margin-bottom: 12px;
    }

    .section-head h2 {
      font-size: 18px;
    }

    .shipment-summary span,
    .purchase-summary span {
      min-height: 40px;
      padding: 7px 12px;
      border-radius: var(--control-radius);
      font-size: 12px;
    }

    .shipment-summary strong,
    .purchase-summary strong {
      font-size: 18px;
    }

    .country-tab {
      border-radius: var(--control-radius);
    }

    .country-tab small {
      font-size: 10px;
    }

    .shipment-country-head {
      min-height: 60px;
      padding: 10px 16px;
    }

    .shipment-country-head h2 {
      font-size: 18px;
    }

    .shipment-action-bar {
      min-height: 50px;
      padding: 8px 14px;
    }

    .shipment-action-bar > span {
      font-size: 12px;
    }

    .shipment-table {
      width: min(100%, 1400px);
      margin-inline: auto;
    }

    .shipment-table-head {
      min-height: 38px;
      font-size: 11px;
      font-weight: 700;
    }

    .shipment-row {
      min-height: 48px;
      padding: 5px 14px;
    }

    .shipment-item {
      transition: background-color 140ms ease;
    }

    .shipment-item:hover {
      background: color-mix(in srgb, var(--surface-soft) 52%, transparent);
    }

    .shipment-product strong,
    .purchase-meta h3,
    .management-series-copy strong {
      font-size: 14px;
    }

    .shipment-product span,
    .purchase-meta span,
    .quantity-cell span,
    .series-category,
    .purchase-series-head p,
    .batch-input span,
    .management-series-copy span {
      font-size: 11px;
      line-height: 1.4;
    }

    .subtitle,
    .section-head p {
      font-size: 13px;
      line-height: 1.55;
    }

    .purchase-control label,
    .unit-price-button,
    .purchase-meta .unit-price-button span,
    .record-date-head span,
    .record-series-head span,
    .combo-card-head span,
    .combo-parts span,
    .combo-card-media span,
    .management-level-badge,
    .access-create label span,
    .access-row span {
      font-size: 11px;
      line-height: 1.4;
    }

    .unit-price-button strong {
      font-size: 11px;
    }

    .combo-card-head h2 {
      font-size: 16px;
      line-height: 1.35;
    }

    .access-row strong {
      font-size: 13px;
      line-height: 1.4;
    }

    .access-row button,
    .management-tabs button,
    .filter-button {
      font-size: 11px;
    }

    .purchase-control input,
    .batch-input input,
    .access-create input,
    .access-create select,
    .access-row input {
      font-size: 12px;
    }

    .shipment-quantity strong,
    .quantity-cell strong {
      font-size: 19px;
    }

    .shipment-status {
      min-height: 28px;
      padding: 4px 9px;
      border: 1px solid var(--line);
      color: var(--text);
      background: var(--surface-soft);
      font-size: 11px;
    }

    .status-pending .shipment-status {
      border-color: #eadbb6;
      color: #71501d;
      background: #fbf5e7;
    }

    .status-partial .shipment-status {
      border-color: #ecd6ad;
      color: #87551c;
      background: #fff3dc;
    }

    .status-packed .shipment-status {
      border-color: #c8e2d5;
      color: #176548;
      background: #eaf7f0;
    }

    .status-shipped .shipment-status {
      border-color: var(--line);
      color: var(--muted);
      background: var(--surface-soft);
    }

    .status-unmatched .shipment-status {
      border-color: #e7caca;
      color: var(--danger);
      background: #fdf1f1;
    }

    :root[data-theme="dark"] .status-pending .shipment-status {
      border-color: rgba(244, 202, 97, 0.34);
      color: #f4ca61;
      background: rgba(244, 202, 97, 0.11);
    }

    :root[data-theme="dark"] .status-partial .shipment-status {
      border-color: rgba(244, 181, 126, 0.36);
      color: #f4b57e;
      background: rgba(244, 181, 126, 0.12);
    }

    :root[data-theme="dark"] .status-packed .shipment-status {
      border-color: rgba(150, 216, 95, 0.32);
      color: #b4e988;
      background: rgba(150, 216, 95, 0.11);
    }

    :root[data-theme="dark"] .status-unmatched .shipment-status {
      border-color: rgba(240, 160, 160, 0.34);
      color: #f0a0a0;
      background: rgba(240, 160, 160, 0.11);
    }

    .shipment-action-bar button,
    .shipment-row-actions button,
    .row-action,
    .management-rename,
    .series-product-actions button,
    .defect-table-row button,
    .access-row button {
      min-height: 36px;
      border-radius: var(--control-radius);
      font-size: 11px;
    }

    .primary-page-action,
    .secondary-page-action {
      min-height: 42px;
      border-radius: var(--control-radius);
      font-size: 12px;
    }

    .search-box input,
    .filter-button,
    .purchase-control input,
    .batch-input input,
    .access-create input,
    .access-create select,
    .access-row input {
      min-height: 40px;
      border-radius: var(--control-radius);
    }

    .metric,
    .category-card,
    .purchase-series-group,
    .combo-card,
    .shipment-country-panel,
    .shipment-demand-panel,
    .calendar-card,
    .selected-records-panel,
    .access-create,
    .access-row,
    .record-date-group,
    .defect-series-section {
      border-radius: var(--radius);
    }

    .shipment-summary span,
    .purchase-summary span {
      border-color: transparent;
      background: var(--surface-soft);
      box-shadow: none;
    }

    .country-tab.active,
    .series-tab.active,
    .management-tabs button.active {
      border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--line));
      color: var(--ink);
      background: var(--accent-soft);
      box-shadow: none;
    }

    .country-tab.active span,
    .series-tab.active span,
    .management-tabs button.active {
      color: var(--ink);
    }

    .country-tab.active small,
    .series-tab.active small {
      color: var(--text);
      background: transparent;
    }

    .management-level-badge {
      border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
      color: var(--accent-dark);
      background: var(--accent-soft);
    }

    @media (min-width: 900px) {
      .topbar-inner,
      body .page {
        width: min(1360px, calc(100% - var(--side-rail-width) - 96px));
        margin-left: max(
          calc(var(--side-rail-width) + 32px),
          calc((100vw + var(--side-rail-width) - 1360px) / 2)
        );
        margin-right: auto;
      }

      body .page {
        padding: 30px 0 48px;
      }

      .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      }

      .combo-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
      }
    }

    @media (min-width: 1400px) {
      .shipment-table-head,
      .shipment-row {
        grid-template-columns: 30px minmax(280px, 460px) 84px 84px 84px 96px 230px;
        column-gap: 14px;
        justify-content: space-between;
      }

      .detail-page .product-card {
        width: min(100%, 1240px);
        margin-inline: auto;
        grid-template-columns: 64px minmax(220px, 320px) minmax(340px, 400px) 216px;
        justify-content: space-between;
      }

      .purchase-series-rows .purchase-row {
        width: min(100%, 1060px);
        margin-inline: auto;
        grid-template-columns: minmax(300px, 420px) 360px 112px;
        justify-content: space-between;
        column-gap: 20px;
      }

      .access-create {
        grid-template-columns: minmax(320px, 1fr) 150px auto;
        justify-content: stretch;
      }
    }

    @media (min-width: 1800px) and (min-aspect-ratio: 2/1) {
      .topbar-inner {
        width: min(1600px, calc(100% - 64px));
        max-width: none;
      }

      body .page {
        width: min(1600px, calc(100% - var(--side-rail-width) - 96px));
        margin-left: auto;
        margin-right: auto;
      }

      .category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .combo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .shipments-page .title-row,
      .shipments-page .shipment-summary,
      .shipments-page .country-tabs,
      .shipments-page .shipment-country-panel,
      .shipments-page .shipment-demand-panel {
        width: min(100%, 1400px);
        margin-left: auto;
        margin-right: auto;
      }
    }

    @media (min-width: 2600px) and (min-aspect-ratio: 2/1) {
      .topbar-inner {
        width: min(1800px, calc(100% - 64px));
      }

      body .page {
        width: min(1800px, calc(100% - var(--side-rail-width) - 96px));
      }

      .category-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
      }

      .combo-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }

    /* Hover-expand side navigation */
    :root {
      --side-rail-width: 72px;
      --side-rail-expanded: 240px;
    }

    .side-rail {
      width: var(--side-rail-width);
      padding: 20px 9px 14px;
      overflow: hidden;
      transition:
        width 220ms ease-out,
        box-shadow 220ms ease-out;
      will-change: width;
    }

    .side-rail:hover,
    .side-rail:focus-within,
    .side-rail.is-expanded {
      width: var(--side-rail-expanded);
      box-shadow: 16px 0 34px rgba(0, 0, 0, 0.18);
    }

    .side-nav {
      width: 100%;
    }

    .side-nav-item {
      width: 54px;
      padding: 0 10px;
      grid-template-columns: 34px minmax(0, 0fr);
      justify-content: start;
      column-gap: 0;
      transition:
        width 220ms ease-out,
        color 150ms ease,
        background 150ms ease;
    }

    .side-rail:hover .side-nav-item,
    .side-rail:focus-within .side-nav-item,
    .side-rail.is-expanded .side-nav-item {
      width: 100%;
      grid-template-columns: 34px minmax(0, 1fr);
      column-gap: 12px;
    }

    .side-nav-label {
      position: static;
      z-index: auto;
      width: auto;
      max-width: none;
      min-width: 0;
      padding: 0;
      overflow: hidden;
      border: 0;
      border-radius: 0;
      color: #dfe6e1;
      background: transparent;
      box-shadow: none;
      font-size: 13px;
      font-weight: 600;
      text-overflow: ellipsis;
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition:
        opacity 150ms ease-out 0ms,
        transform 150ms ease-out 0ms,
        visibility 0s linear 0s;
    }

    .side-nav-label::before {
      display: none;
    }

    .side-rail:hover .side-nav-label,
    .side-rail:focus-within .side-nav-label,
    .side-rail.is-expanded .side-nav-label {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
      transition-delay: 80ms, 80ms, 80ms;
    }

    .side-nav-item.active .side-nav-label {
      color: #ffffff;
      font-weight: 700;
    }

    .side-footer {
      width: 100%;
    }

    .side-user-link {
      width: 54px;
      justify-content: center;
      padding: 0;
      transition:
        width 220ms ease-out,
        background 150ms ease;
    }

    .side-rail:hover .side-user-link,
    .side-rail:focus-within .side-user-link,
    .side-rail.is-expanded .side-user-link {
      width: 100%;
      justify-content: flex-start;
      gap: 12px;
      padding: 0 10px;
    }

    .side-user-copy {
      position: static;
      z-index: auto;
      top: auto;
      left: auto;
      width: auto;
      min-width: 0;
      padding: 0;
      overflow: hidden;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition:
        opacity 150ms ease-out 0ms,
        transform 150ms ease-out 0ms,
        visibility 0s linear 0s;
    }

    .side-user-copy::before {
      display: none;
    }

    .side-rail:hover .side-user-copy,
    .side-rail:focus-within .side-user-copy,
    .side-rail.is-expanded .side-user-copy {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
      transition-delay: 80ms, 80ms, 80ms;
    }

    .side-user-copy small {
      font-size: 10px;
    }

    @media (min-width: 900px) and (max-width: 1799px) {
      .topbar-inner,
      body .page {
        transition:
          width 220ms ease-out,
          margin-left 220ms ease-out;
      }

      body:has(.side-rail:hover) .topbar-inner,
      body:has(.side-rail:focus-within) .topbar-inner,
      body:has(.side-rail.is-expanded) .topbar-inner,
      body:has(.side-rail:hover) .page,
      body:has(.side-rail:focus-within) .page,
      body:has(.side-rail.is-expanded) .page {
        width: min(1360px, calc(100% - var(--side-rail-expanded) - 64px));
        margin-left: calc(var(--side-rail-expanded) + 32px);
        margin-right: auto;
      }
    }

    @media (max-width: 560px) {
      :root {
        --side-rail-width: 58px;
      }
    }

    /* Haven Home console theme */
    :root {
      color-scheme: light;
      --bg: #fbf8f2;
      --surface: #fffdf9;
      --surface-soft: #f4eee4;
      --ink: #24211d;
      --text: #4b463f;
      --muted: #827a6f;
      --line: #e4dccf;
      --line-strong: #d4c8b8;
      --accent: #e8a548;
      --accent-dark: #b97822;
      --accent-ink: #211f1c;
      --accent-soft: #fbedd7;
      --warning: #a66c1f;
      --warning-soft: #f9ecd3;
      --danger: #a65346;
      --shadow: 0 18px 46px rgba(43, 35, 25, 0.10);
      --radius: 20px;
      --control-radius: 14px;
      --side-rail-width: 72px;
      --side-rail-expanded: 264px;
      --inspector-width: 400px;
      --side-rail-bg: #211f1c;
      --side-rail-soft: #2c2925;
      --topbar-bg: rgba(251, 248, 242, 0.94);
    }

    :root[data-theme="dark"] {
      color-scheme: dark;
      --bg: #171512;
      --surface: #211e1a;
      --surface-soft: #2b2722;
      --ink: #f8f2e8;
      --text: #d9d0c3;
      --muted: #a59b8e;
      --line: #3b352e;
      --line-strong: #51493f;
      --accent: #e8a548;
      --accent-dark: #f2bd70;
      --accent-ink: #211f1c;
      --accent-soft: rgba(232, 165, 72, 0.14);
      --warning: #f0bd71;
      --warning-soft: rgba(232, 165, 72, 0.13);
      --danger: #e2a294;
      --shadow: 0 18px 46px rgba(0, 0, 0, 0.30);
      --side-rail-bg: #161411;
      --side-rail-soft: #24211d;
      --topbar-bg: rgba(23, 21, 18, 0.94);
    }

    html,
    body {
      background: var(--bg);
      color: var(--text);
    }

    body {
      background:
        radial-gradient(circle at 92% 0%, rgba(232, 165, 72, 0.10), transparent 32rem),
        var(--bg);
      font-family: Inter, "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
    }

    h1,
    .category-card h3,
    .section-head h2,
    .product-card h3,
    .purchase-meta h3,
    .combo-card-head h2,
    .management-series-copy strong,
    .shipment-product strong {
      font-family: Inter, "Segoe UI Variable Display", "Microsoft YaHei UI", sans-serif;
    }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    a:focus-visible {
      outline-color: rgba(232, 165, 72, 0.58);
    }

    .side-rail {
      top: 0;
      z-index: 30;
      padding: 26px 9px 18px;
      overflow: hidden;
      background:
        radial-gradient(circle at 42% 0%, rgba(232, 165, 72, 0.10), transparent 18rem),
        var(--side-rail-bg);
    }

    .side-rail:hover,
    .side-rail:focus-within,
    .side-rail.is-expanded {
      width: var(--side-rail-expanded);
      box-shadow: 18px 0 40px rgba(24, 18, 11, 0.20);
    }

    .side-brand {
      min-height: 52px;
      padding: 0 10px 24px;
      display: flex;
      align-items: center;
      gap: 13px;
      overflow: hidden;
    }

    .side-brand-mark {
      width: 42px;
      height: 42px;
      flex: 0 0 42px;
      display: grid;
      place-items: center;
      border-radius: 13px;
      color: var(--charcoal, #211f1c);
      background: var(--accent);
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.08em;
    }

    .side-brand-copy {
      min-width: 0;
      display: grid;
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition:
        opacity 150ms ease-out 0ms,
        transform 150ms ease-out 0ms,
        visibility 0s linear 0s;
    }

    .side-brand-copy strong {
      overflow: hidden;
      color: #fffaf1;
      font-size: 15px;
      font-weight: 650;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .side-brand-copy span {
      margin-top: 3px;
      overflow: hidden;
      color: #8d857a;
      font-size: 8px;
      letter-spacing: 0.08em;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .side-rail:hover .side-brand-copy,
    .side-rail:focus-within .side-brand-copy,
    .side-rail.is-expanded .side-brand-copy {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
      transition-delay: 80ms, 80ms, 80ms;
    }

    .side-section-label {
      height: 0;
      margin: 0 11px;
      overflow: hidden;
      color: #746e65;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.15em;
      opacity: 0;
      transition: opacity 140ms ease-out 0ms;
    }

    .side-rail:hover .side-section-label,
    .side-rail:focus-within .side-section-label,
    .side-rail.is-expanded .side-section-label {
      height: auto;
      margin-bottom: 9px;
      opacity: 1;
      transition-delay: 80ms;
    }

    .side-nav-item {
      min-height: 50px;
      border-radius: 14px;
    }

    .side-nav-item.active {
      background: var(--side-rail-soft);
    }

    .side-nav-icon {
      width: 30px;
      height: 30px;
      border-radius: 9px;
    }

    .side-nav-item.active .side-nav-icon,
    .brand-mark,
    .side-avatar,
    .avatar {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .side-nav-label {
      color: #dcd6ca;
      font-size: 12px;
      font-weight: 560;
    }

    .side-nav-item.active .side-nav-label {
      color: #fffaf1;
    }

    .side-user-copy strong {
      color: #efeadf;
    }

    .side-user-copy small {
      color: #8d857b;
    }

    .topbar {
      z-index: 20;
      height: var(--topbar-height);
      padding-left: calc(var(--side-rail-width) + 24px);
      padding-right: 24px;
      border-bottom-color: var(--line);
      background: var(--topbar-bg);
      transition: padding-left 220ms ease-out;
    }

    body:has(.side-rail:hover) .topbar,
    body:has(.side-rail:focus-within) .topbar,
    body:has(.side-rail.is-expanded) .topbar {
      padding-left: calc(var(--side-rail-expanded) + 24px);
    }

    .topbar-inner {
      width: 100%;
      max-width: none;
      margin: 0;
      gap: 16px;
    }

    .topbar-page-title {
      min-width: 0;
      display: flex;
      align-items: baseline;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
    }

    .topbar-page-title strong {
      color: var(--ink);
      font-size: 12px;
      font-weight: 650;
    }

    .topbar-context {
      min-height: 38px;
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      gap: 9px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: var(--surface);
      font-size: 10px;
      white-space: nowrap;
    }

    .topbar-context i {
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--accent);
    }

    .sync-chip,
    .undo-button,
    .redo-button,
    .theme-toggle,
    .members-button {
      border-color: var(--line);
      border-radius: 12px;
      color: var(--text);
      background: var(--surface);
    }

    .context-inspector {
      position: fixed;
      z-index: 16;
      top: var(--topbar-height);
      right: 0;
      bottom: 0;
      width: var(--inspector-width);
      padding: 24px 22px;
      overflow: auto;
      border-left: 1px solid var(--line);
      background: #f0e9de;
    }

    :root[data-theme="dark"] .context-inspector {
      background: #1c1916;
    }

    .context-inspector-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .context-inspector-head > span {
      color: var(--muted);
      font-size: 9px;
      font-weight: 750;
      letter-spacing: 0.1em;
    }

    .context-sync-badge {
      padding: 6px 9px;
      border: 1px solid var(--line-strong);
      border-radius: 999px;
      color: var(--muted);
      background: color-mix(in srgb, var(--surface) 60%, transparent);
      font-size: 9px;
      white-space: nowrap;
    }

    .context-inspector > h2 {
      margin: 0 0 16px;
      color: var(--ink);
      font-size: 22px;
      font-weight: 650;
      line-height: 1.3;
      letter-spacing: -0.025em;
    }

    .context-inspector > p {
      margin: 7px 0 16px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.55;
    }

    .context-focus-card,
    .context-note-card {
      border: 1px solid var(--line);
      background: var(--surface);
    }

    .context-focus-card {
      min-height: 136px;
      padding: 17px;
      display: grid;
      align-content: center;
      border-radius: var(--radius);
    }

    .context-focus-card > span {
      color: var(--muted);
      font-size: 10px;
    }

    .context-focus-card strong {
      margin-top: 8px;
      color: var(--ink);
      font-family: "Cascadia Mono", Consolas, monospace;
      font-size: 31px;
      font-weight: 650;
      letter-spacing: -0.04em;
    }

    .context-focus-card small {
      margin-top: 4px;
      color: var(--muted);
      font-size: 9px;
    }

    .context-stat-grid {
      margin-top: 10px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .context-stat-grid div {
      min-height: 74px;
      padding: 11px 7px;
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 5px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: color-mix(in srgb, var(--surface) 74%, transparent);
      text-align: center;
    }

    .context-stat-grid span {
      color: var(--muted);
      font-size: 9px;
    }

    .context-stat-grid strong {
      color: var(--ink);
      font-family: "Cascadia Mono", Consolas, monospace;
      font-size: 14px;
      font-weight: 650;
    }

    .context-note-card {
      margin-top: 10px;
      padding: 15px;
      border-radius: 14px;
    }

    .context-note-card > strong {
      color: var(--ink);
      font-size: 11px;
    }

    .context-note-card p {
      margin: 7px 0 13px;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.6;
    }

    .context-note-card > span {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--muted);
      font-size: 9px;
    }

    .context-note-card i {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--accent);
    }

    @media (min-width: 1440px) {
      body .page {
        width: calc(100% - var(--side-rail-width) - var(--inspector-width) - 64px);
        margin-left: calc(var(--side-rail-width) + 32px);
        margin-right: calc(var(--inspector-width) + 32px);
        padding: 28px 0 42px;
        transition:
          width 220ms ease-out,
          margin-left 220ms ease-out;
      }

      body:has(.side-rail:hover) .page,
      body:has(.side-rail:focus-within) .page,
      body:has(.side-rail.is-expanded) .page {
        width: calc(100% - var(--side-rail-expanded) - var(--inspector-width) - 64px);
        margin-left: calc(var(--side-rail-expanded) + 32px);
      }

      .shipment-table-head,
      .shipment-row {
        grid-template-columns: 26px minmax(180px, 1fr) 64px 64px 64px 74px 178px;
        gap: 8px;
      }

      .detail-page .product-card {
        width: 100%;
        grid-template-columns: 58px minmax(190px, 260px) minmax(280px, 340px) 198px;
        gap: 10px;
      }

      .purchase-series-rows .purchase-row {
        width: 100%;
        grid-template-columns: minmax(230px, 1fr) 300px 100px;
        gap: 12px;
      }

      .metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      }

      .combo-grid {
        grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
      }
    }

    @media (max-width: 1439px) {
      .context-inspector {
        display: none;
      }

      .topbar {
        padding-left: calc(var(--side-rail-width) + 24px);
      }

      body:has(.side-rail:hover) .topbar,
      body:has(.side-rail:focus-within) .topbar,
      body:has(.side-rail.is-expanded) .topbar {
        padding-left: calc(var(--side-rail-expanded) + 24px);
      }

      body .page {
        width: min(1360px, calc(100% - var(--side-rail-width) - 64px));
        margin-left: calc(var(--side-rail-width) + 32px);
        margin-right: 32px;
      }

      body:has(.side-rail:hover) .page,
      body:has(.side-rail:focus-within) .page,
      body:has(.side-rail.is-expanded) .page {
        width: calc(100% - var(--side-rail-expanded) - 64px);
        margin-left: calc(var(--side-rail-expanded) + 32px);
      }
    }

    .metric,
    .category-card,
    .purchase-series-group,
    .combo-card,
    .shipment-country-panel,
    .shipment-demand-panel,
    .calendar-card,
    .selected-records-panel,
    .record-date-group,
    .access-create,
    .access-row,
    .defect-series-section {
      border-color: var(--line);
      border-radius: var(--radius);
      background: var(--surface);
      box-shadow: none;
    }

    .purchase-row,
    .product-card,
    .management-series-card,
    .series-product-row,
    .combo-sku-row input,
    .batch-input input,
    .purchase-control,
    .access-create input,
    .access-create select,
    .access-row input,
    .search-box input,
    .filter-button {
      border-color: var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .primary-page-action,
    .secondary-page-action,
    .shipment-action-bar button,
    .shipment-row-actions button,
    .row-action,
    .management-rename,
    .series-product-actions button,
    .defect-table-row button,
    .access-row button {
      border-radius: var(--control-radius);
    }

    .primary-page-action,
    .shipment-action-bar button:first-of-type,
    .series-submit button,
    .purchase-entry,
    .modal-confirm,
    .shipment-empty button,
    .selected-day-empty button,
    .records-empty button {
      border-color: var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
    }

    .country-tab.active,
    .series-tab.active,
    .management-tabs button.active,
    .management-level-badge {
      border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
      color: var(--ink);
      background: var(--accent-soft);
      box-shadow: none;
    }

    .country-tab.active span,
    .series-tab.active span,
    .management-tabs button.active,
    .country-tab.active small,
    .series-tab.active small {
      color: var(--ink);
    }

    .metric-icon,
    .metric-icon.slate,
    .category-card .category-icon,
    .category-card:nth-child(3n+1) .category-icon,
    .category-card:nth-child(3n+2) .category-icon,
    .category-card:nth-child(3n) .category-icon {
      color: #8a642d;
      background: var(--accent-soft);
    }

    .metric strong,
    .category-footer strong,
    .stock-cell strong,
    .quantity-cell strong,
    .shipment-quantity strong,
    .series-product-stock strong,
    .low-stock-number,
    .management-count,
    .context-focus-card strong {
      font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
      font-variant-numeric: tabular-nums;
    }

    .shipment-summary span,
    .purchase-summary span {
      border-color: var(--line);
      background: var(--surface);
    }

    .shipment-status {
      border-color: #ead5b2;
      color: #87571f;
      background: var(--amber-soft);
    }

    .status-packed .shipment-status {
      border-color: #cbdccd;
      color: var(--green);
      background: var(--green-soft);
    }

    .status-shipped .shipment-status {
      border-color: var(--line);
      color: var(--muted);
      background: var(--surface-soft);
    }

    .status-unmatched .shipment-status {
      border-color: #e5c4bc;
      color: var(--red);
      background: var(--red-soft);
    }

    :root[data-theme="dark"] .context-inspector {
      border-left-color: var(--line);
      background: #1b1815;
    }

    :root[data-theme="dark"] .context-focus-card,
    :root[data-theme="dark"] .context-stat-grid div,
    :root[data-theme="dark"] .context-note-card {
      background: var(--surface);
    }

    .context-inspector.combo-inspector-editor {
      padding: 0;
      overflow: hidden;
      background: #f0e9de;
    }

    :root[data-theme="dark"] .context-inspector.combo-inspector-editor {
      background: #1c1916;
    }

    .combo-dock-panel {
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr) auto;
      color: var(--text);
    }

    .combo-dock-panel .quantity-modal-head {
      align-items: flex-start;
      padding: 24px 22px 14px;
      border-bottom: 1px solid var(--line);
    }

    .combo-dock-panel .quantity-modal-head h2 {
      font-size: 22px;
      line-height: 1.25;
      letter-spacing: -0.025em;
    }

    .combo-dock-scroll {
      min-height: 0;
      padding: 0 22px 16px;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .combo-inspector-editor .combo-form-grid {
      margin-top: 16px;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .combo-inspector-editor .combo-form-wide {
      grid-column: auto;
    }

    .combo-inspector-editor .combo-form-grid label > span,
    .combo-inspector-editor .combo-sku-head > span,
    .combo-inspector-editor .combo-components-head > span {
      font-size: 10px;
      font-weight: 650;
    }

    .combo-inspector-editor .combo-form-grid input,
    .combo-inspector-editor .combo-component-row input {
      height: 40px;
      border-color: var(--line-strong);
      border-radius: var(--control-radius);
      background: var(--surface);
    }

    .combo-inspector-editor .combo-sku-head button,
    .combo-inspector-editor .combo-components-head button,
    .combo-inspector-editor .combo-sku-row button,
    .combo-inspector-editor .combo-component-row button {
      border-color: var(--line-strong);
      border-radius: 10px;
      background: var(--surface);
    }

    .combo-inspector-editor .combo-sku-head button {
      color: var(--ink);
      background: var(--accent-soft);
    }

    .combo-inspector-editor .image-upload-control {
      align-items: flex-start;
      gap: 10px;
    }

    .combo-inspector-editor .image-preview {
      flex-basis: 64px;
      width: 64px;
      height: 64px;
      border-radius: 14px;
    }

    .combo-inspector-editor .image-upload-actions {
      gap: 7px;
    }

    .combo-inspector-editor .image-upload-control input[type="file"],
    .combo-inspector-editor .image-remove-button {
      min-height: 38px;
      height: 38px;
      border-radius: 10px;
    }

    .combo-inspector-editor .combo-components-head {
      margin-top: 18px;
      padding-top: 15px;
      border-top: 1px solid var(--line);
    }

    .combo-inspector-editor .combo-components-head button {
      min-height: 32px;
      padding-inline: 10px;
    }

    .combo-inspector-editor .combo-components-empty {
      padding: 24px 12px;
      border-color: var(--line-strong);
      border-radius: 14px;
      background: color-mix(in srgb, var(--surface) 58%, transparent);
    }

    .combo-inspector-editor .combo-component-row {
      grid-template-columns: minmax(0, 1fr) 82px 48px;
      gap: 5px;
    }

    .combo-inspector-editor .combo-component-name {
      padding: 8px 9px;
      border-color: var(--line);
      border-radius: 10px;
      background: var(--surface);
    }

    .combo-inspector-editor .combo-component-name strong {
      font-size: 11px;
    }

    .combo-inspector-editor .combo-component-name span {
      font-size: 9px;
    }

    .combo-inspector-editor .combo-component-row button {
      min-height: 40px;
      color: var(--danger);
      background: var(--surface);
    }

    .combo-inspector-editor .combo-modal-actions {
      margin-top: 0;
      padding: 14px 22px 18px;
      border-top: 1px solid var(--line);
      background: #f0e9de;
      box-shadow: 0 -8px 20px rgba(32, 25, 17, 0.06);
    }

    :root[data-theme="dark"] .combo-inspector-editor .combo-modal-actions {
      background: #1c1916;
      box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.22);
    }

    .combo-inspector-editor .modal-cancel,
    .combo-inspector-editor .modal-confirm {
      min-height: 42px;
      border-radius: var(--control-radius);
    }

    @media (max-width: 1439px) {
      .context-inspector.combo-inspector-editor {
        display: block;
        z-index: 70;
        box-shadow: -18px 0 40px rgba(32, 25, 17, 0.18);
      }
    }

    .combo-parts {
      min-width: 0;
      display: grid;
      gap: 5px;
    }

    .combo-parts-line {
      min-width: 0;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 6px;
      overflow: hidden;
      white-space: nowrap;
      -webkit-mask-image: linear-gradient(
        to right,
        #000 0,
        #000 calc(100% - 34px),
        transparent 100%
      );
      mask-image: linear-gradient(
        to right,
        #000 0,
        #000 calc(100% - 34px),
        transparent 100%
      );
    }

    .combo-parts-line > span {
      flex: 0 0 auto;
      max-width: none;
      white-space: nowrap;
    }

    .combo-parts-line .combo-parts-empty {
      color: var(--muted);
      background: transparent;
    }

    .packaging-parts > span {
      color: #806548;
      background: color-mix(in srgb, var(--amber-soft) 76%, var(--surface));
    }

    :root[data-theme="dark"] .packaging-parts > span {
      color: #e3bd84;
      background: rgba(232, 165, 72, 0.10);
    }

    .side-nav {
      position: relative;
    }

    .side-nav-indicator {
      position: absolute;
      z-index: 0;
      top: 0;
      left: 0;
      right: 0;
      height: 50px;
      border-radius: 14px;
      background: var(--side-rail-soft);
      box-shadow: inset 3px 0 0 var(--accent);
      pointer-events: none;
      opacity: 1;
      transform: translateY(calc(var(--indicator-index, 0) * 57px));
      transition:
        transform 280ms cubic-bezier(0.22, 0.8, 0.3, 1),
        opacity 140ms ease-out;
    }

    .side-nav-indicator.is-hidden {
      opacity: 0;
    }

    .side-nav-item {
      position: relative;
      z-index: 1;
      background: transparent !important;
    }

    .side-nav-item:hover {
      background: rgba(255, 255, 255, 0.045) !important;
    }

    .side-collapse-toggle {
      width: 100%;
      min-height: 36px;
      margin: 0 0 16px;
      padding: 0 11px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 11px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 11px;
      color: #9d968c;
      background: rgba(255, 255, 255, 0.025);
      font-size: 10px;
      white-space: nowrap;
      transition:
        width 220ms ease-out,
        color 150ms ease,
        background 150ms ease;
    }

    .side-collapse-toggle:hover {
      color: #f7f1e7;
      background: rgba(255, 255, 255, 0.055);
    }

    .side-toggle-icon {
      width: 30px;
      flex: 0 0 30px;
      display: grid;
      place-items: center;
      color: var(--accent);
      font-size: 21px;
      line-height: 1;
    }

    .side-toggle-copy {
      min-width: 0;
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition:
        opacity 150ms ease-out 0ms,
        transform 150ms ease-out 0ms,
        visibility 0s linear 0s;
    }

    .side-rail:hover .side-toggle-copy,
    .side-rail:focus-within .side-toggle-copy,
    .side-rail.is-expanded .side-toggle-copy {
      opacity: 1;
      visibility: visible;
      transform: translateX(0);
      transition-delay: 80ms, 80ms, 80ms;
    }

    .side-rail.is-collapsed,
    .side-rail.is-collapsed:hover,
    .side-rail.is-collapsed:focus-within {
      width: var(--side-rail-width);
      box-shadow: none;
    }

    .side-rail.is-collapsed .side-brand-copy,
    .side-rail.is-collapsed .side-section-label,
    .side-rail.is-collapsed .side-nav-label,
    .side-rail.is-collapsed .side-toggle-copy,
    .side-rail.is-collapsed .side-user-copy {
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition-delay: 0ms, 0ms, 0ms;
    }

    .side-rail.is-collapsed .side-nav-item {
      width: 54px;
      grid-template-columns: 34px minmax(0, 0fr);
      column-gap: 0;
    }

    .side-rail.is-collapsed .side-user-link {
      width: 54px;
      justify-content: center;
      gap: 0;
      padding: 0;
    }

    body:has(.side-rail.is-collapsed) .topbar {
      padding-left: calc(var(--side-rail-width) + 24px);
    }

    @media (min-width: 1440px) {
      body:has(.side-rail.is-collapsed) .page {
        width: calc(100% - var(--side-rail-width) - var(--inspector-width) - 64px);
        margin-left: calc(var(--side-rail-width) + 32px);
      }
    }

    @media (max-width: 1439px) {
      body:has(.side-rail.is-collapsed) .page {
        width: calc(100% - var(--side-rail-width) - 64px);
        margin-left: calc(var(--side-rail-width) + 32px);
      }
    }

    .side-brand-copy,
    .side-toggle-copy,
    .side-user-copy {
      max-width: 180px;
      transition:
        opacity 150ms ease-out 0ms,
        transform 150ms ease-out 0ms,
        visibility 0s linear 0ms,
        max-width 180ms ease-out;
    }

    .side-rail.is-collapsed .side-brand-copy,
    .side-rail.is-collapsed .side-toggle-copy,
    .side-rail.is-collapsed .side-user-copy {
      width: 0;
      min-width: 0;
      max-width: 0;
      flex: 0 0 0;
      opacity: 0;
      visibility: hidden;
      transform: translateX(-4px);
      transition-delay: 0ms, 0ms, 0ms, 0ms;
    }

    .side-rail.is-collapsed .side-brand {
      padding-inline: 0;
      justify-content: center;
      gap: 0;
    }

    .side-rail.is-collapsed .side-collapse-toggle,
    .side-rail.is-collapsed .side-user-link {
      justify-content: center;
      gap: 0;
      padding-inline: 0;
    }

    /* Keep the icon rail fixed while only the label area animates. */
    .side-nav {
      align-items: stretch;
    }

    .side-nav-item {
      width: 100%;
      flex-basis: 50px;
      margin-inline: 0;
    }

    .side-nav-icon {
      justify-self: center;
    }

    .side-brand {
      padding-inline: 6px 10px;
      justify-content: flex-start;
    }

    .side-section-label,
    .side-rail:hover .side-section-label,
    .side-rail:focus-within .side-section-label,
    .side-rail.is-expanded .side-section-label {
      height: 18px;
      margin: 0 11px 9px;
    }

    .side-section-label {
      opacity: 0;
      transition: opacity 140ms ease-out 0ms;
    }

    .side-rail:hover .side-section-label,
    .side-rail:focus-within .side-section-label,
    .side-rail.is-expanded .side-section-label {
      opacity: 1;
      transition-delay: 80ms;
    }

    .unit-price-readonly {
      min-height: 28px;
      padding: 4px 7px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border-radius: 7px;
      color: var(--muted);
      background: var(--surface-soft);
      font-size: 9px;
    }

    .unit-price-readonly strong {
      color: var(--ink);
      font-size: 10px;
    }

    .selected-records-head.is-price-hidden {
      grid-template-columns: minmax(0, 1fr) 170px;
    }

    .record-series-head.is-price-hidden {
      grid-template-columns: minmax(0, 1fr) 170px;
    }

    .record-row.is-price-hidden.is-edit-hidden {
      grid-template-columns: minmax(0, 1fr) 100px 78px;
    }

    @media (max-width: 560px) {
      .selected-records-head.is-price-hidden {
        grid-template-columns: 1fr;
      }

      .record-series-head.is-price-hidden {
        grid-template-columns: minmax(0, 1fr);
      }

      .record-row.is-price-hidden.is-edit-hidden {
        grid-template-columns: minmax(0, 1fr) 68px;
      }
    }

    .topbar-mode-switch {
      min-height: 38px;
      padding: 4px;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--surface);
    }

    .topbar-mode-switch > span {
      padding: 0 7px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 700;
    }

    .topbar-mode-switch button {
      min-height: 28px;
      padding: 0 10px;
      border: 0;
      border-radius: 999px;
      color: var(--muted);
      background: transparent;
      font-size: 10px;
      font-weight: 650;
    }

    .topbar-mode-switch button.active {
      color: var(--accent-ink);
      background: var(--accent);
    }

    .context-description {
      margin: 7px 0 16px !important;
      color: var(--muted) !important;
      font-size: 11px !important;
      line-height: 1.55 !important;
    }

    .context-preview-card {
      margin-bottom: 10px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--surface);
    }

    .context-preview-media {
      height: auto;
      min-height: 136px;
      display: grid;
      place-items: center;
      overflow: hidden;
      border: 1px dashed var(--line-strong);
      border-radius: 14px;
      background: var(--surface-soft);
    }

    .context-preview-media img {
      display: block;
      width: 100%;
      height: auto;
      object-fit: contain;
    }

    .context-preview-media span {
      color: var(--muted);
      font-size: 10px;
    }

    .context-preview-copy {
      padding: 12px 2px 0;
    }

    .context-preview-copy strong {
      display: block;
      color: var(--ink);
      font-size: 15px;
      font-weight: 650;
      line-height: 1.35;
    }

    .context-preview-copy span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 9px;
    }

    .context-sku-list {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 10px;
    }

    .context-sku-list span,
    .context-sku-list button {
      padding: 4px 7px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--muted);
      background: var(--cream, var(--bg));
      font-size: 9px;
    }

    .context-sku-list button {
      cursor: pointer;
      transition:
        border-color 140ms ease,
        color 140ms ease,
        background 140ms ease;
    }

    .context-sku-list button:hover {
      border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
      color: var(--ink);
      background: var(--accent-soft);
    }

    .context-progress-card,
    .context-detail-card {
      margin-top: 10px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
    }

    .context-progress-card > div:first-child {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      color: var(--muted);
      font-size: 9px;
    }

    .context-progress-card strong {
      color: var(--ink);
      font-size: 15px;
      font-weight: 650;
    }

    .context-progress-track {
      height: 6px;
      margin-top: 10px;
      overflow: hidden;
      border-radius: 999px;
      background: var(--surface-soft);
    }

    .context-progress-track i {
      height: 100%;
      display: block;
      border-radius: inherit;
      background: var(--accent);
      transition: width 220ms ease-out;
    }

    .context-detail-card > strong {
      color: var(--ink);
      font-size: 10px;
      font-weight: 650;
    }

    .context-detail-list {
      margin-top: 8px;
    }

    .context-detail-list > div {
      min-height: 36px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-top: 1px solid var(--line-soft, var(--line));
    }

    .context-detail-list > div:first-child {
      border-top: 0;
    }

    .context-detail-list span {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .context-detail-list b {
      overflow: hidden;
      color: var(--text);
      font-size: 9px;
      font-weight: 600;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .context-detail-list small {
      overflow: hidden;
      color: var(--muted);
      font-size: 8px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .context-detail-list > div > strong {
      flex: 0 0 auto;
      color: var(--ink);
      font-size: 10px;
    }

    .context-inspector.context-product-links {
      padding: 0;
      overflow: hidden;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
    }

    .context-product-links-scroll {
      min-height: 0;
      padding: 24px 22px 16px;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .context-product-links .product-link-stats {
      margin-top: 0;
    }

    .context-product-links .product-related-card {
      margin-top: 12px;
    }

    .context-related-combo-list {
      margin-top: 10px;
      display: grid;
      gap: 8px;
    }

    .context-related-combo {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--surface-soft);
    }

    .context-related-combo > summary {
      min-height: 58px;
      padding: 10px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto 10px;
      align-items: center;
      gap: 9px;
      list-style: none;
      cursor: pointer;
    }

    .context-related-combo > summary::-webkit-details-marker {
      display: none;
    }

    .context-related-combo > summary > span,
    .context-related-countries > div > span {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .context-related-combo > summary b,
    .context-related-countries b {
      overflow: hidden;
      color: var(--ink);
      font-size: 11px;
      font-weight: 700;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .context-related-combo > summary small,
    .context-related-countries small {
      overflow: hidden;
      color: var(--muted);
      font-size: 9px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .context-related-combo > summary > strong,
    .context-related-countries > div > strong {
      color: var(--ink);
      font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
      font-size: 11px;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .context-related-combo > summary > i {
      width: 7px;
      height: 7px;
      border-right: 1.5px solid var(--muted);
      border-bottom: 1.5px solid var(--muted);
      transform: rotate(45deg);
      transition: transform 160ms ease;
    }

    .context-related-combo[open] > summary > i {
      transform: rotate(225deg);
    }

    .context-related-countries {
      padding: 0 10px 8px;
      border-top: 1px solid var(--line);
    }

    .context-related-countries > div {
      min-height: 42px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    }

    .context-related-countries > div:first-child {
      border-top: 0;
    }

    .context-product-pinned-card {
      padding: 12px 22px 18px;
      border-top: 1px solid var(--line);
      background: #f0e9de;
      box-shadow: 0 -10px 24px rgba(32, 25, 17, 0.08);
    }

    .context-product-pinned-card .context-preview-media {
      height: 130px;
      min-height: 0;
    }

    .context-product-pinned-card .context-preview-copy {
      padding-top: 9px;
    }

    :root[data-theme="dark"] .context-product-pinned-card {
      background: #1c1916;
      box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28);
    }

    .context-actions {
      margin-top: 10px;
      display: grid;
      grid-template-columns: 1fr 1.25fr;
      gap: 7px;
    }

    .context-actions:has(> :only-child) {
      grid-template-columns: 1fr;
    }

    .context-actions button {
      min-height: 40px;
      padding: 0 12px;
      border-radius: 14px;
      font-size: 10px;
      font-weight: 700;
    }

    .context-secondary-action {
      border: 1px solid var(--line-strong);
      color: var(--text);
      background: var(--surface);
    }

    .context-primary-action {
      border: 1px solid var(--accent);
      color: var(--accent-ink);
      background: var(--accent);
    }

    .combo-card,
    .product-card,
    .shipment-item {
      cursor: pointer;
    }

    .combo-card.is-context-active,
    .product-card.is-context-active {
      border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
    }

    .shipment-item.is-context-active {
      background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
    }

    .side-collapse-toggle {
      padding-inline: 12px;
      justify-content: flex-start;
    }

    .side-rail.is-collapsed .side-brand {
      padding-inline: 6px 0;
      justify-content: flex-start;
      gap: 0;
    }

    .side-user-link,
    .side-rail.is-collapsed .side-user-link {
      justify-content: flex-start;
      gap: 0;
      padding: 0 10px;
    }

    .side-rail.is-collapsed .side-collapse-toggle {
      padding-inline: 12px;
      justify-content: flex-start;
    }

    .side-rail.is-collapsed .side-nav-item {
      width: 100%;
      margin-inline: 0;
    }

    .side-rail.is-collapsed .side-section-label {
      opacity: 0;
      transition-delay: 0ms;
    }

    .side-rail.is-expanded .side-section-label {
      opacity: 1;
      transition-delay: 80ms;
    }
