/* ==========================================================================
   Beak Rack - black and light blue: cool off-white with a light blue glow, glass cards,
   black for active items and main buttons, light blue highlights, Outfit font
   ========================================================================== */
/* Outfit (SIL Open Font License, see /fonts/OUTFIT-LICENSE.txt), served by Beak Rack itself */
@font-face {
  font-family: "Outfit"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/outfit-latin.woff2) format("woff2-variations"), url(/fonts/outfit-latin.woff2) format("woff2");
}
:root {
  --ink: #1d1d1b;
  --ink-2: #474d55;
  --muted: #848b93;
  --bg: #edf1f4;
  --bg-2: #e4e9ee;
  --panel: var(--glass);
  --line: #e1e7ec;
  --line-2: #eef2f5;
  --head: #f4f7f9;
  --accent: #1d1d1b;
  --accent-2: #1d1d1b;
  --blue: #8ecff5;
  --blue-2: #bfe4fa;
  --blue-bg: #e8f6fe;
  --charcoal: #262624;
  --scan: #f1f9fe;
  --ok: #1e8a5a;    --ok-bg: #e4f4ea;
  --warn: #946400;  --warn-bg: #fff3c9;
  --bad: #c2362f;   --bad-bg: #fbe4e1;
  --info: #1d1d1b;  --info-bg: #edf2f6;
  --sb-w: 248px;
  --sb-w-c: 76px;
  --radius: 24px;
  --shadow-1: 0 1px 2px rgba(20, 30, 40, .04), 0 8px 24px rgba(20, 30, 40, .06);
  --shadow-2: 0 2px 6px rgba(20, 30, 40, .06), 0 18px 44px rgba(20, 30, 40, .14);
  /* frosted glass: see-through white that blurs what is behind it, with a bright edge and a top shine */
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .78);
  --glass-blur: blur(20px) saturate(1.5);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .25);
  font-family: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14.5px;
  color: var(--ink);
}
/* named accent colours (kept for markup that names them; the theme keeps icons neutral) */
.c-blue, .c-green, .c-teal, .c-violet, .c-amber, .c-rose, .c-indigo, .c-cyan, .c-slate { --c1: #edf2f6; --c2: #1d1d1b; --c3: #1d1d1b; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh;
  background: radial-gradient(900px 640px at 105% -6%, #cfeafb 0%, rgba(207, 234, 251, 0) 62%),
              radial-gradient(760px 520px at 78% 112%, rgba(142, 207, 245, .16) 0%, rgba(142, 207, 245, 0) 60%),
              linear-gradient(180deg, #f2f5f8 0%, #e9eef2 100%) fixed; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(460px circle at 16% 24%, rgba(142, 207, 245, .42), transparent 70%),
              radial-gradient(560px circle at 88% 68%, rgba(191, 228, 250, .5), transparent 70%),
              radial-gradient(420px circle at 52% 108%, rgba(176, 200, 218, .45), transparent 70%),
              radial-gradient(360px circle at 62% 30%, rgba(255, 255, 255, .8), transparent 70%); }
/* Dashboard: a faint isometric (3D) warehouse with moving stock behind the glass cards. It fades in on the
   Dashboard and out on other screens, its edges fade away, and it drifts slowly. */
.app-scene { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; pointer-events: none;
  opacity: 0; transform: scale(1.04); transition: opacity .9s ease, transform 1.4s ease;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 62% 58%, #000 30%, transparent 88%); mask-image: radial-gradient(ellipse 78% 72% at 62% 58%, #000 30%, transparent 88%); }
body.on-dash .app-scene { opacity: .55; transform: scale(1); animation: sceneDrift 45s ease-in-out infinite alternate; }
@keyframes sceneDrift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1.5%, -1%); } }
@media (max-width: 768px) { body.on-dash .app-scene { opacity: .4; } }
a { color: var(--ink); text-underline-offset: 2px; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; font-weight: 500; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

/* ---------- Logo ---------- */
.logo-cube { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--ink); }

/* ---------- Company logo (white PNG used as a mask, filled in the theme colour) ---------- */
.brand-logo { display: block; flex: 0 0 auto; aspect-ratio: 969 / 144;
  -webkit-mask: url(/img/logo.png) center / contain no-repeat; mask: url(/img/logo.png) center / contain no-repeat; background: var(--ink); }
.top-logo { height: 24px; background: var(--ink); }
.login-brand { width: 100%; max-width: 300px; justify-self: center; margin: 0 auto 4px; }

/* ---------- Footer ---------- */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 22px;
  background: transparent; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.app-footer .powered { display: inline-flex; align-items: center; gap: 12px; }
.foot-logo { height: 20px; background: var(--ink); }
/* ==========================================================================
   Login: animated warehouse yard behind a glass card with a notch tab,
   floating labels, icons and a show-password eye
   ========================================================================== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px 76px; position: relative; overflow: hidden; background: #a9c7da; }
.login-3d { position: fixed; inset: 0; z-index: 0; opacity: 0; transition: opacity .6s ease; }
.login-3d.on { opacity: 1; }
.login-3d canvas { display: block; width: 100%; height: 100%; }
/* a soft shade behind the card, so the text stays easy to read over the moving scene */
.login::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 520px 460px at 50% 48%, rgba(12, 28, 40, .35), rgba(12, 28, 40, 0) 70%); }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 390px; padding: 70px 32px 28px; border-radius: 22px; color: #fff;
  background: rgba(16, 34, 48, .38); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 30px 70px rgba(6, 18, 28, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: cardIn .7s cubic-bezier(.2, .8, .2, 1); }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
