/* ================================================================
   板仓 · 广告车间板材库存
   Design tokens / base / shell / dashboard
   ================================================================ */

:root {
  --ink: #1c2621;
  --ink-2: #334039;
  --ink-3: #526158;
  --muted: #7d867f;
  --muted-2: #a0a69f;
  --bg: #f4f1e9;
  --bg-deep: #ece7db;
  --surface: #fffdf9;
  --surface-2: #f9f6ef;
  --surface-3: #f3eee3;
  --line: #e7e0d3;
  --line-strong: #d8cfbf;
  --accent: #e7652d;
  --accent-dark: #c94c18;
  --accent-soft: #fdeadd;
  --accent-ink: #8d3210;
  --green: #367d5c;
  --green-soft: #e6f1ea;
  --green-dark: #246044;
  --red: #c34d45;
  --red-soft: #fae9e6;
  --blue: #316b93;
  --blue-soft: #e8f0f5;
  --yellow: #a9741b;
  --yellow-soft: #f8efdb;
  --shadow-lg: 0 24px 60px rgba(48, 43, 31, 0.10), 0 3px 10px rgba(48, 43, 31, 0.04);
  --shadow: 0 14px 36px rgba(48, 43, 31, 0.075), 0 2px 7px rgba(48, 43, 31, 0.035);
  --shadow-sm: 0 5px 16px rgba(48, 43, 31, 0.06);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius: 15px;
  --radius-sm: 11px;
  --font: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "SF Pro Display", "Segoe UI", var(--font);
  --sidebar-w: 252px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgba(231, 101, 45, 0.055), transparent 32rem),
    radial-gradient(circle at 96% 2%, rgba(54, 125, 92, 0.06), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  z-index: -1;
  background-image:
    linear-gradient(rgba(70, 62, 45, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 62, 45, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

::selection { background: rgba(231, 101, 45, 0.24); }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.025em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d4ccbd; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Boot ---------- */
.boot-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
}
.boot-mark { position: relative; width: 58px; height: 58px; margin-bottom: 10px; }
.boot-mark span {
  position: absolute;
  width: 46px;
  height: 34px;
  border-radius: 7px;
  border: 2px solid var(--ink);
  background: var(--surface);
  left: 6px;
  top: 14px;
  animation: bootStack 1.25s var(--ease) infinite;
}
.boot-mark span:nth-child(2) { top: 8px; background: var(--accent); border-color: var(--accent); animation-delay: .08s; }
.boot-mark span:nth-child(3) { top: 2px; background: var(--surface); animation-delay: .16s; }
.boot-mark span:nth-child(3)::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px; top: 15px;
  border-top: 2px dashed var(--ink);
  opacity: .5;
}
@keyframes bootStack {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.boot-name { font-size: 24px; font-weight: 800; letter-spacing: 0.14em; }
.boot-sub { font-size: 13px; color: var(--muted); }
.noscript { padding: 40px; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28, 38, 33, .14); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { --btn-bg: var(--accent); --btn-color: #fff; box-shadow: 0 8px 18px rgba(231, 101, 45, .24); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark { --btn-bg: var(--ink); }
.btn-secondary {
  --btn-bg: var(--surface);
  --btn-color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 2px 5px rgba(48, 43, 31, .03);
}
.btn-secondary:hover { background: #fff; border-color: #c8bfaf; box-shadow: var(--shadow-sm); }
.btn-ghost { --btn-bg: transparent; --btn-color: var(--ink-2); }
.btn-ghost:hover { background: rgba(28, 38, 33, .06); box-shadow: none; }
.btn-soft { --btn-bg: var(--accent-soft); --btn-color: var(--accent-ink); }
.btn-soft:hover { background: #fbdcc9; }
.btn-danger { --btn-bg: var(--red); --btn-color: #fff; }
.btn-danger-soft { --btn-bg: var(--red-soft); --btn-color: var(--red); }
.btn-success { --btn-bg: var(--green); --btn-color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 50px; padding: 0 23px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 11px;
  background: transparent; color: var(--ink-2); border: 1px solid transparent;
}
.btn-icon:hover { background: rgba(28, 38, 33, .06); }
.btn-icon.bordered { border-color: var(--line); background: var(--surface); }
.link-btn {
  border: 0; background: none; padding: 3px; color: var(--accent-dark);
  font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 249, .78);
  border-right: 1px solid rgba(216, 207, 191, .72);
  backdrop-filter: blur(18px);
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}
.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--ink);
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  position: absolute;
  width: 25px; height: 17px;
  left: 9px; top: 9px;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(-6deg);
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 22px; height: 15px;
  left: 8px; top: 17px;
  border-radius: 3px;
  border: 1.5px solid #fff4e9;
  background: rgba(255,255,255,.08);
  transform: rotate(5deg);
}
.brand-text strong { display: block; font-size: 20px; letter-spacing: .08em; line-height: 1.1; }
.brand-text small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.shop-chip {
  margin: 25px 3px 20px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(249, 246, 239, .8);
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
}
.shop-chip .dot {
  width: 7px; height: 7px; border-radius: 99px; background: var(--green);
  box-shadow: 0 0 0 3px rgba(54,125,92,.13);
  flex: 0 0 auto;
}
.shop-chip span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.shop-chip small { margin-left: auto; font-size: 10px; color: var(--muted-2); flex: 0 0 auto; }
.side-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label {
  margin: 16px 11px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.nav-label:first-child { margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 550;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: rgba(231, 101, 45, .065); color: var(--ink); }
.nav-item.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 7px 16px rgba(28, 38, 33, .15);
}
.nav-item.active .nav-icon { color: #ffc89f; }
.nav-icon { color: var(--muted); }
.nav-badge {
  margin-left: auto;
  min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.15); color: #fff; }
.side-foot { margin-top: auto; padding-top: 20px; }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}
.avatar {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.avatar-lg { width: 58px; height: 58px; border-radius: 17px; font-size: 21px; }
.avatar-sm { width: 29px; height: 29px; border-radius: 9px; font-size: 11px; }
.side-user-info { min-width: 0; flex: 1; }
.side-user-info strong { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-info small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.logout-btn { color: var(--muted); border: 0; background: none; padding: 6px; border-radius: 8px; }
.logout-btn:hover { background: var(--red-soft); color: var(--red); }
.version { margin: 13px 8px 0; font-size: 10px; color: var(--muted-2); line-height: 1.55; }

.content-shell {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 36px 44px 64px;
}
.page-enter { animation: pageIn .42s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-top, .bottom-nav { display: none; }

/* ---------- Page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 25px;
}
.eyebrow {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
  color: var(--accent-dark);
  text-transform: uppercase;
}
.page-title { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.14; letter-spacing: -0.04em; }
.page-sub { margin-top: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.head-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.dashboard-head .page-title { font-size: clamp(27px, 2.8vw, 38px); }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #f0d4bd;
  border-radius: 13px;
  background: #fff5eb;
  color: #7d3a18;
  font-size: 12.5px;
}
.banner .icon { color: var(--accent); }
.banner .btn { margin-left: auto; }

/* ---------- Panels & common ---------- */
.panel {
  background: var(--surface);
  border: 1px solid rgba(216, 207, 191, .76);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 23px 0;
}
.panel-head.with-border { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 16.5px; letter-spacing: -0.025em; }
.panel-sub { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-body { padding: 18px 23px 23px; }
.panel-actions { display: flex; gap: 6px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr); gap: 20px; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, .75fr);
  min-height: 268px;
  margin-bottom: 19px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 32%, rgba(231, 101, 45, .34), transparent 22rem),
    linear-gradient(122deg, #1a241f 0%, #202e26 50%, #263a2f 100%);
  color: #fff;
  box-shadow: 0 22px 48px rgba(25, 34, 29, .17);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  background-image: radial-gradient(rgba(255,255,255,.35) .65px, transparent .65px);
  background-size: 13px 13px;
  mask-image: linear-gradient(90deg, black, transparent 70%);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  padding: 37px 38px 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffc9a7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-kicker::before { content: ""; width: 20px; height: 1px; background: currentColor; }
.hero-title {
  margin-top: 16px;
  max-width: 560px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.17;
  letter-spacing: -0.045em;
}
.hero-title em { font-style: normal; color: #ffb57d; }
.hero-text {
  margin-top: 12px;
  max-width: 470px;
  color: rgba(255,255,255,.64);
  font-size: 13px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 9px; margin-top: 23px; flex-wrap: wrap; }
.hero .btn-primary { box-shadow: 0 9px 22px rgba(231, 101, 45, .34); }
.hero .btn-secondary { background: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.2); backdrop-filter: blur(10px); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.13); }
.hero-art {
  position: relative;
  z-index: 1;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board-stack { position: relative; width: 250px; height: 210px; }
.stack-board {
  position: absolute;
  width: 188px;
  height: 124px;
  border-radius: 7px;
  transform-origin: center;
  box-shadow: 0 18px 35px rgba(0,0,0,.22);
  overflow: hidden;
}
.stack-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.2), transparent 40%, rgba(0,0,0,.14));
}
.stack-board.b1 { left: 16px; top: 39px; background: #d9d2c0; transform: rotate(-13deg); opacity: .9; }
.stack-board.b2 { left: 35px; top: 54px; background: #d9534b; transform: rotate(-4deg); }
.stack-board.b3 { left: 56px; top: 27px; background: #f3efe4; transform: rotate(7deg); }
.stack-board.b3::before {
  content: "";
  position: absolute;
  left: 26px; right: 26px; top: 58px;
  border-top: 2px dashed rgba(28,38,33,.48);
}
.stack-board.b3 .cut-mark {
  position: absolute;
  right: 20px; bottom: 17px;
  font-family: var(--num);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink);
  opacity: .56;
}
.hero-badge {
  position: absolute;
  right: 4px;
  bottom: 29px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  background: rgba(20, 30, 25, .7);
  backdrop-filter: blur(12px);
  font-size: 10.5px;
  color: rgba(255,255,255,.78);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.hero-badge strong { color: #fff; font-size: 14px; font-family: var(--num); }
.hero-badge .dot { width: 6px; height: 6px; border-radius: 99px; background: #88d2a9; box-shadow: 0 0 0 3px rgba(136,210,169,.14); }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border: 1px solid rgba(216, 207, 191, .8);
  border-radius: 17px;
  background: rgba(255, 253, 249, .92);
  box-shadow: var(--shadow-sm);
}
.metric::after {
  content: "";
  position: absolute;
  width: 88px; height: 88px;
  right: -38px; bottom: -45px;
  border-radius: 50%;
  background: var(--metric-soft, var(--surface-2));
  opacity: .8;
}
.metric-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.metric-icon {
  width: 31px; height: 31px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--metric-soft, var(--surface-2));
  color: var(--metric-color, var(--ink-2));
}
.metric-icon .icon { width: 16px; height: 16px; }
.metric-value {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.04em;
}
.metric-value small { font-family: var(--font); font-size: 11px; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.metric-note { margin-top: 9px; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric.accent { --metric-color: var(--accent); --metric-soft: var(--accent-soft); }
.metric.green { --metric-color: var(--green); --metric-soft: var(--green-soft); }
.metric.blue { --metric-color: var(--blue); --metric-soft: var(--blue-soft); }
.metric.yellow { --metric-color: var(--yellow); --metric-soft: var(--yellow-soft); }

/* ---------- Cut list ---------- */
.cut-list { display: flex; flex-direction: column; }
.cut-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cut-row:last-child { border-bottom: 0; padding-bottom: 0; }
.cut-row:first-child { padding-top: 2px; }
.swatch {
  position: relative;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--swatch, #ccc);
  border: 1px solid rgba(28,38,33,.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
  overflow: hidden;
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.25), transparent 45%, rgba(0,0,0,.12));
}
.swatch.light::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(28,38,33,.26);
  border-radius: 3px;
}
.cut-main { min-width: 0; }
.cut-main strong { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-side { text-align: right; }
.cut-side strong { display: block; font-family: var(--num); font-size: 14px; font-weight: 700; }
.cut-side span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.cut-side .voided { color: var(--red); font-size: 10px; }
.cut-main .new-code {
  display: inline-flex; width: auto; align-items: center; gap: 3px;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-family: var(--num);
  font-size: 9px;
  font-weight: 700;
}

/* ---------- Low stock ---------- */
.low-list { display: flex; flex-direction: column; gap: 13px; }
.low-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.low-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.low-name .swatch { width: 23px; height: 23px; border-radius: 7px; }
.low-name strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.low-name span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.low-count { font-family: var(--num); font-size: 12px; font-weight: 700; color: var(--red); }
.low-count small { color: var(--muted); font-weight: 500; }
.low-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.low-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e7945f, var(--red)); }
.low-foot { display: flex; justify-content: space-between; margin-top: 1px; font-size: 9.5px; color: var(--muted-2); }

/* ---------- Chart ---------- */
.chart { display: flex; flex-direction: column; gap: 10px; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%;
  max-width: 26px;
  min-height: 3px;
  border-radius: 5px 5px 3px 3px;
  background: var(--surface-3);
  position: relative;
  transition: height .55s var(--ease);
}
.chart-bar.has-value { background: linear-gradient(180deg, #f0a16e, var(--accent)); }
.chart-col:hover .chart-bar { filter: brightness(.94); }
.chart-day { font-size: 9px; color: var(--muted); }
.chart-day.today { color: var(--accent-dark); font-weight: 700; }
.chart-meta { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); }

/* ---------- Category bars ---------- */
.cat-bars { display: flex; flex-direction: column; gap: 11px; margin-top: 1px; }
.cat-row { display: grid; grid-template-columns: 66px minmax(0,1fr) 48px; gap: 8px; align-items: center; }
.cat-row span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row .bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cat-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.cat-row strong { text-align: right; font-family: var(--num); font-size: 10px; font-weight: 600; color: var(--muted); }

/* ---------- Empty ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 24px;
  color: var(--muted);
}
.empty-art {
  position: relative;
  width: 74px; height: 57px;
  margin-bottom: 15px;
}
.empty-art::before, .empty-art::after {
  content: "";
  position: absolute;
  width: 54px; height: 34px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  left: 10px; top: 12px;
  transform: rotate(-7deg);
}
.empty-art::after { transform: rotate(5deg); background: var(--surface); }
.empty strong { color: var(--ink-2); font-size: 13px; }
.empty p { max-width: 280px; margin-top: 5px; font-size: 11px; line-height: 1.65; }
.empty .btn { margin-top: 14px; }

/* ---------- Skeleton / loading ---------- */
.page-loading { padding: 8px 0; }
.skeleton-line {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee8dc 25%, #f8f4eb 40%, #eee8dc 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 12px;
}
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-block {
  height: 140px;
  border-radius: 18px;
  background: linear-gradient(90deg, #eee8dc 25%, #f8f4eb 40%, #eee8dc 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite;
  margin-top: 18px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-secondary .spinner { border-color: rgba(28,38,33,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 380px;
  padding: 13px 15px;
  border-radius: 13px;
  background: #1e2923;
  color: #fff;
  box-shadow: 0 16px 35px rgba(20,27,23,.25);
  font-size: 12.5px;
  line-height: 1.55;
  animation: toastIn .35s var(--ease);
  pointer-events: auto;
}
.toast .icon { color: #8bd4a8; margin-top: 1px; }
.toast.error .icon { color: #ff9c8e; }
.toast.warn .icon { color: #ffc777; }
.toast strong { display: block; font-size: 12.5px; }
.toast span { display: block; color: rgba(255,255,255,.68); font-size: 11px; margin-top: 2px; }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }


/* ================================================================
   Forms / filters / inventory
   ================================================================ */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.field > label .req { color: var(--accent); font-size: 12px; }
.field-hint { font-size: 10px; color: var(--muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input::placeholder, .textarea::placeholder { color: #b3b5ad; }
.input:hover, .select:hover, .textarea:hover { border-color: #c8bfaf; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 101, 45, .11);
  background: #fff;
}
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d867f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.textarea { height: auto; min-height: 82px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input[type="number"] { font-family: var(--num); }
.input-group { position: relative; }
.input-group .unit {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}
.input-group .input { padding-right: 38px; }
.search-field { position: relative; }
.search-field .icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  width: 17px; height: 17px;
}
.search-field .input { padding-left: 38px; }
.input-row { display: flex; gap: 9px; align-items: center; }
.input-row .input { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}
.form-note .icon { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.check-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check-line input { width: 17px; height: 17px; accent-color: var(--accent); }
.color-input-wrap { display: flex; gap: 8px; align-items: center; }
.color-input-wrap input[type="color"] {
  width: 46px; height: 44px; flex: 0 0 auto; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .16s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 7px rgba(48,43,31,.08); }
.segmented .count { margin-left: 4px; font-family: var(--num); font-size: 9px; opacity: .65; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 249, .86);
  box-shadow: var(--shadow-sm);
}
.toolbar .search-field { flex: 1 1 210px; min-width: 180px; }
.toolbar .select { width: auto; min-width: 130px; height: 40px; font-size: 12px; }
.toolbar .segmented { flex: 0 0 auto; }
.toolbar-spacer { flex: 1; }
.toolbar-note { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.summary-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 2px 12px;
  color: var(--muted);
  font-size: 11px;
}
.summary-strip strong { color: var(--ink); font-family: var(--num); font-size: 13px; font-weight: 700; }
.summary-strip .sep { width: 1px; height: 11px; background: var(--line-strong); }
.summary-strip .right { margin-left: auto; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  padding: 12px 15px;
  text-align: left;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fffbf4; }
.inventory-table { border-collapse: separate; border-spacing: 0; min-width: 1000px; border: 1px solid var(--line-strong); }
.inventory-table th, .inventory-table td { border-right: 1px solid var(--line-strong); }
.inventory-table th:last-child, .inventory-table td:last-child { border-right: 0; }
.inventory-table thead th { border-bottom: 2px solid var(--line-strong); background: #f3eee3; }
.inventory-table tbody td { border-bottom: 1px solid var(--line-strong); }
.inventory-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.data-table .right { text-align: right; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn + .btn { margin-left: 5px; }
.data-table .sub { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.mat-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mat-cell .swatch { width: 31px; height: 31px; border-radius: 8px; }
.mat-cell strong { display: block; font-size: 12.5px; font-weight: 620; white-space: nowrap; }
.mat-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.code { font-family: var(--num); font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
.code.muted-code { color: var(--muted); font-weight: 500; }
.dims { font-family: var(--num); font-size: 12px; font-weight: 650; white-space: nowrap; }
.dims small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}
.tag-sheet { background: var(--blue-soft); color: var(--blue); }
.tag-offcut { background: var(--green-soft); color: var(--green-dark); }
.tag-warn { background: var(--red-soft); color: var(--red); }
.tag-muted { background: var(--surface-3); color: var(--muted); }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.qty-badge { display: inline-flex; align-items: center; gap: 3px; font-family: var(--num); font-size: 14px; font-weight: 750; }
.qty-badge small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }
.location-text { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 10.5px; }
.location-text .icon { width: 13px; height: 13px; color: var(--muted-2); }
.empty-row { padding: 42px !important; }


/* Inventory grouped by material colour */
.inv-color-grid { display: flex; align-items: flex-start; gap: 6px; }
.inv-color-column { display: flex; flex-direction: column; gap: 6px; width: 390px; flex: 0 0 390px; min-width: 0; }
.inv-color-group {
  display: block;
  width: 390px;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.inv-color-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
}
.inv-color-head .swatch { width: 34px; height: 34px; border-radius: 9px; }
.inv-color-title { flex: 1; min-width: 0; }
.inv-color-title strong { display: block; font-size: 14px; }
.inv-color-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.inv-color-total { text-align: right; white-space: nowrap; }
.inv-color-total strong { display: block; font-family: var(--num); font-size: 18px; line-height: 1; }
.inv-color-total small { display: block; margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.inv-color-unit { margin-left: 2px; font-family: var(--font); font-size: 9.5px; font-weight: 500; color: var(--muted); }
.inv-color-items { padding: 0 14px; }
.inv-color-item {
  display: grid;
  grid-template-columns: 140px 30px 60px max-content;
  align-items: center;
  gap: 5px 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.inv-color-item:last-child { border-bottom: 0; }
.inv-color-spec strong { display: block; font-family: var(--num); font-size: 13.5px; }
.inv-color-cm { margin-left: 2px; font-family: var(--font); font-size: 9.5px; font-weight: 500; color: var(--muted); }
.inv-color-spec small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.inv-color-qty strong { display: block; font-family: var(--num); font-size: 16px; text-align: right; }
.inv-color-qty small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; text-align: right; }
.inv-color-loc { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); font-size: 10.5px; }
.inv-color-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-color-loc .icon { width: 13px; height: 13px; flex: 0 0 auto; }
.inv-color-actions { display: flex; justify-content: flex-start; gap: 5px; }
@media (max-width: 760px) {
  .inv-color-grid { flex-direction: column; }
  .inv-color-column { width: 100% !important; }
  .inv-color-item { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .inv-color-qty { text-align: right; }
  .inv-color-loc { grid-column: 1 / -1; }
  .inv-color-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.inv-cards { display: none; }

/* ================================================================
   Finder / smart cut
   ================================================================ */

.finder-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; }
.search-panel { position: sticky; top: 24px; padding: 24px; }
.search-panel h2 { font-size: 18px; }
.search-panel .panel-sub { margin-bottom: 19px; }
.search-panel .field + .field { margin-top: 13px; }
.search-panel .form-grid > .field + .field { margin-top: 0; }
.form-grid > .field { align-self: start; }
.field > label { min-height: 16px; line-height: 16px; }
.field > label .req { line-height: 1; }
.search-panel .btn-block { margin-top: 17px; }
.search-panel .form-note { margin-top: 16px; }
.search-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10.5px;
}
.search-stats strong { color: var(--ink); font-family: var(--num); font-size: 14px; }
.search-stats .offcut-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--green); display: inline-block; margin-right: 5px; }

.finder-results { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 1px 2px 10px; }
.result-heading h3 { font-size: 16px; }
.result-heading span { font-size: 10.5px; color: var(--muted); }
.result-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 22px;
  padding: 24px;
  border: 1px solid #efd3bd;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 12%, rgba(231,101,45,.12), transparent 18rem),
    linear-gradient(135deg, #fff9f2, #fffdf9 72%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.result-hero::after {
  content: "";
  position: absolute;
  right: -48px; top: -58px;
  width: 155px; height: 155px;
  border: 1px solid rgba(231,101,45,.16);
  border-radius: 50%;
}
.best-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
}
.best-badge .icon { width: 12px; height: 12px; }
.result-hero h3 { font-size: 19px; letter-spacing: -.03em; }
.result-hero h3 small { color: var(--muted); font-size: 12px; font-weight: 500; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 9px; color: var(--muted); font-size: 10.5px; }
.result-meta span { display: inline-flex; align-items: center; gap: 4px; }
.result-meta .icon { width: 13px; height: 13px; }
.result-dims { display: flex; align-items: baseline; gap: 7px; margin-top: 15px; font-family: var(--num); font-size: 23px; font-weight: 750; letter-spacing: -.02em; }
.result-dims small { font-family: var(--font); font-size: 10px; color: var(--muted); font-weight: 500; }
.result-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.util-ring {
  position: relative;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), #f3e7db 0);
  display: flex; align-items: center; justify-content: center;
  margin: 7px auto 0;
  box-shadow: 0 8px 20px rgba(231,101,45,.13);
}
.util-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fffaf5; }
.util-ring .ring-inner { position: relative; z-index: 1; text-align: center; }
.util-ring strong { display: block; font-family: var(--num); font-size: 22px; font-weight: 750; letter-spacing: -.03em; }
.util-ring span { display: block; margin-top: 1px; font-size: 8.5px; color: var(--muted); }
.ring-label { margin-top: 9px; text-align: center; color: var(--muted); font-size: 9px; }
.result-visual { display: flex; flex-direction: column; justify-content: center; }

.offcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.offcut-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s ease;
}
.offcut-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d7c8b5; }
.offcut-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.offcut-card-head strong { font-size: 13px; }
.offcut-card-head .code { display: block; margin-top: 3px; }
.offcut-card-dim { margin-top: 12px; font-family: var(--num); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.offcut-card-dim small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }
.offcut-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 9.5px; }
.offcut-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--line); }
.util-mini { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.util-mini .bar { width: 46px; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.util-mini .bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }

.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sheet-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); display: flex; gap: 13px; align-items: flex-start; }
.sheet-thumb {
  width: 56px; height: 70px; flex: 0 0 auto;
  border-radius: 5px;
  background: var(--board-color, #ddd);
  border: 1px solid rgba(28,38,33,.1);
  position: relative;
  box-shadow: 4px 5px 0 rgba(28,38,33,.055);
}
.sheet-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255,255,255,.28), transparent 45%, rgba(0,0,0,.1)); }
.sheet-info { min-width: 0; flex: 1; }
.sheet-info h4 { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-info p { margin-top: 5px; color: var(--muted); font-size: 9.5px; }
.sheet-info .dims { margin-top: 7px; font-size: 12px; }
.sheet-info .btn { margin-top: 10px; }
.finder-empty .empty-art { width: 90px; height: 68px; }
.finder-empty .empty-art::before, .finder-empty .empty-art::after { width: 64px; height: 42px; }
.search-intro { padding: 5px 3px; }
.search-intro h3 { font-size: 17px; }
.search-intro > p { margin-top: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.steps { display: flex; flex-direction: column; gap: 12px; margin-top: 21px; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step-num {
  width: 25px; height: 25px; flex: 0 0 auto;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--num); font-size: 10px; font-weight: 700; color: var(--accent-dark);
}
.step strong { display: block; font-size: 11.5px; }
.step p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--yellow-soft);
  color: #6f511d;
  font-size: 10.5px;
  line-height: 1.6;
}
.notice .icon { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.notice.green { background: var(--green-soft); color: var(--green-dark); }
.notice.red { background: var(--red-soft); color: #8d312a; }

/* ================================================================
   Cut modal & diagrams
   ================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 28, 24, .52);
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%);
  max-height: min(90vh, 850px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(15, 22, 18, .34);
  animation: modalIn .33s var(--ease);
  overflow: hidden;
}
.modal.wide { width: min(780px, 100%); }
.modal.small { width: min(430px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
body.modal-open { overflow: hidden; }
.modal-head {
  position: relative;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head .eyebrow { margin-bottom: 5px; }
.modal-head h2 { font-size: 20px; letter-spacing: -.035em; padding-right: 36px; }
.modal-head p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.modal-close {
  position: absolute;
  top: 17px; right: 17px;
  width: 33px; height: 33px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-body { padding: 20px 24px 23px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.modal-foot .left { margin-right: auto; }

.piece-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.piece-summary .swatch { width: 35px; height: 35px; }
.piece-summary .ps-info { min-width: 0; flex: 1; }
.piece-summary strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.piece-summary .ps-qty { text-align: right; font-family: var(--num); font-size: 17px; font-weight: 750; }
.piece-summary .ps-qty small { font-family: var(--font); font-size: 8.5px; font-weight: 500; }

.cut-visual {
  margin-top: 15px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(rgba(28,38,33,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,38,33,.026) 1px, transparent 1px),
    #faf7f0;
  background-size: 18px 18px;
}
.cut-svg { width: 100%; height: auto; max-height: 230px; }
.svg-board { fill: var(--board-color, #d9d1c0); stroke: rgba(28,38,33,.2); stroke-width: 1; }
.svg-board-light { fill: #faf7ec; stroke: rgba(28,38,33,.2); stroke-width: 1; }
.svg-cut { fill: rgba(231,101,45,.28); stroke: var(--accent); stroke-width: 1.7; stroke-dasharray: 5 4; }
.svg-remainder { fill: rgba(54,125,92,.16); stroke: var(--green); stroke-width: 1.3; stroke-dasharray: 3 3; }
.svg-waste { fill: rgba(195,77,69,.13); stroke: var(--red); stroke-width: 1; }
.svg-label { font-family: var(--font); font-size: 9px; fill: var(--ink-3); }
.svg-label-strong { font-family: var(--num); font-size: 10px; font-weight: 700; fill: var(--ink); }
.svg-small { font-family: var(--num); font-size: 8px; fill: rgba(28,38,33,.55); }
.cut-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 8px; padding: 0 2px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--surface-3); border: 1px solid rgba(28,38,33,.1); }
.legend-dot.cut { background: var(--accent-soft); border-color: var(--accent); }
.legend-dot.remainder { background: var(--green-soft); border-color: var(--green); }
.legend-dot.waste { background: var(--red-soft); border-color: var(--red); }

.cut-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; }
.cut-mode-row .segmented button { min-height: 32px; font-size: 11px; }
.cut-form { margin-top: 14px; }
.cut-form .form-grid { gap: 12px; }
.cut-form .field .input { height: 46px; font-size: 15px; font-family: var(--num); }
.cut-form .field .input::placeholder { font-family: var(--font); font-size: 12px; }
.quick-lengths { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.quick-lengths button {
  height: 23px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); color: var(--muted);
  font-family: var(--num); font-size: 9.5px;
}
.quick-lengths button:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.estimate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}
.estimate-item {
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.estimate-item span { display: block; font-size: 8.5px; color: var(--muted); }
.estimate-item strong { display: block; margin-top: 4px; font-family: var(--num); font-size: 15px; font-weight: 700; }
.estimate-item strong small { font-family: var(--font); font-size: 8.5px; color: var(--muted); font-weight: 500; }
.estimate-item.green { background: var(--green-soft); border-color: #cfe5d8; }
.estimate-item.green strong { color: var(--green-dark); }
.estimate-item.red { background: var(--red-soft); border-color: #f1d3cf; }
.estimate-item.red strong { color: var(--red); }
.preview-note { margin-top: 10px; font-size: 9.5px; color: var(--muted); line-height: 1.55; }
.preview-note strong { color: var(--ink-2); }

.success-hero { text-align: center; padding: 9px 0 0; }
.success-mark {
  width: 57px; height: 57px; margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.success-mark .icon { width: 27px; height: 27px; stroke-width: 2; }
.success-hero h3 { font-size: 20px; }
.success-hero p { margin-top: 6px; color: var(--muted); font-size: 11px; }
.success-code { display: inline-block; margin-top: 11px; padding: 5px 10px; border-radius: 7px; background: var(--surface-2); font-family: var(--num); font-size: 11px; font-weight: 700; }
.created-list { display: flex; flex-direction: column; gap: 7px; margin-top: 19px; }
.created-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d5e6dc;
  border-radius: 10px;
  background: #f6fbf7;
}
.created-item .icon { color: var(--green); }
.created-item strong { display: block; font-family: var(--num); font-size: 11px; }
.created-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.created-item .dims { margin-left: auto; font-size: 10px; color: var(--green-dark); }
.success-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ================================================================
   Records
   ================================================================ */

.record-tabs { margin-bottom: 15px; }
.record-tabs .segmented { background: transparent; padding: 0; border: 0; gap: 22px; border-bottom: 1px solid var(--line); border-radius: 0; }
.record-tabs .segmented button {
  position: relative;
  border-radius: 0;
  padding: 0 2px 11px;
  min-height: 38px;
  font-size: 13px;
  background: transparent;
  box-shadow: none;
}
.record-tabs .segmented button.active { color: var(--ink); box-shadow: none; }
.record-tabs .segmented button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.record-toolbar { margin-bottom: 15px; }
.record-toolbar .date-filter { display: flex; align-items: center; gap: 7px; }
.record-cards { display: none; }
.record-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.record-card + .record-card { margin-top: 10px; }
.record-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record-card-head .code { font-size: 10px; }
.record-card-head strong { display: block; margin-top: 5px; font-size: 13px; }
.record-card-time { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.record-card-specs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.spec-pill { padding: 5px 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink-3); font-family: var(--num); font-size: 10px; }
.record-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 10px; color: var(--muted); }
.record-card.voided { opacity: .66; }
.voided-tag { text-decoration: line-through; text-decoration-color: rgba(195,77,69,.5); }
.record-note { margin-top: 9px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.55; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { position: relative; display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.activity-icon .icon { width: 15px; height: 15px; }
.activity-icon.cut { background: var(--accent-soft); color: var(--accent-dark); }
.activity-icon.stock_in { background: var(--green-soft); color: var(--green); }
.activity-icon.adjust, .activity-icon.cut_void { background: var(--red-soft); color: var(--red); }
.activity-icon.user_create, .activity-icon.user_edit, .activity-icon.user_reset_password { background: var(--blue-soft); color: var(--blue); }
.activity-main { flex: 1; min-width: 0; }
.activity-main p { font-size: 11.5px; line-height: 1.55; color: var(--ink-2); }
.activity-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.activity-time { flex: 0 0 auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.activity-empty { padding: 30px; }

/* ================================================================
   Admin / users / materials / settings / profile
   ================================================================ */

.permission-card {
  padding: 17px 19px;
  border-radius: 15px;
  background: linear-gradient(120deg, #f7f3e9, #fffdf9);
  border: 1px solid var(--line);
}
.permission-card h4 { font-size: 12px; display: flex; align-items: center; gap: 7px; }
.permission-card p { margin-top: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.role-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 9.5px; font-weight: 650; }
.role-admin { background: var(--ink); color: #ffd4b8; }
.role-staff { background: var(--surface-3); color: var(--ink-3); }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--green); }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.status-dot.off { color: var(--muted-2); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell strong { display: block; font-size: 12px; }
.user-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 16px; }
.admin-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.admin-stat span { font-size: 9.5px; color: var(--muted); }
.admin-stat strong { display: block; margin-top: 4px; font-family: var(--num); font-size: 22px; font-weight: 750; }
.admin-stat strong small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }

.admin-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; margin-top: 16px; }
.admin-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.admin-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-link .admin-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
.admin-link:nth-child(2) .admin-icon { background: var(--green-soft); color: var(--green); }
.admin-link:nth-child(3) .admin-icon { background: var(--blue-soft); color: var(--blue); }
.admin-link strong { font-size: 13px; }
.admin-link p { color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-link .arrow { margin-top: auto; color: var(--muted-2); }


/* Material catalog grouped rows */
.material-type-list {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.material-type-block { border-bottom: 1px solid var(--line); }
.material-type-block:last-child { border-bottom: 0; }
.material-type-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1.2fr) minmax(220px, 1.5fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}
.material-type-head {
  padding-top: 12px; padding-bottom: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.material-type-detail {
  padding: 0 20px 8px 20px;
  background: var(--surface-2);
  border-top: 1px dashed var(--line);
}
.material-type-detail .material-variant-row { padding: 10px 0; }
.material-type-detail .material-variant-row:last-child { border-bottom: 0; }
.mt-name strong { display: block; font-size: 15px; }
.mt-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.mt-thickness { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-thickness span {
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-family: var(--num);
  font-size: 11px;
  font-weight: 650;
}
.mt-stock { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 10px; }
.mt-stock strong { color: var(--ink); font-family: var(--num); font-size: 14px; }
.mt-stock em { color: var(--red); font-style: normal; font-size: 10px; font-weight: 650; }
.mt-actions { display: flex; justify-content: flex-end; }
.material-variant-list { margin-top: 13px; }
.material-variant-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.material-variant-row:last-child { border-bottom: 0; }
@media (max-width: 760px) {
  .material-type-head { display: none; }
  .material-type-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 15px; }
  .mt-thickness, .mt-stock { grid-column: 1 / -1; }
  .mt-actions { grid-column: 2; grid-row: 1; }
}

.material-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.material-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.material-card.inactive { opacity: .6; }
.mat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mat-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mat-title .swatch { width: 30px; height: 30px; }
.mat-title strong { display: block; font-size: 13px; }
.mat-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.mat-dims { margin-top: 13px; font-family: var(--num); font-size: 15px; font-weight: 650; }
.mat-dims small { font-family: var(--font); font-size: 9px; color: var(--muted); font-weight: 500; }
.mat-stock { display: flex; gap: 15px; margin-top: 11px; }
.mat-stock div { font-size: 9.5px; color: var(--muted); }
.mat-stock strong { display: block; margin-bottom: 2px; font-family: var(--num); font-size: 15px; color: var(--ink); }
.mat-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--line); }
.mat-card-foot span { font-size: 9px; color: var(--muted); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.settings-layout .panel + .panel { margin-top: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row:first-child { padding-top: 0; }
.setting-copy strong { display: block; font-size: 12.5px; }
.setting-copy p { max-width: 420px; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.setting-action { flex: 0 0 auto; }
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 45px; height: 25px; border-radius: 99px; background: #d9d3c7; position: relative; transition: background .2s ease; }
.switch-track::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.data-actions { display: flex; flex-direction: column; gap: 8px; }
.data-action {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 11px;
  text-align: left;
  transition: background .16s ease, border-color .16s ease;
}
.data-action:hover { background: var(--surface); border-color: var(--line-strong); }
.data-action .icon { color: var(--muted); width: 16px; height: 16px; }
.data-action strong { display: block; font-size: 11px; }
.data-action small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.data-action .arrow { margin-left: auto; color: var(--muted-2); }
.mini-help { padding: 15px; border-radius: 13px; background: var(--ink); color: #fff; }
.mini-help h4 { font-size: 11.5px; color: #ffd3b6; }
.mini-help p { margin-top: 6px; color: rgba(255,255,255,.62); font-size: 10px; line-height: 1.65; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 5%, rgba(231,101,45,.22), transparent 17rem),
    linear-gradient(125deg, #1b251f, #28392f);
  color: #fff;
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: 66px; height: 66px;
  flex: 0 0 auto;
  border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(231,101,45,.25);
}
.profile-meta { flex: 1; min-width: 0; }
.profile-meta h1 { font-size: 24px; }
.profile-meta p { margin-top: 5px; color: rgba(255,255,255,.58); font-size: 11px; }
.profile-badges { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.profile-badges span { padding: 3px 7px; border-radius: 5px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.72); font-size: 9px; }
.profile-stats { display: flex; gap: 24px; text-align: right; }
.profile-stats div span { display: block; font-size: 9px; color: rgba(255,255,255,.5); }
.profile-stats div strong { display: block; margin-top: 3px; font-family: var(--num); font-size: 21px; }
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  width: 100%;
  color: var(--ink);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { color: var(--accent-dark); }
.menu-icon { width: 33px; height: 33px; border-radius: 9px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.menu-icon .icon { width: 16px; height: 16px; }
.menu-item strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.menu-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.menu-item .chev { margin-left: auto; color: var(--muted-2); }
.menu-item.danger strong { color: var(--red); }

/* ================================================================
   Login
   ================================================================ */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr);
  background: var(--bg);
}
.login-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at 68% 22%, rgba(231,101,45,.4), transparent 24rem),
    radial-gradient(circle at 16% 90%, rgba(54,125,92,.32), transparent 25rem),
    linear-gradient(145deg, #19231e, #223329 55%, #1b2a22);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 66px);
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.28) .7px, transparent .7px);
  background-size: 15px 15px;
  opacity: .26;
  mask-image: linear-gradient(135deg, black, transparent 70%);
}
.login-visual::after {
  content: "STOCK / CUT / REUSE";
  position: absolute;
  right: -16px;
  bottom: 42px;
  transform: rotate(-90deg);
  transform-origin: right bottom;
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: .34em;
  color: rgba(255,255,255,.2);
}
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { background: #fff4e9; }
.login-brand .brand-mark::before { background: var(--accent); }
.login-brand .brand-mark::after { border-color: var(--ink); background: transparent; }
.login-brand strong { display: block; font-size: 21px; letter-spacing: .1em; }
.login-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.43); font-size: 9px; letter-spacing: .08em; }
.login-copy { position: relative; z-index: 2; margin-top: auto; padding-bottom: 24px; max-width: 590px; }
.login-kicker { font-size: 10px; font-weight: 700; letter-spacing: .2em; color: #ffc39c; text-transform: uppercase; }
.login-title { margin-top: 16px; font-size: clamp(38px, 4.5vw, 65px); line-height: 1.08; letter-spacing: -.055em; font-weight: 750; }
.login-title em { font-style: normal; color: #ffac72; }
.login-text { margin-top: 18px; max-width: 440px; color: rgba(255,255,255,.57); font-size: 13px; line-height: 1.8; }
.login-art { position: absolute; right: clamp(18px, 8vw, 110px); top: 25%; width: 300px; height: 300px; z-index: 1; opacity: .96; }
.login-board {
  position: absolute;
  width: 226px; height: 143px;
  border-radius: 8px;
  box-shadow: 0 28px 50px rgba(0,0,0,.3);
  overflow: hidden;
}
.login-board::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.22), transparent 42%, rgba(0,0,0,.14)); }
.login-board.lb1 { top: 26px; left: 7px; background: #d9d1bd; transform: rotate(-14deg); opacity: .8; }
.login-board.lb2 { top: 78px; left: 48px; background: #d95047; transform: rotate(4deg); }
.login-board.lb3 { top: 36px; left: 78px; background: #f4f0e5; transform: rotate(16deg); }
.login-board.lb3::before { content: ""; position: absolute; left: 29px; right: 29px; top: 70px; border-top: 2px dashed rgba(28,38,33,.42); }
.login-board .lb-label { position: absolute; left: 12px; bottom: 9px; font-family: var(--num); font-size: 8px; color: rgba(28,38,33,.45); letter-spacing: .08em; }
.login-note { position: relative; z-index: 2; display: flex; gap: 18px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.38); font-size: 9.5px; }
.login-note span { display: flex; align-items: center; gap: 5px; }
.login-note .dot { width: 5px; height: 5px; border-radius: 99px; background: #7dc69d; }
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px clamp(25px, 5vw, 74px);
  background: var(--bg);
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-mobile-brand { display: none; }
.login-form-head h2 { font-size: 28px; letter-spacing: -.045em; }
.login-form-head p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-form { margin-top: 28px; }
.login-form .field + .field { margin-top: 15px; }
.login-form .input { height: 49px; border-radius: 12px; background: rgba(255,253,249,.8); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 45px; }
.password-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.password-toggle:hover { background: var(--surface-3); color: var(--ink); }
.login-options { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; font-size: 10.5px; color: var(--muted); }
.login-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin-top: 15px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: #94352e;
  font-size: 11px;
  line-height: 1.5;
}
.login-error.show { display: flex; animation: shake .38s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.login-submit { width: 100%; margin-top: 22px; height: 50px; border-radius: 12px; font-size: 14px; }
.login-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; line-height: 1.7; text-align: center; }
.login-foot strong { color: var(--muted); font-weight: 600; }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1180px) {
  .page { padding: 32px 30px 56px; }
  .grid-2 { grid-template-columns: minmax(0, 1.15fr) minmax(285px, .85fr); }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .login-art { right: 4vw; opacity: .72; }
  .profile-stats { display: none; }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-104%); visibility: hidden; }
  .content-shell { margin-left: 0; }
  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 18px;
    background: rgba(244, 241, 233, .88);
    border-bottom: 1px solid rgba(216, 207, 191, .7);
    backdrop-filter: blur(15px);
  }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .mobile-brand .brand-mark::before { width: 19px; height: 13px; left: 7px; top: 7px; }
  .mobile-brand .brand-mark::after { width: 17px; height: 11px; left: 6px; top: 13px; }
  .mobile-brand strong { font-size: 16px; letter-spacing: .1em; }
  .mobile-brand small { font-size: 8.5px; color: var(--muted); margin-left: 3px; }
  .mobile-avatar { width: 32px; height: 32px; border-radius: 9px; }
  .bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, .94);
    border-top: 1px solid rgba(216, 207, 191, .8);
    backdrop-filter: blur(18px);
  }
  .bottom-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 550;
    transition: color .16s ease;
  }
  .bottom-item .icon { width: 21px; height: 21px; }
  .bottom-item.active { color: var(--accent-dark); }
  .bottom-item.active .icon { stroke-width: 2.1; }
  .bottom-center { position: relative; }
  .bottom-center .bottom-action {
    width: 46px; height: 46px;
    margin-top: -21px;
    margin-bottom: 2px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(231,101,45,.3), 0 0 0 4px rgba(255,253,249,.94);
  }
  .bottom-center .bottom-action .icon { width: 22px; height: 22px; stroke-width: 2; }
  .bottom-center span { color: var(--accent-dark); }
  .page { padding: 25px 22px 92px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: minmax(0, 1fr) 225px; }
  .hero-copy { padding: 30px 28px; }
  .hero-art { min-height: 210px; transform: scale(.83); transform-origin: center right; }
  .finder-layout { grid-template-columns: 1fr; }
  .search-panel { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; min-height: 100dvh; padding: 40px 25px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 38px; }
  .login-mobile-brand strong { font-size: 20px; letter-spacing: .1em; }
  .login-mobile-brand small { color: var(--muted); font-size: 10px; }
  .login-form-wrap { max-width: 390px; }
  .login-foot { margin-top: 38px; }
}

