/* ==========================================================================
   料清 · UI
   ========================================================================== */
:root {
  --bg: #f2f1e9;
  --paper: #fffefa;
  --paper-2: #f9f8f2;
  --paper-3: #f1f0e7;
  --ink: #16302f;
  --ink-2: #2d4442;
  --muted: #74817c;
  --muted-2: #98a29d;
  --line: #e2e1d6;
  --line-strong: #cfcec1;
  --teal: #11655f;
  --teal-deep: #123b3a;
  --teal-mid: #1a514d;
  --teal-soft: #e2f0eb;
  --teal-wash: #f0f7f4;
  --amber: #c47a1b;
  --amber-deep: #9a5b10;
  --amber-soft: #fbefd8;
  --red: #b3453c;
  --red-soft: #fbe9e5;
  --blue: #3f6f8c;
  --blue-soft: #e9f0f4;
  --purple: #705d93;
  --purple-soft: #f0ecf6;
  --shadow-sm: 0 1px 2px rgba(18, 59, 58, .04), 0 8px 24px -18px rgba(18, 59, 58, .28);
  --shadow-md: 0 18px 50px -32px rgba(18, 59, 58, .45);
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-w: 252px;
  --font: "Microsoft YaHei UI", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #cfe8df; color: var(--teal-deep); }
:focus-visible { outline: 3px solid rgba(196, 122, 27, .45); outline-offset: 2px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- shell ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 26px 18px 18px; color: #e9efe9; overflow: hidden;
  background:
    radial-gradient(120% 55% at 10% 0%, rgba(67, 132, 120, .38), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(196, 122, 27, .12), transparent 60%),
    linear-gradient(180deg, #143f3c 0%, #102f2e 60%, #0d2928 100%);
  z-index: 30;
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .17;
  background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; color: #f8f4e8; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  color: #f3c36c; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.brand-mark svg { width: 31px; height: 31px; stroke-width: 1.7; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; }
.brand-mark.small svg { width: 25px; height: 25px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 17px; letter-spacing: .08em; }
.brand-copy small { margin-top: 4px; font-size: 8.5px; letter-spacing: .18em; color: rgba(233,239,233,.5); }
.sidebar-label { padding: 10px 10px 8px; font-size: 10px; letter-spacing: .22em; color: rgba(233,239,233,.4); }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  color: rgba(236,241,235,.72); font-size: 13.5px; transition: .18s ease; position: relative;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .82; }
.side-nav a em {
  font-style: normal; margin-left: auto; font-family: var(--font-num); font-size: 11px;
  min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 99px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.65);
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav a.active {
  color: #fff; background: rgba(255,255,255,.11);
  box-shadow: inset 3px 0 0 #e5ad54, 0 10px 24px -20px #000;
}
.side-nav a.active svg { color: #f3c36c; opacity: 1; }
.sidebar-spacer { flex: 1; min-height: 20px; }
.sidebar-tip {
  display: flex; gap: 10px; padding: 12px; margin: 10px 4px 12px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.08);
}
.sidebar-tip .tip-icon { color: #f3c36c; flex: 0 0 auto; }
.sidebar-tip .tip-icon svg { width: 17px; height: 17px; }
.sidebar-tip strong { display: block; font-size: 11.5px; color: #f3f0e4; margin-bottom: 2px; }
.sidebar-tip p { font-size: 10.5px; line-height: 1.55; color: rgba(236,241,235,.52); }
.side-settings {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 4px;
  border-radius: 10px; color: rgba(236,241,235,.6); font-size: 12.5px;
}
.side-settings:hover, .side-settings.active { background: rgba(255,255,255,.07); color: #fff; }
.side-settings svg { width: 17px; height: 17px; }
.sidebar-foot {
  display: flex; align-items: center; gap: 7px; padding: 12px 10px 0; margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,.08); font-size: 10px; color: rgba(236,241,235,.42);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #6ed0a7; box-shadow: 0 0 0 3px rgba(110,208,167,.12); }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px;
  min-height: 86px; padding: 16px 38px; background: rgba(242,241,233,.86);
  border-bottom: 1px solid rgba(207,206,193,.55); backdrop-filter: blur(14px);
}
.mobile-brand { display: none; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .06em; }
.page-heading { display: flex; flex-direction: column; min-width: 200px; }
.eyebrow { font-size: 10px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.page-heading h1 { font-size: 25px; line-height: 1.25; letter-spacing: -.03em; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-pill {
  display: flex; align-items: center; gap: 8px; height: 42px; min-width: 270px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px; background: rgba(255,254,250,.7);
  transition: .18s ease;
}
.search-pill:focus-within { border-color: #a9c8bf; background: var(--paper); box-shadow: 0 0 0 3px rgba(17,101,95,.08); }
.search-pill svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search-pill input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; font-size: 12.5px; }
.search-pill input::placeholder { color: var(--muted-2); }
.search-pill kbd {
  font-family: var(--font); font-size: 10px; color: var(--muted-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; background: var(--paper-2);
}
.mobile-search-btn { display: none; }
.view { width: 100%; max-width: 1460px; margin: 0 auto; padding: 30px 38px 60px; outline: 0; }
.view > .page { animation: pageIn .38s cubic-bezier(.22,.75,.25,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 600;
  transition: .16s ease; white-space: nowrap; user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: #a9bdb7; background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: #0b5752; border-color: #0b5752; color: #fff; }
.btn-dark { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-dark:hover { background: #0b2f2e; color: #fff; }
.btn-accent { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-accent:hover { background: var(--amber-deep); border-color: var(--amber-deep); color: #fff; }
.btn-soft { background: var(--teal-soft); border-color: transparent; color: var(--teal); }
.btn-soft:hover { background: #d4ebe4; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(17,101,95,.06); border-color: transparent; box-shadow: none; color: var(--teal); }
.btn-danger { color: var(--red); border-color: #e7c8c2; background: #fff9f7; }
.btn-danger:hover { background: var(--red-soft); border-color: #d9a9a1; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14px; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); transition: .16s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: #a9bdb7; background: #fff; color: var(--teal); }
.icon-btn.danger:hover { color: var(--red); border-color: #d9a9a1; background: var(--red-soft); }

/* ---------- common panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-head .head-action { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page-intro { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.page-intro h2 { font-size: 24px; letter-spacing: -.03em; line-height: 1.2; }
.page-intro p { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.page-intro .intro-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.section-title::before { content: ""; width: 4px; height: 14px; border-radius: 4px; background: var(--amber); }
.dot-divider { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); display: inline-block; vertical-align: middle; }
.empty-state { padding: 50px 22px; text-align: center; color: var(--muted); }
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--paper-3); color: var(--muted); border: 1px dashed var(--line-strong);
}
.empty-state .empty-icon svg { width: 25px; height: 25px; }
.empty-state strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty-state p { font-size: 12px; }
.empty-state .btn { margin-top: 16px; }

/* ---------- badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 8px;
  border-radius: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--paper-3); color: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-ok { background: var(--teal-soft); color: #0e6b5c; }
.badge-low { background: var(--amber-soft); color: #95600f; }
.badge-zero { background: var(--red-soft); color: var(--red); }
.badge-in { background: var(--teal-soft); color: #0e6b5c; }
.badge-out { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 33px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted);
  font-size: 12px; transition: .15s ease; white-space: nowrap;
}
.chip:hover { color: var(--teal); border-color: #b8cec6; }
.chip.active { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 5px 14px -9px var(--teal); }
.chip .chip-count { font-family: var(--font-num); font-size: 10.5px; opacity: .7; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 10px; background: var(--paper-3); color: var(--muted); }
.category-tag { background: var(--teal-wash); color: var(--teal); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.field .req { color: var(--red); font-size: 13px; line-height: 1; }
.field .hint { font-size: 10.5px; color: var(--muted-2); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--paper); padding: 0 12px; outline: 0; font-size: 13px; transition: .16s ease;
  color: var(--ink);
}
.textarea { height: auto; min-height: 78px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: #b9c9c3; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(17,101,95,.09); background: #fff; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 0; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%2374817c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .span-2 { grid-column: 1 / -1; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .btn { border-radius: 0 9px 9px 0; height: 44px; border-left: 0; }
.form-note { display: block; padding: 10px 12px; border-radius: 9px; background: var(--teal-wash); color: #32625b; font-size: 11.5px; line-height: 1.6; }
.form-note svg { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.form-note.warn { background: var(--amber-soft); color: #79520f; }
.form-note.danger { background: var(--red-soft); color: #8a332b; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }
.form-actions .btn-primary { min-width: 140px; }
.form-section { padding: 22px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { font-size: 13px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-section-title .step {
  width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center;
  background: var(--teal); color: #fff; font-size: 10px; font-family: var(--font-num);
}

/* ---------- dashboard ---------- */
.hero {
  position: relative; overflow: hidden; padding: 30px 32px; border-radius: var(--radius-lg);
  color: #f5f1e5; background:
    radial-gradient(120% 120% at 100% 0%, rgba(239,190,104,.22), transparent 45%),
    radial-gradient(100% 100% at 0% 100%, rgba(61,133,120,.35), transparent 55%),
    linear-gradient(125deg, #143f3c, #0d2e2c 70%);
  box-shadow: 0 28px 60px -36px rgba(13,46,44,.65);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(90% 90% at 100% 0%, #000, transparent 65%);
}
.hero::after {
  content: "WZ"; position: absolute; right: 24px; bottom: -46px; font-family: var(--font-num);
  font-size: 190px; line-height: 1; font-weight: 700; color: rgba(255,255,255,.035); letter-spacing: -.05em; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 30px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: 10.5px; letter-spacing: .08em; color: rgba(245,241,229,.68); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #72d3a8; box-shadow: 0 0 0 4px rgba(114,211,168,.12); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(114,211,168,.12); } 50% { box-shadow: 0 0 0 7px rgba(114,211,168,.03); } }
.hero h2 { font-size: 33px; line-height: 1.28; letter-spacing: -.04em; margin: 14px 0 9px; font-weight: 700; color: #fbf7ea; }
.hero h2 em { font-style: normal; color: #efbd6d; }
.hero p { font-size: 12.5px; line-height: 1.75; color: rgba(235,240,231,.62); max-width: 520px; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.hero-actions .btn { height: 41px; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.09); color: #f4f0e5; backdrop-filter: blur(4px); }
.hero-actions .btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.25); color: #fff; }
.hero-actions .btn-accent { background: var(--amber); border-color: var(--amber); color: #fff; }
.hero-actions .btn-accent:hover { background: #d48a26; }
.hero-side { border-left: 1px solid rgba(255,255,255,.12); padding-left: 28px; }
.hero-side .side-label { font-size: 10px; letter-spacing: .16em; color: rgba(255,255,255,.4); }
.hero-side .side-big { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.hero-side .side-big strong { font-family: var(--font-num); font-size: 46px; line-height: 1.1; font-weight: 600; color: #f7f2e5; letter-spacing: -.04em; }
.hero-side .side-big span { font-size: 11px; color: rgba(255,255,255,.45); }
.hero-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.1); }
.hero-mini div span { display: block; font-size: 10px; color: rgba(255,255,255,.42); }
.hero-mini div strong { font-family: var(--font-num); font-size: 19px; font-weight: 500; color: #f1ecdd; }
.hero-mini div strong small { font-family: var(--font); font-size: 9.5px; font-weight: 400; color: rgba(255,255,255,.42); margin-left: 7px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card { position: relative; padding: 17px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 78px; height: 78px; border-radius: 50%; background: var(--paper-3); opacity: .7; }
.stat-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.stat-label { font-size: 11px; color: var(--muted); }
.stat-icon { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-wash); color: var(--teal); }
.stat-icon svg { width: 15px; height: 15px; }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 5px; margin-top: 7px; }
.stat-value strong { font-family: var(--font-num); font-size: 29px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.stat-value span { font-size: 10.5px; color: var(--muted-2); }
.stat-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 10px; color: var(--muted-2); }
.stat-foot .up { color: var(--teal); }
.stat-foot .warn { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(300px, .84fr); gap: 18px; margin-top: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); transition: .18s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: #b9cec7; box-shadow: var(--shadow-sm); }
.quick-card .q-icon { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-wash); color: var(--teal); }
.quick-card .q-icon svg { width: 17px; height: 17px; }
.quick-card:nth-child(2) .q-icon { background: var(--amber-soft); color: var(--amber); }
.quick-card:nth-child(3) .q-icon { background: var(--blue-soft); color: var(--blue); }
.quick-card:nth-child(4) .q-icon { background: var(--purple-soft); color: var(--purple); }
.quick-card strong { font-size: 12.5px; }
.quick-card span { font-size: 10.5px; color: var(--muted); line-height: 1.45; }

.low-list { display: flex; flex-direction: column; }
.low-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.low-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.low-thumb { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; background: var(--paper-3); color: var(--muted); overflow: hidden; }
.low-thumb img { width: 100%; height: 100%; object-fit: cover; }
.low-thumb svg { width: 17px; height: 17px; }
.low-main { min-width: 0; flex: 1; }
.low-main strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.low-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.low-meter { width: 78px; flex: 0 0 auto; }
.meter { height: 5px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--amber); }
.meter i.danger { background: var(--red); }
.low-meter small { display: block; margin-top: 4px; font-size: 9.5px; color: var(--muted-2); text-align: right; font-family: var(--font-num); }
.low-stock-num { font-family: var(--font-num); font-size: 13px; color: var(--amber); }

.activity { position: relative; display: flex; flex-direction: column; }
.activity-row { display: flex; gap: 11px; padding: 9px 0; position: relative; }
.activity-row:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: -6px; width: 1px; background: var(--line); }
.activity-icon { width: 27px; height: 27px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); position: relative; z-index: 1; }
.activity-icon svg { width: 13px; height: 13px; }
.activity-icon.out { background: var(--red-soft); color: var(--red); }
.activity-main { min-width: 0; flex: 1; }
.activity-main strong { font-size: 11.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-main span { font-size: 10px; color: var(--muted); display: block; margin-top: 1px; }
.activity-qty { font-family: var(--font-num); font-size: 12px; color: var(--teal); white-space: nowrap; padding-top: 3px; }
.activity-qty.out { color: var(--red); }

.category-bars { display: flex; flex-direction: column; gap: 11px; }
.category-bar .c-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.category-bar .c-top span:last-child { color: var(--muted); font-family: var(--font-num); }
.category-track { height: 6px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.category-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #1b6d64, #6eaaa0); }
.category-bar:nth-child(2) .category-track i { background: linear-gradient(90deg, #b97b25, #dfb26f); }
.category-bar:nth-child(3) .category-track i { background: linear-gradient(90deg, #3f6f8c, #88aec3); }
.category-bar:nth-child(4) .category-track i { background: linear-gradient(90deg, #705d93, #a99bc3); }
.category-bar:nth-child(5) .category-track i { background: linear-gradient(90deg, #8a6a3d, #c9a97a); }
.category-bar:nth-child(n+6) .category-track i { background: linear-gradient(90deg, #667773, #a7b3af); }

/* ---------- inventory ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 430px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 38px; height: 43px; border-radius: 10px; }
.search-box .clear-search { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); border: 0; background: var(--paper-3); color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; }
.search-box .clear-search svg { position: static; width: 12px; height: 12px; transform: none; }
.search-box.has-value .clear-search { display: grid; }
.toolbar-spacer { flex: 1; }
.filter-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 15px; }
.filter-row .chip svg { width: 13px; height: 13px; }
.filter-meta { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.table-wrap { overflow: auto; border-radius: 12px; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { text-align: left; font-size: 10px; letter-spacing: .09em; font-weight: 600; color: var(--muted-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #efeee6; font-size: 12px; vertical-align: middle; }
.data-table tbody tr { transition: background .13s ease; cursor: pointer; }
.data-table tbody tr:hover { background: #fbfaf4; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .actions-cell { text-align: right; width: 66px; }
.material-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.thumb { width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg, #f0eee3, #e5e2d3); color: #8a958d; border: 1px solid rgba(0,0,0,.03); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 20px; height: 20px; }
.thumb.lg { width: 64px; height: 64px; border-radius: 13px; }
.material-cell .m-main { min-width: 0; }
.material-cell .m-main strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.material-cell .m-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; font-family: var(--font-num); letter-spacing: .02em; }
.loc-cell { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.loc-cell svg { width: 13px; height: 13px; color: var(--muted-2); }
.stock-cell { display: flex; align-items: baseline; gap: 4px; }
.stock-cell strong { font-family: var(--font-num); font-size: 16px; font-weight: 600; }
.stock-cell span { font-size: 10px; color: var(--muted-2); }
.stock-cell.low strong { color: var(--amber); }
.stock-cell.zero strong { color: var(--red); }
.mobile-material-list { display: none; }
.material-mobile-card { display: flex; gap: 12px; align-items: center; padding: 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; box-shadow: 0 2px 10px -8px rgba(18,59,58,.3); }
.material-mobile-card .mm-main { flex: 1; min-width: 0; }
.material-mobile-card .mm-main strong { display: block; font-size: 13px; }
.material-mobile-card .mm-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.material-mobile-card .mm-side { text-align: right; }
.material-mobile-card .mm-side strong { font-family: var(--font-num); font-size: 18px; display: block; line-height: 1.1; }
.material-mobile-card .mm-side span { font-size: 9px; color: var(--muted-2); }
.material-mobile-card .badge { margin-top: 4px; height: 19px; font-size: 9px; }

/* ---------- detail ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb svg { width: 12px; height: 12px; }
.detail-top { display: flex; gap: 22px; align-items: flex-start; padding: 24px; }
.detail-photo { width: 148px; height: 148px; border-radius: 16px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, #f0eee3, #e5e2d3); display: grid; place-items: center; color: #8a958d; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-photo svg { width: 42px; height: 42px; opacity: .6; }
.detail-main { flex: 1; min-width: 0; }
.detail-title-row { display: flex; align-items: flex-start; gap: 12px; }
.detail-title h2 { font-size: 25px; line-height: 1.25; letter-spacing: -.03em; }
.detail-title .detail-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; font-size: 10.5px; color: var(--muted); }
.detail-title .detail-sub .mono { font-family: var(--font-num); letter-spacing: .03em; }
.detail-title .detail-sub .tag { height: 20px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-stock { display: flex; align-items: flex-end; gap: 20px; margin-top: 20px; padding-top: 17px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.detail-stock .stock-big { display: flex; align-items: baseline; gap: 6px; }
.detail-stock .stock-big strong { font-family: var(--font-num); font-size: 46px; line-height: 1; font-weight: 600; letter-spacing: -.04em; }
.detail-stock .stock-big span { font-size: 12px; color: var(--muted); }
.detail-stock .stock-meta { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.detail-stock .stock-meta div span { display: block; font-size: 9.5px; color: var(--muted-2); }
.detail-stock .stock-meta div strong { display: block; font-size: 12px; margin-top: 2px; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 18px; margin-top: 18px; align-items: start; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.info-item:nth-last-child(-n+2) { border-bottom: 0; }
.info-item span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.info-item strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.info-item .mono { font-family: var(--font-num); letter-spacing: .02em; }
.qr-panel { text-align: center; }
.qr-panel .qr-box { width: 176px; height: 176px; margin: 6px auto 12px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: inset 0 0 0 5px var(--paper-2); }
.qr-panel .qr-box img { width: 100%; height: 100%; }
.qr-panel h3 { font-size: 13px; }
.qr-panel p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.qr-panel .qr-code-text { margin: 10px 0 12px; font-family: var(--font-num); font-size: 12px; letter-spacing: .06em; color: var(--teal); }
.qr-panel .btn { width: 100%; margin-top: 7px; }
.timeline-list { display: flex; flex-direction: column; }
.timeline-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-dot { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: var(--teal-soft); color: var(--teal); }
.timeline-dot.out { background: var(--red-soft); color: var(--red); }
.timeline-dot svg { width: 14px; height: 14px; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-body strong { font-size: 11.5px; display: block; }
.timeline-body span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.timeline-qty { font-family: var(--font-num); font-size: 13px; color: var(--teal); }
.timeline-qty.out { color: var(--red); }

/* ---------- inbound layout ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.form-aside { position: sticky; top: 106px; display: flex; flex-direction: column; gap: 14px; }
.upload-box { position: relative; border: 1.5px dashed #c5c8ba; border-radius: 12px; background: var(--paper-2); min-height: 154px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; transition: .18s ease; cursor: pointer; }
.upload-box:hover, .upload-box.dragover { border-color: var(--teal); background: var(--teal-wash); }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-placeholder { padding: 18px; color: var(--muted); }
.upload-placeholder .up-icon { width: 43px; height: 43px; border-radius: 12px; margin: 0 auto 9px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--teal); box-shadow: var(--shadow-sm); }
.upload-placeholder strong { display: block; font-size: 12px; color: var(--ink-2); }
.upload-placeholder span { display: block; font-size: 10px; margin-top: 3px; color: var(--muted-2); }
.upload-preview { position: absolute; inset: 0; background: #ddd; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .remove-photo { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.upload-preview .remove-photo svg { width: 14px; height: 14px; }
.upload-preview .change-photo { position: absolute; left: 8px; bottom: 8px; height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; }
.upload-compressing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-size: 11px; color: var(--teal); z-index: 2; }
.existing-hit { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--teal-wash); border: 1px solid #cfe4dc; font-size: 11.5px; color: #2e6159; }
.existing-hit svg { width: 16px; height: 16px; flex: 0 0 auto; }
.existing-hit strong { font-weight: 700; }
.existing-hit .hit-stock { margin-left: auto; font-family: var(--font-num); white-space: nowrap; }

/* QR preview card (also used for actual print cards) */
.preview-card-wrap { padding: 17px; border-radius: 14px; background: #f6f4ea; border: 1px solid var(--line); }
.preview-card-wrap .preview-label { display: flex; align-items: center; justify-content: space-between; font-size: 9px; letter-spacing: .14em; color: var(--muted-2); margin-bottom: 9px; }
.preview-card-wrap .preview-label .printer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.material-card { background: #fff; border: 1px solid #d9d7c9; border-radius: 3mm; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 6px 18px -16px rgba(0,0,0,.4); }
.preview-card-wrap .material-card { transform-origin: top left; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 2.4mm 3.2mm 1.5mm; border-bottom: 1px solid #eceae0; }
.card-brand { display: flex; align-items: center; gap: 1.6mm; font-size: 7.6pt; font-weight: 700; letter-spacing: .08em; color: #143f3c; }
.card-brand svg { width: 4.4mm; height: 4.4mm; }
.card-head .card-type { font-size: 5.5pt; letter-spacing: .14em; color: #8c958f; }
.card-body { display: flex; gap: 3mm; padding: 2.4mm 3.2mm 1.8mm; flex: 1; min-height: 0; }
.card-qr { width: 24mm; height: 24mm; flex: 0 0 auto; padding: .8mm; background: #fff; border: 1px solid #e7e5da; border-radius: 1.3mm; }
.card-qr img { width: 100%; height: 100%; }
.card-qr .qr-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8mm; border: 1px dashed #d6d4c6; border-radius: 1mm; background: #faf9f3; color: #a0a89f; font-size: 5pt; letter-spacing: .08em; }
.card-qr .qr-placeholder svg { width: 7.5mm; height: 7.5mm; opacity: .42; }
.card-info { min-width: 0; display: flex; flex-direction: column; }
.card-info h4 { font-size: 9.4pt; line-height: 1.3; color: #15302f; margin: 0 0 .8mm; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.card-code { font-family: var(--font-num); font-size: 6.5pt; letter-spacing: .04em; color: #53655f; margin-bottom: 1mm; }
.card-meta { display: flex; align-items: center; gap: 1.2mm; font-size: 5.8pt; color: #7d8881; margin-top: auto; }
.card-meta svg { width: 2.3mm; height: 2.3mm; flex: 0 0 auto; }
.card-meta b { font-weight: 600; color: #2b4642; }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 1.3mm 3.2mm 1.8mm; border-top: 1px solid #eceae0; }
.card-foot .card-no { font-family: var(--font-num); font-size: 6pt; letter-spacing: .07em; color: #53655f; }
.card-foot .card-hint { display: flex; align-items: center; gap: 1mm; font-size: 5.4pt; color: #a5742a; }
.card-foot .card-hint svg { width: 2.2mm; height: 2.2mm; }
.preview-card-wrap .material-card { aspect-ratio: 90 / 54; }
.preview-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.preview-tip { display: flex; gap: 7px; align-items: flex-start; padding: 10px 11px; border-radius: 9px; background: var(--paper-2); border: 1px solid var(--line); font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.preview-tip svg { width: 14px; height: 14px; color: var(--amber); flex: 0 0 auto; margin-top: 2px; }

/* ---------- scan / outbound ---------- */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 18px; align-items: start; }
.scan-panel { padding: 18px; }
.scan-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: radial-gradient(80% 80% at 50% 40%, #173f3d, #081c1b); display: grid; place-items: center; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-placeholder { position: relative; z-index: 1; text-align: center; color: rgba(255,255,255,.65); padding: 20px; }
.scan-placeholder .scan-icon-wrap { width: 58px; height: 58px; border-radius: 17px; margin: 0 auto 12px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #f0c06b; }
.scan-placeholder .scan-icon-wrap svg { width: 28px; height: 28px; }
.scan-placeholder strong { display: block; font-size: 13px; color: #f2eee1; }
.scan-placeholder p { font-size: 10.5px; line-height: 1.65; margin-top: 4px; color: rgba(255,255,255,.45); max-width: 270px; }
.scan-placeholder .btn { margin-top: 13px; background: #e8b463; border-color: #e8b463; color: #20312d; font-weight: 700; }
.scan-placeholder .btn:hover { background: #f0c478; color: #20312d; }
.scan-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.scan-frame { position: absolute; left: 50%; top: 50%; width: 58%; max-width: 260px; aspect-ratio: 1; transform: translate(-50%, -50%); }
.scan-frame span { position: absolute; width: 24px; height: 24px; border: 2px solid #f1c575; }
.scan-frame span:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.scan-frame span:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.scan-frame span:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.scan-frame span:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.scan-line { position: absolute; left: 6%; right: 6%; top: 12%; height: 2px; background: linear-gradient(90deg, transparent, rgba(241,197,117,.9), transparent); box-shadow: 0 0 12px rgba(241,197,117,.55); animation: scanline 2.1s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 12%; opacity: .3; } 50% { top: 86%; opacity: 1; } }
.scan-controls { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.scan-controls .scan-status { font-size: 10.5px; color: var(--muted); margin-left: auto; }
.manual-row { display: flex; gap: 8px; margin-top: 14px; }
.manual-row .input { flex: 1; }
.scan-help { margin-top: 12px; font-size: 10px; line-height: 1.65; color: var(--muted-2); }
.scan-steps { display: flex; flex-direction: column; gap: 15px; margin-top: 5px; }
.scan-step { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 11px; align-items: start; }
.scan-step > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--teal-wash); border: 1px solid #cfe3db; color: var(--teal); font-family: var(--font-num); font-size: 12px; font-weight: 600; }
.scan-step strong { display: block; font-size: 11.5px; line-height: 27px; color: var(--ink); }
.scan-step p { font-size: 10.5px; line-height: 1.65; color: var(--muted); margin-top: 1px; }
.scan-step p b { color: var(--ink-2); font-weight: 600; }
.recent-scans { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.recent-scans h4 { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.recent-scan-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 10.5px; }
.recent-scan-row span { color: var(--muted); }
.recent-scan-row strong { margin-left: auto; font-family: var(--font-num); font-weight: 600; }
.selected-material { padding: 17px; }
.selected-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.selected-head .thumb { width: 52px; height: 52px; }
.selected-head .sel-main { flex: 1; min-width: 0; }
.selected-head .sel-main strong { display: block; font-size: 14px; }
.selected-head .sel-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.selected-head .sel-stock { text-align: right; }
.selected-head .sel-stock strong { display: block; font-family: var(--font-num); font-size: 27px; line-height: 1; }
.selected-head .sel-stock span { display: block; font-size: 9px; color: var(--muted-2); margin-top: 3px; }
.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-input { display: flex; align-items: center; height: 46px; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: #fff; }
.qty-input button { width: 38px; height: 100%; border: 0; background: var(--paper-2); color: var(--ink-2); font-size: 18px; display: grid; place-items: center; }
.qty-input button:hover { background: var(--teal-soft); color: var(--teal); }
.qty-input input { width: 76px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; outline: 0; font-family: var(--font-num); font-size: 17px; font-weight: 600; background: #fff; }
.qty-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.qty-chips button { height: 28px; min-width: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-family: var(--font-num); font-size: 11px; color: var(--muted); }
.qty-chips button:hover { border-color: var(--teal); color: var(--teal); }
.receipt { padding: 28px; text-align: center; }
.receipt .receipt-check { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 13px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.receipt .receipt-check svg { width: 30px; height: 30px; stroke-width: 2.2; }
.receipt h3 { font-size: 20px; letter-spacing: -.02em; }
.receipt p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.receipt .receipt-stock { margin: 18px auto 4px; padding: 16px; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--line-strong); max-width: 300px; }
.receipt .receipt-stock span { display: block; font-size: 10px; color: var(--muted); }
.receipt .receipt-stock strong { display: block; font-family: var(--font-num); font-size: 36px; line-height: 1.1; margin-top: 2px; }
.receipt .receipt-stock strong small { font-family: var(--font); font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.receipt .receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px auto 0; max-width: 300px; text-align: left; font-size: 10.5px; color: var(--muted); }
.receipt .receipt-meta b { color: var(--ink); font-weight: 600; }

/* ---------- cards page ---------- */
.cards-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.cards-main { min-width: 0; }
.cards-side { position: sticky; top: 106px; }
.card-picker { max-height: 440px; overflow: auto; padding-right: 3px; }
.picker-row { display: flex; align-items: center; gap: 9px; padding: 8px 7px; border-radius: 8px; cursor: pointer; }
.picker-row:hover { background: var(--paper-2); }
.picker-row input { width: 15px; height: 15px; accent-color: var(--teal); flex: 0 0 auto; }
.picker-row .p-name { flex: 1; min-width: 0; }
.picker-row .p-title { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-row .p-code { display: block; margin-top: 1px; font-size: 9px; color: var(--muted-2); font-family: var(--font-num); }
.picker-select-all { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); padding: 4px 7px 9px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.picker-select-all input { accent-color: var(--teal); }
.picker-select-all .picker-count { margin-left: auto; font-family: var(--font-num); }
.cards-preview-wrap { background: #d9d8ce; border-radius: var(--radius); padding: 18px; overflow: auto; box-shadow: inset 0 1px 4px rgba(0,0,0,.08); }
.card-pages { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.card-page { width: 210mm; min-height: 297mm; background: #fff; padding: 10mm; display: grid; grid-template-columns: repeat(2, 90mm); grid-auto-rows: 54mm; gap: 5mm 6mm; align-content: start; box-shadow: 0 10px 30px -20px rgba(0,0,0,.35); }
.card-page .material-card { width: 90mm; height: 54mm; }
.card-page-empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.cards-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cards-bar .selected-count { font-size: 11.5px; color: var(--muted); }
.cards-bar .selected-count b { color: var(--ink); font-family: var(--font-num); }
.cards-bar .bar-spacer { flex: 1; }
.card-note { font-size: 10px; color: var(--muted-2); margin-top: 10px; line-height: 1.6; }

/* ---------- records ---------- */
.records-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-stat { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); background: var(--paper); border-radius: 11px; }
.mini-stat .ms-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.mini-stat .ms-icon.out { background: var(--red-soft); color: var(--red); }
.mini-stat .ms-icon.count { background: var(--blue-soft); color: var(--blue); }
.mini-stat svg { width: 15px; height: 15px; }
.mini-stat span { display: block; font-size: 9.5px; color: var(--muted); }
.mini-stat strong { display: block; font-family: var(--font-num); font-size: 19px; line-height: 1.2; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { position: relative; padding: 10px 14px; font-size: 12px; color: var(--muted); border: 0; background: none; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--teal); font-weight: 700; }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--teal); }
.tab .tab-count { font-family: var(--font-num); font-size: 9px; margin-left: 3px; color: var(--muted-2); }
.record-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.record-type svg { width: 13px; height: 13px; }
.record-type.in { color: var(--teal); }
.record-type.out { color: var(--red); }
.record-qty { font-family: var(--font-num); font-size: 13px; font-weight: 600; }
.record-qty.in { color: var(--teal); }
.record-qty.out { color: var(--red); }
.record-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.record-person { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.record-person .avatar-mini { width: 20px; height: 20px; border-radius: 50%; background: var(--paper-3); color: var(--muted); display: grid; place-items: center; font-size: 8px; }
.records-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 13px; }
.date-input { height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 11px; color: var(--muted); }
.records-mobile { display: none; }
.record-mobile-card { display: block; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); margin-bottom: 8px; }
.record-mobile-top { display: flex; align-items: center; gap: 8px; }
.record-mobile-top strong { font-size: 12px; }
.record-mobile-top .record-qty { margin-left: auto; }
.record-mobile-sub { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 10px; color: var(--muted); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .s-icon { width: 35px; height: 35px; border-radius: 9px; background: var(--teal-wash); color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; }
.settings-row .s-icon svg { width: 16px; height: 16px; }
.settings-row .s-main { flex: 1; min-width: 0; }
.settings-row .s-main strong { display: block; font-size: 12px; }
.settings-row .s-main span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.settings-row .s-main code { font-family: var(--font-num); font-size: 10.5px; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
.danger-zone { border-color: #eccfc9; }
.danger-zone .panel-head h3 { color: var(--red); }
.danger-zone p { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.danger-zone .btn { margin-top: 14px; }

/* ---------- modal / toast ---------- */
.modal-root { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-root.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,35,33,.55); backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
.modal-card { position: relative; z-index: 1; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--paper); border-radius: 18px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.5); animation: modalIn .25s cubic-bezier(.2,.8,.3,1); }
.modal-card.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 17px; letter-spacing: -.02em; }
.modal-head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.modal-close { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--paper-2); color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: var(--paper-3); color: var(--ink); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 4px 22px 20px; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.modal-foot .btn { min-width: 84px; }
.modal-note { font-size: 11px; color: var(--muted); line-height: 1.65; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.toast-root { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, calc(100vw - 28px)); }
.toast { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 11px 15px; border-radius: 10px; background: #183f3c; color: #f7f3e8; font-size: 12px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.5); animation: toastIn .25s ease both; }
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; color: #8ad7b5; }
.toast.error { background: #5e2622; }
.toast.error svg { color: #f0b3aa; }
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px); } }
.loader { width: 20px; height: 20px; border: 2px solid rgba(17,101,95,.18); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-loading { min-height: 60vh; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.boot-loading .loader { width: 26px; height: 26px; }
.skeleton { background: linear-gradient(90deg, #eeece2 25%, #f6f4ec 37%, #eeece2 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 7px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.page-loading { padding: 30px; }

/* ---------- bottom nav ---------- */
.bottom-nav { display: none; }
.bottom-nav a { color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9.5px; padding: 8px 0 6px; position: relative; }
.bottom-nav a svg { width: 20px; height: 20px; }
.bottom-nav a.active { color: var(--teal); }
.bottom-nav a.active::after { content: ""; position: absolute; top: 0; width: 16px; height: 2px; border-radius: 2px; background: var(--teal); }
.bottom-nav .bottom-action { color: var(--teal); }
.bottom-nav .bottom-action .bottom-action-ring { width: 42px; height: 42px; margin-top: -18px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; border: 4px solid var(--bg); box-shadow: 0 10px 20px -10px rgba(17,101,95,.6); }
.bottom-nav .bottom-action .bottom-action-ring svg { width: 19px; height: 19px; stroke-width: 2.2; }
.bottom-nav .bottom-action span:last-child { color: var(--teal); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  :root { --sidebar-w: 228px; }
  .view { padding: 26px 28px 50px; }
  .topbar { padding: 15px 28px; }
  .hero-grid { gap: 20px; }
  .hero h2 { font-size: 29px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .cards-preview-wrap { padding: 13px; }
}
@media (max-width: 1060px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-top { flex-wrap: wrap; }
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .scan-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .cards-layout { grid-template-columns: 1fr; }
  .cards-side { position: static; }
  .card-picker { max-height: 190px; }
  .hero-side { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .topbar { min-height: 64px; padding: 11px 16px; gap: 12px; }
  .mobile-brand { display: flex; }
  .page-heading { min-width: 0; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { font-size: 20px; }
  .topbar-actions { gap: 7px; }
  .search-pill { display: none; }
  .mobile-search-btn { display: inline-grid; width: 38px; height: 38px; }
  .btn-scan-quick { height: 38px; padding: 0 12px; font-size: 12px; }
  .view { padding: 18px 16px 92px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,254,250,.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(18px); box-shadow: 0 -10px 30px -25px rgba(18,59,58,.45);
  }
  .page-intro { margin-bottom: 16px; }
  .page-intro h2 { font-size: 21px; }
  .page-intro .intro-actions .btn span { display: none; }
  .stats-grid { gap: 9px; margin-top: 12px; }
  .stat-card { padding: 13px 14px; }
  .stat-value strong { font-size: 25px; }
  .dashboard-grid { gap: 12px; margin-top: 12px; }
  .dash-col { gap: 12px; }
  .hero { padding: 24px; border-radius: 18px; }
  .hero h2 { font-size: 26px; }
  .hero p { font-size: 11.5px; }
  .panel-pad { padding: 17px; }
  .form-section { padding: 18px; }
  .form-aside { grid-template-columns: 1fr; }
  .detail-top { padding: 18px; gap: 16px; }
  .detail-photo { width: 110px; height: 110px; }
  .detail-stock { margin-top: 15px; }
  .settings-grid { gap: 12px; }
  .modal-root { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; animation: sheetIn .28s cubic-bezier(.2,.8,.3,1); }
  @keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
  .toast-root { bottom: 78px; }
  .cards-preview-wrap { margin: 0 -16px; border-radius: 0; padding: 12px; }
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 23px; }
  .hero-actions .btn { flex: 1; }
  .desktop-table { display: none; }
  .mobile-material-list { display: block; }
  .page-intro { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .page-intro .intro-actions { margin-left: 0; }
  .page-intro .intro-actions .btn { height: 36px; font-size: 11.5px; }
  .toolbar { gap: 8px; }
  .search-box { max-width: none; flex-basis: 100%; }
  .filter-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-meta { display: none; }
  .detail-top { flex-direction: column; }
  .detail-photo { width: 100%; height: 180px; }
  .detail-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  .detail-stock .stock-meta { margin-left: 0; width: 100%; gap: 16px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item { padding: 11px 0; }
  .info-item:nth-last-child(-n+2) { border-bottom: 1px dashed var(--line); }
  .info-item:last-child { border-bottom: 0; }
  .field-grid { grid-template-columns: 1fr; gap: 13px; }
  .field-grid .span-2 { grid-column: auto; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn-primary { flex: 1; }
  .records-summary { grid-template-columns: 1fr 1fr; }
  .records-summary .mini-stat:last-child { grid-column: 1 / -1; }
  .desktop-records { display: none; }
  .records-mobile { display: block; }
  .cards-bar .btn span { display: none; }
  .card-page { transform-origin: top left; }
  .card-pages { zoom: .45; }
  .record-time { font-size: 9.5px; }
  .receipt { padding: 22px 17px; }
  .qr-panel .qr-box { width: 150px; height: 150px; }
}
@media (max-width: 480px) {
  .view { padding: 14px 12px 88px; }
  .topbar { padding: 9px 12px; }
  .mobile-brand span:last-child { font-size: 14px; }
  .btn-scan-quick { width: 38px; padding: 0; }
  .btn-scan-quick span { display: none; }
  .hero { padding: 19px; }
  .hero h2 { font-size: 21px; }
  .hero-kicker { font-size: 9.5px; }
  .hero-actions { gap: 7px; }
  .hero-actions .btn { padding: 0 10px; font-size: 11px; }
  .stat-card { padding: 11px 12px; }
  .stat-label { font-size: 10px; }
  .stat-value strong { font-size: 23px; }
  .stat-icon { width: 25px; height: 25px; }
  .quick-card { padding: 12px; }
  .quick-card span { display: none; }
  .panel-pad { padding: 14px; }
  .page-intro h2 { font-size: 19px; }
  .detail-title h2 { font-size: 21px; }
  .detail-stock .stock-big strong { font-size: 39px; }
  .cards-preview-wrap { margin: 0 -12px; padding: 10px; }
  .card-pages { gap: 10px; }
  .records-summary { gap: 7px; }
  .mini-stat { padding: 10px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---------- auth & accounts ---------- */
body.auth-pending .app-shell,
body.auth-pending .bottom-nav { visibility: hidden; }
.auth-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; padding: 28px 16px;
  background:
    radial-gradient(circle at 18% 12%, rgba(196,122,27,.14), transparent 34%),
    radial-gradient(circle at 84% 82%, rgba(17,101,95,.16), transparent 36%),
    var(--cream);
}
.auth-card {
  width: min(420px, 100%); padding: 36px 34px 30px; border-radius: 24px;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 34px 80px -54px rgba(18,59,58,.6);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.auth-brand .brand-mark { width: 42px; height: 42px; }
.auth-brand strong { display: block; font-size: 15px; letter-spacing: .06em; }
.auth-brand small { display: block; margin-top: 1px; font-size: 8px; letter-spacing: .16em; color: var(--muted-2); }
.auth-card h1 { font-size: 29px; letter-spacing: -.03em; }
.auth-sub { margin-top: 7px; margin-bottom: 24px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.auth-card .field { margin-bottom: 14px; }
.auth-card .input { height: 46px; background: #fffefb; }
.auth-submit { width: 100%; height: 46px; margin-top: 6px; }
.auth-error {
  margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; font-size: 11.5px;
  color: #8a332b; background: var(--red-soft); border: 1px solid #eccfc9;
}
.auth-hint { margin-top: 18px; font-size: 10.5px; line-height: 1.75; color: var(--muted-2); }
.auth-status { display: flex; align-items: center; gap: 7px; margin-top: 20px; padding-top: 15px; border-top: 1px dashed var(--line); font-size: 10px; color: var(--muted); }
.auth-status .status-dot { background: var(--amber); box-shadow: none; }
.auth-status.ok .status-dot { background: var(--teal-2); }
.auth-foot { font-size: 9px; letter-spacing: .18em; color: var(--muted-2); }
.sidebar-user {
  display: flex; align-items: center; gap: 9px; margin: 9px 12px 4px;
  padding: 11px 10px; border-top: 1px solid rgba(255,255,255,.09);
}
.user-avatar {
  width: 31px; height: 31px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: rgba(237,233,215,.14);
  color: var(--cream); font-family: var(--font-num); font-size: 12px; font-weight: 600;
}
.user-copy { min-width: 0; flex: 1; }
.user-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #f4f0e4; font-size: 11.5px; font-weight: 500; }
.user-copy span { display: block; margin-top: 2px; color: rgba(237,233,215,.55); font-size: 9px; }
.user-logout {
  width: 28px; height: 28px; flex: 0 0 auto; border: 0; border-radius: 8px;
  background: transparent; color: rgba(237,233,215,.6); cursor: pointer;
}
.user-logout:hover { background: rgba(255,255,255,.09); color: var(--cream); }
.user-logout svg { width: 15px; height: 15px; }
.account-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper);
  color: var(--teal); font-family: var(--font-num); font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.account-btn:hover { border-color: var(--teal); }
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row .user-avatar { background: var(--teal-wash); color: var(--teal); }
.user-row-main { flex: 1; min-width: 0; }
.user-row-main strong { display: block; font-size: 12px; }
.user-row-main span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted-2); }
.user-row-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.user-row-actions .btn { height: 28px; padding: 0 9px; font-size: 10px; }
.role-pill { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px; font-size: 9px; background: var(--teal-wash); color: var(--teal); }
.role-pill.admin { background: var(--amber-soft); color: #79520f; }
.role-pill.scanner { background: #eef1f0; color: #52615f; }
.user-state { margin-left: 5px; font-size: 9px; color: var(--muted-2); }
.user-state.off { color: var(--red); }
.account-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; border-radius: 12px; background: var(--teal-wash); }
.account-summary .user-avatar { width: 42px; height: 42px; background: var(--teal); color: #fff; font-size: 15px; }
.account-summary strong { display: block; font-size: 14px; }
.account-summary span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 24px; border-radius: 20px; }
  .auth-card h1 { font-size: 25px; }
  .account-btn { width: 36px; height: 36px; }
  .user-row-actions .btn { padding: 0 7px; }
}

/* ---------- stocktake / import / scrap / move ---------- */
.stocktake-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stocktake-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stocktake-switch label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.stocktake-switch input { accent-color: var(--teal); width: 15px; height: 15px; }
.stocktake-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stocktake-summary .mini-stat { padding: 12px 14px; }
.stocktake-summary .mini-stat .ms-icon.warn { background: var(--amber-soft); color: var(--amber); }
.stocktake-book { font-family: var(--font-num); font-size: 15px; }
.stocktake-book small { font-family: var(--font-body, inherit); font-size: 10px; color: var(--muted-2); margin-left: 2px; }
.stocktake-input-wrap { display: inline-flex; align-items: center; gap: 6px; }
.stocktake-input { width: 104px; height: 38px; text-align: right; font-family: var(--font-num); font-size: 15px; font-weight: 600; padding: 0 9px; }
.stocktake-input-wrap > span { font-size: 10px; color: var(--muted-2); }
.stocktake-diff { display: inline-block; min-width: 48px; font-family: var(--font-num); font-size: 14px; color: var(--muted-2); }
.stocktake-diff.plus { color: var(--teal); }
.stocktake-diff.minus { color: var(--red); }
.stocktake-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 14px; }
.stocktake-foot > span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.stocktake-foot svg { width: 13px; height: 13px; }
.stocktake-mobile { display: none; }
.stocktake-mobile-card { border: 1px solid var(--line); border-radius: 11px; background: var(--paper); padding: 11px 12px; margin-bottom: 8px; }
.stocktake-mobile-top { display: flex; align-items: center; gap: 10px; }
.stocktake-mobile-top .m-main { flex: 1; min-width: 0; }
.stocktake-mobile-top .m-main strong { display: block; font-size: 12.5px; }
.stocktake-mobile-top .m-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.stocktake-mobile-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.stocktake-mobile-bottom > span { font-size: 10.5px; color: var(--muted); }
.stocktake-mobile-bottom .stocktake-input { height: 34px; width: 96px; }
.timeline-dot.count { background: var(--blue-soft); color: var(--blue); }
.timeline-dot.scrap { background: var(--red-soft); color: var(--red); }
.timeline-dot.move, .timeline-dot.adjust { background: var(--amber-soft); color: var(--amber); }
.timeline-qty.count, .timeline-qty.move, .timeline-qty.adjust { color: var(--muted); }
.timeline-qty.scrap { color: var(--red); }
.record-type.count { color: var(--blue); }
.record-type.scrap { color: var(--red); }
.record-type.move, .record-type.adjust { color: var(--amber); }
.record-qty.count, .record-qty.move, .record-qty.adjust { color: var(--muted); }
.record-qty.scrap { color: var(--red); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }
.import-template { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); margin-bottom: 14px; }
.import-template strong { display: block; font-size: 12px; }
.import-template span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.import-template-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.import-drop { position: relative; border: 1px dashed #c7d8d2; border-radius: 12px; background: var(--paper-2); padding: 26px 16px; text-align: center; cursor: pointer; transition: .15s ease; }
.import-drop:hover, .import-drop.dragging { border-color: var(--teal); background: var(--teal-wash); }
.import-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.import-drop-icon { width: 38px; height: 38px; margin: 0 auto 8px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.import-drop-icon svg { width: 19px; height: 19px; }
.import-drop strong { display: block; font-size: 12.5px; }
.import-drop > span:last-child { display: block; margin-top: 3px; font-size: 10px; color: var(--muted-2); }
.import-selected { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid #cfe3db; border-radius: 10px; background: var(--teal-wash); }
.import-selected > span:nth-child(2) { flex: 1; min-width: 0; }
.import-selected strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-selected span span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.import-file-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; color: var(--teal); flex: 0 0 auto; }
.import-file-icon svg { width: 15px; height: 15px; }
.import-result { margin-top: 12px; padding: 13px 14px; border: 1px solid #cfe3db; border-radius: 11px; background: #f4faf7; }
.import-result-head { display: flex; align-items: center; gap: 7px; color: var(--teal); }
.import-result-head svg { width: 16px; height: 16px; }
.import-result-stats { display: flex; gap: 18px; margin: 9px 0; font-size: 11px; color: var(--muted); }
.import-result-stats b { font-family: var(--font-num); font-size: 16px; color: var(--ink); margin-left: 3px; }
.import-result-stats .bad b { color: var(--amber); }
.import-errors { margin: 8px 0 0; padding-left: 18px; font-size: 10.5px; color: var(--red); line-height: 1.7; }
.field-hint { display: block; margin-top: 4px; font-size: 10px; color: var(--muted-2); }
@media (max-width: 900px) {
  .stocktake-summary { grid-template-columns: 1fr 1fr; }
  .stocktake-mobile { display: block; }
  .stocktake-table { display: none; }
  .stocktake-foot { align-items: flex-start; flex-direction: column; }
  .stocktake-foot .btn { width: 100%; }
  .import-template { align-items: flex-start; flex-direction: column; }
  .import-template-actions { width: 100%; }
  .import-template-actions .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
  .stocktake-head { gap: 9px; }
  .stocktake-head .search-box { max-width: none; width: 100%; }
  .stocktake-summary { gap: 7px; }
  .stocktake-summary .mini-stat { padding: 10px; }
}

/* ---------- print ---------- */
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; width: 210mm; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .bottom-nav, .cards-side, .cards-bar, .page-intro, .card-note,
  .toast-root, .modal-root, .no-print { display: none !important; }
  .app-shell { display: block; }
  .view { padding: 0 !important; max-width: none; margin: 0; }
  .page { animation: none !important; }
  .cards-layout { display: block; }
  .cards-preview-wrap { background: #fff; padding: 0; margin: 0; border-radius: 0; overflow: visible; box-shadow: none; }
  .card-pages { gap: 0; display: block; }
  .card-page {
    width: 210mm; height: 297mm; min-height: 0; padding: 10mm; margin: 0;
    box-shadow: none; page-break-after: always; break-after: page;
    grid-template-columns: repeat(2, 90mm); grid-auto-rows: 54mm; gap: 5mm 6mm;
  }
  .card-page:last-child { page-break-after: auto; break-after: auto; }
  .card-page .material-card { box-shadow: none; border: .3mm solid #d9d7c9; break-inside: avoid; }
  .material-card { box-shadow: none; }
}