/* the "Login" tab hanging from the top edge, with curved inner corners */
.login-tab { --tab: #dbe9f2; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 150px; height: 56px; display: grid; place-items: center;
  background: var(--tab); color: var(--ink); font-size: 26px; font-weight: 400; border-radius: 0 0 22px 22px; }
.login-tab::before, .login-tab::after { content: ""; position: absolute; top: 0; width: 22px; height: 22px; }
.login-tab::before { left: -22px; background: radial-gradient(circle at 0 100%, transparent 21.5px, var(--tab) 22px); }
.login-tab::after { right: -22px; background: radial-gradient(circle at 100% 100%, transparent 21.5px, var(--tab) 22px); }
.login .login-brand { background: #fff; max-width: 220px; margin: 4px auto 0; }
.login-mark { display: inline-block; vertical-align: -3px; margin-right: 7px; color: #fff; }
.login-sub { text-align: center; margin: 8px 0 22px; color: rgba(255, 255, 255, .78); font-size: 13.5px; letter-spacing: .02em; }
/* pill fields with a label that floats onto the border */
.lf-field { position: relative; margin: 0 0 20px; }
.login-card .lf-field input { height: 50px; border-radius: 999px; padding: 0 84px 0 22px; font-size: 15px; color: #fff; background: rgba(255, 255, 255, .04);
  border: 1.5px solid rgba(255, 255, 255, .78); box-shadow: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.login-card .lf-field input:hover { background: rgba(255, 255, 255, .08); }
.login-card .lf-field input:focus { border-color: var(--blue); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 4px rgba(142, 207, 245, .28); }
.login-card .lf-field input:-webkit-autofill { -webkit-text-fill-color: #fff; caret-color: #fff; transition: background-color 9999s ease-out 0s; }
.lf-field label { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); display: block; color: rgba(255, 255, 255, .88); font-size: 15px; font-weight: 400;
  pointer-events: none; padding: 0; border-radius: 999px; transition: top .22s ease, font-size .22s ease, padding .22s ease, background .22s ease, color .22s ease; }
.lf-field input:focus + label, .lf-field input:not(:placeholder-shown) + label { top: 0; font-size: 12px; padding: 2px 10px; background: var(--blue); color: var(--ink); font-weight: 500; }
.lf-ic { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: #fff; display: grid; pointer-events: none; }
.lf-eye { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer; transition: background .15s, color .15s, transform .12s; }
.lf-eye:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lf-eye:active { transform: translateY(-50%) scale(.9); }
.lf-eye .eye-hide, .lf-eye[aria-pressed="true"] .eye-show { display: none; }
.lf-eye[aria-pressed="true"] .eye-hide { display: block; }
.lf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 2px 16px; font-size: 13.5px; }
.lf-check { display: flex; align-items: center; gap: 7px; color: #fff; font-size: 13.5px; font-weight: 400; cursor: pointer; }
.lf-check input { width: 15px; height: 15px; accent-color: var(--blue); }
.lf-link { border: 0; background: none; padding: 0; color: #fff; font: inherit; cursor: pointer; }
.lf-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.lf-help { margin: -6px 0 14px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45; color: #fff;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); animation: rise .2s ease-out; }
.lf-btn { width: 100%; height: 48px; border: 0; border-radius: 999px; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  background: #eef3f7; position: relative; overflow: hidden; box-shadow: 0 8px 20px rgba(6, 18, 28, .25); transition: background .2s, transform .12s, box-shadow .2s; }
.lf-btn:hover { background: var(--blue); box-shadow: 0 10px 24px rgba(6, 18, 28, .3); }
.lf-btn:active { transform: scale(.97); }
/* Login button: tap sends a light sweep, an energy ring and sparks; then an "Authenticating" scan,
   then "Access granted" (or a shake on a wrong password) */
.lf-btn-text { position: relative; z-index: 1; transition: letter-spacing .3s, font-size .3s; }
.lf-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .9) 45%, rgba(142, 207, 245, .95) 55%, transparent 80%); }
.lf-btn.zap::before { animation: lfSweep .6s ease-out; }
@keyframes lfSweep { to { transform: translateX(120%); } }
.lf-btn.charging { background: #0f2230; color: #dff3ff; cursor: progress;
  box-shadow: 0 0 0 1.5px var(--blue), 0 0 26px rgba(142, 207, 245, .55), inset 0 0 18px rgba(142, 207, 245, .35); }
.lf-btn.charging .lf-btn-text, .lf-btn.granted .lf-btn-text { letter-spacing: .24em; text-transform: uppercase; font-size: 12.5px; }
.lf-btn.charging::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(142, 207, 245, .6), transparent); animation: lfScan .9s linear infinite; }
@keyframes lfScan { to { left: 100%; } }
.lf-btn.granted { background: var(--blue); color: var(--ink); box-shadow: 0 0 0 2px #fff, 0 0 44px rgba(142, 207, 245, .95); }
.lf-btn.denied { animation: lfShake .45s; box-shadow: 0 0 0 1.5px #ff9b9b, 0 0 22px rgba(255, 120, 120, .55); }
@keyframes lfShake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.lf-fx { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 80; }
.lf-ring { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--blue);
  box-shadow: 0 0 12px var(--blue), inset 0 0 8px var(--blue); transform: scale(.3); animation: lfRing .7s ease-out forwards; }
.lf-ring.r2 { border-color: #fff; animation-delay: .12s; }
@keyframes lfRing { from { transform: scale(.3); opacity: 1; } to { transform: scale(9); opacity: 0; } }
.lf-spark { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px 2px var(--blue);
  animation: lfSpark .75s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes lfSpark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
/* after sign-in: the card warps away into the scene while scan lines run over it */
.login-card .lf-scan { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(142, 207, 245, .25) 0 2px, transparent 2px 6px); }
.login.entering .login-card { animation: cardWarp .9s cubic-bezier(.55, 0, .25, 1) .15s forwards; pointer-events: none; }
.login.entering .lf-scan { animation: lfScanIn .9s linear .15s forwards; }
@keyframes cardWarp {
  25% { transform: perspective(900px) scale(1.03); filter: brightness(1.25) drop-shadow(0 0 22px rgba(142, 207, 245, .8)); }
  100% { transform: perspective(900px) translateY(-40px) rotateX(38deg) translateZ(-520px); opacity: 0; filter: blur(8px) brightness(1.7); } }
@keyframes lfScanIn { 20% { opacity: 1; } 100% { opacity: 1; background-position: 0 -140px; } }
.login::after, .login-footer { transition: opacity .6s ease, transform .6s ease; }
.login.entering::after { opacity: 0; }
.login.entering .login-footer { opacity: 0; transform: translateY(100%); }
/* as the worker reaches the store room door, the dashboard opens out of the doorway */
/* the dashboard is built out of sight (fixed, so the page does not grow) while the walk-through plays */
#app.wipe-prep { visibility: hidden; position: fixed; inset: 0; overflow: hidden; }
#app.revealing { position: fixed; inset: 0; z-index: 2; overflow: hidden; will-change: clip-path, opacity, transform;
  background: linear-gradient(180deg, #f2f5f8 0%, #e9eef2 100%); }
.login-error { color: #ffd2cf; min-height: 1.1em; font-weight: 500; font-size: 13.5px; margin: 0 4px 10px; text-align: center; }
/* phones: the scene is cropped to its bright middle, so the glass is a little darker for readable white text */
@media (max-width: 520px) { .login-card { padding: 66px 22px 24px; background: rgba(16, 34, 48, .58); } .login-tab { width: 128px; height: 50px; font-size: 22px; } }
/* phones: no footer on the sign-in page, and no space kept for it */
@media (max-width: 760px) { .login-footer { display: none; } .login { padding-bottom: 40px; } }
/* footer on the sign-in page: all white */
.login-footer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; color: #fff; background: rgba(12, 28, 40, .45); border-top: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login-footer .foot-logo { background: #fff; }

/* ==========================================================================
   Shell: sidebar + main column
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
body.sb-collapsed .shell { grid-template-columns: var(--sb-w-c) minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 40; color: var(--ink);
  background: rgba(255, 255, 255, .42); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-edge); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .6), 8px 0 30px rgba(20, 30, 40, .05); }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; text-decoration: none; color: var(--ink); }
.sb-brand-text { display: grid; min-width: 0; }
.sb-brand-text b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 10px; scrollbar-width: thin; scrollbar-color: #cfd8df transparent; }
.sb-group { margin-top: 8px; }
.sb-title { font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 3px; white-space: nowrap; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 4px 8px; margin: 2px 0; border-radius: 999px; color: var(--ink-2); text-decoration: none;
  font-weight: 400; white-space: nowrap; position: relative; overflow: hidden; transition: background .18s, color .18s, transform .12s; }
.sb-link:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.sb-link.active { color: #fff; background: var(--ink); box-shadow: 0 6px 16px rgba(29, 29, 27, .18); }
.sb-ic { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.sb-link.active .sb-ic { color: #fff; background: rgba(255, 255, 255, .14); border-color: transparent; }
.sb-ic svg { width: 15px; height: 15px; }
/* Side menu: the icon nudges forward on hover; a tapped item squeezes and springs back while its icon
   gives a little turn; the open page gets a light-blue dot that pops in */
.sb-ic { transition: transform .3s cubic-bezier(.34, 1.6, .5, 1), background .2s, color .2s; }
.sb-link:hover .sb-ic { transform: translateX(3px) scale(1.08); }
.sb-link.tapped { animation: sbTap .45s cubic-bezier(.34, 1.6, .5, 1); }
.sb-link.tapped .sb-ic { animation: sbIcon .55s ease; }
@keyframes sbTap { 30% { transform: scale(.93); } 65% { transform: scale(1.04); } }
@keyframes sbIcon { 40% { transform: rotate(-20deg) scale(1.22); } 70% { transform: rotate(8deg) scale(1.05); } }
.sb-link.active::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 10px rgba(142, 207, 245, .9); animation: sbDot .45s cubic-bezier(.34, 1.8, .5, 1); }
@keyframes sbDot { from { transform: scale(0); } }
body.sb-collapsed .sb-link.active::after { display: none; }
/* Each page arrives with its own futuristic entrance (the class names stay the same; the looks are new) */
.view[class*="pt-"] { position: relative; animation-duration: .8s; animation-timing-function: cubic-bezier(.16, .9, .25, 1); animation-fill-mode: both; }
/* Dashboard - a holographic rise: comes up out of a bright blur */
.view.pt-rise { animation-name: ptHoloRise; }
@keyframes ptHoloRise { 0% { opacity: 0; transform: translateY(60px) scale(.94); filter: blur(10px) brightness(1.8); }
  60% { opacity: 1; filter: blur(0) brightness(1.15); } 100% { transform: none; filter: none; } }
/* warp slides: rush in sideways, stretched and blurred, then snap into place */
.view.pt-slide-r { animation-name: ptWarpR; }
.view.pt-slide-l { animation-name: ptWarpL; }
@keyframes ptWarpR { 0% { opacity: 0; transform: translateX(-160px) skewX(14deg) scaleX(1.15); filter: blur(12px); }
  55% { opacity: 1; transform: translateX(12px) skewX(-3deg); filter: blur(0); } 100% { transform: none; filter: none; } }
@keyframes ptWarpL { 0% { opacity: 0; transform: translateX(160px) skewX(-14deg) scaleX(1.15); filter: blur(12px); }
  55% { opacity: 1; transform: translateX(-12px) skewX(3deg); filter: blur(0); } 100% { transform: none; filter: none; } }
/* 3D flip down from the top edge */
.view.pt-flip { animation-name: ptFlip3d; transform-origin: 50% 0; }
@keyframes ptFlip3d { 0% { opacity: 0; transform: perspective(900px) rotateX(-55deg) translateY(30px); }
  65% { opacity: 1; transform: perspective(900px) rotateX(6deg); } 100% { transform: none; } }
/* 3D swing in like a door from the left */
.view.pt-swing { animation-name: ptSwing3d; transform-origin: 0 50%; }
@keyframes ptSwing3d { 0% { opacity: 0; transform: perspective(1000px) rotateY(55deg) translateZ(-120px); }
  65% { opacity: 1; transform: perspective(1000px) rotateY(-5deg); } 100% { transform: none; } }
/* zoom out of the distance with an overshoot */
.view.pt-zoom { animation-name: ptZoomIn; }
@keyframes ptZoomIn { 0% { opacity: 0; transform: scale(.6); filter: blur(14px) brightness(1.6); }
  60% { opacity: 1; transform: scale(1.03); filter: blur(0); } 100% { transform: none; filter: none; } }
/* drop in from above and bounce */
.view.pt-drop { animation-name: ptDropIn; }
@keyframes ptDropIn { 0% { opacity: 0; transform: translateY(-140px) scaleY(1.08); } 50% { opacity: 1; transform: translateY(14px) scaleY(.97); }
  72% { transform: translateY(-6px); } 100% { transform: none; } }
/* digital glitch: sliced, colour-shifted and jittering, then it locks in */
.view.pt-blur { animation-name: ptGlitch; animation-timing-function: steps(1, end); animation-duration: .7s; }
@keyframes ptGlitch {
  0% { opacity: 0; transform: translateX(-14px) skewX(12deg); filter: hue-rotate(120deg) saturate(2.5); clip-path: inset(12% 0 55% 0); }
  12% { opacity: 1; transform: translateX(16px); clip-path: inset(48% 0 18% 0); filter: hue-rotate(-60deg) saturate(2); }
  24% { transform: translateX(-9px) skewX(-8deg); clip-path: inset(0 0 72% 0); }
  36% { transform: translateX(6px); clip-path: inset(30% 0 30% 0); filter: hue-rotate(40deg); }
  48% { transform: translateX(-3px); clip-path: inset(0 0 12% 0); filter: none; }
  60%, 100% { transform: none; clip-path: inset(0 0 0 0); filter: none; } }
/* holographic scan: revealed top to bottom behind a glowing scan line */
.view.pt-unfold { animation-name: ptScanReveal; animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
.view.pt-unfold::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; z-index: 5;
  background: #8ecff5; box-shadow: 0 0 18px 6px rgba(142, 207, 245, .85), 0 0 60px 20px rgba(142, 207, 245, .35);
  animation: ptScanLine .8s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes ptScanReveal { from { clip-path: inset(0 0 100% 0); filter: brightness(1.4); } to { clip-path: inset(0 0 0 0); filter: none; } }
@keyframes ptScanLine { from { top: 0; opacity: 1; } 90% { opacity: 1; } to { top: 100%; opacity: 0; } }
/* 3D fly-in from deep space, tilted */
.view.pt-tilt { animation-name: ptFly3d; transform-origin: 50% 60%; }
@keyframes ptFly3d { 0% { opacity: 0; transform: perspective(1000px) translateZ(-500px) rotateY(-28deg) rotateX(12deg); filter: blur(8px); }
  65% { opacity: 1; transform: perspective(1000px) translateZ(20px) rotateY(3deg); filter: blur(0); } 100% { transform: none; filter: none; } }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink);
  background: var(--blue); box-shadow: 0 0 0 2px #fff; }
body.sb-collapsed .sb-badge { position: absolute; top: 0; right: 10px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; margin: 0; }
@media (max-width: 1100px) and (min-width: 769px) { .sb-badge { position: absolute; top: 0; right: 10px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; margin: 0; } }

/* notification bell */
.notif-menu { position: relative; }
.bell-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink);
  border: 1px solid var(--glass-edge); background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shine), 0 4px 14px rgba(20, 30, 40, .05); transition: transform .12s, background .15s; }
.bell-btn:hover { background: #fff; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; color: var(--ink); background: var(--blue); box-shadow: 0 0 0 2px #fff; }
.notif-drop { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.notif-head button { padding: 4px 8px !important; font-size: 12px; color: var(--ink) !important; font-weight: 500; }
.notif-list { max-height: 60vh; overflow-y: auto; padding: 4px; }
.notif { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 9px 10px; border-radius: 14px; cursor: pointer; position: relative; }
.notif:hover { background: var(--head); }
.notif.unread { background: var(--blue-bg); }
.notif.unread::after { content: ""; position: absolute; right: 10px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.notif .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.notif .dot svg { width: 16px; height: 16px; }
.notif .nt { display: grid; gap: 2px; min-width: 0; padding-right: 14px; }
.notif .nt b { font-size: 13px; font-weight: 600; }
.notif .nt small { color: var(--ink-2); font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif .nt em { color: var(--muted); font-size: 11px; font-style: normal; }
.notif-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line-2); font-weight: 500; text-decoration: none; }
.notif-foot:hover { background: var(--head); }
@media (max-width: 768px) { .bell-btn { width: 36px; height: 36px; } .notif-drop { position: fixed; right: 12px; top: 56px; } }

/* receive: serial number grid */
.receive-split { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .receive-split { grid-template-columns: minmax(0, 1fr); } }
.sn-head { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 14px; align-items: end; margin-bottom: 12px; }
.sn-head .check { grid-column: span 1; }
.sn-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.sn-bar { flex: 0 0 160px; height: 8px; border-radius: 4px; background: #e6ebef; overflow: hidden; }
.sn-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--blue); transition: width .2s; }
.sn-grid { max-height: 420px; }
.sn-grid td { padding: 4px 6px; }
.sn-grid .sn-in { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; padding: 6px 8px; background: var(--scan); border-color: #b9e0f7; }
.sn-grid .sn-in:focus { background: #fff; }
.sn-grid select { padding: 6px 8px; }
.sn-grid tr.sn-ok td { background: #f3faf5 !important; }
.sn-grid tr.sn-bad td { background: var(--bad-bg) !important; }
.sn-grid tr.sn-bad .sn-in { border-color: #e9aaa4; }
.sn-grid .sn-in { min-width: 140px; }
.sn-st { min-width: 24px; max-width: 220px; font-size: 12px; line-height: 1.3; }
.sn-tick { color: var(--ok); font-weight: 700; }
.sn-msg { color: var(--bad); font-weight: 500; }
.sn-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sn-help { margin: 8px 0 0; }
@media (max-width: 600px) { .sn-head { grid-template-columns: 1fr 1fr; } .sn-st { min-width: 0; } }

/* stock requests */
.req-pri { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.req-pri.low { background: var(--info-bg); color: var(--ink-2); }
.req-pri.normal { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.req-pri.high { background: var(--warn-bg); color: var(--warn); }
.req-pri.urgent { background: var(--bad-bg); color: var(--bad); }
.req-lines td input { width: 90px; text-align: right; }
.timeline { display: grid; gap: 10px; margin: 6px 0 12px; }
.tl { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.tl .who { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; background: var(--ink); }
.tl.status .who { background: var(--blue); color: var(--ink); }
.tl .bubble { background: var(--head); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.tl.status .bubble { background: #fff; border-style: dashed; }
.tl .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.tl .text { white-space: pre-wrap; word-break: break-word; }
.req-new-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 90px 36px; gap: 8px; align-items: end; margin-bottom: 8px; }
@media (max-width: 600px) { .req-new-line { grid-template-columns: 1fr 80px 36px; } .req-new-line .desc { grid-column: 1 / -1; order: 5; } }
.sb-foot { padding: 6px 10px 10px; border-top: 1px solid var(--line); }
.sb-collapse { width: 100%; display: flex; align-items: center; gap: 11px; padding: 5px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.sb-collapse > span:first-child { width: 32px; text-align: center; font-size: 16px; transition: transform .2s; }
.sb-collapse:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
body.sb-collapsed .sb-label, body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-title { display: none; }
body.sb-collapsed .sb-title + .sb-link, body.sb-collapsed .sb-group { margin-top: 6px; }
body.sb-collapsed .sb-link, body.sb-collapsed .sb-collapse { justify-content: center; }
body.sb-collapsed .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sb-collapsed .sb-collapse > span:first-child { transform: rotate(180deg); }
.scrim { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: rgba(244, 247, 249, .45); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid rgba(255, 255, 255, .6); }
.icon-btn { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; color: var(--ink); transition: transform .12s; }
.sr-switch { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 14px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-edge);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shine), 0 4px 14px rgba(20, 30, 40, .05); }
.sr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(142, 207, 245, .3); }
.sr-switch select { border: 0; background: transparent; font-weight: 500; padding: 5px 4px; max-width: 300px; outline: none; cursor: pointer; box-shadow: none; }
.sr-switch select:focus { box-shadow: none; }
.spacer { flex: 1; }
.today { color: var(--muted); font-size: 13px; white-space: nowrap; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink);
  background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shine), 0 4px 14px rgba(20, 30, 40, .05); border-color: var(--glass-edge); transition: transform .12s; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); font-weight: 600; font-size: 12px; background: var(--blue); }
.uname { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--muted); font-size: 11px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: rgba(255, 255, 255, .8); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink); border-radius: 20px; box-shadow: var(--glass-shine), var(--shadow-2); min-width: 220px; padding: 6px; display: grid; z-index: 50; border: 1px solid var(--glass-edge); animation: rise .16s ease-out; }
.drop-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: grid; }
.drop-head small { color: var(--muted); }
.dropdown a, .dropdown button { text-align: left; padding: 9px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: rgba(255, 255, 255, .75); }

/* ---------- Document tabs: pills, the open one in black ---------- */
.tabbar { display: flex; align-items: center; gap: 6px; padding: 10px 22px 0; min-width: 0; }
.tabstrip { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 3px 0; }
.tabstrip::-webkit-scrollbar { display: none; }
.tab-arrow { display: none; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink); background: #fff; }
.tab-arrow:disabled { opacity: .35; cursor: default; }
.tabbar.overflow .tab-arrow { display: block; }
.tab { flex: 0 1 auto; min-width: 110px; max-width: 220px; display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 16px; cursor: pointer; white-space: nowrap; user-select: none; font-size: 13px; font-weight: 500; color: var(--ink-2);
  border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shine); position: relative; overflow: hidden; transition: background .18s, color .18s, transform .12s; }
.tab:hover { color: var(--ink); background: var(--glass-strong); }
.tab.active { color: #fff; border-color: var(--ink); background: var(--ink); }
.tab .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tab.active { flex-shrink: 0; max-width: 260px; }
.tab .x { flex: 0 0 auto; border: 0; background: rgba(0,0,0,.06); cursor: pointer; color: inherit; font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: 50%; }
.tab.active .x { background: rgba(255,255,255,.16); }
.tab .x:hover { background: rgba(0,0,0,.15); }

main { padding: 0 22px 28px; flex: 1; }
.view { width: 100%; padding-top: 18px; }

/* ==========================================================================
   Panels, forms, buttons
   ========================================================================== */
.panel { background: var(--panel); border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shine), var(--shadow-1); }
.panel.tight { padding: 12px 16px; }
.panel[style*="background:#dce9f7"], .panel[style*="background: #dce9f7"] { background: var(--blue-bg) !important; border-color: #c6e6f9; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h1 { margin: 0; }
.panel-head .spacer { flex: 1; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.page-head .spacer { flex: 1; }
.step { font-weight: 500; color: var(--ink); margin: 2px 0 12px; display: flex; align-items: center; gap: 8px; }
.step::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(142, 207, 245, .3); }

label { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); padding: 9px 13px; border: 1px solid rgba(29, 29, 27, .1); border-radius: 14px; background: rgba(255, 255, 255, .7); min-width: 0; width: 100%;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(142, 207, 245, .45); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--ink); box-shadow: none; }
textarea { min-height: 64px; resize: vertical; }
input.scan { background: var(--scan); border-color: #b9e0f7; font-family: "Cascadia Mono", Consolas, monospace; }
input.count { background: var(--scan); border-color: #b9e0f7; text-align: right; width: 84px; }
input:disabled, select:disabled, textarea:disabled { background: #f2f5f7; color: var(--muted); }
.check { display: flex; align-items: center; gap: 7px; font-weight: 400; color: var(--ink); font-size: 13.5px; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.row > .fit { flex: 0 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.split-wide { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* pill buttons: white, the main action in black */
.btn { font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; text-decoration: none; color: var(--ink); border: 1px solid var(--glass-edge); background: var(--glass-strong); position: relative; overflow: hidden;
  backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: var(--glass-shine), 0 2px 8px rgba(20, 30, 40, .06); transition: transform .12s ease, background .15s, box-shadow .15s, color .15s; }
.btn:hover { background: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { color: #fff; background: rgba(29, 29, 27, .9); border-color: rgba(29, 29, 27, .9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px rgba(29, 29, 27, .22); }
.btn.primary:hover { background: rgba(51, 51, 47, .92); }
.btn.danger { color: var(--bad); background: var(--bad-bg); border-color: #f3c6c0; }
.btn.danger:hover { background: #f8d6d1; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------- Tap animation: everything pressable shrinks a little and shows a soft ripple ---------- */
.btn:active:not(:disabled), .tile:active, .item-hit:active, .sb-link:active, .tab:active, .bell-btn:active, .user-chip:active, .icon-btn:active, .tab-arrow:active:not(:disabled), .sb-collapse:active { transform: scale(.95); }
.kpi:active { transform: scale(.97); }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .ripple { display: none; }
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.hero { position: relative; padding: 6px 2px 18px; margin-bottom: 4px; color: var(--ink); display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.hero-text { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hero h1 { color: var(--ink); margin: 0 10px 0 0; font-size: 44px; font-weight: 300; letter-spacing: -.025em; line-height: 1.05; flex-basis: 100%; }
.hero p { margin: 0; color: var(--muted); }
.hero .chip-sr { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shine); font-size: 12.5px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.hero-actions .btn svg { width: 15px; height: 15px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--ink); min-height: 124px;
  background: var(--panel); border: 1px solid var(--glass-edge); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shine), var(--shadow-1); transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--glass-shine), var(--shadow-2); }
.kpi .v { font-size: 46px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 0; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 6px; }
.kpi .kpi-ic { position: relative; margin: -4px 0 14px -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--ink); }
.kpi .kpi-ic svg { width: 15px; height: 15px; }
.kpi .flag { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--blue); color: var(--ink); }
/* first figure dark, second light blue, like the reference's accent cards */
.kpis .kpi:nth-child(1) { background: rgba(38, 38, 36, .86); color: #fff; border-color: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--shadow-1); }
.kpis .kpi:nth-child(1) .l { color: rgba(255, 255, 255, .62); }
.kpis .kpi:nth-child(1) .kpi-ic { background: rgba(255, 255, 255, .12); color: #fff; }
.kpis .kpi:nth-child(2) { background: rgba(142, 207, 245, .82); border-color: rgba(255, 255, 255, .6); }
.kpis .kpi:nth-child(2) .l { color: var(--ink-2); }
.kpis .kpi:nth-child(2) .kpi-ic { background: rgba(255, 255, 255, .55); }
/* Pointing at a card pops it to the front - each card in its own way */
.kpis .kpi { transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease; }
.kpis .kpi:hover, .kpis .kpi:focus-visible { z-index: 3; }
/* 1 - lifts and grows */
.kpis .kpi:nth-child(1):hover { transform: translateY(-8px) scale(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 24px 42px rgba(6, 18, 28, .38); }
/* 2 - tilts towards you in 3D */
.kpis .kpi:nth-child(2):hover { transform: perspective(700px) rotateX(9deg) rotateY(-11deg) translateZ(34px) scale(1.04);
  box-shadow: 16px 24px 38px rgba(6, 18, 28, .26); }
/* 3 - grows inside a light-blue glow ring */
.kpis .kpi:nth-child(3):hover { transform: scale(1.07);
  box-shadow: var(--glass-shine), 0 0 0 2px var(--blue), 0 0 30px rgba(142, 207, 245, .9), 0 18px 34px rgba(6, 18, 28, .2); }
/* 4 - springs up with a bounce */
.kpis .kpi:nth-child(4) { transition: transform .55s cubic-bezier(.34, 1.9, .5, 1), box-shadow .3s ease; }
.kpis .kpi:nth-child(4):hover { transform: translateY(-10px) scale(1.06); box-shadow: var(--glass-shine), 0 22px 38px rgba(6, 18, 28, .26); }
/* 5 - swings forward while its icon spins */
.kpis .kpi:nth-child(5):hover { transform: translateY(-7px) rotate(-2.5deg) scale(1.06); box-shadow: var(--glass-shine), 0 22px 38px rgba(6, 18, 28, .26); }
.kpis .kpi:nth-child(5) .kpi-ic { transition: transform .6s cubic-bezier(.2, .8, .2, 1), background .3s; }
.kpis .kpi:nth-child(5):hover .kpi-ic { transform: rotate(360deg) scale(1.15); background: var(--blue); }
/* 6 - rises as a shine sweeps across it */
.kpis .kpi:nth-child(6)::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent); }
.kpis .kpi:nth-child(6):hover { transform: translateY(-7px) scale(1.06); box-shadow: var(--glass-shine), 0 22px 38px rgba(6, 18, 28, .26); }
.kpis .kpi:nth-child(6):hover::after { transition: transform .75s ease; transform: translateX(130%) skewX(-20deg); }

.dash-grid { display: grid; gap: 16px; }
.dash-grid > .panel { margin-bottom: 0; }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* charts: dark bars, light blue on hover */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #e6ebef; stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--ink); transition: fill .15s; }
.chart .bar:hover, .chart .hit:hover + .bar { fill: var(--blue); }
.chart .hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: 0 6px 16px rgba(0,0,0,.2); opacity: 0; transition: opacity .1s; }
.chart-tip.show { opacity: 1; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 140px) minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 400; }
.hbar .track { height: 12px; border-radius: 999px; background: #e9eef2; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; background: var(--ink); min-width: 4px; }
.hbar:first-child .fill { background: var(--blue); }
.hbar .val { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.feed { display: grid; gap: 2px; }
.feed-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 16px; }
.feed-item:hover { background: var(--head); }
.feed-item .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.feed-item .dot svg { width: 16px; height: 16px; }
.feed-item .t { min-width: 0; }
.feed-item .t b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .t small { color: var(--muted); }
.feed-item .q { font-weight: 600; font-variant-numeric: tabular-nums; }
.q-pos { color: var(--ok); } .q-neg { color: var(--bad); }

.meter { height: 8px; border-radius: 999px; background: #f3e4e1; overflow: hidden; margin-top: 4px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--bad); }

/* report picker tiles */
.tiles { display: grid; gap: 8px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 16px; color: var(--ink); text-decoration: none; font-weight: 500;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shine); position: relative; overflow: hidden; transition: transform .12s, border-color .15s, background .15s; }
.tile:hover { border-color: var(--ink); }

/* ==========================================================================
   Tables & data display
   ========================================================================== */
.table-wrap { overflow: auto; border: 1px solid var(--glass-edge); border-radius: 18px; background: rgba(255, 255, 255, .55); box-shadow: var(--glass-shine); }
.table-wrap.tall { max-height: 62vh; }
.table-wrap.mid { max-height: 400px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
/* table headers: solid black with white text (solid, so rows scrolling under a sticky header stay hidden) */
th { background: var(--ink); text-align: left; font-weight: 500; color: #fff; padding: 11px 12px; border-bottom: 1px solid var(--ink); position: sticky; top: 0; z-index: 1; white-space: nowrap; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .35); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--blue-bg); }
tr.selected td { background: #cdeafc !important; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.var-pos { color: var(--ok); font-weight: 600; }
td.var-neg { color: var(--bad); font-weight: 600; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.grey { background: #edf1f4; color: var(--ink-2); }

.notice { padding: 11px 16px; border-radius: 16px; background: rgba(255, 255, 255, .5); margin-bottom: 14px; border: 1px solid var(--glass-edge); box-shadow: var(--glass-shine); }
.notice.warn { background: var(--warn-bg); border-color: #f3dc8b; }
.notice.bad { background: var(--bad-bg); border-color: #f1c0ba; }
/* Receive Items: items matching the search, listed under the search box */
.item-hits { border: 1px solid var(--glass-edge); border-radius: 18px; background: rgba(255, 255, 255, .82); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); max-height: 280px; overflow-y: auto; box-shadow: var(--glass-shine), var(--shadow-1); }
.item-hit { display: block; width: 100%; text-align: left; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; color: inherit; cursor: pointer; position: relative; overflow: hidden; transition: background .12s, transform .12s; }
.item-hit:last-child { border-bottom: 0; }
.item-hit:hover, .item-hit.on { background: var(--blue-bg); color: var(--ink); }
.item-more { padding: 8px 16px; }
.pw-rules { font-size: 13px; padding: 10px 16px; border-radius: 16px; background: var(--head); border: 1px solid var(--line); }
.pw-rules ul { margin: 6px 0; padding: 0; list-style: none; }
.pw-rules li { padding: 2px 0 2px 22px; position: relative; }
.pw-rules li::before { content: '•'; position: absolute; left: 6px; color: var(--muted); }
.pw-rules li.ok { color: var(--ok); } .pw-rules li.ok::before { content: '✓'; left: 3px; color: var(--ok); font-weight: 700; }
.pw-rules li.bad { color: var(--bad); } .pw-rules li.bad::before { content: '✗'; left: 3px; color: var(--bad); font-weight: 700; }
.pw-rules .pw-note { color: var(--muted); }
.notice.ok { background: var(--ok-bg); border-color: #b5e2c6; }

.serial-box { border: 1px solid var(--line); border-radius: 16px; max-height: 230px; overflow: auto; background: #fff; }
.serial-box label { display: flex; flex-direction: row; align-items: center; gap: 9px; padding: 7px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); font-weight: 400; font-size: 13.5px; cursor: pointer; }
.serial-box label:hover { background: var(--blue-bg); }
.serial-box .empty { padding: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; }

.scan-log { max-height: 170px; overflow: auto; font-size: 12px; display: grid; gap: 4px; margin-top: 8px; }
.scan-log div { padding: 5px 10px; border-radius: 10px; }
.scan-log .found { background: var(--ok-bg); }
.scan-log .moved, .scan-log .unexpected { background: var(--warn-bg); }
.scan-log .unknown, .scan-log .error { background: var(--bad-bg); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 12.5px; font-weight: 400; }
dl.facts dd { margin: 0; }

/* ==========================================================================
   Modals & toasts
   ========================================================================== */
.modal-back { position: fixed; inset: 0; background: rgba(15, 22, 30, .35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: rgba(255, 255, 255, .8); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); border: 1px solid var(--glass-edge); border-radius: 28px; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(15, 22, 30, .25); animation: rise .2s ease-out; overflow: hidden; }
.modal.wide { max-width: 900px; }
.modal-head { padding: 18px 22px 12px; display: flex; align-items: center; color: var(--ink); background: transparent; border-bottom: 1px solid rgba(29, 29, 27, .06); }
.modal-head h2 { margin: 0; flex: 1; color: var(--ink); font-size: 20px; font-weight: 500; }
.modal-head .btn { color: var(--ink); }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid rgba(29, 29, 27, .06); display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; background: rgba(255, 255, 255, .45); }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 18px; border-radius: 18px; background: rgba(29, 29, 27, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .12); color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); animation: rise .2s ease-out; font-weight: 400; }
.toast.ok { background: rgba(30, 138, 90, .9); }
.toast.bad { background: rgba(194, 54, 47, .9); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sigpad { border: 2px dashed #cdd8e0; border-radius: 16px; background: #f7fbfe; touch-action: none; width: 100%; height: 190px; display: block; }
.cam video { width: 100%; border-radius: 16px; background: #000; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 520px) {
  .top-logo { display: none; }
}
@media (max-width: 1200px) {
  .dash-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) and (min-width: 769px) {
  /* tablets: icon-only sidebar */
  .shell { grid-template-columns: var(--sb-w-c) minmax(0, 1fr); }
  .sb-label, .sb-brand-text, .sb-title { display: none; }
  .sb-link, .sb-collapse { justify-content: center; }
  .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .sb-collapse { display: none; }
  .today { display: none; }
}
@media (max-width: 960px) {
  .split, .split-wide, .dash-grid, .dash-grid.three { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  /* phones: off-canvas sidebar */
  .shell, body.sb-collapsed .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .22s ease; background: #f5f8fa; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 22, 30, .35); z-index: 35; }
  body.sb-collapsed .sb-label, body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-title { display: revert; }
  body.sb-collapsed .sb-link { justify-content: flex-start; }
  .sb-collapse { display: none; }
  .icon-btn { display: grid; place-items: center; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .today, .uname, .caret { display: none; }
  .top-logo { height: 16px; }
  .app-footer { padding: 10px 12px; font-size: 12px; justify-content: center; text-align: center; }
  .foot-logo { height: 16px; }
  .user-chip { padding: 3px; }
  .sr-switch select { max-width: 52vw; }
  .tabbar { padding: 10px 12px 0; }
  .tabbar.overflow .tab-arrow { display: none; }
  .tab { min-width: 84px; max-width: 160px; }
  main { padding: 0 12px 20px; }
  .hero h1 { font-size: 32px; }
  .hero-actions { margin-left: 0; }
  .page-head h1 { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 108px; }
  .kpi .v { font-size: 34px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .panel { padding: 16px; }
}

/* devices without the blur effect: more solid glass, so text stays easy to read */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, .88); --glass-strong: rgba(255, 255, 255, .94); }
  .sidebar, .topbar { background: rgba(245, 248, 250, .96); }
  .modal { background: #fff; }
}