@media (max-width: 760px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 19px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .hero { display: block; min-height: 0; }
  .hero-copy { padding: 25px 22px 26px; }
  .hero-title { font-size: 28px; }
  .hero-text { font-size: 11.5px; }
  .hero-art { position: absolute; right: -50px; top: 50px; opacity: .36; transform: scale(.58); transform-origin: center; pointer-events: none; }
  .hero-badge { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 14px 14px 13px; }
  .metric-value { font-size: 27px; margin-top: 9px; }
  .metric-note { font-size: 9.5px; }
  .panel-head { padding: 18px 18px 0; }
  .panel-body { padding: 15px 18px 18px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2-even { grid-template-columns: 1fr; }
  .toolbar { padding: 11px; gap: 8px; }
  .toolbar .segmented { width: 100%; }
  .toolbar .segmented button { flex: 1; padding: 0 6px; }
  .toolbar .search-field { flex-basis: 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
  .summary-strip .right { display: none; }
  .table-wrap { display: none; }
  .inv-cards { display: flex; flex-direction: column; gap: 10px; }
  .inv-card {
    position: relative;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .inv-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
  .inv-card-head .inv-code { font-family: var(--num); font-size: 10px; color: var(--muted); }
  .inv-card-body { display: flex; gap: 12px; margin-top: 11px; align-items: center; }
  .inv-card-body .swatch { width: 43px; height: 43px; border-radius: 11px; }
  .inv-card-info { flex: 1; min-width: 0; }
  .inv-card-info strong { display: block; font-size: 13px; }
  .inv-card-info small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
  .inv-card-dims { display: flex; align-items: baseline; gap: 4px; margin-top: 5px; font-family: var(--num); font-size: 14px; font-weight: 700; }
  .inv-card-dims small { font-family: var(--font); font-size: 8.5px; color: var(--muted); font-weight: 500; }
  .inv-card-qty { text-align: right; flex: 0 0 auto; }
  .inv-card-qty strong { display: block; font-family: var(--num); font-size: 20px; font-weight: 750; }
  .inv-card-qty small { font-size: 8.5px; color: var(--muted); }
  .inv-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .inv-card-foot .location-text { font-size: 9.5px; }
  .inv-card-actions { display: flex; gap: 6px; }
  .offcut-grid, .sheet-grid { grid-template-columns: 1fr; }
  .result-hero { grid-template-columns: minmax(0,1fr) 90px; padding: 18px; gap: 13px; }
  .util-ring { width: 86px; height: 86px; }
  .util-ring::before { inset: 8px; }
  .util-ring strong { font-size: 18px; }
  .util-ring span { font-size: 7.5px; }
  .result-dims { font-size: 19px; }
  .result-hero h3 { font-size: 16px; }
  .record-toolbar .segmented { width: 100%; }
  .record-toolbar .segmented button { flex: 1; }
  .record-cards { display: block; }
  .records-table-wrap { display: none; }
  .record-card { display: block; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .admin-stat { padding: 10px 11px; }
  .admin-stat strong { font-size: 18px; }
  .admin-cards { grid-template-columns: 1fr; }
  .material-grid { grid-template-columns: 1fr; }
  .profile-hero { align-items: flex-start; padding: 20px; }
  .profile-avatar { width: 53px; height: 53px; border-radius: 15px; font-size: 20px; }
  .profile-meta h1 { font-size: 21px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 93dvh;
    border-radius: 22px 22px 0 0;
    animation: sheetIn .32s var(--ease);
  }
  .modal-head { padding: 20px 19px 14px; }
  .modal-body { padding: 17px 19px; }
  .modal-foot { padding: 13px 19px calc(13px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .span-2 { grid-column: auto; }
  .form-grid.three { grid-template-columns: 1fr; }
  .estimate-grid { grid-template-columns: repeat(3, 1fr); }
  .estimate-item { padding: 8px; }
  .estimate-item strong { font-size: 13px; }
  .cut-visual { padding: 9px; }
  .cut-svg { max-height: 190px; }
  .login-form-head h2 { font-size: 25px; }
  .login-title { font-size: 42px; }
  #toast-root { left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .activity-time { display: none; }
  .record-tabs .segmented { gap: 16px; }
}

@keyframes sheetIn { from { opacity: .6; transform: translateY(40px); } to { opacity: 1; transform: none; } }

@media (max-width: 420px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .mobile-top { padding: 0 14px; }
  .hero-copy { padding: 23px 19px 24px; }
  .hero-title { font-size: 25px; }
  .metric { padding: 12px; }
  .metric-value { font-size: 24px; }
  .metric-top { font-size: 10.5px; }
  .metric-icon { width: 27px; height: 27px; }
  .toolbar .select { font-size: 11px; }
  .result-hero { grid-template-columns: 1fr; }
  .result-visual { display: none; }
  .estimate-grid { grid-template-columns: 1fr 1fr; }
  .estimate-item:nth-child(3) { grid-column: span 2; }
  .login-panel { padding: 28px 20px; }
}


/* ================================================================
   Additional components
   ================================================================ */

.hide-mobile { display: inline-flex; }
.avatar-muted { background: #b7b3a8; color: #fff; }

.user-list { padding: 3px 20px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) 90px 80px minmax(95px, .7fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: 0; }
.user-row-meta { min-width: 0; }
.user-row-time span { display: block; color: var(--muted); font-size: 9px; }
.user-row-time small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 10.5px; }
.user-row-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.user-row-actions .btn { white-space: nowrap; }
.session-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) 130px 105px minmax(90px, .8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.session-row:last-child { border-bottom: 0; }
.session-ip { font-family: var(--num); font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .session-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .session-row .user-row-time, .session-row .session-ip { display: none; }
  .session-row .user-row-actions { justify-content: flex-end; }
}

.piece-detail-top { display: flex; align-items: flex-start; gap: 17px; }
.piece-board-big {
  position: relative;
  width: 100px;
  height: 128px;
  flex: 0 0 auto;
  border-radius: 7px;
  border: 1px solid rgba(28,38,33,.12);
  box-shadow: 5px 6px 0 rgba(28,38,33,.055);
  overflow: hidden;
}
.piece-board-big::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,.3), transparent 45%, rgba(0,0,0,.12));
}
.piece-board-big span {
  position: absolute;
  left: 7px;
  bottom: 6px;
  z-index: 1;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.62);
  color: rgba(28,38,33,.72);
  font-family: var(--num);
  font-size: 7.5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.qty-line { display: flex; align-items: baseline; gap: 5px; margin-top: 9px; font-family: var(--num); font-size: 20px; }
.qty-line strong { font-weight: 750; }
.qty-line span { font-family: var(--font); font-size: 10px; color: var(--muted); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.info-item { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.info-item span { display: block; color: var(--muted); font-size: 9px; }
.info-item strong { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 960px) {
  .user-list { padding: 3px 15px; }
  .user-row { grid-template-columns: minmax(140px,1fr) 80px 70px auto; gap: 9px; }
  .user-row-time { display: none; }
}

@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .user-list { padding: 5px 14px; }
  .user-row {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 9px;
    padding: 14px 0;
  }
  .user-row-meta { display: none; }
  .user-row-actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: -2px; }
  .user-row-actions .btn { flex: 1; }
  .piece-detail-top { gap: 12px; }
  .piece-board-big { width: 76px; height: 98px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 0 13px; }
  .info-item strong { font-size: 10.5px; }
  .qty-line { font-size: 18px; }
  .modal-foot .left { display: flex; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .left { margin-right: 0; width: 100%; order: 2; justify-content: flex-start; }
  .modal-foot > .btn { flex: 1; }
  .cut-mode-row { flex-wrap: wrap; }
  .cut-mode-row .segmented { flex: 1; justify-content: flex-end; }
  .cut-mode-row .segmented button { flex: 1; }
}


@media (max-width: 760px) {
  .input, .select, .textarea, .cut-form .field .input, .login-form .input {
    font-size: 16px;
  }
  .toolbar .select { font-size: 16px; }
}


/* Stock-in custom material editor */
.stock-material-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: -4px;
}
.stock-material-head > label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.stock-material-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.stock-material-actions .link-btn {
  padding: 3px 4px;
  font-size: 10.5px;
}
.stock-material-actions .link-btn .icon { width: 13px; height: 13px; }
.stock-material-editor {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
}
.stock-material-editor-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}
.stock-material-editor-title .icon { width: 14px; height: 14px; color: var(--accent-dark); }
.stock-material-editor .form-grid { gap: 10px; }
.stock-material-editor .field > label { font-size: 10.5px; }

@media (max-width: 760px) {
  .stock-material-actions { width: 100%; justify-content: flex-start; }
  .stock-material-actions .link-btn { padding-left: 0; }
  .stock-material-editor { padding: 12px; }
}


/* Category picker and manager */
.category-select-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.category-select-row .select { flex: 1; min-width: 0; }
.category-select-row .btn { flex: 0 0 auto; height: 44px; padding: 0 10px; font-size: 10.5px; }
.category-select-row .btn .icon { width: 13px; height: 13px; }
.category-manager {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.category-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.category-manager-head strong { display: block; font-size: 11px; color: var(--ink-2); }
.category-manager-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.category-manager-head .link-btn { flex: 0 0 auto; font-size: 10px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.category-chip {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.category-chip-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 5px 5px 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
}
.category-chip-name:hover { background: var(--accent-soft); color: var(--accent-ink); }
.category-chip-name small {
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(28,38,33,.07);
  color: var(--muted);
  font-family: var(--num);
  font-size: 8px;
}
.category-chip-edit {
  width: 22px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted-2);
}
.category-chip-edit:hover { background: var(--accent-soft); color: var(--accent-dark); }
.category-chip-edit .icon { width: 12px; height: 12px; }
.category-chip-del {
  width: 22px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted-2);
}
.category-chip-del:hover { background: var(--red-soft); color: var(--red); }
.category-chip-del .icon { width: 12px; height: 12px; }
.category-add-row { display: flex; gap: 7px; margin-top: 10px; }
.category-add-row .input { flex: 1; height: 36px; font-size: 12px; }
.category-add-row .btn { flex: 0 0 auto; height: 36px; }
.category-empty { color: var(--muted); font-size: 10px; }

@media (max-width: 760px) {
  .category-select-row .btn { padding: 0 9px; }
  .category-manager-head { flex-direction: column; gap: 5px; }
  .category-add-row .input { font-size: 16px; }
}


/* Waste records */
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.reason-chip {
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
}
.reason-chip:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.waste-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.waste-preview-icon .swatch { width: 35px; height: 35px; }
.waste-preview-main { flex: 1; min-width: 0; }
.waste-preview-main strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.waste-preview-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.waste-preview-area { text-align: right; flex: 0 0 auto; }
.waste-preview-area strong { display: block; font-family: var(--num); font-size: 20px; color: var(--red); line-height: 1; }
.waste-preview-area small { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.waste-reason-box { margin-top: 11px; padding: 9px 11px; border-radius: 9px; background: var(--red-soft); }
.waste-reason-box .tag { background: #fff; }
.waste-reason-box p { margin-top: 6px; color: #7c312b; font-size: 11px; line-height: 1.55; }
.waste-reason-box small { display: block; margin-top: 3px; color: #9c5b55; font-size: 9.5px; line-height: 1.5; }
.waste-reason-tag { white-space: normal; height: auto; line-height: 1.4; padding: 4px 7px; text-align: left; }
.activity-icon.waste, .activity-icon.waste_void { background: var(--red-soft); color: var(--red); }

@media (max-width: 760px) {
  .waste-preview { align-items: flex-start; }
  .waste-preview-area strong { font-size: 17px; }
  .head-actions .btn { padding-left: 10px; padding-right: 10px; font-size: 12px; }
  .record-tabs .segmented { gap: 13px; }
}


/* Mobile viewport: keep the page itself from moving sideways. */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body { overscroll-behavior-x: none; }
img, svg, canvas, video { max-width: 100%; }
#app, .content-shell { width: 100%; max-width: 100%; overflow-x: clip; }
.page { max-width: 100%; }
.table-wrap { max-width: 100%; }
@media (max-width: 960px) {
  body { touch-action: pan-y; }
  .table-wrap, .modal, .modal-backdrop { touch-action: pan-x pan-y; }
  .page { padding-left: 16px; padding-right: 16px; }
  .banner { margin-left: 0; margin-right: 0; }
  .hero { width: 100%; max-width: 100%; }
}
.brand-mark {
  background: url('/icons/icon-192.png?v=20261103') center / cover no-repeat !important;
  border-radius: 9px;
}
.brand-mark::before, .brand-mark::after { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

