:root {
  color-scheme: light;
  --page: #f4f6f3;
  --paper: #ffffff;
  --paper-muted: #f8faf8;
  --ink: #192725;
  --ink-soft: #5f706d;
  --ink-faint: #84928d;
  --line: #dce4df;
  --line-soft: #eaf0ec;
  --nav: #172328;
  --nav-soft: #213237;
  --accent: #147a58;
  --accent-strong: #0d684a;
  --accent-tint: #e9f5ee;
  --warning: #9c671c;
  --danger: #b23e37;
  --radius-control: 8px;
  --radius-card: 14px;
  --shadow-overlay: 0 20px 60px rgba(12, 31, 24, .18);
  --sidebar-width: 250px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 16px; }
body { min-width: 320px; margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow, .panel-kicker { margin: 0; font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { color: var(--accent); }
.panel-kicker { color: var(--ink-faint); }
.brand-mark { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--accent); border-radius: 10px; transform: skew(-8deg); }
.brand-mark span { width: 4px; height: 14px; border-radius: 3px; background: white; }
.brand-mark span:nth-child(2) { height: 22px; }
.brand-mark span:nth-child(3) { height: 10px; align-self: center; }
.brand-mark-small { width: 36px; height: 36px; flex: 0 0 36px; }

.button { min-height: 40px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-outline { border-color: #b8d7c5; background: #f7fcf8; color: var(--accent-strong); }
.button-outline:hover:not(:disabled) { background: var(--accent-tint); }
.button-quiet { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button-quiet:hover:not(:disabled) { background: var(--paper-muted); }
.button-wide { width: 100%; }
.text-button { padding: 8px 3px; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.text-button:hover { color: var(--accent); }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; }
.icon-button:hover { border-color: var(--accent); }

.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 52%) 1fr; background: var(--paper); }
.login-card { width: min(420px, calc(100% - 48px)); margin: auto; padding: 60px 0; }
.login-card .eyebrow { margin-top: 38px; }
.login-card h1 { margin: 12px 0 16px; font-size: clamp(32px, 4vw, 46px); line-height: 1.15; letter-spacing: -.04em; }
.login-copy { max-width: 360px; margin: 0 0 42px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.login-card form { display: grid; gap: 12px; }
.login-card label { color: var(--ink); font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fbfcfa; color: var(--ink); }
.login-card input:hover { border-color: #a9bdb2; }
.login-card .button { margin-top: 8px; height: 48px; justify-content: space-between; padding-inline: 17px; }
.form-message { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }
.login-foot { margin-top: 64px; font-size: 12px; color: var(--ink-faint); }
.login-aside { position: relative; min-height: 100dvh; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--nav); color: #d2e0d8; }
.login-aside::before { content: ""; position: absolute; width: 470px; height: 470px; left: 50%; top: 48%; border: 1px solid rgba(145, 205, 171, .21); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 80px rgba(145, 205, 171, .025), 0 0 0 160px rgba(145, 205, 171, .025), 0 0 0 240px rgba(145, 205, 171, .018); }
.login-aside::after { content: "+"; position: absolute; top: 47%; left: 49%; color: #84bb9b; font-size: 36px; font-weight: 200; }
.aside-index { position: relative; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.login-aside p { position: relative; z-index: 1; margin: 0; font-size: clamp(20px, 2.4vw, 34px); font-weight: 600; line-height: 1.6; letter-spacing: -.035em; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--nav); color: #ecf3ef; z-index: 30; }
.sidebar-top { padding: 27px 22px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand strong { display: block; font-size: 19px; letter-spacing: -.05em; }
.sidebar-brand small { display: block; margin-top: 1px; font-size: 11px; color: #9eb4a9; }
.workspace-badge { display: inline-block; margin-top: 29px; padding: 6px 9px; border: 1px solid rgba(148, 204, 169, .22); border-radius: 5px; color: #9cd5b2; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.nav { flex: 1; overflow: auto; padding: 13px 12px 20px; }
.nav-group { margin: 24px 13px 12px; color: #779287; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.nav-item { width: 100%; min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 8px; background: transparent; color: #b3c4bc; text-align: left; font-size: 13px; font-weight: 550; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: white; }
.nav-item.is-active { background: #28483d; color: #e2ffed; font-weight: 700; }
.nav-glyph { width: 18px; color: #80bb9a; font-size: 18px; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 22px 23px; display: flex; align-items: center; gap: 9px; border-top: 1px solid rgba(255, 255, 255, .08); color: #93a8a0; font-size: 11px; }
.connection-dot, .live-pulse { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #61c68a; box-shadow: 0 0 0 4px rgba(97, 198, 138, .11); }
.workspace { min-width: 0; }
.topbar { min-height: 68px; padding: 0 clamp(20px, 3vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.breadcrumb, .topbar-actions { display: flex; align-items: center; gap: 15px; }
.breadcrumb { color: var(--ink-faint); font-size: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.crumb-separator { color: #b7c4bc; }
.topbar-actions { color: var(--ink-faint); font-size: 12px; }
.topbar-actions .text-button { border-left: 1px solid var(--line); padding-left: 16px; }
.menu-button { display: none; }

.main-content { max-width: 1600px; margin: 0 auto; padding: 38px clamp(20px, 3vw, 42px) 20px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-heading h1 { margin: 9px 0 9px; font-size: clamp(30px, 3vw, 42px); line-height: 1.2; letter-spacing: -.05em; }
.page-description { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.heading-side { padding-bottom: 10px; display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.panel { margin-bottom: 21px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--paper); box-shadow: 0 1px 2px rgba(23, 35, 40, .025); }
.panel-heading { padding: 23px 26px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 7px 0 0; font-size: 18px; line-height: 1.3; letter-spacing: -.025em; }
.filter-panel form { padding: 0 26px 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px 16px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.field input, .field select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fff; color: var(--ink); font-size: 13px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:hover, .field select:hover { border-color: #9fb8a9; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20, 122, 88, .11); }
.field input::placeholder { color: #a1ada8; }
.field small { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 11px; }
.filter-actions { margin-top: 24px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line-soft); }
.filter-tip { margin: 0; color: var(--ink-faint); font-size: 12px; }
.result-heading { border-bottom: 1px solid var(--line-soft); }
.record-count { margin-left: 7px; color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; align-items: center; gap: 9px; }
.status-banner { margin: 17px 26px; padding: 10px 13px; border-radius: 7px; background: #f1f7f3; color: var(--accent-strong); font-size: 12px; line-height: 1.5; }
.status-banner.is-error { background: #fff2f0; color: var(--danger); }
.status-banner.is-loading { background: #edf2f1; color: var(--ink-soft); }
.status-banner.is-empty { background: #f6f7f4; color: var(--ink-soft); }
.column-toolbar { margin: 0 26px 17px; display: flex; align-items: center; gap: 14px; color: var(--ink-soft); font-size: 12px; }
.column-toolbar span { margin-right: auto; }
.column-toolbar label { white-space: nowrap; }
.column-toolbar select { width: min(240px, 45vw); height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 12px; }
.summary-strip { margin: 16px 26px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-tint); color: var(--accent-strong); font-size: 12px; line-height: 1.5; }
.table-scroll { width: 100%; overflow: auto; }
.wide-table-scroll { max-height: min(70vh, 760px); }
.data-table { width: 100%; min-width: 870px; border-collapse: collapse; text-align: left; font-size: 12px; }
.wide-data-table { width: max-content; min-width: 100%; }
.wide-data-table th, .wide-data-table td { min-width: 145px; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide-data-table th:first-child, .wide-data-table td:first-child { min-width: 170px; max-width: 170px; width: 170px; position: sticky; left: 0; z-index: 2; background: var(--paper); box-shadow: 1px 0 var(--line); }
.wide-data-table th:nth-child(2), .wide-data-table td:nth-child(2) { min-width: 180px; max-width: 180px; width: 180px; position: sticky; left: 170px; z-index: 2; background: var(--paper); box-shadow: 1px 0 var(--line); }
.wide-data-table th:last-child, .wide-data-table td:last-child { min-width: 105px; max-width: 105px; width: 105px; position: sticky; right: 0; z-index: 2; background: var(--paper); box-shadow: -1px 0 var(--line); }
.wide-data-table thead th { position: sticky; top: 0; z-index: 3; background: #f8faf8; }
.wide-data-table thead th:first-child, .wide-data-table thead th:nth-child(2), .wide-data-table thead th:last-child { z-index: 4; background: #f8faf8; }
.wide-data-table tbody tr:hover td:first-child, .wide-data-table tbody tr:hover td:nth-child(2), .wide-data-table tbody tr:hover td:last-child { background: #fafcf9; }
.data-table thead { background: #f8faf8; }
.data-table th { padding: 13px 15px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.data-table td { max-width: 240px; padding: 14px 15px; border-bottom: 1px solid var(--line-soft); color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.data-table tbody tr:hover { background: #fafcf9; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.number-cell { font-variant-numeric: tabular-nums; text-align: right; }
.row-action { padding: 5px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.row-action:hover { text-decoration: underline; }
.empty-state { min-height: 280px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-tint); color: var(--accent); font-size: 29px; }
.empty-state h3 { margin: 16px 0 5px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--ink-faint); font-size: 12px; line-height: 1.7; }
.table-footer { min-height: 65px; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination select { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 12px; }
.page-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); }
.page-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.workspace-footer { padding: 8px 0 16px; color: var(--ink-faint); text-align: right; font-size: 11px; }
.operations-page { min-height: 100dvh; display: flex; flex-direction: column; }
.operations-page > .app-shell, .operations-page > .store-login { flex: 1; min-height: 0; }
.site-footer { margin-top: auto; padding: 8px 16px 16px; text-align: center; font-size: .75rem; line-height: 1rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--accent-strong); }
.site-footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(13, 27, 25, .33); }
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(860px, 88vw); display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--shadow-overlay); transform: translateX(105%); visibility: hidden; transition: transform .24s ease, visibility .24s ease; }
.detail-drawer[aria-hidden="false"] { transform: translateX(0); visibility: visible; }
.drawer-heading { padding: 25px 27px; display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.drawer-heading h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.04em; }
.drawer-content { min-height: 0; flex: 1; overflow: auto; }
.detail-meta { padding: 20px 26px 0; color: var(--ink-soft); font-size: 13px; }
.detail-table { min-width: 680px; }
.detail-table th:first-child, .detail-table td:first-child { padding-left: 26px; }
.drawer-footer { min-height: 72px; padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.drawer-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(10, 25, 21, .3); }

@media (max-width: 1200px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-button { display: inline-grid; flex: 0 0 40px; font-size: 17px; }
  .breadcrumb { margin-right: auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
@media (max-width: 720px) {
  .topbar { min-height: 60px; padding-inline: 16px; gap: 10px; }
  .topbar-date { display: none; }
  .main-content { padding: 25px 16px 10px; }
  .page-heading { margin-bottom: 24px; align-items: start; }
  .heading-side { display: none; }
  .page-heading h1 { font-size: 30px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .panel-heading { padding: 19px 18px 16px; }
  .filter-panel form { padding: 0 18px 18px; }
  .filter-actions { align-items: stretch; }
  .filter-tip { display: none; }
  .filter-actions .button { width: 100%; }
  .result-heading { align-items: start; flex-direction: column; }
  .result-actions { width: 100%; }
  .result-actions .button { flex: 1; }
  .table-footer { padding: 14px 18px; flex-wrap: wrap; }
  .status-banner, .summary-strip { margin-inline: 18px; }
  .column-toolbar { margin-inline: 18px; flex-wrap: wrap; }
  .column-toolbar span { width: 100%; }
  .detail-drawer { width: 100vw; }
  .drawer-footer { align-items: start; flex-direction: column; }
}
@media (max-width: 430px) {
  .filter-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
  .result-actions .button { width: 100%; }
  .login-card { width: calc(100% - 40px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Prominent cross-module entry, shared by inventory and stores. */
.featured-module{width:calc(100% - 24px);margin:16px 12px 0;background:var(--accent);color:white;text-decoration:none;flex-shrink:0;min-height:46px}.featured-module span{margin-left:auto;font-size:10px;white-space:nowrap}.featured-module:hover{background:var(--accent-strong)}.wdt-entry{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 26px;margin-bottom:28px;border:1px solid #b8d7c5;border-radius:var(--radius-card);background:var(--accent-tint);color:var(--ink);text-decoration:none}.wdt-entry strong{display:block;font-size:22px;margin:7px 0}.wdt-entry small{color:var(--ink-soft);font-size:13px;line-height:1.8}.wdt-entry:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.wdt-entry:hover{border-color:var(--accent)}@media(max-width:720px){.wdt-entry{align-items:flex-start;flex-direction:column;gap:16px;padding:20px;margin-bottom:24px}.wdt-entry .button{width:100%}.wdt-entry strong{font-size:20px}}
