/* =========================================================
   检修云仓 · 铁路机车配件仓库管理
   Design system: warm paper + workshop steel + signal amber
   ========================================================= */

:root {
  --paper: #f3f1ea;
  --paper-deep: #ebe7dc;
  --card: #fffdf9;
  --card-soft: #f8f5ed;
  --ink: #182126;
  --ink-2: #2b383f;
  --muted: #77817d;
  --muted-2: #9aa19c;
  --line: #e4dfd3;
  --line-strong: #d6cfc0;
  --navy: #111c22;
  --navy-2: #18262d;
  --navy-3: #22343c;
  --orange: #f0a13b;
  --orange-deep: #d97d1e;
  --orange-soft: #fdf1df;
  --green: #2d7a5c;
  --green-soft: #e9f4ee;
  --red: #c25543;
  --red-soft: #faece8;
  --steel: #58727d;
  --steel-soft: #edf2f3;
  --shadow-sm: 0 1px 2px rgba(32, 38, 36, .04), 0 4px 12px rgba(32, 38, 36, .035);
  --shadow-md: 0 8px 28px rgba(31, 39, 37, .08), 0 2px 8px rgba(31, 39, 37, .04);
  --shadow-lg: 0 30px 80px rgba(17, 26, 30, .22), 0 8px 24px rgba(17, 26, 30, .1);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sidebar-w: 248px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Microsoft YaHei UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.part-card:focus-visible, .alert-item:focus-visible { outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: #f4c27f; color: #111b20; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #c9c1b2 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c9c1b2; border-radius: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Authentication
   ========================================================= */
body.is-auth-locked { overflow-y: auto; }
body.is-auth-locked.is-locked { overflow: hidden; }
body.is-auth-locked .app,
body.is-auth-locked .mobile-nav { display: none !important; }
body.is-authenticated .auth-screen { display: none; }

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr);
  min-height: 100vh;
  background: var(--paper);
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
  padding: 40px 50px 26px;
  color: #ecf1ef;
  background:
    radial-gradient(75% 100% at 100% 0%, rgba(73, 100, 111, .35), transparent 58%),
    radial-gradient(50% 70% at 0% 100%, rgba(240, 161, 59, .1), transparent 65%),
    linear-gradient(124deg, #17272e 0%, #101b20 60%, #16262c 100%);
}
.auth-visual::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) .7px, transparent .7px);
  background-size: 19px 19px;
  opacity: .55;
  pointer-events: none;
}
.auth-visual-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(90deg, #000, transparent 82%);
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 82%);
  opacity: .45;
  pointer-events: none;
}
.auth-brand { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 46px; height: 46px; flex-basis: 46px; }
.auth-brand .brand-text strong { font-size: 18px; }
.auth-brand .brand-text small { font-size: 8px; }
.auth-copy { position: relative; z-index: 3; width: min(590px, 78%); margin-top: clamp(50px, 9vh, 105px); }
.auth-copy .eyebrow { color: #7e939a; }
.auth-copy h1 {
  margin: 21px 0 17px;
  font-size: clamp(45px, 4.7vw, 68px);
  line-height: 1.16;
  letter-spacing: -.055em;
  font-weight: 600;
  color: #f6f8f6;
}
.auth-copy h1 em { font-style: normal; color: var(--orange); }
.auth-copy > p { margin: 0; color: #8fa1a7; font-size: 12.5px; line-height: 1.9; }
.auth-features { display: flex; flex-direction: column; gap: 1px; width: 310px; margin-top: 40px; border-top: 1px solid rgba(255,255,255,.08); }
.auth-feature { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.auth-feature-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border: 1px solid rgba(240,161,59,.23); border-radius: 8px; background: rgba(240,161,59,.07); color: var(--orange); }
.auth-feature-icon svg { width: 15px; height: 15px; }
.auth-feature > div { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.auth-feature strong { color: #dbe3e1; font-size: 10.5px; font-weight: 600; }
.auth-feature small { color: #6f858c; font-size: 8.5px; }
.auth-visual-art { position: absolute; z-index: 2; right: -82px; bottom: -54px; width: min(56vw, 570px); pointer-events: none; opacity: .72; }
.auth-wheel { width: 100%; height: auto; animation: wheelFloat 10s ease-in-out infinite; filter: drop-shadow(0 30px 50px rgba(0,0,0,.28)); }
.auth-security-badge { position: absolute; z-index: 3; top: -8px; right: 100px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 6px; background: rgba(20,34,40,.66); color: #8fa4a9; font-family: var(--font-num); font-size: 7px; letter-spacing: .13em; backdrop-filter: blur(8px); }
.auth-visual-footer { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.07); font-family: var(--font-num); font-size: 7.5px; letter-spacing: .14em; color: #536970; }
.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 40px; background: radial-gradient(80% 70% at 90% 0%, #faf7ef, transparent 60%), var(--paper); }
.auth-panel::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(45,56,52,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(45,56,52,.035) 1px, transparent 1px); background-size: 66px 66px; mask-image: linear-gradient(180deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 60%); pointer-events: none; }
.auth-mobile-brand { display: none; position: relative; z-index: 1; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-mobile-brand .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; }
.auth-mobile-brand .brand-text strong { color: var(--ink); font-size: 17px; }
.auth-mobile-brand .brand-text small { color: var(--muted-2); }
.auth-card { position: relative; z-index: 1; width: min(100%, 392px); padding: 34px 34px 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,249,.92); box-shadow: 0 24px 70px rgba(36,44,40,.1), 0 2px 8px rgba(36,44,40,.04); backdrop-filter: blur(10px); animation: authCardIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes authCardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-card.shake { animation: authShake .42s ease both; }
@keyframes authShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.auth-card-head { margin-bottom: 24px; }
.auth-card-head .section-kicker { margin-bottom: 8px; }
.auth-card-head h2 { margin: 0 0 7px; font-size: 27px; font-weight: 650; letter-spacing: -.04em; }
.auth-card-head p { margin: 0; color: var(--muted); font-size: 10.5px; }
.auth-field { margin-bottom: 14px; }
.auth-field > label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 600; color: var(--ink-2); }
.auth-input { position: relative; display: flex; align-items: center; height: 47px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .18s, box-shadow .18s; }
.auth-input:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,161,59,.1); }
.auth-input > svg { width: 17px; height: 17px; flex: 0 0 17px; margin-left: 13px; color: var(--muted-2); }
.auth-input:focus-within > svg { color: var(--orange-deep); }
.auth-input input { flex: 1; min-width: 0; height: 100%; padding: 0 11px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.auth-input input::placeholder { color: #b4b6ae; }
.password-toggle { display: grid; place-items: center; width: 36px; height: 36px; margin-right: 5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); }
.password-toggle:hover { background: var(--paper); color: var(--ink); }
.password-toggle svg { width: 17px; height: 17px; }
.auth-form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.check-line { display: inline-flex; align-items: center; gap: 7px; font-size: 9.5px; color: var(--muted); cursor: pointer; user-select: none; }
.check-line input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: transparent; transition: .16s; }
.check-box svg { width: 10px; height: 10px; stroke-width: 2.4; }
.check-line input:checked + .check-box { border-color: var(--orange-deep); background: var(--orange); color: #1b211f; }
.check-line input:focus-visible + .check-box { outline: 2px solid var(--orange); outline-offset: 2px; }
.forgot-link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 9.5px; }
.forgot-link:hover { color: var(--orange-deep); }
.login-error { min-height: 18px; margin: 9px 0 4px; color: var(--red); font-size: 9.5px; line-height: 1.5; }
.auth-submit { width: 100%; height: 47px; margin-top: 2px; justify-content: space-between; padding: 0 17px; border-radius: 10px; font-size: 12.5px; }
.auth-submit svg { width: 17px; height: 17px; }
.auth-submit:disabled { transform: none; }
.login-hint { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 11px 12px; border: 1px solid #eadcc5; border-radius: 9px; background: #fdf7eb; }
.login-hint-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 6px; background: var(--orange-soft); color: var(--orange-deep); }
.login-hint-icon svg { width: 13px; height: 13px; }
.login-hint strong { display: block; font-size: 9px; color: #7d5a29; }
.login-hint p { margin: 3px 0 0; font-size: 8.5px; line-height: 1.6; color: #967545; }
.login-hint code { padding: 1px 4px; border-radius: 3px; background: #f3e8d4; color: #70501f; font-family: var(--font-num); font-size: 8.5px; }
.auth-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); font-family: var(--font-num); font-size: 7.5px; letter-spacing: .05em; color: var(--muted-2); }
.auth-card-foot span { display: flex; align-items: center; gap: 6px; }
.auth-card-foot .pulse-dot { width: 5px; height: 5px; flex-basis: 5px; }
.auth-copyright { position: relative; z-index: 1; margin: 22px 0 0; color: var(--muted-2); font-size: 8px; letter-spacing: .04em; text-align: center; }

/* =========================================================
   Sidebar
   ========================================================= */
.app { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  color: #dfe5e2;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(70, 95, 104, .26), transparent 60%),
    linear-gradient(180deg, #132027 0%, #10191e 100%);
  border-right: 1px solid rgba(255, 255, 255, .05);
  overflow-y: auto;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: repeating-linear-gradient(115deg, transparent 0 16px, rgba(255, 255, 255, .025) 16px 17px);
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 28px; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #f5b35e, #dd8123);
  color: #141e22;
  box-shadow: 0 8px 20px rgba(220, 129, 35, .2), inset 0 1px rgba(255, 255, 255, .35);
}
.brand-mark svg { width: 32px; height: 32px; stroke-width: 1.9; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; letter-spacing: .1em; color: #fff; font-weight: 700; }
.brand-text small { margin-top: 4px; font-family: var(--font-num); font-size: 8px; letter-spacing: .18em; color: #798a91; }
.side-section-label {
  padding: 0 12px;
  margin: 8px 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  color: #5f747d;
}
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.main-nav.secondary { margin-top: 2px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9fb0b5;
  font-size: 13.5px;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #f2f4f3; }
.nav-item.is-active { background: linear-gradient(90deg, rgba(240, 161, 59, .17), rgba(240, 161, 59, .07)); color: #fff; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -18px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--orange);
  box-shadow: 0 0 14px rgba(240, 161, 59, .5);
}
.nav-icon { display: grid; place-items: center; width: 21px; height: 21px; color: #7f949b; }
.nav-item.is-active .nav-icon, .nav-item:hover .nav-icon { color: var(--orange); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-count {
  margin-left: auto;
  min-width: 22px; padding: 1px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .075);
  font-family: var(--font-num); font-size: 10px; text-align: center; color: #b7c3c6;
}
.nav-badge {
  margin-left: auto; min-width: 21px; padding: 1px 6px;
  border-radius: 20px; background: var(--orange); color: #181f21;
  font-family: var(--font-num); font-size: 10px; font-weight: 700; text-align: center;
}
.sidebar-spacer { flex: 1; min-height: 28px; }
.depot-card {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
}
.depot-card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #d3dcda; }
.depot-card-top .tiny-icon { width: 13px; height: 13px; margin-left: auto; color: #657a82; }
.pulse-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #6cc69b; box-shadow: 0 0 0 0 rgba(108, 198, 155, .45); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(108, 198, 155, .4); } 70% { box-shadow: 0 0 0 7px rgba(108, 198, 155, 0); } 100% { box-shadow: 0 0 0 0 rgba(108, 198, 155, 0); } }
.depot-meta { display: flex; justify-content: space-between; margin-top: 15px; font-size: 10px; color: #73878e; }
.depot-meta strong { color: var(--orange); font-family: var(--font-num); font-size: 11px; }
.depot-track { height: 4px; margin-top: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.depot-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d87c20, #f2b45d); transition: width .5s ease; }
.depot-foot { display: flex; justify-content: space-between; margin-top: 11px; font-size: 9.5px; color: #62777e; }
.depot-foot b { color: #c6d1d2; font-family: var(--font-num); font-weight: 500; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 20px 6px 0; margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #2b3b42; color: #f1b972; font-size: 12px; border: 1px solid rgba(240, 161, 59, .3); }
.user-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-info strong { color: #e6ecea; font-size: 12px; }
.user-info span { margin-top: 3px; font-size: 9.5px; color: #687d84; }
.sidebar-user-actions { display: flex; align-items: center; gap: 1px; margin-left: auto; }
.sidebar-user-actions .icon-btn { margin-left: 0; }

/* =========================================================
   Topbar
   ========================================================= */
.app-shell { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 70px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  background: rgba(243, 241, 234, .9);
  border-bottom: 1px solid rgba(214, 207, 192, .72);
  backdrop-filter: blur(16px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted-2); }
.crumb i { font-style: normal; color: #c2bdaf; }
.crumb strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.date-chip { display: flex; align-items: center; gap: 9px; padding-right: 16px; border-right: 1px solid var(--line); }
.date-day { font-family: var(--font-num); font-size: 24px; line-height: 1; color: var(--ink); font-weight: 600; }
.date-chip > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.date-chip b { font-size: 10.5px; font-weight: 600; }
.date-chip small { font-size: 9px; color: var(--muted-2); }
.storage-pill { display: flex; align-items: center; gap: 7px; height: 29px; padding: 0 11px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 253, 249, .6); font-size: 10px; color: var(--muted); }
.storage-pill .pulse-dot { width: 5px; height: 5px; flex-basis: 5px; }
.top-user { display: flex; align-items: center; gap: 8px; height: 40px; padding: 3px 7px 3px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-align: left; transition: border-color .18s, background .18s, transform .18s; }
.top-user:hover { border-color: var(--line-strong); background: #fff; transform: translateY(-1px); }
.top-user-avatar { width: 31px; height: 31px; flex: 0 0 31px; font-size: 11px; background: var(--orange-soft); border-color: #eed7b7; color: var(--orange-deep); }
.top-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.top-user-text b { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; color: var(--ink); }
.top-user-text small { margin-top: 2px; font-size: 7.5px; color: var(--muted-2); }
.top-user-chev { width: 12px; height: 12px; color: var(--muted-2); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  transition: border-color .18s, background .18s, transform .18s;
}
.icon-btn:hover { border-color: var(--line-strong); background: #fff; transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.subtle { width: 30px; height: 30px; border-color: transparent; background: transparent; color: #778b92; }
.icon-btn.subtle:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.mobile-menu-btn { display: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: transform .18s, background .18s, border-color .18s, box-shadow .18s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(145deg, #f5ad51, #e58c26); color: #1b211f; box-shadow: 0 5px 14px rgba(218, 130, 33, .2), inset 0 1px rgba(255, 255, 255, .35); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(218, 130, 33, .27), inset 0 1px rgba(255, 255, 255, .35); }
.btn-dark { background: var(--navy); color: #f0f3f1; }
.btn-dark:hover { background: #203038; }
.btn-light { background: #fffdf9; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); border-color: var(--line-strong); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-ghost { background: rgba(255, 255, 255, .92); color: var(--red); border-color: rgba(194, 85, 67, .2); }
.btn-sm { height: 33px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 10.5px; border-radius: 7px; gap: 5px; }
.btn-xs svg { width: 14px; height: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.text-link svg { width: 13px; height: 13px; }
.text-link:hover { color: var(--orange-deep); }

/* =========================================================
   Views & shared
   ========================================================= */
.main { padding: 30px 30px 52px; }
.view { display: none; max-width: 1580px; margin: 0 auto; }
.view.is-active { display: block; animation: viewIn .38s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section-kicker { display: block; font-family: var(--font-num); font-size: 8.5px; letter-spacing: .18em; color: var(--muted-2); margin-bottom: 4px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; }
.panel-head.compact { padding: 19px 20px 12px; align-items: center; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; letter-spacing: -.01em; font-weight: 650; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.count-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; background: var(--red-soft); color: var(--red); font-family: var(--font-num); font-size: 10px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); }
.segmented button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; transition: .18s; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30, 38, 35, .1); font-weight: 600; }
.segmented.mini button { height: 25px; padding: 0 9px; font-size: 10.5px; }
.empty-state { text-align: center; padding: 52px 20px; }
.empty-state h3 { margin: 14px 0 5px; font-size: 16px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--paper); color: var(--muted); }
.empty-icon svg { width: 26px; height: 26px; }
.empty-icon.ok { background: var(--green-soft); color: var(--green); }
.empty-actions { display: flex; justify-content: center; gap: 8px; }
.empty-state.large { background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 72px 20px; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 484px;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 48px 52px 0;
  display: flex; flex-direction: column;
  color: #edf1ef;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(66, 94, 104, .45), transparent 55%),
    radial-gradient(45% 80% at 0% 100%, rgba(240, 161, 59, .1), transparent 65%),
    linear-gradient(118deg, #16252c 0%, #111c22 62%, #17262c 100%);
  box-shadow: 0 18px 40px rgba(21, 31, 35, .13);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) .7px, transparent .7px);
  background-size: 18px 18px;
  opacity: .55; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: -140px; top: -160px;
  width: 540px; height: 540px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 70px rgba(255, 255, 255, .018), 0 0 0 140px rgba(255, 255, 255, .012);
  pointer-events: none;
}
.hero-grid-lines {
  position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(90deg, #000, transparent 75%);
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 75%);
}
.hero-content { position: relative; z-index: 4; width: 61%; max-width: 740px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--font-num); font-size: 8.5px; letter-spacing: .2em; color: #7f959d; }
.eyebrow-line { width: 27px; height: 1px; background: var(--orange); }
.hero h1 { margin: 18px 0 14px; font-size: clamp(33px, 3.2vw, 48px); line-height: 1.22; letter-spacing: -.045em; font-weight: 600; color: #f5f7f5; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero-sub { margin: 0; color: #8fa0a6; font-size: 12px; line-height: 1.85; }
.hero-search {
  position: relative;
  display: flex; align-items: center;
  height: 60px; max-width: 610px; margin-top: 26px;
  padding: 0 7px 0 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.hero-search:focus-within { border-color: rgba(240, 161, 59, .65); background: rgba(255, 255, 255, .1); box-shadow: 0 10px 34px rgba(0, 0, 0, .22), 0 0 0 4px rgba(240, 161, 59, .08); }
.hero-search .search-icon { width: 21px; height: 21px; flex: 0 0 21px; color: var(--orange); }
.hero-search input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; outline: 0; background: transparent; color: #f4f6f4; font-size: 13px; }
.hero-search input::placeholder { color: #75888f; }
.hero-search kbd { padding: 4px 7px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 5px; background: rgba(255, 255, 255, .06); color: #8da0a6; font-family: var(--font-num); font-size: 8.5px; letter-spacing: .03em; white-space: nowrap; }
.hero-search-btn { display: grid; place-items: center; width: 45px; height: 45px; margin-left: 8px; border: 0; border-radius: 10px; background: linear-gradient(145deg, #f5b155, #df8523); color: #172023; transition: .18s; }
.hero-search-btn:hover { filter: brightness(1.07); transform: translateX(1px); }
.hero-search-btn svg { width: 19px; height: 19px; stroke-width: 2.3; }
.search-clear { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #b7c4c6; }
.search-clear:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.search-clear svg { width: 12px; height: 12px; }
.quick-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; font-size: 9.5px; color: #72868d; }
.quick-chip { height: 25px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 20px; background: transparent; color: #a1b0b3; font-size: 9.5px; transition: .18s; }
.quick-chip:hover { border-color: rgba(240, 161, 59, .5); color: #f4b15c; background: rgba(240, 161, 59, .07); }
.quick-alert b { display: inline-grid; place-items: center; min-width: 15px; height: 15px; margin-left: 3px; border-radius: 10px; background: rgba(194, 85, 67, .2); color: #f19c8d; font-family: var(--font-num); font-size: 9px; }
.hero-art { position: absolute; top: 0; right: 1%; width: 42%; height: 405px; pointer-events: none; }
.wheel-art { position: absolute; top: 27px; right: -8px; width: min(390px, 32vw); height: min(390px, 32vw); opacity: .92; filter: drop-shadow(0 20px 35px rgba(0, 0, 0, .32)); animation: wheelFloat 8s ease-in-out infinite; }
@keyframes wheelFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
.hero-badge {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(23, 36, 42, .78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
}
.hero-badge .pulse-dot { width: 5px; height: 5px; flex-basis: 5px; }
.hero-badge svg { width: 16px; height: 16px; color: var(--orange); }
.hero-badge div { display: flex; flex-direction: column; line-height: 1.25; }
.hero-badge small { font-size: 7.5px; letter-spacing: .08em; color: #7d9299; }
.hero-badge strong { margin-top: 2px; color: #e8edeb; font-family: var(--font-num); font-size: 11px; font-weight: 500; }
.badge-top { top: 64px; right: 31%; }
.badge-bottom { top: 255px; right: 4%; }
.hero-coord { position: absolute; right: 15px; bottom: 25px; font-family: var(--font-num); font-size: 7.5px; letter-spacing: .18em; color: #52666e; writing-mode: vertical-rl; }
.hero-footer {
  position: relative; z-index: 4;
  display: flex; align-items: center; gap: 0;
  margin-top: auto;
  height: 76px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.hero-footer > div:not(.hero-scroll) { display: flex; align-items: baseline; gap: 7px; min-width: 150px; padding-right: 26px; margin-right: 26px; border-right: 1px solid rgba(255, 255, 255, .08); }
.hero-foot-label { font-size: 9px; color: #71858c; }
.hero-footer b { font-family: var(--font-num); font-size: 19px; font-weight: 500; color: #f0f3f1; letter-spacing: .01em; }
.hero-footer small { font-family: var(--font-num); font-size: 7.5px; letter-spacing: .12em; color: #5d737b; }
.hero-scroll { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 9px; color: #5f737a; }
.hero-scroll span { width: 24px; height: 1px; background: #536870; }

/* Search suggestion */
.search-suggest {
  position: absolute; z-index: 20; top: calc(100% + 9px); left: 0; right: 0;
  padding: 6px;
  border: 1px solid #394950;
  border-radius: 13px;
  background: #1b2a30;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .34);
  animation: suggestIn .16s ease both;
}
@keyframes suggestIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.suggest-head { display: flex; justify-content: space-between; padding: 7px 10px 8px; color: #6d838a; font-size: 8.5px; letter-spacing: .1em; }
.suggest-head b { color: #a3b2b5; font-weight: 500; }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: #d9e1e0; }
.suggest-item:hover, .suggest-item.is-focused { background: rgba(255, 255, 255, .07); }
.suggest-thumb { width: 36px; height: 36px; flex: 0 0 36px; overflow: hidden; border-radius: 7px; background: #2b3d44; }
.suggest-thumb img { width: 100%; height: 100%; object-fit: cover; }
.suggest-thumb .part-art { border-radius: 7px; }
.suggest-thumb .art-svg { width: 24px; height: 24px; }
.suggest-thumb .art-code, .suggest-thumb .art-label { display: none; }
.suggest-main { min-width: 0; }
.suggest-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; }
.suggest-main small { display: block; margin-top: 2px; color: #71868d; font-family: var(--font-num); font-size: 9px; }
.suggest-stock { margin-left: auto; font-family: var(--font-num); font-size: 10px; color: var(--orange); white-space: nowrap; }
.suggest-empty { padding: 20px 12px; text-align: center; color: #899da3; font-size: 11px; }
.suggest-foot { display: flex; justify-content: space-between; margin-top: 4px; padding: 8px 10px 5px; border-top: 1px solid rgba(255, 255, 255, .07); color: #687d84; font-size: 8.5px; }
.suggest-foot b { color: #c0cccd; font-weight: 500; }

/* =========================================================
   Stats
   ========================================================= */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 18px; }
.stat-card {
  position: relative; overflow: hidden;
  padding: 20px 21px 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.stat-card::before { content: ""; position: absolute; top: 0; left: 22px; width: 32px; height: 2px; background: var(--orange); opacity: .7; }
.stat-card.stat-warning { background: linear-gradient(145deg, #fffaf2, #fffdf9 70%); }
.stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.amber { background: var(--orange-soft); color: var(--orange-deep); }
.stat-icon.steel { background: var(--steel-soft); color: var(--steel); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-trend { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-num); font-size: 9px; color: var(--muted); }
.stat-trend svg { width: 12px; height: 12px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.neutral { color: var(--muted-2); }
.stat-value { margin-top: 15px; font-family: var(--font-num); font-size: 29px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.stat-value small { font-family: var(--font); font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.stat-label { margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 11px; border-top: 1px solid #f0ece2; font-size: 9px; color: var(--muted-2); }
.stat-foot .text-link { color: var(--red); }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.mini-bars i { display: block; width: 3px; border-radius: 2px; background: #e5cda9; }
.mini-bars i:last-child { background: var(--orange); }
.micro-line { width: 52px; height: 18px; background: linear-gradient(180deg, rgba(88, 114, 125, .12), transparent); clip-path: polygon(0 80%, 18% 55%, 35% 70%, 53% 30%, 70% 45%, 86% 20%, 100% 30%, 100% 100%, 0 100%); }
.stat-spark { width: 55px; height: 18px; }
.stat-spark svg { width: 100%; height: 100%; stroke: var(--green); stroke-width: 1.5; }
.stat-warning .stat-value { color: var(--red); }

/* =========================================================
   Dashboard layout
   ========================================================= */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 18px; align-items: start; margin-top: 18px; }
.inventory-panel { min-height: 500px; }
.dashboard-side { display: flex; flex-direction: column; gap: 18px; }
.alert-panel { overflow: hidden; }
.alert-list { display: flex; flex-direction: column; padding: 0 20px; }
.alert-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f1ede4; cursor: pointer; }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover .alert-name { color: var(--orange-deep); }
.alert-thumb { width: 38px; height: 38px; flex: 0 0 38px; overflow: hidden; border-radius: 8px; background: var(--paper); }
.alert-thumb img { width: 100%; height: 100%; object-fit: cover; }
.alert-info { min-width: 0; flex: 1; }
.alert-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; transition: color .18s; }
.alert-meta { display: block; margin-top: 2px; font-family: var(--font-num); font-size: 8.5px; color: var(--muted-2); }
.alert-nums { text-align: right; white-space: nowrap; }
.alert-nums strong { display: block; font-family: var(--font-num); font-size: 14px; color: var(--red); }
.alert-nums span { font-size: 8px; color: var(--muted-2); }
.alert-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 20px 0; padding: 14px 0 18px; border-top: 1px solid var(--line); }
.alert-foot > div { display: flex; flex-direction: column; gap: 2px; }
.alert-foot span { font-size: 8.5px; color: var(--muted-2); }
.alert-foot strong { font-family: var(--font-num); font-size: 15px; color: var(--ink); }
.activity-list { display: flex; flex-direction: column; padding: 0 20px; }
.activity-item { position: relative; display: flex; gap: 11px; padding: 8px 0 13px; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 35px; bottom: 0; border-left: 1px dashed var(--line-strong); }
.activity-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.activity-dot.out { background: var(--red-soft); color: var(--red); }
.activity-dot.adjust { background: var(--steel-soft); color: var(--steel); }
.activity-dot svg { width: 12px; height: 12px; }
.activity-main { min-width: 0; flex: 1; }
.activity-main p { margin: 1px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--ink-2); }
.activity-main p b { font-weight: 600; }
.activity-main p em { margin: 0 3px; font-style: normal; color: var(--muted-2); }
.activity-main span { display: block; overflow: hidden; margin-top: 3px; color: var(--muted-2); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.activity-qty { margin-left: auto; font-family: var(--font-num); font-size: 11px; color: var(--green); white-space: nowrap; }
.activity-qty.out { color: var(--red); }
.activity-qty.adjust { color: var(--steel); }
.panel-link { display: flex; align-items: center; justify-content: center; gap: 4px; width: calc(100% - 40px); margin: 2px 20px 16px; padding: 11px 0 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font-size: 9.5px; }
.panel-link:hover { color: var(--orange-deep); }
.panel-link svg { width: 12px; height: 12px; }
.live-label { display: flex; align-items: center; gap: 6px; font-size: 8.5px; color: var(--muted-2); }
.category-bars { padding: 0 20px 20px; }
.cat-row { display: grid; grid-template-columns: 66px 1fr 28px; align-items: center; gap: 8px; margin-top: 10px; font-size: 9.5px; }
.cat-row span:first-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-track { height: 6px; border-radius: 5px; background: #f1ede3; overflow: hidden; }
.cat-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c7b89c, #a48e68); }
.cat-row:nth-child(2) .cat-track i { background: linear-gradient(90deg, #eeb267, #db8529); }
.cat-row:nth-child(3) .cat-track i { background: linear-gradient(90deg, #7ea99a, #3d7e67); }
.cat-row:nth-child(4) .cat-track i { background: linear-gradient(90deg, #9babb1, #617c88); }
.cat-row:nth-child(5) .cat-track i { background: linear-gradient(90deg, #d2a393, #b96955); }
.cat-row b { font-family: var(--font-num); font-size: 9px; font-weight: 500; color: var(--muted); text-align: right; }

/* =========================================================
   Part cards
   ========================================================= */
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 14px; padding: 0 24px 24px; }
#dashParts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ledger-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 16px; }
.part-card {
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.part-card:hover { transform: translateY(-3px); border-color: #d3c9b6; box-shadow: var(--shadow-md); }
.part-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e9e4d9; }
.part-media > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.part-card:hover .part-media > img { transform: scale(1.035); }
.part-art { position: relative; width: 100%; height: 100%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #e9e2d3, #d9d0bf); }
.part-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(35, 45, 45, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(35, 45, 45, .045) 1px, transparent 1px); background-size: 18px 18px; }
.part-art::after { content: ""; position: absolute; width: 150%; height: 60%; bottom: -32%; left: -20%; border-radius: 50%; background: rgba(255, 255, 255, .18); transform: rotate(-8deg); }
.part-art.art-a { background: linear-gradient(135deg, #e8dfcd, #d6c6ab); color: #8c5f26; }
.part-art.art-b { background: linear-gradient(135deg, #dde5e4, #c1d1d2); color: #42636e; }
.part-art.art-c { background: linear-gradient(135deg, #e6e4d8, #cbcbb8); color: #656744; }
.part-art.art-d { background: linear-gradient(135deg, #e6ddd7, #d3beb1); color: #8c5b46; }
.art-svg { position: relative; z-index: 2; width: 46%; height: 46%; opacity: .82; stroke-width: 1.1; }
.art-code { position: absolute; z-index: 2; left: 11px; bottom: 9px; font-family: var(--font-num); font-size: 7.5px; letter-spacing: .08em; opacity: .55; }
.art-label { position: absolute; z-index: 2; top: 10px; left: 11px; font-size: 7.5px; letter-spacing: .12em; opacity: .48; }
.status-pill {
  position: absolute; z-index: 3; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px;
  border-radius: 20px;
  background: rgba(255, 253, 249, .92);
  box-shadow: 0 2px 8px rgba(29, 38, 36, .1);
  font-size: 9px; font-weight: 600; color: var(--green);
  backdrop-filter: blur(6px);
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.low { color: var(--orange-deep); }
.status-pill.out { color: var(--red); }
.code-chip { position: absolute; z-index: 3; left: 10px; bottom: 9px; padding: 3px 6px; border-radius: 4px; background: rgba(20, 30, 32, .62); color: #f1eee7; font-family: var(--font-num); font-size: 7.5px; letter-spacing: .04em; backdrop-filter: blur(4px); }
.part-body { padding: 13px 14px 10px; flex: 1; }
.part-meta { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--muted-2); }
.category-label { color: var(--orange-deep); font-weight: 600; }
.part-meta .sep { width: 2px; height: 2px; border-radius: 50%; background: #c8c2b5; }
.part-meta .loc { display: inline-flex; align-items: center; gap: 2px; }
.part-meta .loc svg { width: 9px; height: 9px; }
.part-name { margin: 6px 0 3px; font-size: 13.5px; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-model { margin: 0; font-size: 9.25px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.stock-num { display: flex; align-items: baseline; gap: 2px; font-family: var(--font-num); font-size: 20px; font-weight: 600; line-height: 1; color: var(--ink); }
.stock-num small { font-family: var(--font); font-size: 8px; font-weight: 400; color: var(--muted-2); }
.stock-bar-wrap { flex: 1; padding-bottom: 3px; }
.stock-bar { height: 4px; border-radius: 4px; background: #efebe2; overflow: hidden; }
.stock-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s ease; }
.stock-bar.low span { background: var(--orange); }
.stock-bar.out span { background: var(--red); }
.stock-bar-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 8px; color: var(--muted-2); }
.stock-bar-meta b { font-family: var(--font-num); font-weight: 500; color: var(--muted); }
.part-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 14px 11px; border-top: 1px solid #f0ece3; }
.part-price { font-family: var(--font-num); font-size: 11px; font-weight: 500; color: var(--ink-2); }
.part-price small { font-size: 7.5px; color: var(--muted-2); font-family: var(--font); }
.card-actions { display: flex; align-items: center; gap: 4px; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-2); font-size: 9px; font-weight: 500; transition: .16s; }
.mini-btn:hover { border-color: var(--orange); color: var(--orange-deep); background: var(--orange-soft); }
.mini-btn.icon-only { width: 26px; padding: 0; justify-content: center; }
.mini-btn svg { width: 12px; height: 12px; }
.mini-btn.delete:hover { border-color: #e4b4aa; color: var(--red); background: var(--red-soft); }

/* =========================================================
   Inventory / page heading / toolbar
   ========================================================= */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 6px 2px 24px; }
.page-heading h1 { margin: 5px 0 4px; font-size: 31px; line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.page-heading p { margin: 0; font-size: 11.5px; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.ledger-toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.ledger-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 250px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); transition: .18s; }
.ledger-search:focus-within { border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(240, 161, 59, .1); }
.ledger-search > svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--muted); }
.ledger-search input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.ledger-search input::placeholder { color: var(--muted-2); }
.ledger-search .search-clear { background: #ebe6da; color: var(--muted); }
.ledger-search .search-clear:hover { background: #ded7c7; color: var(--ink); }
.search-shortcut { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted-2); font-family: var(--font-num); font-size: 9px; }
.ledger-search.slim { flex: 0 1 300px; min-width: 200px; height: 38px; }
.select-wrap { position: relative; display: flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.select-wrap > svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.select-wrap select { height: 100%; min-width: 112px; padding: 0 30px 0 12px; border: 0; outline: 0; background: transparent; font-size: 11px; color: var(--ink-2); appearance: none; cursor: pointer; }
.select-wrap:has(> svg) select { padding-left: 33px; }
.select-wrap::after { content: ""; position: absolute; right: 12px; top: 17px; width: 5px; height: 5px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.view-toggle { height: 42px; padding: 4px; }
.view-toggle button { display: grid; place-items: center; width: 34px; height: 32px; padding: 0; }
.view-toggle svg { width: 16px; height: 16px; }
.category-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 15px 2px 14px; }
.cat-tab { height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 20px; background: transparent; color: var(--muted); font-size: 10.5px; transition: .18s; }
.cat-tab:hover { color: var(--ink); background: rgba(255, 253, 249, .7); }
.cat-tab.is-active { background: var(--navy); border-color: var(--navy); color: #f0f2f0; }
.cat-tab b { margin-left: 4px; font-family: var(--font-num); font-size: 8px; font-weight: 400; opacity: .6; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; padding: 0 2px; }
.results-bar > div:first-child { font-size: 10.5px; color: var(--muted); }
.results-bar strong { font-family: var(--font-num); font-size: 14px; color: var(--ink); }
.legend { display: flex; align-items: center; gap: 12px; font-size: 8.5px; color: var(--muted-2); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 5px; height: 5px; border-radius: 50%; }
.dot.ok { background: var(--green); }
.dot.low { background: var(--orange); }
.dot.out { background: var(--red); }
.clear-filters { padding: 0; border: 0; background: none; color: var(--orange-deep); font-size: 8.5px; text-decoration: underline; text-underline-offset: 2px; }

/* Data tables */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--card-soft); text-align: left; font-size: 8.5px; font-weight: 500; letter-spacing: .04em; color: var(--muted-2); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f1ede4; font-size: 10.5px; color: var(--ink-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fbf8f1; }
.table-part { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.table-thumb { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 7px; overflow: hidden; background: var(--paper); }
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-part strong { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.table-part small { display: block; margin-top: 2px; color: var(--muted-2); font-family: var(--font-num); font-size: 8.5px; }
.table-cat { display: inline-block; padding: 2px 7px; border-radius: 4px; background: var(--orange-soft); color: var(--orange-deep); font-size: 8px; white-space: nowrap; }
.table-stock { font-family: var(--font-num); font-size: 13px; font-weight: 600; }
.table-stock small { margin-left: 2px; font-family: var(--font); font-size: 7.5px; color: var(--muted-2); font-weight: 400; }
.table-stock.low { color: var(--orange-deep); }
.table-stock.out { color: var(--red); }
.table-loc { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-num); font-size: 9px; color: var(--muted); }
.table-loc svg { width: 10px; height: 10px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.table-empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* =========================================================
   Records
   ========================================================= */
.record-stats { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(240px, 1.4fr); gap: 12px; margin-bottom: 18px; }
.record-stats article { display: flex; align-items: center; gap: 12px; min-height: 83px; padding: 14px 17px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.record-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; }
.record-icon svg { width: 17px; height: 17px; }
.record-icon.in { background: var(--green-soft); color: var(--green); }
.record-icon.out { background: var(--red-soft); color: var(--red); }
.record-icon.total { background: var(--steel-soft); color: var(--steel); }
.record-stats article > div { display: flex; align-items: baseline; flex-wrap: wrap; }
.record-stats small { width: 100%; font-size: 8.5px; color: var(--muted); }
.record-stats strong { margin-top: 2px; font-family: var(--font-num); font-size: 22px; line-height: 1; }
.record-stats em { margin-left: 3px; font-style: normal; font-size: 8px; color: var(--muted-2); }
.record-tip { background: linear-gradient(135deg, #1b2b32, #132027) !important; border-color: #253840 !important; color: #aebdc0; }
.record-tip svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--orange); }
.record-tip p { margin: 0; font-size: 10px; line-height: 1.65; }
.record-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; flex-wrap: wrap; }
.records-table { min-width: 900px; }
.record-type { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 8.5px; font-weight: 600; white-space: nowrap; }
.record-type svg { width: 11px; height: 11px; }
.record-type.in { background: var(--green-soft); color: var(--green); }
.record-type.out { background: var(--red-soft); color: var(--red); }
.record-type.adjust { background: var(--steel-soft); color: var(--steel); }
.record-qty { font-family: var(--font-num); font-size: 11px; font-weight: 600; }
.record-qty.in { color: var(--green); }
.record-qty.out { color: var(--red); }
.record-flow { display: flex; align-items: center; gap: 6px; font-family: var(--font-num); font-size: 10px; color: var(--muted); }
.record-flow b { color: var(--ink); font-weight: 500; }
.record-flow svg { width: 10px; height: 10px; color: var(--muted-2); }
.record-time { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-num); font-size: 9.5px; color: var(--ink-2); }
.record-time small { font-family: var(--font); font-size: 8px; color: var(--muted-2); }
.record-note { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9.5px; }
.record-op { display: flex; align-items: center; gap: 6px; }
.record-op .avatar { width: 23px; height: 23px; font-size: 8px; color: var(--steel); background: var(--steel-soft); border: 0; }

/* =========================================================
   Alerts
   ========================================================= */
.alert-summary {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 22px;
  min-height: 154px; padding: 26px 30px;
  border-radius: var(--r-lg);
  color: #eef2ef;
  background:
    radial-gradient(80% 150% at 100% 0%, rgba(240, 161, 59, .15), transparent 60%),
    linear-gradient(120deg, #18272e, #111b20);
  box-shadow: 0 14px 30px rgba(20, 29, 32, .12);
}
.alert-summary::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, .025) 22px 23px); }
.alert-summary-copy { position: relative; z-index: 1; flex: 1; }
.alert-summary .section-kicker { color: #71868c; }
.alert-summary h2 { margin: 7px 0 6px; font-size: 24px; letter-spacing: -.03em; font-weight: 600; }
.alert-summary h2 span { color: var(--orange); }
.alert-summary p { margin: 0; font-size: 10.5px; color: #899ca1; }
.alert-summary p b { color: #dfe7e4; font-weight: 500; }
.alert-summary-visual { position: relative; z-index: 1; width: 200px; opacity: .85; }
.alert-summary-visual svg { width: 100%; height: auto; }
.alert-summary .btn { position: relative; z-index: 1; }
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin-top: 18px; }
.alert-card { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); transition: .2s; }
.alert-card:hover { border-color: #dfc7a5; box-shadow: var(--shadow-md); }
.alert-card-head { display: flex; align-items: flex-start; gap: 11px; }
.alert-card-thumb { width: 48px; height: 48px; flex: 0 0 48px; overflow: hidden; border-radius: 9px; background: var(--paper); }
.alert-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.alert-card-title { min-width: 0; flex: 1; }
.alert-card-title small { font-family: var(--font-num); font-size: 8px; color: var(--muted-2); }
.alert-card-title h3 { margin: 3px 0 2px; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-card-title p { margin: 0; font-size: 8.5px; color: var(--muted); }
.alert-level { padding: 3px 8px; border-radius: 20px; font-size: 8px; font-weight: 600; background: var(--orange-soft); color: var(--orange-deep); white-space: nowrap; }
.alert-level.out { background: var(--red-soft); color: var(--red); }
.alert-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--line); overflow: hidden; }
.alert-card-stats div { padding: 9px 11px; background: var(--card-soft); }
.alert-card-stats span { display: block; font-size: 7.5px; color: var(--muted-2); }
.alert-card-stats strong { display: block; margin-top: 2px; font-family: var(--font-num); font-size: 16px; font-weight: 600; }
.alert-card-stats strong.danger { color: var(--red); }
.alert-card-stats strong.amber { color: var(--orange-deep); }
.alert-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.alert-card-foot > span { font-size: 8.5px; color: var(--muted); }
.alert-card-foot > span b { color: var(--ink-2); font-family: var(--font-num); font-weight: 500; }
.alert-card-actions { display: flex; gap: 5px; }

/* =========================================================
   Modals
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; visibility: hidden; opacity: 0; transition: visibility .22s, opacity .22s; }
.modal.is-open { visibility: visible; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 20, 23, .58); backdrop-filter: blur(5px); }
.modal-dialog {
  position: relative; z-index: 1;
  width: min(100%, 780px); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.985);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.modal.is-open .modal-dialog { transform: none; }
.modal-dialog > form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.modal-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 4px; font-size: 21px; letter-spacing: -.025em; font-weight: 650; }
.modal-head p { margin: 0; font-size: 10px; color: var(--muted); }
.modal-head .icon-btn { flex: 0 0 38px; }
.modal-body { flex: 1; min-height: 0; padding: 22px 26px; overflow-y: auto; }
.modal-foot { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 26px; border-top: 1px solid var(--line); background: var(--card-soft); }
.foot-actions { display: flex; align-items: center; gap: 8px; }
.save-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted-2); }
.save-hint svg { width: 12px; height: 12px; color: var(--green); }
.part-dialog { width: min(100%, 1080px); }
.part-form-body { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 28px; }
.image-column { min-width: 0; }
.field-label { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.field-label span { font-size: 8px; font-weight: 400; color: var(--muted-2); }
.field-label b { color: var(--red); font-weight: 600; }
.drop-zone {
  position: relative; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: 13px;
  background: var(--card-soft);
  outline: 0;
  transition: .18s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--orange); background: #fffaf1; box-shadow: 0 0 0 4px rgba(240, 161, 59, .08); }
.image-placeholder { display: flex; flex-direction: column; align-items: center; padding: 20px; text-align: center; }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-deep); }
.upload-icon svg { width: 22px; height: 22px; }
.image-placeholder strong { font-size: 11px; font-weight: 600; }
.image-placeholder p { margin: 3px 0 9px; font-size: 8.5px; color: var(--muted-2); }
.upload-hint { padding: 3px 8px; border-radius: 20px; background: #ede8dd; font-family: var(--font-num); font-size: 7.5px; color: var(--muted); }
.image-preview { position: absolute; inset: 0; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 18, 21, .55)); }
.image-tools { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 6px; }
.image-tools .btn { backdrop-filter: blur(8px); }
.image-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; background: rgba(250, 247, 239, .9); color: var(--muted); font-size: 9px; }
.spinner { width: 23px; height: 23px; border: 2px solid #e3d9c7; border-top-color: var(--orange-deep); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.image-error { min-height: 14px; margin: 6px 0 0; font-size: 9px; color: var(--red); }
.image-tip { display: flex; gap: 8px; margin-top: 12px; padding: 10px; border-radius: 8px; background: var(--steel-soft); color: var(--steel); }
.image-tip svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.image-tip p { margin: 0; font-size: 8.5px; line-height: 1.55; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0ece2; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.form-section-title span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--paper); color: var(--muted); font-family: var(--font-num); font-size: 8px; font-weight: 500; }
.form-section-title:not(:first-child) { margin-top: 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: block; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field input, .field select, .field textarea {
  width: 100%; height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: 0;
  font-size: 11px;
  transition: .16s;
}
.field textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: #b1b5ad; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 161, 59, .1); }
.field input:disabled, .field input[readonly], .field select:disabled { background: #f2efe7; color: var(--muted); cursor: not-allowed; }
.field input[readonly]:focus { border-color: var(--line); box-shadow: none; }
.switch-line:has(input:disabled) { background: #f2efe7; color: var(--muted-2); cursor: not-allowed; opacity: .75; }
.field.has-error input, .field.has-error select { border-color: var(--red); background: #fffaf8; }
.field-error { display: none; margin-top: 3px; font-style: normal; font-size: 8.5px; color: var(--red); }
.field.has-error .field-error { display: block; }
.field small { display: block; margin-top: 4px; font-size: 7.5px; color: var(--muted-2); }
.field-note { display: flex; gap: 6px; margin: 10px 0 0; padding: 8px 10px; border-radius: 7px; background: var(--orange-soft); color: #916328; font-size: 8.5px; line-height: 1.5; }
.field-note svg { width: 12px; height: 12px; flex: 0 0 12px; margin-top: 1px; }
.qty-input { display: flex; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.qty-input button { width: 44px; height: 100%; border: 0; background: var(--card-soft); color: var(--ink-2); font-size: 18px; font-weight: 300; }
.qty-input button:hover { background: var(--paper-deep); }
.qty-input input { flex: 1; height: 100%; border: 0; border-radius: 0; text-align: center; font-family: var(--font-num); font-size: 18px; font-weight: 600; box-shadow: none !important; }
.qty-input input::-webkit-inner-spin-button { appearance: none; }

/* Sort out select arrows inside forms */
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b938d 50%), linear-gradient(135deg, #8b938d 50%, transparent 50%); background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* Stock modal */
.stock-dialog { width: min(100%, 560px); }
.stock-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 15px; }
.stock-type-switch button { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; transition: .18s; }
.stock-type-switch button > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--paper); color: var(--muted); }
.stock-type-switch button > span svg { width: 15px; height: 15px; }
.stock-type-switch button div { display: flex; flex-direction: column; line-height: 1.3; }
.stock-type-switch strong { font-size: 11px; }
.stock-type-switch small { margin-top: 2px; font-size: 8px; color: var(--muted-2); }
.stock-type-switch button.is-active { border-color: var(--orange); background: #fffbf4; box-shadow: 0 0 0 2px rgba(240, 161, 59, .09); }
.stock-type-switch button.is-active > span { background: var(--orange-soft); color: var(--orange-deep); }
.stock-type-switch button[data-stock-type="out"].is-active { border-color: var(--red); background: #fff9f7; box-shadow: 0 0 0 2px rgba(194, 85, 67, .07); }
.stock-type-switch button[data-stock-type="out"].is-active > span { background: var(--red-soft); color: var(--red); }
.stock-current { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 14px 16px; border-radius: 10px; background: var(--navy); color: #f1f4f2; }
.stock-current > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; min-width: 80px; }
.stock-current span { width: 100%; font-size: 8px; color: #7d9096; }
.stock-current strong { font-family: var(--font-num); font-size: 23px; line-height: 1; }
.stock-current small { font-size: 8px; color: #788b91; }
.stock-current > svg { width: 15px; height: 15px; color: #50666e; }
.stock-preview-tag { margin-left: auto; padding: 3px 8px; border-radius: 20px; background: rgba(255, 255, 255, .08); color: #9cb0b3; font-size: 8px; }
.stock-preview-tag.in { background: rgba(108, 198, 155, .14); color: #83d4ae; }
.stock-preview-tag.out { background: rgba(211, 111, 92, .15); color: #e49c8d; }
.stock-warning { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 10px; border-radius: 7px; background: var(--red-soft); color: var(--red); font-size: 9px; }
.stock-warning svg { width: 13px; height: 13px; }

/* Settings */
.settings-dialog { width: min(100%, 660px); }
.settings-account-card { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; padding: 13px 14px; border: 1px solid #ddcfb8; border-radius: 11px; background: linear-gradient(135deg, #fffaf1, #fffdf9); }
.settings-account-card .avatar { width: 38px; height: 38px; flex-basis: 38px; background: var(--orange-soft); border-color: #ecd2ae; color: var(--orange-deep); font-size: 12px; }
.settings-account-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.25; }
.settings-account-info strong { font-size: 12px; }
.settings-account-info span { font-family: var(--font-num); font-size: 8.5px; color: var(--muted-2); }
.settings-account-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.settings-block { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--card-soft); }
.settings-title { display: flex; align-items: center; gap: 10px; }
.settings-title > div { display: flex; flex-direction: column; line-height: 1.35; }
.settings-title strong { font-size: 11px; }
.settings-title small { margin-top: 2px; font-size: 8.5px; color: var(--muted-2); }
.storage-gauge { height: 7px; margin-top: 15px; border-radius: 5px; background: #e8e2d6; overflow: hidden; }
.storage-gauge span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d6c6aa, #e99632); transition: width .4s; }
.storage-meta { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-num); font-size: 8px; color: var(--muted-2); }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.settings-action { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; transition: .18s; }
.settings-action:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.settings-action > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.settings-action strong { font-size: 9.5px; font-weight: 600; }
.settings-action small { margin-top: 2px; font-size: 7.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-action .chev { width: 13px; height: 13px; margin-left: auto; color: var(--muted-2); flex: 0 0 13px; }
.settings-action .stat-icon { width: 31px; height: 31px; flex: 0 0 31px; }
.settings-action.danger strong { color: var(--red); }
.settings-note { display: flex; gap: 8px; margin-top: 14px; padding: 11px 12px; border-radius: 8px; background: var(--orange-soft); color: #8f652b; }
.settings-note svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.settings-note p { margin: 0; font-size: 9px; line-height: 1.6; }

/* Confirm */
.confirm-modal { z-index: 120; }
.confirm-dialog { width: min(100%, 390px); padding: 27px; text-align: center; overflow: visible; }
.confirm-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.confirm-icon.amber { background: var(--orange-soft); color: var(--orange-deep); }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-dialog h2 { margin: 0 0 7px; font-size: 17px; }
.confirm-dialog p { margin: 0 auto; max-width: 290px; font-size: 10.5px; line-height: 1.65; color: var(--muted); }
.confirm-actions { display: flex; gap: 8px; margin-top: 20px; }
.confirm-actions .btn { flex: 1; }

/* Reorder */
.reorder-dialog { width: min(100%, 690px); }
.reorder-head, .reorder-row { display: grid; grid-template-columns: minmax(0, 1.5fr) .8fr .7fr; gap: 12px; align-items: center; }
.reorder-head { padding: 0 10px 8px; border-bottom: 1px solid var(--line); font-size: 8px; color: var(--muted-2); }
.reorder-list { max-height: 330px; overflow-y: auto; }
.reorder-row { padding: 10px; border-bottom: 1px solid #f1ede4; }
.reorder-row:last-child { border-bottom: 0; }
.reorder-part { display: flex; align-items: center; gap: 8px; min-width: 0; }
.reorder-part .table-thumb { width: 32px; height: 32px; flex-basis: 32px; }
.reorder-part strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
.reorder-part small { display: block; font-family: var(--font-num); font-size: 8px; color: var(--muted-2); }
.reorder-nums { font-family: var(--font-num); font-size: 9.5px; color: var(--muted); }
.reorder-nums b { color: var(--ink); font-weight: 500; }
.reorder-qty { justify-self: end; padding: 3px 9px; border-radius: 20px; background: var(--orange-soft); color: var(--orange-deep); font-family: var(--font-num); font-size: 11px; font-weight: 600; }
.reorder-total { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 13px 15px; border-radius: 9px; background: var(--navy); color: #9fb0b3; font-size: 10px; }
.reorder-total strong { font-family: var(--font-num); font-size: 19px; color: var(--orange); font-weight: 600; }

/* =========================================================
   Accounts
   ========================================================= */
.modal-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.accounts-dialog { width: min(100%, 820px); }
.accounts-summary { display: flex; align-items: center; gap: 22px; padding: 13px 16px; margin-bottom: 14px; border-radius: 10px; background: var(--navy); color: #c9d4d3; }
.accounts-summary > div { display: flex; align-items: baseline; gap: 5px; }
.accounts-summary strong { font-family: var(--font-num); font-size: 19px; color: #f1f4f2; }
.accounts-summary span { font-size: 8px; color: #788d93; }
.accounts-summary .summary-note { margin-left: auto; color: #6f858b; font-size: 8.5px; }
.accounts-list { display: flex; flex-direction: column; gap: 7px; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) 105px 92px auto; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .18s, box-shadow .18s; }
.account-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.account-row.is-disabled { background: #f8f6f0; opacity: .7; }
.account-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-person .avatar { width: 34px; height: 34px; flex: 0 0 34px; background: var(--steel-soft); border: 1px solid #dbe3e1; color: var(--steel); font-size: 10px; }
.account-row.is-self .account-person .avatar { background: var(--orange-soft); border-color: #ecd2ae; color: var(--orange-deep); }
.account-person > div { min-width: 0; line-height: 1.3; }
.account-person strong { display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.account-person strong i { padding: 1px 5px; border-radius: 4px; background: var(--paper); color: var(--muted); font-style: normal; font-size: 7px; font-weight: 400; }
.account-person small { display: block; margin-top: 2px; font-family: var(--font-num); font-size: 8.5px; color: var(--muted-2); }
.role-badge { display: inline-flex; align-items: center; width: fit-content; padding: 3px 8px; border-radius: 20px; background: var(--steel-soft); color: var(--steel); font-size: 8px; font-weight: 600; white-space: nowrap; }
.role-badge.admin { background: var(--orange-soft); color: var(--orange-deep); }
.account-state { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.account-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.account-state.disabled { color: var(--muted-2); }
.account-state.disabled::before { background: var(--muted-2); }
.account-actions { display: flex; justify-content: flex-end; gap: 4px; }
.accounts-empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 10px; }
.account-form-modal { z-index: 110; }
.account-form-dialog, .password-dialog { width: min(100%, 560px); }
.password-field-stack { display: flex; flex-direction: column; gap: 13px; }
.switch-line { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 10px; cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 30px; height: 17px; flex: 0 0 30px; border-radius: 20px; background: #d8d2c5; transition: background .18s; }
.switch-ui i { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,30,30,.2); transition: transform .18s; }
.switch-line input:checked + .switch-ui { background: var(--green); }
.switch-line input:checked + .switch-ui i { transform: translateX(13px); }
.switch-line input:focus-visible + .switch-ui { outline: 2px solid var(--orange); outline-offset: 2px; }
.switch-line:has(input:checked) { color: var(--ink); }
.save-hint.safety { color: var(--muted-2); }
.save-hint.safety svg { color: var(--orange-deep); }
.admin-only[hidden] { display: none !important; }

/* =========================================================
   Audit trail
   ========================================================= */
.audit-dialog { width: min(100%, 880px); }
.audit-summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 9px; background: var(--navy); color: #9fb1b4; font-size: 9.5px; }
.audit-summary strong { color: var(--orange); font-family: var(--font-num); font-size: 17px; }
.audit-list { display: flex; flex-direction: column; }
.audit-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px 2px; border-bottom: 1px solid #f0ece2; }
.audit-row:last-child { border-bottom: 0; }
.audit-time { font-family: var(--font-num); font-size: 9px; color: var(--muted-2); line-height: 1.5; }
.audit-time span { display: block; font-family: var(--font); font-size: 7.5px; color: #b1aca1; }
.audit-main { min-width: 0; }
.audit-main-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.audit-main-head strong { font-size: 10.5px; font-weight: 600; }
.audit-main-head small { font-family: var(--font-num); font-size: 8px; color: var(--muted-2); }
.audit-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; background: var(--steel-soft); color: var(--steel); font-size: 7.5px; font-weight: 600; white-space: nowrap; }
.audit-badge.auth { background: var(--green-soft); color: var(--green); }
.audit-badge.stock { background: var(--orange-soft); color: var(--orange-deep); }
.audit-badge.account { background: #f0eaf8; color: #70549b; }
.audit-badge.data { background: var(--red-soft); color: var(--red); }
.audit-main p { margin: 4px 0 2px; font-size: 9.5px; line-height: 1.6; color: var(--ink-2); }
.audit-main p b { font-weight: 600; }
.audit-meta { font-size: 8px; color: var(--muted-2); }

/* =========================================================
   Detail drawer
   ========================================================= */
.drawer-layer { position: fixed; inset: 0; z-index: 90; visibility: hidden; opacity: 0; transition: visibility .25s, opacity .25s; }
.drawer-layer.is-open { visibility: visible; opacity: 1; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(13, 20, 23, .48); backdrop-filter: blur(3px); }
.detail-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(100%, 460px);
  display: flex; flex-direction: column;
  background: var(--card);
  box-shadow: -20px 0 60px rgba(17, 26, 30, .18);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.drawer-layer.is-open .detail-drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 22px 24px; }
.detail-hero { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--paper); }
.detail-hero > img { width: 100%; height: 100%; object-fit: cover; }
.detail-status { position: absolute; top: 12px; left: 12px; }
.detail-title-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 17px; }
.detail-title-row > div { flex: 1; min-width: 0; }
.detail-title-row h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; letter-spacing: -.03em; }
.detail-title-row p { margin: 0; font-family: var(--font-num); font-size: 10px; color: var(--muted-2); }
.detail-code { padding: 4px 8px; border-radius: 5px; background: var(--paper); color: var(--muted); font-family: var(--font-num); font-size: 8.5px; white-space: nowrap; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); overflow: hidden; }
.detail-stats div { padding: 11px 12px; background: var(--card-soft); }
.detail-stats span { display: block; font-size: 8px; color: var(--muted-2); }
.detail-stats strong { display: block; margin-top: 3px; font-family: var(--font-num); font-size: 17px; font-weight: 600; }
.detail-stats strong.low { color: var(--orange-deep); }
.detail-stats strong.out { color: var(--red); }
.detail-info { margin-top: 16px; border-top: 1px solid var(--line); }
.detail-info-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1ede4; font-size: 10px; }
.detail-info-row span { color: var(--muted-2); }
.detail-info-row b { font-weight: 500; color: var(--ink-2); }
.detail-info-row b.mono { font-family: var(--font-num); font-weight: 400; }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; font-size: 11px; font-weight: 600; }
.detail-section-title small { font-size: 8px; font-weight: 400; color: var(--muted-2); }
.detail-timeline { display: flex; flex-direction: column; }
.detail-timeline .activity-item { padding-bottom: 10px; }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
.detail-actions .btn { flex: 1; }
.detail-actions .btn.delete-action { flex: 0 0 44px; padding: 0; }
.detail-note { margin-top: 13px; padding: 11px 12px; border-radius: 8px; background: var(--card-soft); font-size: 9px; line-height: 1.7; color: var(--muted); }

/* =========================================================
   Toasts
   ========================================================= */
.toast-stack { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body.is-locked .toast-stack { top: 18px; bottom: auto; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 250px; max-width: 370px; padding: 12px 14px; border: 1px solid #30444b; border-radius: 10px; background: #17262c; color: #e8eeeb; box-shadow: 0 14px 35px rgba(15, 24, 27, .28); animation: toastIn .28s ease both; pointer-events: auto; }
.toast.is-leaving { animation: toastOut .25s ease both; }
.toast-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: rgba(108, 198, 155, .14); color: #79cda7; }
.toast.error .toast-icon { background: rgba(211, 111, 92, .15); color: #e29586; }
.toast.info .toast-icon { background: rgba(240, 161, 59, .14); color: var(--orange); }
.toast-icon svg { width: 13px; height: 13px; }
.toast p { margin: 0; font-size: 10px; line-height: 1.5; }
.toast p b { display: block; font-size: 10.5px; }
.toast p span { color: #8ea1a5; font-size: 9px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* =========================================================
   Mobile nav / scrim
   ========================================================= */
.mobile-nav { display: none; }
.sidebar-scrim { display: none; }

/* =========================================================
   Small shared details
   ========================================================= */
mark { padding: 0 1px; border-radius: 2px; background: #f9d796; color: inherit; }
.dash-note-empty { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 22px 10px; color: var(--muted-2); font-size: 9.5px; text-align: center; }
.dash-note-empty svg { width: 14px; height: 14px; color: var(--green); }
.hero.suggest-open { overflow: visible; z-index: 22; }
.hero.suggest-open::after { display: none; }
.hero.suggest-open .hero-grid-lines { border-radius: 24px 24px 0 0; }
.search-suggest { max-height: min(430px, 62vh); overflow-y: auto; overscroll-behavior: contain; }
.detail-status { right: auto; }
.table-thumb .part-art .art-label,
.table-thumb .part-art .art-code,
.alert-thumb .part-art .art-label,
.alert-thumb .part-art .art-code,
.alert-card-thumb .part-art .art-label,
.alert-card-thumb .part-art .art-code,
.suggest-thumb .part-art .art-label,
.suggest-thumb .part-art .art-code { display: none; }
.table-thumb .art-svg,
.alert-thumb .art-svg,
.alert-card-thumb .art-svg,
.suggest-thumb .art-svg { width: 68%; height: 68%; }
.table-thumb .part-art,
.alert-thumb .part-art,
.alert-card-thumb .part-art,
.suggest-thumb .part-art { border-radius: inherit; }
.field.has-error .field-error { display: block; }
.field.is-disabled .field-label { opacity: .65; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1360px) {
  :root { --sidebar-w: 228px; }
  .main { padding: 24px 24px 46px; }
  .topbar { padding: 0 24px; }
  .hero { padding-left: 42px; padding-right: 42px; }
  .hero-content { width: 64%; }
  .hero-art { width: 38%; }
  .badge-top { right: 24%; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 324px; }
  .parts-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .record-stats { grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(210px, 1.2fr); }
}

@media (max-width: 1180px) {
  .top-user-text, .top-user-chev { display: none; }
  .top-user { width: 40px; padding: 3px; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .category-panel { grid-column: span 2; }
  .category-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .hero-art { opacity: .78; }
  .hero-content { width: 68%; }
  .hero-footer > div:not(.hero-scroll) { min-width: 125px; padding-right: 18px; margin-right: 18px; }
  .record-stats { grid-template-columns: repeat(3, 1fr); }
  .record-tip { display: none !important; }
  .part-form-body { grid-template-columns: 250px minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 1000px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 20px 11px 14px; align-items: center; }
  .brand { padding: 0 0 26px; }
  .brand-text, .side-section-label, .nav-item > span:not(.nav-icon), .nav-item .nav-count, .nav-item .nav-badge, .depot-card, .user-info, .sidebar-user .icon-btn { display: none; }
  .main-nav { width: 100%; align-items: center; }
  .nav-item { justify-content: center; padding: 0; height: 46px; }
  .nav-item.is-active::before { left: -11px; }
  .sidebar-user { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); width: 100%; justify-content: center; }
  .topbar { padding-left: 20px; }
  .storage-pill { display: none; }
  .hero { min-height: 470px; padding-left: 36px; }
  .hero-content { width: 75%; }
  .hero-art { width: 33%; opacity: .6; }
  .badge-top { display: none; }
  .badge-bottom { right: 0; top: 260px; }
  .hero-footer > div:not(.hero-scroll) { min-width: 115px; margin-right: 14px; padding-right: 14px; }
  .hero-footer b { font-size: 17px; }
  .part-form-body { grid-template-columns: 215px minmax(0, 1fr); gap: 18px; }
  .modal-dialog { max-height: calc(100vh - 30px); }
}

@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar { visibility: hidden; transform: translateX(-100%); transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; width: 250px; padding: 22px 18px 18px; align-items: stretch; box-shadow: 20px 0 60px rgba(10,18,21,.3); }
  .sidebar.is-open { visibility: visible; transform: none; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  .sidebar.is-open .brand-text, .sidebar.is-open .side-section-label, .sidebar.is-open .nav-item > span:not(.nav-icon), .sidebar.is-open .nav-count, .sidebar.is-open .nav-badge, .sidebar.is-open .depot-card, .sidebar.is-open .user-info, .sidebar.is-open .sidebar-user .icon-btn { display: flex; }
  .sidebar.is-open .brand-text { display: flex; }
  .sidebar.is-open .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar.is-open .main-nav { align-items: stretch; }
  .sidebar.is-open .sidebar-user { justify-content: flex-start; width: auto; }
  .sidebar.is-open .nav-item .nav-count, .sidebar.is-open .nav-item .nav-badge { display: inline-block; margin-left: auto; }
  .sidebar.is-open .depot-card { display: block; }
  .sidebar.is-open .user-info { display: flex; }
  .sidebar.is-open .sidebar-user .icon-btn { display: inline-grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(12,19,22,.48); backdrop-filter: blur(2px); display: none; }
  .sidebar-scrim.is-open { display: block; }
  .app-shell { margin-left: 0; }
  .topbar { height: 62px; padding: 0 16px; }
  .mobile-menu-btn { display: inline-grid; }
  .date-chip, .settings-btn { display: none; }
  .top-add { height: 38px; }
  .main { padding: 18px 16px 92px; }
  .mobile-nav {
    position: fixed; z-index: 30; left: 12px; right: 12px; bottom: 12px;
    display: flex; align-items: center; justify-content: space-around;
    height: 62px; padding: 0 8px;
    background: rgba(18, 30, 35, .96);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(12,20,23,.3);
    backdrop-filter: blur(16px);
    transition: opacity .2s, transform .2s;
  }
  body.suggestions-open .mobile-nav { opacity: 0; transform: translateY(88px); pointer-events: none; }
  .mobile-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: 1; height: 100%; border: 0; background: transparent; color: #71858c; font-size: 8px; }
  .mobile-nav button.is-active { color: var(--orange); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav .mobile-add { flex: 0 0 48px; width: 48px; height: 48px; margin-top: -21px; border-radius: 15px; background: linear-gradient(145deg, #f5b155, #df8523); color: #192226; box-shadow: 0 8px 18px rgba(219, 129, 32, .3); }
  .mobile-nav .mobile-add svg { width: 23px; height: 23px; }
  .mobile-dot { position: absolute; top: 12px; right: 22%; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
  .hero { padding: 32px 24px 0; min-height: 455px; border-radius: 18px; }
  .hero h1 { font-size: 32px; }
  .hero-content { width: 100%; }
  .hero-art { opacity: .24; width: 50%; right: -9%; }
  .badge-bottom { display: none; }
  .search-suggest { max-height: min(340px, 48vh); }
  .hero-sub br { display: none; }
  .hero-search { height: 55px; }
  .hero-search kbd { display: none; }
  .hero-search-btn { width: 41px; height: 41px; }
  .hero-footer > div:not(.hero-scroll) { min-width: 0; flex: 1; margin-right: 12px; padding-right: 10px; gap: 4px; }
  .hero-footer b { font-size: 15px; }
  .hero-foot-label { font-size: 8px; }
  .hero-footer small { display: none; }
  .hero-scroll { display: none; }
  .stat-grid { gap: 10px; margin-top: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 25px; }
  .stat-foot { margin-top: 12px; padding-top: 9px; }
  .dashboard-grid { margin-top: 12px; gap: 12px; }
  .dashboard-side { grid-template-columns: 1fr; gap: 12px; }
  .category-panel { grid-column: auto; }
  .category-bars { display: block; }
  .parts-grid { padding: 0 16px 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
  #dashParts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashParts .part-card:nth-child(n+5) { display: none; }
  .panel-head { padding: 18px 16px 13px; flex-wrap: wrap; }
  .panel-actions { gap: 6px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; padding-bottom: 18px; }
  .page-heading h1 { font-size: 26px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .ledger-toolbar { gap: 7px; padding: 9px; }
  .ledger-search { flex-basis: 100%; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; min-width: 0; }
  .view-toggle { flex: 0 0 auto; }
  .ledger-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); padding: 0; }
  .category-tabs { padding: 12px 0; flex-wrap: nowrap; overflow-x: auto; }
  .cat-tab { flex: 0 0 auto; }
  .results-bar { margin-bottom: 10px; }
  .record-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .record-stats article { padding: 11px; min-height: 72px; }
  .record-stats strong { font-size: 18px; }
  .record-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .record-toolbar { gap: 8px; }
  .ledger-search.slim { flex: 1 1 100%; }
  .alert-summary { padding: 22px; flex-wrap: wrap; }
  .alert-summary-visual { display: none; }
  .alert-summary h2 { font-size: 21px; }
  .alert-summary .btn { margin-top: 4px; }
  .alerts-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-head { padding: 19px 20px 14px; }
  .modal-body { padding: 18px 20px; }
  .modal-foot { padding: 12px 20px; }
  .part-form-body { display: block; }
  .image-column { display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto auto auto; gap: 0 15px; margin-bottom: 22px; }
  .image-column .field-label { grid-column: 1 / -1; grid-row: 1; }
  .drop-zone { grid-column: 1; grid-row: 2; aspect-ratio: 1 / 1; }
  .image-tip { grid-column: 2; grid-row: 2; margin-top: 0; align-self: start; }
  .image-error { grid-column: 1 / -1; grid-row: 3; }
  .detail-drawer { width: 100%; }
  .toast-stack { left: 16px; right: 16px; bottom: 86px; }
  body.is-locked .toast-stack { top: 14px; bottom: auto; }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .settings-actions { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .top-add span { display: none; }
  .top-add { width: 38px; padding: 0; }
  .crumb { gap: 7px; }
  .hero { min-height: 435px; padding: 27px 18px 0; }
  .hero h1 { margin-top: 14px; font-size: 28px; }
  .hero-sub { font-size: 10.5px; line-height: 1.7; }
  .hero-search { padding-left: 14px; margin-top: 20px; }
  .hero-search input { font-size: 11.5px; padding: 0 8px; }
  .hero-search .search-clear { display: none !important; }
  .quick-row > span { display: none; }
  .hero-footer { height: 64px; }
  .hero-footer > div:not(.hero-scroll) { flex-direction: column; align-items: flex-start; gap: 1px; border: 0; margin-right: 0; }
  .hero-footer b { font-size: 14px; }
  .stat-card { padding: 13px; }
  .stat-icon { width: 28px; height: 28px; border-radius: 7px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .stat-trend { font-size: 8px; }
  .stat-value { margin-top: 11px; font-size: 21px; }
  .stat-label { font-size: 9px; }
  .stat-foot { font-size: 8px; }
  .stat-foot .text-link { display: none; }
  .parts-grid, .ledger-grid, #dashParts { grid-template-columns: 1fr; }
  .part-media { aspect-ratio: 16 / 9; }
  .part-name { font-size: 14px; }
  .panel-head { align-items: flex-start; }
  .panel-actions .btn span { display: none; }
  .segmented.mini button { padding: 0 7px; }
  .record-stats { grid-template-columns: 1fr 1fr; }
  .record-stats article:nth-child(3) { grid-column: span 2; }
  .alert-summary { padding: 20px 18px; }
  .alert-summary h2 { font-size: 19px; }
  .alert-summary-copy p { line-height: 1.6; }
  .alert-summary .btn { width: 100%; }
  .results-bar { align-items: flex-start; gap: 8px; }
  .legend { display: flex; }
  .legend > span { display: none; }
  .part-form-body .field-grid { grid-template-columns: 1fr; }
  .part-form-body .field.span-2 { grid-column: auto; }
  .image-column { display: block; }
  .drop-zone { aspect-ratio: 16 / 10; }
  .image-tip { margin-top: 12px; }
  .image-error { min-height: 0; }
  .modal-head h2 { font-size: 18px; }
  .modal-head p { display: none; }
  .save-hint { display: none; }
  .modal-foot { justify-content: flex-end; }
  .stock-type-switch { grid-template-columns: 1fr; }
  .stock-current { gap: 10px; padding: 12px; }
  .stock-current strong { font-size: 20px; }
  .stock-preview-tag { display: none; }
  .reorder-head, .reorder-row { grid-template-columns: minmax(0, 1.4fr) .7fr .6fr; gap: 6px; }
  .reorder-head span:last-child { text-align: right; }
  .alert-card-stats strong { font-size: 14px; }
  .confirm-dialog { padding: 24px 20px; border-radius: 18px 18px 0 0; }
  .toast-stack { bottom: 86px; }
}

@media (max-width: 1100px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr) 430px; }
  .auth-visual { padding: 34px 36px 24px; }
  .auth-copy { width: 88%; }
  .auth-copy h1 { font-size: clamp(40px, 4.5vw, 56px); }
  .auth-visual-art { width: min(64vw, 500px); right: -120px; opacity: .6; }
}

@media (max-width: 900px) {
  .auth-screen { display: block; min-height: 100vh; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 34px 22px; }
  .auth-mobile-brand { display: flex; }
  .auth-card { width: min(100%, 410px); }
}

@media (max-width: 820px) {
  .account-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
  .account-person { grid-column: 1; grid-row: 1; }
  .account-row > .role-badge { grid-column: 2; grid-row: 1; justify-self: end; }
  .account-state { grid-column: 1; grid-row: 2; }
  .account-actions { grid-column: 2; grid-row: 2; justify-self: end; }
  .accounts-summary { flex-wrap: wrap; gap: 10px 18px; }
  .accounts-summary .summary-note { width: 100%; margin-left: 0; }
  .settings-account-actions { gap: 4px; }
}

@media (max-width: 560px) {
  .auth-panel { justify-content: flex-start; padding: 24px 14px 30px; }
  .auth-mobile-brand { margin-bottom: 20px; }
  .auth-card { padding: 26px 20px 20px; border-radius: 16px; }
  .auth-card-head { margin-bottom: 20px; }
  .auth-card-head h2 { font-size: 24px; }
  .auth-input { height: 45px; }
  .auth-submit { height: 45px; }
  .auth-copyright { font-size: 7.5px; line-height: 1.6; }
  .settings-account-card { flex-wrap: wrap; }
  .settings-account-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .modal-head-actions .btn span { display: inline; }
  .modal-head-actions .btn { padding: 0 10px; }
  .account-form-dialog .field-grid { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr; }
  .account-person { grid-column: 1; grid-row: 1; }
  .account-row > .role-badge { grid-column: 1; grid-row: 2; justify-self: start; }
  .account-state { grid-column: 1; grid-row: 3; }
  .account-actions { grid-column: 1; grid-row: 4; justify-self: start; }
  .account-actions .mini-btn { flex: 1; justify-content: center; }
  .accounts-dialog .modal-head { flex-wrap: wrap; }
  .modal-head-actions { width: 100%; justify-content: space-between; }
  .accounts-summary strong { font-size: 17px; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 2px; }
  .audit-time { display: flex; align-items: center; gap: 8px; }
  .audit-time span { display: inline; }
  .audit-dialog .modal-head { align-items: flex-start; }
}

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