@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: rgba(255, 255, 255, .84);
  --surface-solid: #fff;
  --surface-2: #efeee9;
  --surface-3: #e8e8e1;
  --ink: #17201d;
  --muted: #718079;
  --muted-2: #96a099;
  --line: rgba(34, 55, 47, .11);
  --line-strong: rgba(34, 55, 47, .18);
  --brand: #2d5b4b;
  --brand-2: #3e7561;
  --brand-soft: #e3eee8;
  --sand: #c8a96a;
  --sand-soft: #f5eddd;
  --danger: #a14f45;
  --danger-soft: #f6e8e5;
  --warning: #9a702b;
  --warning-soft: #f7edd8;
  --info: #4b6577;
  --shadow-sm: 0 1px 2px rgba(22, 33, 29, .04), 0 8px 28px rgba(31, 45, 39, .06);
  --shadow-lg: 0 24px 80px rgba(19, 28, 25, .18);
  --sidebar: #1f2c28;
  --sidebar-2: #263731;
  --sidebar-text: #f6f3ea;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131816;
  --surface: rgba(30, 38, 35, .88);
  --surface-solid: #1e2623;
  --surface-2: #242d2a;
  --surface-3: #2b3632;
  --ink: #edf1ed;
  --muted: #9da9a3;
  --muted-2: #75827c;
  --line: rgba(225, 237, 230, .09);
  --line-strong: rgba(225, 237, 230, .16);
  --brand: #75a994;
  --brand-2: #8ab6a4;
  --brand-soft: #263b33;
  --sand: #d2b77c;
  --sand-soft: #3a3325;
  --danger: #d5887e;
  --danger-soft: #3c2927;
  --warning: #d6ad63;
  --warning-soft: #3b3324;
  --info: #91afc1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .12), 0 12px 34px rgba(0, 0, 0, .18);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .42);
  --sidebar: #18211e;
  --sidebar-2: #202e29;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -5%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 2px;
}
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr);
  animation: fade-in .55s var(--ease);
}
.login-scene {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(36px, 6vw, 76px);
  color: #f4f1e8;
  background:
    linear-gradient(145deg, rgba(25, 37, 33, .05), rgba(8, 15, 12, .32)),
    #263b34;
  isolation: isolate;
}
.login-scene::before, .login-scene::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(240, 235, 219, .08);
  border-radius: 50%;
  z-index: -1;
}
.login-scene::before { width: 520px; height: 520px; right: -220px; top: -160px; }
.login-scene::after { width: 680px; height: 680px; left: -400px; bottom: -390px; }
.scene-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  right: 4%;
  top: 20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 181, 126, .18), transparent 68%);
  filter: blur(14px);
}
.brand-lockup { display: flex; align-items: center; gap: 18px; position: relative; z-index: 2; }
.brand-lockup h1 { margin: 4px 0 0; font-size: clamp(27px, 2.4vw, 42px); letter-spacing: -.045em; line-height: 1.05; }
.eyebrow { margin: 0; color: var(--sand); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 11px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: #cfb474;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px rgba(255,255,255,.45), 0 10px 28px rgba(6, 18, 13, .28);
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-mark--large { width: 58px; height: 58px; border-radius: 19px; }
.login-lead { max-width: 580px; margin: 42px 0 0; font-size: clamp(18px, 1.6vw, 25px); line-height: 1.5; color: rgba(255,255,255,.76); }
.rack-illustration {
  position: relative;
  width: min(620px, 94%);
  height: 330px;
  margin: auto auto 24px;
  perspective: 1000px;
  transform: rotateY(-4deg);
}
.rack-level {
  position: absolute;
  left: 7%;
  right: 7%;
  height: 88px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 26px 13px;
  border-bottom: 9px solid #9e8760;
  box-shadow: 0 8px 0 rgba(8, 17, 14, .22);
}
.rack-level--one { top: 16px; }
.rack-level--two { top: 122px; }
.rack-level--three { top: 228px; }
.rack-post { position: absolute; z-index: 2; top: 0; bottom: 4px; width: 14px; border-radius: 6px; background: linear-gradient(90deg, #7f6b4b, #c1a875 55%, #705d40); }
.rack-post--left { left: 5%; }
.rack-post--right { right: 5%; }
.box {
  display: block;
  width: 104px;
  height: 58px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(135deg, #c5a875, #9d8153);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: inset -12px -10px rgba(80, 59, 31, .12), 0 12px 22px rgba(7,15,12,.16);
}
.box::after { content: ""; display: block; width: 34px; height: 14px; margin: 18px auto; border-radius: 3px; background: rgba(248,240,214,.48); }
.box--wide { width: 144px; }
.box--small { width: 78px; height: 46px; }
.bag { display: block; width: 92px; height: 66px; border-radius: 42% 42% 13px 13px; background: linear-gradient(145deg, #d6ccb2, #a99b7c); box-shadow: 0 12px 22px rgba(7,15,12,.16); }
.bag--short { height: 52px; }
.scanner-beam {
  position: absolute;
  z-index: 5;
  left: 12%;
  right: 12%;
  top: 94px;
  height: 1px;
  background: rgba(224, 202, 142, .8);
  box-shadow: 0 0 12px #e9cd85, 0 0 32px rgba(233,205,133,.38);
  animation: scan 4.8s var(--ease) infinite;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 510px;
  padding: 17px 19px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(14px);
}
.login-feature > div { display: flex; flex-direction: column; gap: 3px; }
.login-feature small { color: rgba(255,255,255,.6); }
.feature-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #e5ce95; background: rgba(229,206,149,.12); }
.feature-icon svg { width: 19px; }
.login-panel { position: relative; display: grid; place-items: center; padding: 50px; }
.theme-switch--login { position: absolute !important; right: 32px; top: 28px; }
.login-card { width: min(410px, 100%); animation: rise .65s var(--ease) .08s both; }
.login-card h2 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 32px; }
.brand-mobile { display: none; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; font-weight: 700; font-size: 13px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 15px; width: 18px; color: var(--muted); pointer-events: none; }
.input-wrap input { padding-left: 45px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent); outline: none; }
textarea { min-height: 88px; resize: vertical; }
.form-error { min-height: 20px; color: var(--danger); margin: 10px 0; font-size: 13px; }
.secure-note { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 23px; }
.secure-note svg { width: 17px; flex: 0 0 auto; color: var(--brand); }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); overflow-x: hidden; transition: grid-template-columns .36s var(--ease); }
.app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.sidebar-collapsed .sidebar { transform: translateX(-105%); opacity: 0; pointer-events: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  min-width: 264px;
  display: flex;
  flex-direction: column;
  padding: 22px 15px 15px;
  color: var(--sidebar-text);
  background:
    radial-gradient(circle at 15% 5%, rgba(208,183,125,.09), transparent 26%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  box-shadow: 12px 0 40px rgba(19,31,26,.08);
  transition: transform .36s var(--ease), opacity .24s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy b { white-space: nowrap; font-size: 14px; }
.brand-copy small { margin-top: 2px; color: rgba(255,255,255,.48); font-size: 10px; }
.sidebar-close { display: inline-grid !important; margin-left: auto; color: rgba(255,255,255,.7) !important; }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { padding: 19px 14px 7px; color: rgba(255,255,255,.34); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  min-height: 45px;
  padding: 0 13px;
  border: 0;
  border-radius: 13px;
  color: rgba(255,255,255,.66);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  transition: color .2s, background .25s, transform .25s var(--ease);
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 #d2bb82; }
.nav-item svg { width: 19px; height: 19px; stroke-width: 1.8; }
.nav-item em {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  color: #2b2417;
  background: #d6bd82;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}
.nav-item em:empty { display: none; }
.sidebar-bottom { margin-top: auto; }
.ai-card {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(222,202,155,.18);
  border-radius: 16px;
  color: #f5f0e4;
  background: linear-gradient(135deg, rgba(211,187,132,.13), rgba(255,255,255,.045));
  cursor: pointer;
  text-align: left;
  transition: transform .25s var(--ease), background .25s;
}
.ai-card:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(211,187,132,.2), rgba(255,255,255,.07)); }
.ai-card > svg { width: 17px; opacity: .5; }
.ai-card__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #dcc58e; background: rgba(220,197,142,.1); }
.ai-card__icon svg { width: 19px; }
.ai-card span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.ai-card b { font-size: 11px; }
.ai-card small { color: rgba(255,255,255,.45); font-size: 9px; }
.user-card { display: grid; grid-template-columns: 36px 1fr 30px 30px; align-items: center; gap: 5px; padding: 17px 5px 3px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.user-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.user-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-card small { color: rgba(255,255,255,.42); font-size: 9px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #23362f; background: linear-gradient(145deg,#dac48e,#b99756); font-weight: 800; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s var(--ease);
}
.icon-button:hover { color: var(--ink); background: var(--surface-2); transform: translateY(-1px); }
.icon-button svg { width: 19px; height: 19px; }
.user-card .icon-button { color: rgba(255,255,255,.42); }
.user-card .icon-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.app-body { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
}
.menu-button { display: inline-grid; flex: 0 0 auto; }
.global-search { position: relative; width: min(430px, 42vw); display: flex; align-items: center; }
.global-search svg { position: absolute; left: 14px; width: 17px; color: var(--muted); }
.global-search input { padding: 10px 52px 10px 42px; border: 1px solid transparent; background: var(--surface-2); }
.global-search kbd { position: absolute; right: 10px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-solid); font-family: inherit; font-size: 9px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; color: var(--muted); font-size: 11px; }
.live-status > span { width: 7px; height: 7px; border-radius: 50%; background: #65977f; box-shadow: 0 0 0 4px rgba(101,151,127,.12); animation: live 2.4s ease-in-out infinite; }
.live-status.is-offline > span { background: var(--danger); box-shadow: none; animation: none; }
.theme-switch {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), color .2s;
}
.theme-switch:hover { transform: rotate(-8deg) scale(1.04); color: var(--ink); }
.theme-switch svg { width: 18px; }
.content { width: min(1540px, 100%); margin: 0 auto; padding: 30px 32px 60px; outline: 0; animation: content-in .4s var(--ease); }

/* Reusable UI */
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.page-head > div:first-child { flex: 1; }
.page-head h1 { margin: 5px 0 7px; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-solid);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s, background .22s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(25,42,35,.11); }
.button:active { transform: translateY(0) scale(.98); }
.button svg { width: 17px; height: 17px; }
.button--primary { color: #f7f5ee; border-color: transparent; background: linear-gradient(135deg, #315d4e, #23473b); box-shadow: 0 9px 22px rgba(42,82,68,.2); }
html[data-theme="dark"] .button--primary { color: #17251f; background: linear-gradient(135deg,#8ab7a4,#6c9b87); }
.button--sand { color: #342b1c; border-color: transparent; background: linear-gradient(135deg,#dec990,#c3a567); }
.button--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.button--danger { color: var(--danger); border-color: color-mix(in srgb,var(--danger) 22%,var(--line)); background: var(--danger-soft); }
.button--wide { width: 100%; min-height: 48px; }
.button--compact { min-height: 38px; padding: 0 14px; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; }
.card-head > div:first-child { flex: 1; }
.card-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 0 22px 22px; }
.card-link { border: 0; color: var(--brand); background: none; cursor: pointer; font-weight: 800; font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 99px; font-weight: 800; font-size: 10px; white-space: nowrap; }
.badge--good { color: var(--brand); background: var(--brand-soft); }
.badge--warn { color: var(--warning); background: var(--warning-soft); }
.badge--danger { color: var(--danger); background: var(--danger-soft); }
.badge--muted { color: var(--muted); background: var(--surface-2); }
.badge--sand { color: var(--warning); background: var(--sand-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 135px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: rise .45s var(--ease) both;
}
.stat-card:nth-child(2) { animation-delay: .04s; }
.stat-card:nth-child(3) { animation-delay: .08s; }
.stat-card:nth-child(4) { animation-delay: .12s; }
.stat-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -36px; top: -36px; border-radius: 50%; background: color-mix(in srgb,var(--brand) 7%,transparent); }
.stat-card__top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.stat-icon svg { width: 16px; }
.stat-card strong { display: block; margin: 16px 0 2px; font-size: 29px; letter-spacing: -.04em; line-height: 1; }
.stat-card small { color: var(--muted); font-size: 10px; }
.stat-card--alert .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-card--reserved .stat-icon { color: var(--warning); background: var(--warning-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,.7fr); gap: 18px; }
.dashboard-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  transition: transform .2s var(--ease), background .2s;
}
.alert-row:hover { transform: translateX(3px); background: var(--surface-3); }
.product-glyph { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); }
.product-glyph svg { width: 19px; }
.alert-row.is-critical .product-glyph { color: var(--danger); background: var(--danger-soft); }
.alert-copy { min-width: 0; }
.alert-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.alert-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.alert-value { text-align: right; }
.alert-value b { display: block; font-size: 13px; }
.alert-value small { color: var(--muted); font-size: 9px; }
.sales-pulse { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.pulse-item { padding: 15px 13px; border-radius: 14px; background: var(--surface-2); }
.pulse-item span { display: block; color: var(--muted); font-size: 10px; }
.pulse-item strong { display: block; margin-top: 8px; font-size: 22px; letter-spacing: -.04em; }
.top-list { display: flex; flex-direction: column; gap: 12px; }
.top-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; }
.top-row__name { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 11px; }
.bar { height: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.bar > span { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),var(--brand-2)); animation: grow-x .8s var(--ease) both; transform-origin: left; }
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.activity-icon.issue { color: var(--warning); background: var(--warning-soft); }
.activity-icon svg { width: 16px; }
.activity-copy { min-width: 0; }
.activity-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.activity-copy small { color: var(--muted); font-size: 9px; }
.activity-qty { text-align: right; font-weight: 800; font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: transform .22s var(--ease), background .22s;
}
.quick-action:hover { transform: translateY(-3px); background: var(--surface-3); }
.quick-action svg { width: 20px; color: var(--brand); }
.quick-action b { font-size: 11px; }

/* Tables */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar-search { position: relative; flex: 1; max-width: 390px; }
.toolbar-search svg { position: absolute; left: 13px; top: 50%; width: 17px; transform: translateY(-50%); color: var(--muted); }
.toolbar-search input { padding-left: 40px; background: var(--surface-solid); }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.segmented button.is-active { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; color: var(--muted); background: var(--surface-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { transition: background .2s; }
.data-table tbody tr:hover { background: color-mix(in srgb,var(--brand-soft) 35%,transparent); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.item-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.item-cell .product-glyph { width: 36px; height: 36px; flex: 0 0 auto; }
.item-cell b { display: block; font-size: 12px; }
.item-cell small { color: var(--muted); font-size: 10px; }
.stock-number { font-size: 14px; font-weight: 800; }
.stock-number small { color: var(--muted); font-weight: 500; font-size: 10px; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.empty-state { display: grid; place-items: center; min-height: 280px; padding: 40px; text-align: center; }
.empty-state__icon { width: 70px; height: 70px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 24px; color: var(--brand); background: var(--brand-soft); }
.empty-state__icon svg { width: 30px; }
.empty-state h3 { margin: 0 0 7px; font-size: 17px; }
.empty-state p { max-width: 370px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.reservation-card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.reservation-card { padding: 18px; }
.reservation-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reservation-card h3 { margin: 15px 0 4px; font-size: 14px; }
.reservation-card p { margin: 0; color: var(--muted); font-size: 11px; }
.reservation-card__qty { display: flex; align-items: baseline; gap: 5px; margin: 18px 0; }
.reservation-card__qty strong { font-size: 27px; letter-spacing: -.04em; }
.reservation-card__qty span { color: var(--muted); font-size: 11px; }
.reservation-meta { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.reservation-meta span { display: flex; align-items: center; gap: 7px; }
.reservation-meta svg { width: 14px; }
.reservation-card .button { width: 100%; margin-top: 12px; }
.report-hero { display: grid; grid-template-columns: 1fr 1.6fr; gap: 18px; margin-bottom: 18px; }
.report-total { position: relative; overflow: hidden; padding: 24px; min-height: 190px; color: #f4f1e8; background: linear-gradient(145deg,#2f4d42,#20382f); }
.report-total::after { content:""; position:absolute; width:220px; height:220px; border:1px solid rgba(255,255,255,.08); border-radius:50%; right:-80px; top:-100px; }
.report-total .eyebrow { color: #d9c28b; }
.report-total strong { display: block; margin: 34px 0 7px; font-size: 42px; letter-spacing: -.055em; }
.report-total p { margin: 0; color: rgba(255,255,255,.58); font-size: 11px; }
.chart-card { padding: 20px; }
.mini-chart { height: 130px; display: flex; align-items: flex-end; gap: 10px; padding-top: 22px; }
.mini-chart__bar { flex: 1; min-width: 18px; height: var(--h); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg,var(--brand-2),var(--brand)); transform-origin: bottom; animation: grow-y .7s var(--ease) both; }

/* Modal */
.modal-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(13,20,17,.5); backdrop-filter: blur(8px); animation: fade-in .25s; }
.modal {
  position: relative;
  width: min(780px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  animation: modal-in .35s var(--ease);
}
.modal--wide { width: min(980px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface-solid) 90%,transparent); backdrop-filter: blur(18px); }
.modal-head > div:first-of-type { flex: 1; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.modal-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); }
.modal-icon.issue { color: var(--warning); background: var(--warning-soft); }
.modal-icon svg { width: 19px; }
.modal-body { padding: 22px; }
.modal-foot { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb,var(--surface-solid) 92%,transparent); backdrop-filter: blur(18px); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid .field { margin: 0; }
.form-grid .field--full { grid-column: 1/-1; }
.lines-editor { margin-top: 22px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-label h3 { margin: 0; font-size: 13px; }
.document-line { display: grid; grid-template-columns: minmax(220px,1fr) 100px 92px 38px; gap: 8px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.document-line .field { margin: 0; }
.document-line .field > span:first-child { font-size: 9px; color: var(--muted); }
.parsed-line { grid-template-columns: minmax(210px,1.25fr) minmax(190px,1fr) 130px 78px 38px; }
.scanner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scanner-action {
  position: relative;
  min-height: 138px;
  display: grid;
  grid-template-columns: 52px 1fr 20px;
  align-items: center;
  gap: 13px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}
.scanner-action:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-sm); }
.scanner-action--camera { color: #f7fbf8; border-color: transparent; background: linear-gradient(135deg,var(--brand),color-mix(in srgb,var(--brand) 70%,#15241f)); }
.scanner-action input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.scanner-action__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; color: var(--brand); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.scanner-action--camera .scanner-action__icon { color: var(--brand); background: #f4f8f5; }
.scanner-action__icon svg { width: 24px; }
.scanner-action > span:nth-child(3) { min-width: 0; }
.scanner-action b { display: block; color: inherit; font-size: 15px; }
.scanner-action small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.scanner-action--camera small { color: rgba(255,255,255,.7); }
.scanner-action > svg { width: 18px; opacity: .62; }
.scan-selection { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 12px; padding: 11px 14px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); }
.scan-selection.has-files { color: var(--brand); border-style: solid; border-color: color-mix(in srgb,var(--brand) 40%,var(--line)); background: var(--brand-soft); }
.scan-selection > svg { width: 19px; flex: 0 0 auto; }
.scan-selection span { min-width: 0; }
.scan-selection b, .scan-selection small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-selection b { color: var(--ink); font-size: 12px; }
.scan-selection small { margin-top: 2px; font-size: 10px; }
.secure-note { display: flex; align-items: center; gap: 13px; padding: 15px; margin-top: 16px; border: 1px solid color-mix(in srgb,var(--brand) 25%,var(--line)); border-radius: 15px; background: var(--brand-soft); }
.secure-note > div { flex: 1; }
.secure-note b { display: block; font-size: 12px; }
.secure-note small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.scan-tips { display: flex; gap: 12px; padding: 14px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.scan-tips b { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--ink); }
.scan-tips svg { width: 16px; color: var(--sand); }
.duplicate-box { display: flex; align-items: center; gap: 12px; padding: 15px; margin-bottom: 14px; color: var(--danger); border: 1px solid color-mix(in srgb,var(--danger) 30%,var(--line)); border-radius: 15px; background: var(--danger-soft); }
.duplicate-box > svg { width: 22px; flex: 0 0 auto; }
.duplicate-box b, .duplicate-box span { display: block; }
.duplicate-box b { font-size: 12px; }
.duplicate-box span { margin-top: 3px; font-size: 10px; opacity: .8; }
.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 30px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface-2);
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 19px; color: var(--brand); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.upload-icon svg { width: 26px; }
.upload-zone b { display: block; color: var(--ink); font-size: 15px; }
.upload-zone small { display: block; margin-top: 6px; font-size: 11px; }
.parse-progress { display: flex; align-items: center; gap: 11px; padding: 14px; margin-top: 12px; border-radius: 14px; color: var(--muted); background: var(--surface-2); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
.parse-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.parse-summary > div { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.parse-summary span { display: block; color: var(--muted); font-size: 9px; }
.parse-summary b { display: block; margin-top: 5px; font-size: 12px; }
.warning-box { display: flex; gap: 10px; padding: 13px; margin: 10px 0; border-radius: 13px; color: var(--warning); background: var(--warning-soft); font-size: 11px; line-height: 1.5; }
.warning-box svg { width: 17px; flex: 0 0 auto; }
.ai-choice { display: flex; align-items: center; gap: 13px; padding: 15px; margin-top: 16px; border: 1px solid color-mix(in srgb,var(--sand) 30%,var(--line)); border-radius: 15px; background: var(--sand-soft); }
.ai-choice > div { flex: 1; }
.ai-choice b { display: block; font-size: 12px; }
.ai-choice small { color: var(--muted); font-size: 11px; }
.confidence { display: inline-flex; align-items: center; gap: 7px; }
.confidence__track { width: 60px; height: 5px; overflow: hidden; border-radius: 9px; background: var(--surface-3); }
.confidence__track span { display: block; height: 100%; width: var(--w); background: var(--brand); border-radius: inherit; }
.toast-stack { position: fixed; z-index: 110; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 280px; max-width: 390px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease); pointer-events: auto; }
.toast__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.toast.is-error .toast__icon { color: var(--danger); background: var(--danger-soft); }
.toast svg { width: 17px; }
.toast b { display: block; font-size: 11px; }
.toast small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.skeleton { position: relative; overflow: hidden; min-height: 90px; border-radius: var(--radius); background: var(--surface-2); }
.skeleton::after { content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent); animation: shimmer 1.4s infinite; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes content-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.975); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(22px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live { 50% { opacity: .48; transform: scale(.82); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes scan { 0%,100% { transform: translateY(-8px); opacity: .25; } 50% { transform: translateY(208px); opacity: 1; } }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-column--side { display: grid; grid-template-columns: 1fr 1fr; }
  .reservation-card-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-scene { display: none; }
  .brand-mobile { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; }
  .brand-mobile > div:last-child { display: flex; flex-direction: column; }
  .brand-mobile small { color: var(--muted); font-size: 9px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; min-width: 0; transform: translateX(-105%); width: min(285px,86vw); opacity: 1; pointer-events: auto; transition: transform .35s var(--ease); }
  .app-shell.sidebar-collapsed .sidebar { opacity: 1; pointer-events: auto; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: inline-grid !important; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(8,14,12,.36); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sidebar.is-open + .app-body + .sidebar-scrim, .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 18px; }
  .global-search { width: auto; flex: 1; }
  .live-status, .global-search kbd { display: none; }
  .content { padding: 24px 18px 50px; }
  .report-hero { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-panel { padding: 28px 22px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .page-actions .button { flex: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 122px; padding: 16px; }
  .stat-card strong { font-size: 22px; }
  .dashboard-column--side { display: flex; }
  .reservation-card-grid { grid-template-columns: 1fr; }
  .top-actions .button span { display: none; }
  .top-actions .button { width: 38px; padding: 0; }
  .global-search input { font-size: 13px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-search { max-width: none; }
  .table-card { margin: 0 -18px; border-left: 0; border-right: 0; border-radius: 0; overflow-x: auto; }
  .data-table { min-width: 760px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--full { grid-column: auto; }
  .modal-layer { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .modal-body { padding: 18px; }
  .document-line { grid-template-columns: 1fr 78px 34px; }
  .document-line:not(.parsed-line) .field:nth-child(3) { display: none; }
  .parsed-line { position: relative; grid-template-columns: 1fr 82px; gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); }
  .parsed-line .parsed-name, .parsed-line .parsed-item { grid-column: 1/-1; }
  .parsed-line .parsed-quantity { grid-column: 1; }
  .parsed-line > .icon-button { position: absolute; top: 8px; right: 8px; }
  .scanner-actions { grid-template-columns: 1fr; }
  .scanner-action { min-height: 104px; padding: 16px; }
  .scan-tips { flex-direction: column; gap: 5px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .button--primary { flex: 1 1 100%; order: -1; }
  .sales-pulse { grid-template-columns: 1fr; }
  .parse-summary { grid-template-columns: 1fr; }
  .ai-choice { align-items: flex-start; flex-direction: column; }
  .toast-stack { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}

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