/* ==========================================================================
   钥管家 ERP — visual system
   ========================================================================== */

:root {
  --ui-scale: 1;
  --bg: #f4f6f4;
  --bg-soft: #f8faf8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #14201d;
  --ink-soft: #33413d;
  --muted: #74827e;
  --muted-light: #9aa6a2;
  --line: #e5ebe7;
  --line-strong: #d8e1dc;
  --primary: #0f766e;
  --primary-dark: #0b5d56;
  --primary-deep: #0b3b36;
  --primary-soft: #e7f5f2;
  --teal-100: #d7f1ec;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --amber: #b45309;
  --amber-soft: #fff5e6;
  --danger: #c2413b;
  --danger-soft: #fff1f0;
  --rose: #be123c;
  --success: #15803d;
  --success-soft: #eefbf3;
  --purple: #7c3aed;
  --purple-soft: #f3edff;
  --sidebar: #081b18;
  --sidebar-soft: #0d2824;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 27, 0.04);
  --shadow-card: 0 1px 2px rgba(15, 31, 27, 0.03), 0 14px 40px -30px rgba(15, 31, 27, 0.2);
  --shadow-pop: 0 24px 70px -22px rgba(5, 25, 21, 0.35);
  --font: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  zoom: var(--ui-scale, 1);
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.055), transparent 34rem),
    radial-gradient(circle at 0% 100%, rgba(180, 83, 9, 0.04), transparent 32rem),
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
em { font-style: normal; }
::selection { background: rgba(15, 118, 110, 0.16); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd8d3; border: 2px solid transparent; border-radius: 999px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aabbb4; border: 2px solid transparent; background-clip: content-box; }

.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.muted-cell { color: var(--muted); white-space: nowrap; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.align-right { text-align: right !important; }
.align-center { text-align: center !important; }
.nowrap { white-space: nowrap; }

.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
  stroke-width: 1.8;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Boot screen
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #071714;
  color: #e7f5f2;
  transition: opacity 0.25s ease;
}

.boot-screen.is-hidden { opacity: 0; pointer-events: none; }
.boot-logo { width: 64px; height: 64px; border-radius: 19px; overflow: hidden; box-shadow: 0 16px 40px rgba(15, 118, 110, 0.45); }
.boot-logo img { width: 100%; height: 100%; }
.boot-screen strong { font-size: 21px; letter-spacing: 0.16em; margin-top: 8px; }
.boot-screen span { color: #81a8a0; font-size: 12px; letter-spacing: 0.08em; }
.boot-spinner {
  width: 22px;
  height: 22px;
  margin-top: 18px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Buttons / form primitives
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .filter-toggle:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.55);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.55; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, #13847b 0%, var(--primary) 55%, #0e6b64 100%);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(15, 118, 110, 0.8), inset 0 1px rgba(255, 255, 255, 0.16);
}
.btn-primary:hover { background: linear-gradient(180deg, #15958b 0%, #0f7d74 55%, #0d665f 100%); box-shadow: 0 12px 22px -12px rgba(15, 118, 110, 0.9); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #b9c8c1; background: var(--bg-soft); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }
.btn-soft:hover { background: #d9f0eb; }
.btn-light { background: #fff; color: var(--primary-deep); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.btn-light:hover { background: #f4fffc; }
.btn-hero-ghost { border-color: rgba(255, 255, 255, 0.24); color: #e5f5f1; background: rgba(255, 255, 255, 0.055); }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.38); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 8px 18px -12px rgba(194, 65, 59, 0.7); }
.btn-danger:hover { background: #a9342f; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #f1c6c3; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: #e7a9a5; }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; font-size: 14.5px; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { min-height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; gap: 4px; }
.btn.is-loading { pointer-events: none; opacity: 0.82; }
.btn.is-loading .icon { animation: spin 0.85s linear infinite; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #6b7a75;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: rgba(15, 118, 110, 0.07); color: var(--primary-dark); }
.icon-btn:disabled { opacity: 0.35; }
.icon-btn.danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.text-button:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

.input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input::placeholder { color: #aab5b1; }
.input:hover { border-color: #c4d1cb; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1); }
.input:disabled { background: var(--surface-muted); color: var(--muted); }
.input.has-icon { padding-left: 42px; }
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2374827e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.textarea { height: auto; min-height: 80px; padding: 11px 13px; resize: vertical; line-height: 1.65; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 5px; color: #5b6964; font-size: 12px; font-weight: 600; }
.field-label em { color: var(--danger); }
.field-hint { display: flex; align-items: flex-start; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.field-hint .icon { margin-top: 1px; }
.readonly-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 13px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.form-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.money-input { position: relative; display: block; }
.money-input > span { position: absolute; left: 13px; top: 50%; z-index: 1; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; pointer-events: none; }
.money-input .input { padding-left: 29px; font-variant-numeric: tabular-nums; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.check-field input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-field input:disabled { opacity: 0.5; }

.form-error.is-hidden { display: none; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

#login-root { min-height: 100vh; }
.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(440px, 0.87fr);
  min-height: 100vh;
  background: #f2f5f2;
}
.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 40px 54px 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 12%, rgba(20, 184, 166, 0.24), transparent 28rem),
    radial-gradient(circle at 15% 82%, rgba(217, 119, 6, 0.11), transparent 24rem),
    linear-gradient(145deg, #071a17 0%, #0b2722 56%, #07201c 100%);
  color: #f2faf7;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 35% 45%, #000, transparent 80%);
  pointer-events: none;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  right: -180px;
  bottom: -220px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 150px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-mark { width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; border-radius: 15px; box-shadow: 0 12px 28px rgba(2, 20, 17, 0.35); }
.login-brand .brand-mark img { width: 100%; height: 100%; }
.login-brand strong { display: block; font-size: 19px; letter-spacing: 0.14em; }
.login-brand small { display: block; margin-top: 2px; color: #89ada4; font-size: 10.5px; letter-spacing: 0.12em; }
.visual-copy { position: relative; z-index: 1; width: min(590px, 96%); margin: auto 0; padding: 52px 0 34px; }
.visual-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #b8d8d0;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.visual-copy h1 {
  margin-top: 22px;
  font-size: clamp(36px, 3.45vw, 53px);
  font-weight: 750;
  line-height: 1.24;
  letter-spacing: -0.035em;
  color: #f6fcfa;
}
.visual-copy > p { max-width: 500px; margin-top: 17px; color: #9ebdb5; font-size: 14px; line-height: 1.9; }
.visual-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 34px; }
.visual-feature {
  display: flex;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(8px);
}
.visual-feature > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.14);
  color: #6ee7d6;
}
.visual-feature strong { display: block; font-size: 12.5px; color: #edf9f6; }
.visual-feature small { display: block; margin-top: 3px; color: #809f97; font-size: 10.5px; line-height: 1.5; }
.visual-preview {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  margin-top: auto;
  padding: 17px 19px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; color: #afcdc5; font-size: 10.5px; letter-spacing: 0.08em; }
.preview-live { display: inline-flex; align-items: center; gap: 5px; color: #7ee0cf; }
.preview-live i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.preview-stats { display: flex; align-items: flex-end; gap: 48px; margin-top: 8px; }
.preview-stats small { display: block; color: #799a91; font-size: 10px; }
.preview-stats strong { display: block; margin-top: 3px; color: #f2fbf8; font-family: var(--mono); font-size: 19px; letter-spacing: -0.04em; }
.preview-stats strong.warm { color: #f6c66b; }
.preview-bars { display: flex; align-items: flex-end; gap: 7px; height: 42px; margin-top: 13px; }
.preview-bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, rgba(45, 212, 191, 0.75), rgba(45, 212, 191, 0.1)); }
.preview-bars i:nth-child(4), .preview-bars i:nth-child(6) { background: linear-gradient(180deg, rgba(251, 191, 36, 0.8), rgba(251, 191, 36, 0.08)); }
.visual-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; color: #68887f; font-size: 10.5px; letter-spacing: 0.04em; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 28px;
  background:
    radial-gradient(circle at 10% 4%, rgba(15, 118, 110, 0.055), transparent 18rem),
    #f7f9f7;
}
.login-card { width: min(430px, 100%); }
.login-mobile-brand { display: none; }
.login-card > h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 750; }
.login-sub { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-alert {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding: 10px 12px;
  border: 1px solid #f0d8c6;
  border-radius: 9px;
  background: #fff9f3;
  color: #9a5a21;
  font-size: 12px;
}
.login-alert.is-hidden { display: none; }
.login-form { display: grid; gap: 16px; margin-top: 23px; }
.login-form .btn { margin-top: 4px; }
.input-wrap { position: relative; display: block; }
.input-wrap > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #93a29d; pointer-events: none; }
.login-card .input { height: 47px; background: #fff; }
.login-tip { display: flex; align-items: flex-start; gap: 5px; margin-top: 20px; color: #98a49f; font-size: 10.5px; line-height: 1.5; }
.demo-box { margin-top: 23px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.65); }
.demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.demo-head span { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; }
.demo-head small { color: var(--muted-light); font-size: 10px; }
.demo-chips { display: grid; gap: 5px; }
.demo-chip {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.demo-chip:hover { background: #f1f8f5; border-color: #e0ebe6; }
.demo-chip > span { display: inline-flex; color: var(--primary); }
.demo-chip strong { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.demo-chip small { color: #9aa8a3; font-family: var(--mono); font-size: 9.5px; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  width: 252px;
  padding: 22px 14px 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% -5%, rgba(20, 184, 166, 0.22), transparent 20rem),
    radial-gradient(circle at 100% 100%, rgba(217, 119, 6, 0.06), transparent 18rem),
    linear-gradient(180deg, #0a211d 0%, #071815 70%, #061410 100%);
  color: #b8ccc6;
  transition: transform 0.24s ease;
}
.sidebar::after {
  content: "";
  position: absolute;
  right: -70px;
  top: 150px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.02), 0 0 0 94px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 5px 9px 22px; }
.brand-mark { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; }
.brand-mark img { width: 100%; height: 100%; }
.brand-copy strong { display: block; color: #f2fbf8; font-size: 17px; font-weight: 750; letter-spacing: 0.15em; line-height: 1.2; }
.brand-copy small { display: block; margin-top: 3px; color: #6d9188; font-size: 9.5px; letter-spacing: 0.08em; }
.sidebar-scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 2px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); background-clip: content-box; }
.main-nav { display: flex; flex-direction: column; gap: 19px; }
.nav-group-title { margin: 0 0 7px; padding: 0 12px; color: #57776f; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 10px;
  color: #9eb8b1;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: #e0f2ed; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.055));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.06);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.55);
}
.nav-icon { display: inline-flex; color: #6f948a; }
.nav-item.is-active .nav-icon { color: #5eead4; }
.nav-label { flex: 1; }
.nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.sidebar-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  width: calc(100% - 4px);
  margin-top: 22px;
  padding: 11px 12px;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.055);
  color: #e9c983;
  text-align: left;
}
.sidebar-alert:hover { background: rgba(251, 191, 36, 0.09); }
.sidebar-alert-icon { display: inline-flex; color: #f6c453; }
.sidebar-alert > span:nth-child(2) { flex: 1; min-width: 0; }
.sidebar-alert strong { display: block; font-size: 11.5px; font-weight: 600; }
.sidebar-alert small { display: block; margin-top: 2px; color: #a68b55; font-size: 9.5px; }
.sidebar-alert small em { color: #f6c453; font-style: normal; }
.sidebar-install { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 9px 12px 0; padding: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(255,255,255,.07); color: #e8f3ef; font-size: 9px; cursor: pointer; }
.sidebar-install:hover { background: rgba(255,255,255,.13); }
.sidebar-install.is-hidden { display: none; }
.sidebar-note { display: flex; align-items: flex-start; gap: 8px; margin: 16px 9px 0; color: #58776f; }
.status-dot { width: 6px; height: 6px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1); }
.sidebar-note strong { display: block; color: #78948d; font-size: 9.5px; font-weight: 500; }
.sidebar-note small { display: block; margin-top: 2px; color: #4d6b64; font-size: 9px; }
.sidebar-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
  padding: 12px 6px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}
.side-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.side-user strong { display: block; color: #dcebe6; font-size: 11.5px; font-weight: 600; }
.side-user small { display: block; margin-top: 1px; color: #63847b; font-size: 9.5px; }
.side-logout { color: #6e9087; }
.side-logout:hover { background: rgba(255, 255, 255, 0.07); color: #fecaca; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #2dd4bf, #0f766e);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.avatar-side { width: 31px; height: 31px; background: linear-gradient(145deg, #28534c, #173b34); color: #8fe3d3; border: 1px solid rgba(94, 234, 212, 0.16); }
.avatar-top { width: 32px; height: 32px; font-size: 12px; }

.app-main { width: calc(100% - 252px); min-height: 100vh; margin-left: 252px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 68px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(220, 229, 224, 0.76);
  background: rgba(246, 248, 246, 0.82);
  backdrop-filter: blur(18px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #8a9894; font-size: 11.5px; }
.breadcrumb strong { color: var(--ink-soft); font-weight: 600; }
.crumb-sep { color: #c1ccc8; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.font-scale-btn { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.font-scale-btn:hover { border-color: var(--primary); color: var(--primary); }
.today-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; color: #76857f; font-size: 10.5px; white-space: nowrap; }
.alert-button { position: relative; background: rgba(255, 255, 255, 0.66); border-color: var(--line); }
.alert-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #f6f8f6;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}
.topbar-sale { min-height: 36px; border-radius: 9px; padding: 0 13px; font-size: 12px; }
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: 5px; padding-left: 12px; border-left: 1px solid var(--line); }
.topbar-user strong { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.topbar-user small { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.mobile-menu { display: none; }
.sidebar-backdrop { display: none; }

.content { width: 100%; max-width: 1520px; margin: 0 auto; padding: 28px 32px 64px; }
.page-shell { animation: fadeUp 0.35s ease both; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.page-heading h1 { font-size: 27px; font-weight: 750; line-height: 1.25; letter-spacing: -0.035em; color: var(--ink); }
.page-heading p { max-width: 720px; margin-top: 7px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; padding-bottom: 2px; }
.draft-chip { display: inline-flex; align-items: center; gap: 6px; color: #8a9893; font-size: 10.5px; white-space: nowrap; }
.draft-chip i { width: 5px; height: 5px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }

/* --------------------------------------------------------------------------
   Cards & tables
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head.compact { margin-bottom: 11px; }
.card-head h2 { font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }
.card-kicker { display: block; margin-bottom: 4px; color: #94a29e; font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; }
.card-subtitle { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.card-head-note { align-self: center; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.card-foot-link { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; justify-content: space-between; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.count-pill.is-warning { border-color: #f0dfc3; background: var(--amber-soft); color: var(--amber); }
.count-pill.small { padding: 2px 7px; font-size: 9.5px; }

.table-card { padding: 0; overflow: hidden; }
.table-card .table-scroll { padding: 4px 8px 8px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 12px; }
.data-table thead th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: #8a9894;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}
.data-table tbody td { padding: 12px; border-bottom: 1px solid #f0f4f1; color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.13s ease; }
.data-table tbody tr[data-open-sale], .data-table tbody tr[data-customer-row] { cursor: pointer; }
.data-table tbody tr:hover { background: #f8fbf9; }
.data-table tfoot td { padding: 13px 12px; border-top: 1px solid var(--line); background: #fafcfb; font-size: 12px; }
.data-table tfoot strong { color: var(--ink); }
.data-table .row-cancelled { opacity: 0.62; }
.data-table .row-inactive { opacity: 0.64; }
.order-no { color: var(--ink); font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.cell-main { display: block; color: var(--ink-soft); font-weight: 500; }
.cell-sub { display: block; margin-top: 2px; color: #96a39f; font-size: 10px; line-height: 1.45; }
.money-cell { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.paid-cell { color: #3f7f61; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-cell { color: #8b9894; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-cell.has-balance { color: var(--danger); font-weight: 700; }
.person-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mini-avatar { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 50%; background: #e2f2ee; color: #24675b; font-size: 9.5px; font-weight: 700; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.badge-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: #27744a; }
.badge-warning { background: var(--amber-soft); color: #a05b11; }
.badge-danger { background: var(--danger-soft); color: #b13d37; }
.badge-muted { background: #f1f4f2; color: #7e8d88; }
.badge-neutral { background: #f1f4f2; color: #687973; }
.badge-purple { background: var(--purple-soft); color: #6d3bc7; }
.badge-info { background: #eaf2ff; color: #2563eb; }
.badge-teal { background: #e7f7f3; color: #0f766e; }
.shelf-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid #e8eeeb;
  border-radius: 5px;
  background: #f8faf9;
  color: #60716b;
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}
.customer-name-cell { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.customer-name-cell strong { font-size: 12px; font-weight: 600; color: var(--ink); }
.contact-line { display: inline-flex; align-items: center; gap: 4px; color: #5f716b; white-space: nowrap; }
.row-action-group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-action-group .icon-btn { width: 30px; height: 30px; }

.skeleton { display: block; border-radius: 5px; background: linear-gradient(90deg, #eef2ef 25%, #f6f8f6 37%, #eef2ef 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton-text { height: 11px; }
.skeleton-block { width: 100%; height: 100px; }
.skeleton-stat strong { color: #c7d2ce !important; }
.skeleton-row td { padding-top: 15px; padding-bottom: 15px; }
.table-loading, .table-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.table-loading .icon { animation: spin 1s linear infinite; color: var(--primary); }
.table-error { flex-direction: column; gap: 4px; color: var(--muted); }
.table-error strong { color: var(--ink-soft); font-size: 13px; }
.table-error p { color: var(--muted); font-size: 11.5px; }
.table-error .btn { margin-top: 8px; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 230px;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}
.empty-icon { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: 5px; border-radius: 17px; background: #f1f6f3; color: #96aaa3; }
.empty-state strong { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.empty-state p { max-width: 370px; color: var(--muted); font-size: 11.5px; }
.empty-state .btn { margin-top: 9px; }
.empty-inline { display: flex; align-items: center; gap: 8px; padding: 20px 4px; color: var(--muted); font-size: 11.5px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 6px; border-top: 1px solid var(--line); }
.pagination-info { color: var(--muted); font-size: 10.5px; }
.pagination-buttons { display: flex; align-items: center; gap: 4px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-soft); font-size: 10.5px; }
.page-btn:hover { border-color: #c4d3cc; background: #f8fbf9; }
.page-btn.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; }
.page-ellipsis { color: var(--muted); font-size: 10px; }
.table-footnote { margin-top: 11px; color: var(--muted-light); font-size: 10.5px; }

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.filter-card { padding: 18px 20px 14px; }
.filter-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; max-width: 520px; }
.search-field > .icon { position: absolute; left: 13px; color: #93a19d; pointer-events: none; }
.search-field input { width: 100%; height: 39px; padding: 0 13px 0 39px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 12.5px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.search-field input::placeholder { color: #a4b0ac; }
.search-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.09); }
.date-presets { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.date-presets button { padding: 5px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10.5px; }
.date-presets button:hover { color: var(--ink-soft); background: #fff; }
.date-presets button.is-active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(15, 31, 27, 0.09); }
.filter-grid { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.field-inline { flex: 0 1 170px; }
.field-inline .input { height: 36px; font-size: 11.5px; }
.filter-grid .reset-filters { align-self: flex-end; }
.filter-summary { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f4f1; color: var(--muted); font-size: 10.5px; }
.filter-summary span { display: inline-flex; align-items: center; gap: 5px; }
.filter-summary strong { color: var(--ink-soft); font-weight: 600; }
.meta-separator { width: 1px; height: 10px; background: var(--line-strong); }
.filter-right { display: flex; align-items: center; gap: 8px; }
.filter-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.filter-toggle:hover { color: var(--ink-soft); border-color: #c4d2cc; }
.filter-toggle.is-active { border-color: #edcfa7; background: var(--amber-soft); color: #a05b11; }
.filter-meta { align-self: center; margin-left: auto; color: var(--muted-light); font-size: 10.5px; }
.products-filter .filter-main .filter-right { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dashboard-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 36px;
  min-height: 224px;
  padding: 30px 34px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 84% 12%, rgba(45, 212, 191, 0.24), transparent 19rem),
    radial-gradient(circle at 95% 100%, rgba(251, 191, 36, 0.1), transparent 17rem),
    linear-gradient(115deg, #0a2722 0%, #0b3a33 54%, #092922 100%);
  color: #f3fbf9;
  box-shadow: 0 22px 50px -35px rgba(4, 35, 29, 0.65);
}
.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(circle at 25% 50%, #000, transparent 75%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; max-width: 650px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: #a6cbc3; font-size: 10.5px; letter-spacing: 0.035em; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.hero-copy h1 { margin-top: 14px; font-size: clamp(28px, 2.4vw, 37px); font-weight: 750; line-height: 1.24; letter-spacing: -0.035em; }
.hero-copy > p { max-width: 590px; margin-top: 9px; color: #a0c0b9; font-size: 12.5px; line-height: 1.8; }
.hero-copy > p strong { color: #f7d28a; font-weight: 700; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; }
.hero-actions .btn { min-height: 38px; padding: 0 14px; font-size: 12px; border-radius: 9px; }
.hero-side { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; flex: 0 0 auto; }
.hero-today { width: 208px; padding: 16px 17px; border: 1px solid rgba(255, 255, 255, 0.11); border-radius: 14px; background: rgba(255, 255, 255, 0.055); backdrop-filter: blur(13px); }
.hero-today > span { color: #a7c8c1; font-size: 10px; letter-spacing: 0.04em; }
.hero-today > strong { display: block; margin-top: 4px; color: #fff7e6; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.045em; }
.hero-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.hero-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2dd4bf, #fbbf24); }
.hero-today small { display: block; margin-top: 8px; color: #83a59d; font-size: 9.5px; line-height: 1.55; }
.hero-key-art { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.12); transform: rotate(-12deg); }
.hero-key-art .icon { width: 80px; height: 80px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.stat-card { position: relative; min-width: 0; padding: 17px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px; background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.18), transparent); opacity: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; }
.tone-teal .stat-icon { background: #e7f7f3; color: #0b756d; }
.tone-blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.tone-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.tone-rose .stat-icon { background: var(--danger-soft); color: var(--rose); }
.stat-arrow { display: inline-flex; color: #c0ccc7; }
.stat-label { margin-top: 13px; color: var(--muted); font-size: 10.5px; }
.stat-value { display: block; margin-top: 2px; font-family: var(--mono); font-size: clamp(21px, 1.8vw, 27px); font-weight: 600; line-height: 1.28; letter-spacing: -0.055em; color: var(--ink); white-space: nowrap; }
.stat-detail { margin-top: 5px; color: #97a39f; font-size: 9.5px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--primary); font-size: 9.5px; font-weight: 600; }
.stat-link:hover { text-decoration: underline; }

.dashboard-grid { display: grid; gap: 16px; margin-top: 16px; }
.dashboard-grid-upper { grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr); }
.dashboard-grid-lower { grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr); }
.chart-card { min-height: 376px; }
.chart-card .card-head { margin-bottom: 4px; }
.chart-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.chart-summary span { color: var(--muted); font-size: 9.5px; }
.chart-summary strong { color: var(--ink); font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -0.04em; }
.chart-container { width: 100%; min-height: 250px; padding-top: 4px; }
.chart-container canvas { display: block; width: 100%; }
.low-stock-card { display: flex; flex-direction: column; min-height: 376px; }
.low-stock-list { display: flex; flex-direction: column; flex: 1; }
.low-stock-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid #f2f5f3; background: none; text-align: left; }
.low-stock-item:last-child { border-bottom: 0; }
.low-stock-item:hover .low-stock-copy strong { color: var(--primary); }
.low-stock-thumb { display: inline-flex; width: 36px; height: 36px; flex: 0 0 auto; overflow: hidden; border-radius: 9px; }
.low-stock-thumb img { width: 100%; height: 100%; object-fit: cover; }
.low-stock-copy { flex: 1; min-width: 0; }
.low-stock-copy strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 11.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; transition: color 0.15s ease; }
.low-stock-copy small { display: block; margin-top: 2px; overflow: hidden; color: #99a5a1; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.low-stock-number { display: flex; align-items: baseline; gap: 2px; flex: 0 0 auto; color: #aa5e12; }
.low-stock-number strong { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.low-stock-number small { color: #b09d81; font-size: 8.5px; }
.low-stock-number.is-out strong { color: var(--danger); }
.low-stock-clear { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #88a196; }
.low-stock-clear strong { color: var(--ink-soft); font-size: 12px; }
.low-stock-clear p { font-size: 10.5px; }
.low-stock-clear .icon { color: #4ab58c; }
.recent-card { min-width: 0; }
.dashboard-orders-table { min-width: 610px; }
.team-card { min-width: 0; }
.rank-list { display: flex; flex-direction: column; gap: 3px; }
.rank-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f3f6f4; }
.rank-row:last-child { border-bottom: 0; }
.rank-index { width: 19px; flex: 0 0 auto; color: #b0bbb7; font-family: var(--mono); font-size: 9.5px; font-weight: 600; }
.rank-index.is-top { color: var(--primary); }
.rank-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: #e9f4f0; color: #24675c; font-size: 10px; font-weight: 700; }
.rank-copy { flex: 1; min-width: 0; }
.rank-copy strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.rank-copy > small { display: block; margin-top: 3px; color: #9ba7a3; font-size: 8.5px; }
.rank-bar { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #f0f4f2; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #49b9a8, #0f766e); }
.rank-value { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: 0 0 auto; }
.rank-value strong { color: var(--ink-soft); font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: -0.03em; }
.rank-value small { color: #9aa7a2; font-size: 8px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Quick sale
   -------------------------------------------------------------------------- */

.sale-layout { display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 17px; align-items: start; }
.sale-main { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.sale-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.customer-card .card-head, .items-card .card-head, .notes-card .card-head { margin-bottom: 13px; }
.sale-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f4f2; }
.selected-customer { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border: 1px solid #dfebe6; border-radius: 12px; background: linear-gradient(135deg, #f6fbf9, #fbfdfc); }
.selected-customer-avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: #dff2ed; color: #1b6c60; font-size: 15px; font-weight: 700; }
.selected-customer-main { flex: 1; min-width: 0; }
.selected-customer-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selected-customer-name strong { font-size: 14px; font-weight: 650; }
.selected-customer-name span { color: var(--muted); font-size: 10.5px; }
.customer-contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: #75847e; font-size: 10px; }
.customer-contact-row span { display: inline-flex; align-items: center; gap: 4px; }
.selected-customer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.customer-debt { color: var(--danger); font-size: 10px; font-weight: 600; }
.customer-search-block .field-hint { margin-top: 7px; }
.combo { position: relative; z-index: 20; }
.combo-input-wrap { position: relative; display: flex; align-items: center; }
.combo-input-wrap > .icon { position: absolute; left: 13px; z-index: 1; color: #8fa09a; pointer-events: none; }
.combo-input-wrap .input { padding-right: 84px; height: 44px; }
.combo-shortcut { position: absolute; right: 10px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fafcfb; color: #9aa7a2; font-size: 8.5px; pointer-events: none; }
.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: 336px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-pop);
}
.combo-menu.is-open { display: block; animation: popIn 0.14s ease both; }
.combo-loading, .combo-empty { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 64px; padding: 14px; color: var(--muted); font-size: 11px; text-align: center; }
.combo-loading .icon { animation: spin 1s linear infinite; color: var(--primary); }
.combo-empty { flex-direction: column; }
.combo-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.combo-option:hover, .combo-option:focus { background: #f3f9f6; outline: none; }
.combo-option:disabled { opacity: 0.5; }
.combo-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: #e8f3ef; color: #2e6f64; font-size: 11px; font-weight: 700; }
.combo-avatar.large { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }
.combo-copy { flex: 1; min-width: 0; }
.combo-copy strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 11.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.combo-copy small { display: block; margin-top: 2px; overflow: hidden; color: #95a29d; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.combo-meta { flex: 0 0 auto; color: #9aa7a3; font-size: 9.5px; white-space: nowrap; }
.combo-meta.has-debt { color: var(--danger); font-weight: 600; }
.product-menu { max-height: 380px; }
.product-option { padding: 8px 9px; }
.option-photo { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 8px; background: #f4f7f5; }
.option-photo img { width: 100%; height: 100%; object-fit: cover; }
.option-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.option-price strong { color: var(--ink); font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.option-price span { color: #83928d; font-size: 9px; }
.option-price .low-stock-text { color: var(--amber); }
.option-price .out-stock { color: var(--danger); }
.product-picker { margin-bottom: 13px; }
.sale-items-scroll { border: 1px solid #eef2f0; border-radius: 11px; }
.sale-items-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 11.5px; }
.sale-items-table thead th { padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafcfb; color: #8b9994; font-size: 9.5px; font-weight: 600; text-align: left; white-space: nowrap; }
.sale-items-table tbody td { padding: 11px 10px; border-bottom: 1px solid #f2f5f3; vertical-align: middle; }
.sale-items-table tbody tr:last-child td { border-bottom: 0; }
.sale-items-table tbody tr.has-stock-error { background: #fff9f8; }
.item-product { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.item-thumb { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 8px; background: #f5f8f6; cursor: zoom-in; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-product-copy { min-width: 0; }
.item-product-copy strong { display: block; color: var(--ink-soft); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.item-product-copy small { display: block; margin-top: 2px; color: #99a6a1; font-size: 8.5px; white-space: nowrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: #fff; }
.qty-stepper button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 29px; border: 0; background: #fafcfb; color: #75847e; }
.qty-stepper button:hover { background: #f0f6f3; color: var(--primary); }
.qty-stepper input { width: 37px; height: 29px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 11px; text-align: center; outline: none; -moz-appearance: textfield; }
.qty-stepper input::-webkit-inner-spin-button { display: none; }
.stock-hint { display: block; margin-top: 3px; color: #9aa7a3; font-size: 8.5px; white-space: nowrap; }
.stock-hint.is-danger { color: var(--danger); font-weight: 600; }
.price-field { display: flex; align-items: center; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.price-field > span { color: #8c9a95; font-size: 10px; }
.price-field input { width: 100%; min-width: 0; height: 100%; padding: 0 0 0 3px; border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 11px; text-align: right; outline: none; -moz-appearance: textfield; }
.price-field input::-webkit-inner-spin-button { display: none; }
.price-field.is-low-price { border-color: #e9b0ac; background: #fff7f6; }
.price-field.is-low-price input { color: #b13d37; }
.history-price-btn { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; padding: 0; border: 0; background: none; color: var(--primary); font-size: 8.5px; white-space: nowrap; }
.history-price-btn:hover { text-decoration: underline; }
.price-source { display: inline-block; margin-top: 3px; margin-left: 5px; padding: 1px 4px; border-radius: 3px; background: var(--primary-soft); color: var(--primary-dark); font-size: 8px; }
.price-source.is-overall { background: #eef4ff; color: #3566b8; }
.low-price-warning { display: flex; align-items: center; gap: 3px; margin-top: 4px; color: var(--danger); font-size: 8.5px; font-weight: 600; white-space: nowrap; }
.low-price-warning.is-hidden { display: none; }
tr.has-low-price .line-total { color: var(--danger); }
.summary-low-price { display: flex; align-items: flex-start; gap: 5px; margin-top: 9px; padding: 8px 9px; border: 1px solid #f0cac7; border-radius: 7px; background: #fff8f7; color: #a33f39; font-size: 9px; line-height: 1.55; }
.summary-low-price.is-hidden { display: none; }
.line-total { color: var(--ink); font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.notes-card .textarea { min-height: 66px; }
.sale-summary { padding: 20px; }
.summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.summary-head h2 { font-size: 16px; font-weight: 700; }
.summary-badge { padding: 3px 8px; border-radius: 5px; background: #f1f5f3; color: var(--muted); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.summary-badge.is-paid { background: var(--success-soft); color: var(--success); }
.summary-badge.is-partial { background: var(--amber-soft); color: var(--amber); }
.summary-badge.is-due { background: var(--danger-soft); color: var(--danger); }
.summary-lines { display: flex; flex-direction: column; gap: 11px; padding: 14px 0 12px; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 11.5px; }
.summary-line strong { color: var(--ink-soft); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.summary-line small { color: #8b9995; font-size: 9.5px; }
.discount-line label { color: var(--muted); }
.mini-money-input { position: relative; display: inline-flex; align-items: center; width: 110px; height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.mini-money-input > span { padding-left: 8px; color: #94a19c; font-size: 9.5px; }
.mini-money-input input { width: 100%; min-width: 0; padding: 0 7px 0 2px; border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 10.5px; text-align: right; outline: none; -moz-appearance: textfield; }
.mini-money-input input::-webkit-inner-spin-button { display: none; }
.summary-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 13px 0 14px; border-top: 1px dashed #dde7e2; border-bottom: 1px solid var(--line); }
.summary-total span { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.summary-total strong { color: var(--ink); font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -0.055em; line-height: 1; }
.payment-panel { padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.payment-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.payment-panel-head > span { color: var(--muted); font-size: 11px; }
.quick-pay { display: flex; gap: 8px; }
.quick-pay button { padding: 0; border: 0; background: none; color: var(--primary); font-size: 9.5px; }
.quick-pay button:hover { text-decoration: underline; }
.big-money-input { display: flex; align-items: center; height: 46px; padding: 0 12px; border: 1px solid #cbdad4; border-radius: 9px; background: #fbfdfc; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.big-money-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.09); background: #fff; }
.big-money-input > span { color: #6e8079; font-family: var(--mono); font-size: 16px; }
.big-money-input input { width: 100%; min-width: 0; padding: 0 0 0 5px; border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -0.04em; outline: none; -moz-appearance: textfield; }
.big-money-input input::-webkit-inner-spin-button { display: none; }
.payment-method { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.payment-method label { color: var(--muted); font-size: 10.5px; }
.payment-method .select { width: 114px; height: 30px; font-size: 10.5px; border-radius: 6px; background-position: right 8px center; padding: 0 25px 0 9px; }
.balance-box { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 12px 0 13px; padding: 11px 12px; border: 1px solid #f0e1cd; border-radius: 9px; background: #fffbf5; }
.balance-box > div { display: flex; flex-direction: column; gap: 1px; }
.balance-box span { color: #9b753f; font-size: 10px; }
.balance-box strong { color: #a45f14; font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.balance-box small { max-width: 140px; color: #b19c7d; font-size: 8.5px; line-height: 1.45; text-align: right; }
.balance-box.is-clear { border-color: #d9ebdf; background: #f7fdf9; }
.balance-box.is-clear span { color: #6e8d79; }
.balance-box.is-clear strong { color: var(--success); }
.balance-box.is-invalid { border-color: #f0cac7; background: #fff9f8; }
.balance-box.is-invalid strong { color: var(--danger); }
.sale-summary > .btn { min-height: 46px; }
.sale-summary .form-error { margin-top: 9px; }
.summary-foot { display: flex; align-items: flex-start; gap: 4px; margin-top: 10px; color: #9aa6a2; font-size: 8.5px; line-height: 1.5; }
.summary-foot .icon { margin-top: 1px; }
.sale-side-tip { display: flex; gap: 9px; padding: 12px 14px; border: 1px solid #e8eee9; border-radius: 12px; background: rgba(255, 255, 255, 0.58); color: #81908a; }
.sale-side-tip > .icon { color: #b58c44; margin-top: 1px; }
.sale-side-tip strong { display: block; color: #7f6c4e; font-size: 10px; font-weight: 600; }
.sale-side-tip p { margin-top: 3px; font-size: 9px; line-height: 1.6; }

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */

.inventory-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.inv-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.inv-stat > span { display: block; color: var(--muted); font-size: 9.5px; }
.inv-stat > strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.25; }
.inv-stat > strong small { margin-left: 2px; color: var(--muted-light); font-family: var(--font); font-size: 9px; font-weight: 400; letter-spacing: 0; }
.inv-stat.is-warning { border-color: #f2dfc3; background: #fffdf8; }
.inv-stat.is-warning > strong { color: var(--amber); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(223px, 1fr)); gap: 14px; }
.product-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #d5e2dc; box-shadow: 0 18px 34px -28px rgba(15, 31, 27, 0.35); }
.product-card.is-warning { border-color: #ecdcc4; }
.product-media { position: relative; aspect-ratio: 1.25 / 1; overflow: hidden; background: #f2f6f3; cursor: zoom-in; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.product-card:hover .product-media img { transform: scale(1.025); }
.product-media .photo-fallback { height: 100%; border-radius: 0; }
.product-media-badges { position: absolute; top: 9px; left: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.zoom-hint { position: absolute; right: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 5px; background: rgba(8, 27, 23, 0.62); color: #fff; font-size: 8.5px; opacity: 0; transition: opacity 0.18s ease; backdrop-filter: blur(5px); }
.product-media:hover .zoom-hint { opacity: 1; }
.product-body { flex: 1; padding: 12px 13px 10px; }
.product-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-category { display: inline-flex; padding: 2px 6px; border-radius: 4px; background: #edf6f2; color: #3a776c; font-size: 8.5px; white-space: nowrap; }
.product-sku { overflow: hidden; color: #a0aca8; font-family: var(--mono); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.product-body h3 { display: -webkit-box; min-height: 35px; margin-top: 7px; overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-location-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.stock-line { color: #92a09b; font-size: 9px; white-space: nowrap; }
.stock-line strong { color: #486158; font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.stock-line.is-warning { color: var(--amber); }
.stock-line.is-warning strong { color: var(--amber); }
.product-price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #f1f5f3; }
.product-price small { display: block; color: #9aa6a2; font-size: 8px; }
.product-price strong { display: block; margin-top: 1px; color: var(--ink); font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.2; }
.product-price.is-low-price strong { color: var(--danger); }
.product-cost { color: #a1aca8; font-size: 8px; white-space: nowrap; }
.product-cost.is-low { color: var(--danger); font-weight: 600; }
.product-card.is-low-price { border-color: #efd2cf; }
.low-price-tag { display: inline-flex; padding: 1px 5px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 8px; font-weight: 600; white-space: nowrap; }
.price-low-text { color: var(--danger) !important; font-weight: 700; }
.price-low-tag { display: block; margin-top: 2px; color: var(--danger); font-size: 8px; font-weight: 600; white-space: nowrap; }
.price-history-current.is-low-price { border-color: #f0cac7; background: #fff9f8; }
.price-history-current.is-low-price strong { color: var(--danger); }
.product-actions { display: flex; align-items: center; gap: 2px; padding: 7px 9px; border-top: 1px solid #f2f5f3; background: #fcfdfc; }
.product-actions .btn-xs { color: #788781; }
.product-actions .btn-xs:hover { color: var(--primary); background: #f0f7f4; }
.product-actions .icon-btn { width: 26px; height: 26px; margin-left: auto; }
.product-actions .icon-btn + .icon-btn { margin-left: 0; }
.product-loading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 230px; color: var(--muted); font-size: 12px; }
.product-loading .icon { animation: spin 1s linear infinite; color: var(--primary); }
.photo-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(145deg, #f1f5f3, #e8efeb); color: #a2b2ac; }
.photo-fallback span { font-size: 8.5px; }
.product-card .photo-fallback span { display: none; }
.photo-fallback img { width: 100%; height: 100%; object-fit: cover; }
.product-photo { width: 100%; height: 100%; object-fit: cover; }
.low-stock-thumb .photo-fallback { flex-direction: row; }
.low-stock-thumb .photo-fallback span { display: none; }
.low-stock-thumb .photo-fallback .icon { width: 17px; height: 17px; }

/* Product form / upload */
.product-form { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.product-form-photo { position: sticky; top: 4px; }
.photo-upload-area { padding: 10px; border: 1px dashed #ccd9d3; border-radius: 13px; background: #fafcfb; text-align: center; transition: border-color 0.16s ease, background 0.16s ease; }
.photo-upload-area.is-dragging { border-color: var(--primary); background: #f2fbf8; }
.photo-upload-preview { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 9px; background: #f1f6f3; }
.photo-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 180px; text-align: center; color: #a0aea9; }
.photo-upload-empty strong { color: #75857f; font-size: 10.5px; font-weight: 500; }
.photo-upload-empty small { max-width: 150px; font-size: 8.5px; line-height: 1.5; }
.photo-upload-actions { display: flex; justify-content: center; gap: 6px; margin-top: 9px; }
.photo-upload-tip { margin-top: 8px; color: #9aa8a3; font-size: 8.5px; line-height: 1.5; }
.product-fields { gap: 14px; }
.product-fields .input { font-size: 12px; height: 39px; }
.product-fields .textarea { height: auto; }
.product-form .field-label { font-size: 11px; }
.product-form .money-input .input { font-size: 12px; }

/* Stock adjust */
.stock-adjust { display: flex; flex-direction: column; gap: 15px; }
.stock-adjust-product { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfb; }
.stock-adjust-thumb { width: 43px; height: 43px; flex: 0 0 auto; overflow: hidden; border-radius: 9px; }
.stock-adjust-product > div:nth-child(2) { flex: 1; min-width: 0; }
.stock-adjust-product strong { display: block; font-size: 12px; font-weight: 600; }
.stock-adjust-product small { display: block; margin-top: 2px; color: #98a59f; font-size: 9px; }
div.stock-current { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; }
.stock-current span { color: var(--muted); font-size: 9px; }
.stock-current strong { margin-top: 1px; color: var(--ink); font-family: var(--mono); font-size: 19px; font-weight: 600; }
.stock-current strong small { display: inline; margin: 0; font-family: var(--font); font-size: 9px; }
.stock-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf9; }
.stock-mode-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10.5px; }
.stock-mode-tabs button.is-active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(15, 31, 27, 0.08); }
.stock-form { display: flex; flex-direction: column; gap: 12px; }
.stock-preview { padding: 9px 11px; border-radius: 7px; background: #f4f9f6; color: #73837d; font-size: 10.5px; }
.stock-preview strong { color: var(--primary); font-family: var(--mono); font-size: 13px; }
.stock-preview.is-negative { background: var(--danger-soft); color: var(--danger); }
.stock-preview.is-negative strong { color: var(--danger); }

/* Price history */
.price-history-head { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 15px; }
.price-history-current, .price-history-last { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.price-history-current > span, .price-history-last > span { display: block; color: var(--muted); font-size: 9.5px; }
.price-history-current strong, .price-history-last strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -0.03em; }
.price-history-current small, .price-history-last small { display: block; margin-top: 2px; color: #98a59f; font-size: 9px; }
.price-history-last { border-color: #dcebe5; background: #f5fbf8; }
.price-history-last .btn { margin-top: 7px; }
.price-history-empty { display: flex; align-items: center; gap: 8px; padding: 20px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 10.5px; }
.price-history-table { border: 1px solid var(--line); border-radius: 10px; }
.price-history-table .data-table { min-width: 700px; }
.price-history-table tr.is-current-customer { background: #f2fbf7; }
.price-history-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 10px; }
.price-scope-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.price-scope-tabs button { padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; white-space: nowrap; }
.price-scope-tabs button:hover:not(:disabled) { background: #fff; color: var(--ink-soft); }
.price-scope-tabs button.is-active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(15, 31, 27, 0.08); }
.price-scope-tabs button:disabled { opacity: 0.45; cursor: not-allowed; }
.price-sort-control, .price-customer-filter { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.price-sort-control .select, .price-customer-filter .select { width: auto; min-width: 132px; height: 30px; padding: 0 25px 0 9px; font-size: 10px; background-position: right 7px center; }
.price-customer-filter .select { min-width: 112px; }
.price-history-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #687a74; font-size: 10px; }
.price-history-result-head small { color: #9ba7a3; font-size: 9px; }
.modal-tip { display: flex; align-items: flex-start; gap: 5px; margin-top: 13px; color: #91a09a; font-size: 9.5px; line-height: 1.6; }

/* --------------------------------------------------------------------------
   Customers
   -------------------------------------------------------------------------- */

.customer-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.customer-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.customer-stat > span { display: block; color: var(--muted); font-size: 9.5px; }
.customer-stat > strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.25; }
.customer-stat > strong small { margin-left: 2px; color: var(--muted-light); font-family: var(--font); font-size: 9px; font-weight: 400; }
.customer-stat.is-warning > strong { color: var(--amber); }
.customer-stat.is-danger > strong { color: var(--danger); }
.customers-table { min-width: 900px; }
.customer-form-meta { padding: 9px 11px; border-radius: 7px; background: #f7faf8; color: #8b9994; font-size: 10px; }
.customer-detail-head { display: flex; align-items: center; gap: 13px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.customer-detail-copy { flex: 1; min-width: 0; }
.customer-detail-copy h3 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.customer-detail-copy h3 span { color: var(--muted); font-size: 10.5px; font-weight: 400; }
.customer-detail-contacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; color: #7a8984; font-size: 10px; }
.customer-detail-contacts span { display: inline-flex; align-items: center; gap: 4px; }
.customer-detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.customer-detail-stats > div { padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.customer-detail-stats span { display: block; color: var(--muted); font-size: 9px; }
.customer-detail-stats strong { display: block; margin-top: 2px; color: var(--ink); font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: -0.03em; }
.customer-detail-stats small { margin-left: 2px; color: var(--muted); font-family: var(--font); font-size: 8.5px; }
.customer-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #fbf8f2; color: #86745a; font-size: 10.5px; line-height: 1.6; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.detail-section-head h3 { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.detail-section-head span { color: var(--muted-light); font-size: 9.5px; }

/* --------------------------------------------------------------------------
   Reports
   -------------------------------------------------------------------------- */

.report-controls { padding: 16px 20px; }
.report-tabs { display: flex; align-items: center; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid #f0f4f1; }
.report-tab { min-height: 32px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; }
.report-tab:hover { color: var(--ink-soft); background: #f7faf8; }
.report-tab.is-active { border-color: var(--line); background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: var(--shadow-sm); }
.report-tab-hint { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--muted-light); font-size: 9.5px; }
.report-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 13px; padding-top: 12px; }
.report-own-scope { display: flex; align-items: center; gap: 5px; align-self: flex-end; height: 36px; color: var(--muted); font-size: 10.5px; }
.report-caption-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 0 11px; }
.report-caption-title { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.report-caption-meta { color: var(--muted); font-size: 10px; }
.report-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-summary-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.report-summary-icon { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 37px; flex: 0 0 auto; border-radius: 10px; }
.report-summary-card.tone-teal .report-summary-icon { background: #e7f7f3; color: var(--primary); }
.report-summary-card.tone-blue .report-summary-icon { background: var(--blue-soft); color: var(--blue); }
.report-summary-card.tone-rose .report-summary-icon { background: var(--danger-soft); color: var(--rose); }
.report-summary-card.tone-amber .report-summary-icon { background: var(--amber-soft); color: var(--amber); }
.report-summary-card > div > span { display: block; color: var(--muted); font-size: 9.5px; }
.report-summary-card > div > strong { display: block; margin-top: 2px; color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.25; white-space: nowrap; }
.report-summary-card > div > strong em { margin-left: 2px; color: var(--muted); font-family: var(--font); font-size: 9px; font-weight: 400; }
.report-summary-card > div > small { display: block; margin-top: 2px; color: #99a5a1; font-size: 8.5px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 14px; margin-top: 14px; }
.report-chart-card { min-height: 350px; }
.report-chart-total { align-self: center; color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: -0.03em; }
.report-chart { min-height: 260px; }
.report-category-card { min-height: 350px; }
.category-list { display: flex; flex-direction: column; gap: 12px; }
.category-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 10.5px; }
.category-row-head strong { font-family: var(--mono); font-size: 10px; font-weight: 600; }
.category-bar { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #f0f4f2; }
.category-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5fc6b5, #0f766e); }
.category-row > small { display: block; margin-top: 3px; color: #9aa6a2; font-size: 8.5px; }
.report-team-card { margin-top: 14px; }
.report-team-card .card-head, .report-lower-grid .card-head { margin-bottom: 12px; }
.team-report-table { min-width: 780px; }
.share-cell { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.share-track { flex: 1; height: 4px; overflow: hidden; border-radius: 999px; background: #f0f4f2; }
.share-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #63c7b6, #0f766e); }
.share-cell > span { width: 38px; color: var(--muted); font-family: var(--mono); font-size: 9px; text-align: right; }
.report-lower-grid { display: grid; grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr); gap: 14px; margin-top: 14px; }
.top-products-list { display: flex; flex-direction: column; }
.top-product-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f2f5f3; }
.top-product-row:last-child { border-bottom: 0; }
.top-product-copy { flex: 1; min-width: 0; }
.top-product-copy strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 10.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.top-product-copy small { display: block; margin-top: 1px; color: #9aa7a2; font-family: var(--mono); font-size: 8px; }
.top-product-numbers { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: 0 0 auto; }
.top-product-numbers strong { color: var(--ink-soft); font-family: var(--mono); font-size: 10px; font-weight: 600; }
.top-product-numbers small { color: #9ca8a4; font-size: 8px; }
.report-orders-card { min-width: 0; }
.report-loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 280px; color: var(--muted); font-size: 12px; }
.report-loading .icon { animation: spin 1s linear infinite; color: var(--primary); }

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.68); width: fit-content; }
.settings-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; }
.settings-tab:hover { color: var(--ink-soft); }
.settings-tab.is-active { background: #fff; border-color: var(--line); color: var(--primary-dark); font-weight: 600; box-shadow: var(--shadow-sm); }
.settings-card { padding: 20px; }
.settings-table { min-width: 680px; }
.settings-name { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-weight: 500; }
.settings-name .icon { color: #85a59c; }
.shelf-code-large { display: inline-flex; padding: 4px 8px; border: 1px solid #dfeae4; border-radius: 6px; background: #f8fbf9; color: var(--primary-dark); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
.account-name { color: #5e6f69; font-family: var(--mono); font-size: 10.5px; }
.self-tag { display: inline-block; margin-left: 3px; padding: 0 4px; border-radius: 3px; background: var(--primary-soft); color: var(--primary-dark); font-size: 8px; vertical-align: 1px; }
.status-inline { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.status-inline i { width: 5px; height: 5px; border-radius: 50%; background: #c6d1cd; }
.status-inline.is-on { color: #32805c; }
.status-inline.is-on i { background: #34b37a; box-shadow: 0 0 0 3px rgba(52, 179, 122, 0.1); }
.status-inline.is-off { color: #9b9f9e; }
.settings-tip { display: flex; align-items: flex-start; gap: 6px; margin-top: 15px; padding: 10px 12px; border-radius: 8px; background: #f8faf9; color: #8c9995; font-size: 9.5px; line-height: 1.6; }
.users-table { min-width: 820px; }
.print-copy-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.copy-badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 8.5px; white-space: nowrap; }
.copy-white { background: #fff; color: #5f6f69; }
.copy-red { background: #fff1f1; border-color: #f3d2d0; color: #a34843; }
.copy-yellow { background: #fff9e8; border-color: #f0e2bb; color: #8f702c; }
.print-settings-card .card-head { align-items: flex-start; }
.print-settings-form { margin-top: 4px; }
.print-settings-form .textarea { min-height: 78px; }
.print-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 3px; }
.print-settings-actions .btn { flex: 0 0 auto; }
.print-size-inputs { display: flex; align-items: center; gap: 7px; }
.print-size-inputs .input { flex: 1; min-width: 0; }
.print-size-inputs > span { color: var(--muted); font-size: 11px; }

/* --------------------------------------------------------------------------
   Edit sale
   -------------------------------------------------------------------------- */

.edit-sale-form { display: flex; flex-direction: column; gap: 13px; }
.edit-sale-notice { display: flex; align-items: flex-start; gap: 7px; padding: 9px 11px; border: 1px solid #f0dfc7; border-radius: 8px; background: #fffbf4; color: #94724a; font-size: 10px; line-height: 1.6; }
.edit-sale-notice .icon { margin-top: 1px; flex: 0 0 auto; }
.edit-sale-meta-grid { display: grid; grid-template-columns: 1.2fr 1fr 0.85fr; gap: 12px; }
.edit-sale-meta-grid .input { height: 38px; font-size: 11.5px; }
.edit-sale-items-wrap { border: 1px solid var(--line); border-radius: 9px; }
.edit-sale-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 11px; }
.edit-sale-table thead th { padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafcfb; color: #8b9994; font-size: 9px; font-weight: 600; text-align: left; white-space: nowrap; }
.edit-sale-table tbody td { padding: 9px 10px; border-bottom: 1px solid #f2f5f3; vertical-align: middle; }
.edit-sale-table tbody tr:last-child td { border-bottom: 0; }
.edit-sale-table tbody tr.has-stock-error { background: #fff9f8; }
.edit-sale-table .qty-stepper button { width: 23px; height: 27px; }
.edit-sale-table .qty-stepper input { width: 31px; height: 27px; }
.edit-sale-table .price-field { height: 28px; }
.edit-sale-table .item-thumb { width: 34px; height: 34px; }
.edit-sale-table .item-product-copy strong { font-size: 10.5px; }
.edit-sale-table .item-product-copy small { font-size: 8px; }
.edit-sale-add-row { display: flex; align-items: flex-end; gap: 9px; }
.edit-sale-add-row .field { flex: 1; }
.edit-sale-add-row .input { height: 35px; font-size: 10.5px; }
.edit-sale-add-row .btn { min-height: 35px; }
.edit-sale-notes { margin-top: 1px; }
.edit-sale-notes .textarea { min-height: 58px; font-size: 11px; }
.edit-sale-summary { width: min(340px, 100%); margin-left: auto; padding: 11px 13px; border: 1px solid #e5ece8; border-radius: 9px; background: #fbfdfc; }
.edit-sale-summary-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--muted); font-size: 10.5px; }
.edit-sale-summary-line strong { color: var(--ink-soft); font-family: var(--mono); font-size: 11px; font-weight: 600; }
.edit-sale-summary-line.discount { margin-top: 2px; padding-top: 7px; border-top: 1px dashed #e0e9e4; }
.edit-sale-summary-line.total { margin-top: 3px; padding-top: 8px; border-top: 1px solid #e5ece8; }
.edit-sale-summary-line.total span { color: var(--ink-soft); font-weight: 600; }
.edit-sale-summary-line.total strong { color: var(--ink); font-size: 19px; letter-spacing: -0.04em; }
.edit-sale-summary-line .mini-money-input { width: 105px; }
.edit-sale-form > .form-error { margin-top: 0; }
.edit-sale-form .summary-low-price { margin-top: 2px; }

/* --------------------------------------------------------------------------
   Logistics
   -------------------------------------------------------------------------- */

.logistics-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.logistics-stat { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.logistics-stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 10px; }
.logistics-stat > div > span { display: block; color: var(--muted); font-size: 9.5px; }
.logistics-stat > div > strong { display: block; margin-top: 2px; color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.2; }
.logistics-stat > div > strong small { margin-left: 2px; color: var(--muted-light); font-family: var(--font); font-size: 9px; font-weight: 400; }
.logistics-stat.tone-teal .logistics-stat-icon { background: #e7f7f3; color: var(--primary); }
.logistics-stat.tone-blue .logistics-stat-icon { background: var(--blue-soft); color: var(--blue); }
.logistics-stat.tone-green .logistics-stat-icon { background: var(--success-soft); color: var(--success); }
.logistics-stat.tone-rose .logistics-stat-icon { background: var(--danger-soft); color: var(--rose); }
.logistics-stat.skeleton-stat { display: block; }
.logistics-table { min-width: 1040px; }
.tracking-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.carrier-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid #e7eeea; border-radius: 4px; background: #f8faf9; color: #5e7770; font-size: 8.5px; white-space: nowrap; }
.carrier-chip.large { gap: 5px; padding: 4px 8px; color: var(--primary-dark); font-size: 10px; }
.tracking-code { color: var(--ink); font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.latest-location { display: -webkit-box; max-width: 250px; overflow: hidden; color: var(--ink-soft); font-size: 10.5px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.shipment-sale-field { display: flex; flex-direction: column; gap: 7px; }
.shipment-sale-combo { z-index: 2; }
.selected-sale-link { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #dcebe5; border-radius: 9px; background: #f7fbf9; }
.selected-sale-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: #e4f4ef; color: var(--primary); }
.selected-sale-link > div { flex: 1; min-width: 0; }
.selected-sale-link strong { display: block; color: var(--ink); font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.selected-sale-link small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; }
.field-hint-inline { color: var(--muted-light); font-size: 9px; }
.tracking-input { font-family: var(--mono); letter-spacing: 0.02em; text-transform: uppercase; }
.shipment-form .readonly-field .badge { flex: 0 0 auto; }

.shipment-detail { display: flex; flex-direction: column; }
.shipment-banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 16px; border: 1px solid #dfeae4; border-radius: 12px; background: linear-gradient(135deg, #f4fbf8, #fbfdfc); }
.shipment-banner-main { min-width: 0; }
.shipment-tracking-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.shipment-tracking-line > strong { color: var(--ink); font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.shipment-tracking-line .icon-btn { width: 27px; height: 27px; }
.shipment-tracking-line .btn { margin-left: 3px; min-height: 28px; padding: 0 9px; font-size: 10px; }
.shipment-latest-card { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 13px 16px; border: 1px solid #d8ebe3; border-radius: 10px; background: #f2fbf7; }
.shipment-latest-label { display: flex; align-items: center; gap: 5px; color: #5b8c7b; font-size: 9.5px; }
.shipment-latest-card strong { margin-top: 2px; color: #145e51; font-size: 13px; font-weight: 600; line-height: 1.5; }
.shipment-latest-card small { color: #7a9b90; font-size: 9px; }
.shipment-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; }
.shipment-info-grid .detail-info-card p { flex-wrap: wrap; }
.shipment-note { margin-top: 13px; }
.shipment-timeline { position: relative; display: flex; flex-direction: column; margin-left: 7px; padding-left: 19px; border-left: 1px solid #dce9e3; }
.shipment-event { position: relative; padding: 0 0 16px; }
.shipment-event:last-child { padding-bottom: 3px; }
.shipment-event-dot { position: absolute; top: 1px; left: -27px; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: #eef4f1; color: #9aaba5; box-shadow: 0 0 0 1px #dce9e3; }
.shipment-event.is-latest .shipment-event-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
.shipment-event-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.shipment-event-head strong { color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.shipment-event.is-latest .shipment-event-head strong { color: var(--primary-dark); }
.shipment-event-head span { color: #94a19c; font-size: 9px; }
.shipment-event-location { display: flex; align-items: flex-start; gap: 4px; margin-top: 3px; color: #5f746d; font-size: 10px; line-height: 1.5; }
.shipment-event-desc { margin-top: 2px; color: #93a09b; font-size: 9.5px; line-height: 1.55; }
.shipment-event-form-card { margin-top: 17px; padding: 14px; border: 1px solid #e1ece7; border-radius: 11px; background: #fafcfb; }
.shipment-event-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; color: var(--primary); }
.shipment-event-form-head strong { display: block; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.shipment-event-form-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.shipment-event-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.shipment-event-form .input { height: 36px; font-size: 10.5px; }
.shipment-event-form .field-label { font-size: 9.5px; }
.shipment-event-form-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.shipment-event-form-actions .form-error { margin-right: auto; }

.shipment-mini-list { display: flex; flex-direction: column; gap: 7px; }
.shipment-mini { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid #e3ede8; border-radius: 9px; background: #fbfdfc; text-align: left; transition: border-color 0.15s ease, background 0.15s ease; }
.shipment-mini:hover { border-color: #c7ddd4; background: #f7fbf9; }
.shipment-mini-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; background: #e7f5f1; color: var(--primary); }
.shipment-mini-main { flex: 1; min-width: 0; }
.shipment-mini-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shipment-mini-top strong { color: var(--ink-soft); font-size: 10.5px; font-weight: 600; }
.shipment-mini-top em { color: #6e817a; font-family: var(--mono); font-size: 9.5px; font-style: normal; }
.shipment-mini-main > small { display: block; margin-top: 3px; overflow: hidden; color: #94a19c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.shipment-mini-count { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; color: #8d9b96; font-size: 9px; }
.shipment-empty-inline { padding-top: 4px; padding-bottom: 13px; }

/* --------------------------------------------------------------------------
   Outbound verification
   -------------------------------------------------------------------------- */

.outbound-table { min-width: 980px; }
.photo-count-chip { display: inline-flex; align-items: center; gap: 4px; color: #9aa7a2; font-size: 9.5px; white-space: nowrap; }
.photo-count-chip.has-photo { color: var(--primary); }
.outbound-detail { display: flex; flex-direction: column; }
.outbound-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.outbound-order > strong { display: block; margin-top: 6px; color: var(--ink); font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.outbound-order > small { display: block; margin-top: 3px; color: #93a09c; font-size: 9.5px; }
.outbound-ship-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 13px; }
.outbound-ship-grid .detail-info-card > p { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; color: #7d8c86; font-size: 9.5px; line-height: 1.55; }
.outbound-section-head { align-items: flex-end; margin-top: 17px; }
.outbound-section-head h3 { font-size: 12px; }
.outbound-subtitle { display: block; margin-top: 2px; color: #9aa6a2; font-size: 9px; }
.outbound-section-head > .btn { margin-bottom: 1px; }
.outbound-check-wrap { border: 1px solid var(--line); border-radius: 9px; }
.outbound-check-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 11.5px; }
.outbound-check-table thead th { padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafcfb; color: #8b9994; font-size: 9px; font-weight: 600; text-align: left; white-space: nowrap; }
.outbound-check-table tbody td { padding: 10px; border-bottom: 1px solid #f2f5f3; vertical-align: middle; }
.outbound-check-table tbody tr:last-child td { border-bottom: 0; }
.outbound-check-table tbody tr.has-check-mismatch { background: #fff9f4; }
.check-box { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.check-box input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.check-box span { display: none; }
.expected-qty { color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.outbound-check-table td > small { color: var(--muted); font-size: 9px; }
.outbound-qty { display: inline-flex; align-items: center; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.outbound-qty input { width: 48px; border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 12px; text-align: center; outline: none; -moz-appearance: textfield; }
.outbound-qty input::-webkit-inner-spin-button { display: none; }
.outbound-qty span { margin-left: 3px; color: #9aa7a3; font-size: 9px; }
.check-result { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; background: #f4f7f5; color: #93a19c; font-size: 9px; white-space: nowrap; }
.check-result.is-ok { background: var(--success-soft); color: var(--success); }
.check-result.is-mismatch { background: var(--amber-soft); color: var(--amber); }
.outbound-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; min-height: 88px; padding: 9px; border: 1px dashed #d7e3dd; border-radius: 10px; background: #fbfdfc; }
.outbound-photo-card { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f2f6f3; }
.outbound-photo-image { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.outbound-photo-image img { width: 100%; height: 100%; object-fit: cover; }
.outbound-photo-remove { position: absolute; top: 5px; right: 5px; display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border: 0; border-radius: 50%; background: rgba(8, 27, 23, 0.62); color: #fff; }
.outbound-photo-remove:hover { background: var(--danger); }
.outbound-photo-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 100px; color: #9aa7a2; text-align: center; }
.outbound-photo-empty strong { color: #7c8d86; font-size: 10.5px; font-weight: 500; }
.outbound-photo-empty span { font-size: 8.5px; }
.outbound-note { margin-top: 13px; }
.outbound-note .textarea { min-height: 58px; font-size: 11px; }
.outbound-detail > .form-error { margin-top: 10px; }
.admin-photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 9px; }
.admin-photo-gallery .outbound-photo-image { aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f2f6f3; }
.admin-photo-gallery .outbound-photo-image img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Sale detail modal
   -------------------------------------------------------------------------- */

.sale-detail { display: flex; flex-direction: column; }
.detail-banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-order > span { display: block; color: var(--muted); font-size: 9.5px; }
.detail-order > strong { display: block; margin-top: 2px; color: var(--ink); font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: -0.03em; }
.detail-order > small { display: block; margin-top: 3px; color: #93a09c; font-size: 9.5px; }
.detail-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.detail-info-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 11px; margin-top: 14px; }
.detail-info-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.detail-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.detail-info-card > strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.detail-info-card > p { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: #7d8c86; font-size: 9.5px; line-height: 1.5; }
.detail-note { display: flex; align-items: flex-start; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf2ef; color: #8c8170; font-size: 9.5px; line-height: 1.6; }
.detail-money-card { padding: 12px 15px; border: 1px solid #e7eee9; border-radius: 10px; background: #fcfdfc; }
.detail-money-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--muted); font-size: 10px; }
.detail-money-row strong { color: var(--ink-soft); font-family: var(--mono); font-size: 10.5px; font-weight: 500; }
.detail-money-row.total { margin-top: 3px; padding-top: 7px; border-top: 1px dashed #e0e9e4; }
.detail-money-row.total strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.detail-money-row.due strong { color: var(--danger); font-weight: 600; }
.detail-items { border: 1px solid var(--line); border-radius: 9px; }
.detail-items .data-table { min-width: 600px; }
.detail-items .data-table tbody td { padding-top: 9px; padding-bottom: 9px; }
.cancelled-notice { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 9px 11px; border-radius: 7px; background: var(--danger-soft); color: #9d433d; font-size: 10px; }
.payment-timeline { display: flex; flex-direction: column; gap: 2px; padding: 1px 0; }
.payment-entry { position: relative; display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; }
.payment-entry + .payment-entry { border-top: 1px dashed #edf2ef; }
.payment-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.payment-entry-main { flex: 1; min-width: 0; }
.payment-entry-main > div { display: flex; align-items: baseline; gap: 7px; }
.payment-entry-main strong { color: var(--ink-soft); font-size: 10.5px; font-weight: 600; }
.payment-entry-main span { color: #94a19c; font-size: 9px; }
.payment-entry-main small { display: block; margin-top: 1px; color: #9ba7a3; font-size: 8.5px; }
.payment-amount { color: var(--success); font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.collect-panel { margin-top: 16px; padding: 15px; border: 1px solid #f0dfc7; border-radius: 12px; background: linear-gradient(135deg, #fffcf7, #fffaf2); }
.collect-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.collect-head strong { display: block; color: #7c643e; font-size: 11.5px; font-weight: 600; }
.collect-head span { display: block; margin-top: 2px; color: #a18964; font-size: 9.5px; }
.collect-head span em { color: var(--danger); font-family: var(--mono); font-style: normal; font-weight: 600; }
.collect-form { display: grid; grid-template-columns: 1.1fr 0.8fr 1fr 1fr; gap: 10px; align-items: end; }
.collect-form .field-label { font-size: 9.5px; }
.collect-form .input { height: 36px; font-size: 11px; }
.collect-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.collect-actions .form-error { margin-right: auto; }
.collect-actions .btn { min-height: 36px; }
.sale-detail + .modal-tip { margin-top: 0; }

/* Success */
.success-panel { display: flex; flex-direction: column; align-items: center; padding: 6px 8px 2px; text-align: center; }
.success-mark { display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; margin-bottom: 13px; border-radius: 50%; background: #e9faf1; color: #188a58; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.055); }
.success-panel h3 { color: var(--ink); font-family: var(--mono); font-size: 31px; font-weight: 600; letter-spacing: -0.05em; }
.success-panel > p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.success-grid { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 9px; margin-top: 20px; }
.success-grid > div { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; text-align: left; }
.success-grid span { display: block; color: var(--muted); font-size: 9px; }
.success-grid strong { display: block; margin-top: 2px; color: var(--ink-soft); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.success-grid .is-due strong { color: var(--danger); }
.success-note { display: flex; align-items: flex-start; gap: 5px; width: 100%; margin-top: 14px; padding: 9px 11px; border-radius: 7px; background: #fffaf2; color: #987344; font-size: 9.5px; text-align: left; line-height: 1.55; }
.success-note.is-ok { background: #f4fbf6; color: #54806a; }

/* --------------------------------------------------------------------------
   Alerts modal
   -------------------------------------------------------------------------- */

.alert-modal-intro { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.alert-pill { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 4px 8px; border-radius: 5px; background: var(--amber-soft); color: #9a5a16; font-size: 9.5px; font-weight: 600; }
.alert-modal-intro p { color: var(--muted); font-size: 10.5px; }
.alert-list { display: flex; flex-direction: column; margin-top: 7px; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f3; }
.alert-item:last-child { border-bottom: 0; }
.alert-item-thumb { width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 8px; }
.alert-item-copy { flex: 1; min-width: 0; }
.alert-item-copy strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.alert-item-copy small { display: block; margin-top: 2px; color: #9aa6a2; font-size: 8.5px; }
.alert-item-stock { flex: 0 0 auto; text-align: right; }
.alert-item-stock strong { color: var(--amber); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.alert-item-stock small { color: #a8b0ad; font-size: 8px; }

/* --------------------------------------------------------------------------
   Modal / lightbox / toast
   -------------------------------------------------------------------------- */

#modal-root { position: relative; z-index: 1000; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 22, 18, 0.44);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  backdrop-filter: blur(5px);
}
.modal-overlay.is-visible { opacity: 1; visibility: visible; }
.modal-card {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.2s ease;
}
.modal-overlay.is-visible .modal-card { transform: translateY(0) scale(1); }
.modal-sm { width: min(430px, 100%); }
.modal-md { width: min(620px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-xl { width: min(1100px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-heading .eyebrow { margin-bottom: 3px; font-size: 9.5px; }
.modal-heading h2 { color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.modal-close { width: 31px; height: 31px; margin-top: -3px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 13px 22px; border-top: 1px solid var(--line); background: #fbfcfb; }
.modal-footer .btn { min-height: 36px; padding: 0 14px; font-size: 11.5px; }
.modal-footer .btn-danger-ghost { margin-right: auto; }
.confirm-body { display: flex; align-items: flex-start; gap: 12px; padding: 3px 0 5px; }
.confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-body p { color: var(--ink-soft); font-size: 12px; line-height: 1.75; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: rgba(4, 16, 13, 0.84);
  opacity: 0;
  transition: opacity 0.18s ease;
  backdrop-filter: blur(9px);
}
.lightbox.is-visible { opacity: 1; }
.lightbox-figure { width: min(880px, 92vw); max-height: 88vh; margin: 0; overflow: hidden; border-radius: 16px; background: #0d1f1b; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.lightbox-figure img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #f3f6f4; }
.lightbox-figure figcaption { padding: 12px 17px; color: #d3e6e0; font-size: 11.5px; text-align: center; background: rgba(255, 255, 255, 0.04); }
.lightbox-close { position: fixed; top: 20px; right: 22px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: #fff; }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.14); }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 4000; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 16px 38px -14px rgba(15, 31, 27, 0.3);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.toast-icon { display: inline-flex; flex: 0 0 auto; color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--blue); }
.toast-error { border-color: #f0d5d2; background: #fffdfc; }
.toast-info { border-color: #dbe7fa; background: #fcfdff; }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-3px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .content { padding-left: 26px; padding-right: 26px; }
  .dashboard-hero { gap: 22px; padding: 26px 28px; }
  .hero-key-art { display: none; }
  .stat-value { font-size: 23px; }
  .sale-layout { grid-template-columns: minmax(0, 1fr) 334px; }
}

@media (max-width: 1180px) {
  .sidebar { width: 232px; }
  .app-main { width: calc(100% - 232px); margin-left: 232px; }
  .topbar { padding: 0 22px; }
  .content { padding: 24px 22px 52px; }
  .hero-side { gap: 12px; }
  .hero-today { width: 192px; }
  .dashboard-grid-upper, .dashboard-grid-lower { grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); }
  .sale-layout { grid-template-columns: minmax(0, 1fr) 318px; }
  .report-summary-card { padding: 13px; }
  .report-summary-card > div > strong { font-size: 17px; }
  .report-summary-card .report-summary-icon { width: 32px; height: 32px; }
}

@media (max-width: 1020px) {
  .today-chip { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 25px; }
  .dashboard-grid-upper, .dashboard-grid-lower { grid-template-columns: 1fr; }
  .chart-card, .low-stock-card { min-height: auto; }
  .sale-layout { grid-template-columns: 1fr; }
  .sale-side { position: static; }
  .sale-summary { max-width: none; }
  .sale-side-tip { display: none; }
  .report-summary-grid, .customer-summary, .logistics-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  .report-lower-grid { grid-template-columns: 1fr; }
  .inventory-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login-page { grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr); }
  .login-visual { padding: 34px 36px 24px; }
  .visual-features { grid-template-columns: 1fr; gap: 8px; }
  .visual-feature { padding: 11px 12px; }
  .visual-copy h1 { font-size: 38px; }
  .visual-preview { width: 100%; }
  .collect-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    width: 256px;
    transform: translateX(-100%);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.25);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 290;
    display: block;
    background: rgba(5, 19, 16, 0.44);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(3px);
  }
  .sidebar-backdrop.is-visible { opacity: 1; visibility: visible; }
  .app-main { width: 100%; margin-left: 0; }
  .topbar { padding: 0 18px; height: 62px; }
  .mobile-menu { display: inline-flex; }
  .content { padding: 20px 18px 48px; }
  .login-page { display: block; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px; background: radial-gradient(circle at 90% 0%, rgba(15, 118, 110, 0.1), transparent 22rem), #f7f9f7; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
  .login-mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; }
  .login-mobile-brand strong { color: var(--ink); font-size: 17px; letter-spacing: 0.13em; }
  .login-card > h2 { font-size: 26px; }
  .topbar-user > div { display: none; }
  .topbar-user { border-left: 0; padding-left: 0; }
  .breadcrumb { font-size: 11px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-actions { width: 100%; }
  .page-actions .btn-primary { flex: 0 0 auto; }
  .inventory-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-form { grid-template-columns: 1fr; }
  .product-form-photo { position: static; max-width: 250px; margin: 0 auto; }
  .product-form .photo-upload-preview { width: 100%; }
  .report-tab-hint { display: none; }
  .detail-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content { padding: 16px 13px 42px; }
  .topbar { height: 58px; padding: 0 13px; }
  .breadcrumb span:first-child, .crumb-sep { display: none; }
  .topbar-sale { font-size: 11px; padding: 0 10px; }
  .topbar-sale .icon { width: 14px; height: 14px; }
  .alert-button { width: 33px; height: 33px; }
  .topbar-actions { gap: 4px; }
  .page-heading { margin-bottom: 17px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading p { font-size: 11.5px; }
  .dashboard-hero { flex-direction: column; gap: 20px; padding: 23px 20px; border-radius: 20px; }
  .hero-copy h1 { margin-top: 11px; font-size: 28px; }
  .hero-copy > p { font-size: 11.5px; }
  .hero-side { width: 100%; }
  .hero-today { width: 100%; }
  .stat-grid { gap: 9px; margin-top: 12px; }
  .stat-card { padding: 14px 14px; border-radius: 13px; }
  .stat-value { font-size: 21px; }
  .stat-detail { font-size: 8.5px; white-space: normal; }
  .stat-label { margin-top: 10px; }
  .card { padding: 16px; border-radius: 15px; }
  .card-head { margin-bottom: 12px; }
  .card-head h2 { font-size: 15px; }
  .dashboard-grid { gap: 12px; margin-top: 12px; }
  .dashboard-grid .card { min-height: auto; }
  .chart-container { min-height: 220px; }
  .recent-card .table-scroll { margin-right: -16px; margin-left: -16px; }
  .dashboard-orders-table { min-width: 620px; }
  .recent-card .card-foot-link { margin-bottom: -3px; }
  .rank-copy > small { font-size: 8px; }
  .filter-card { padding: 14px; }
  .filter-main { flex-direction: column; align-items: stretch; gap: 9px; }
  .search-field { max-width: none; }
  .date-presets { align-self: flex-start; }
  .filter-grid { gap: 9px; }
  .field-inline { flex: 1 1 calc(50% - 6px); }
  .field-inline .field-label { font-size: 10.5px; }
  .filter-meta { width: 100%; margin-left: 0; }
  .filter-summary { flex-wrap: wrap; }
  .table-card { border-radius: 15px; }
  .table-card .table-scroll { padding: 0 2px 4px; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .inventory-stats, .customer-summary, .report-summary-grid { gap: 8px; }
  .inv-stat, .customer-stat { padding: 11px 12px; border-radius: 11px; }
  .inv-stat > strong, .customer-stat > strong { font-size: 17px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .product-media { aspect-ratio: 1.35 / 1; }
  .product-body { padding: 10px; }
  .product-body h3 { min-height: 32px; margin-top: 5px; font-size: 11.5px; }
  .product-category { font-size: 8px; }
  .product-sku { font-size: 7.5px; max-width: 70px; }
  .product-location-row { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 6px; }
  .stock-line { font-size: 8.5px; }
  .product-price-row { margin-top: 8px; padding-top: 8px; }
  .product-price strong { font-size: 14px; }
  .product-cost { display: none; }
  .product-actions { padding: 6px; overflow-x: auto; }
  .product-actions .btn-xs { font-size: 10px; padding: 0 6px; }
  .product-actions .icon-btn { width: 24px; height: 24px; }
  .sale-meta-grid { grid-template-columns: 1fr; gap: 11px; }
  .selected-customer { align-items: flex-start; flex-wrap: wrap; }
  .selected-customer-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; padding-left: 52px; }
  .combo-input-wrap .input { font-size: 12px; }
  .combo-shortcut { display: none; }
  .summary-head h2 { font-size: 15px; }
  .report-tabs { flex-wrap: wrap; }
  .report-tab { flex: 1; text-align: center; }
  .report-filters { gap: 9px; }
  .report-filters .field-inline { flex: 1 1 100%; }
  .report-caption-bar { align-items: flex-start; flex-direction: column; gap: 3px; margin-top: 14px; }
  .report-summary-card { gap: 9px; padding: 12px; }
  .report-summary-icon { width: 31px; height: 31px; border-radius: 8px; }
  .report-summary-card > div > strong { font-size: 16px; }
  .report-summary-card > div > small { font-size: 8px; }
  .settings-tabs { width: 100%; overflow-x: auto; }
  .settings-tab { flex: 1; padding: 0 8px; white-space: nowrap; }
  .settings-card { padding: 15px; }
  .print-copy-badges { justify-content: flex-start; margin-top: 8px; }
  .print-settings-actions { align-items: stretch; flex-direction: column; }
  .print-settings-actions .btn { width: 100%; }
  .customer-detail-head { align-items: flex-start; flex-wrap: wrap; }
  .customer-detail-head .detail-badges { width: 100%; justify-content: flex-start; padding-left: 69px; }
  .customer-detail-stats { grid-template-columns: 1fr 1fr; }
  .customer-detail-stats > div:last-child { grid-column: span 2; }
  .price-history-head { grid-template-columns: 1fr; }
  .price-history-controls { align-items: stretch; flex-direction: column; gap: 7px; }
  .price-scope-tabs { width: 100%; }
  .price-scope-tabs button { flex: 1; text-align: center; }
  .price-sort-control, .price-customer-filter { justify-content: space-between; }
  .price-sort-control .select, .price-customer-filter .select { flex: 1; }
  .modal-overlay { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); border-radius: 15px; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body { padding: 15px 16px; }
  .modal-footer { padding: 11px 16px; gap: 6px; }
  .modal-footer .btn { min-height: 34px; padding: 0 11px; font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .span-2 { grid-column: span 1; }
  .collect-form { grid-template-columns: 1fr; }
  .collect-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .collect-actions { justify-content: space-between; }
  .success-grid { grid-template-columns: 1fr; }
  .alert-item { flex-wrap: wrap; }
  .alert-item-copy { flex-basis: calc(100% - 50px); }
  .alert-item-stock { margin-left: 48px; text-align: left; }
  .detail-banner { flex-direction: column; }
  .detail-badges { justify-content: flex-start; }
  .shipment-banner { flex-direction: column; }
  .shipment-tracking-line { gap: 5px; }
  .shipment-tracking-line > strong { width: 100%; font-size: 17px; }
  .shipment-tracking-line .btn { margin-left: 0; }
  .shipment-info-grid { grid-template-columns: 1fr; }
  .edit-sale-meta-grid { grid-template-columns: 1fr; }
  .edit-sale-add-row { align-items: stretch; flex-direction: column; }
  .edit-sale-add-row .btn { width: 100%; }
  .edit-sale-summary { width: 100%; }
  .outbound-detail-head { flex-direction: column; }
  .outbound-ship-grid { grid-template-columns: 1fr; }
  .outbound-section-head { align-items: flex-start; flex-wrap: wrap; }
  .outbound-photo-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .shipment-event-form { grid-template-columns: 1fr; }
  .shipment-event-form-actions { flex-wrap: wrap; }
  .shipment-mini { align-items: flex-start; }
  .shipment-mini-count { display: none; }
  .shipment-mini-main > small { white-space: normal; }
  .logistics-table { min-width: 900px; }
  .toast-root { right: 12px; bottom: 12px; }
  .toast { max-width: calc(100vw - 24px); }
  .login-panel { padding: 26px 18px; }
  .login-card > h2 { font-size: 24px; }
  .login-card .input { height: 44px; }
  .demo-chip { grid-template-columns: 18px 1fr; }
  .demo-chip small { grid-column: 2; }
}

@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; }
  .inventory-stats, .customer-summary { grid-template-columns: 1fr 1fr; }
  .topbar-user { display: none; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-actions .btn-xs { flex: 1; justify-content: center; }
  .quick-pay { gap: 6px; }
  .settings-tab { font-size: 10px; }
  .detail-info-grid { gap: 8px; }
}

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

/* ---- 2026 feature expansion ---- */
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { color: var(--primary); }
.pending-money { color: #b7791f; font-weight: 600; }
.credit-cell { color: var(--primary); font-family: var(--mono); font-weight: 600; }
.payment-pending-hint { display: flex; gap: 4px; margin: 6px 0 0; color: #a36b25; font-size: 8.5px; line-height: 1.5; }
.credit-panel { margin-top: 9px; padding: 8px 10px; border: 1px solid #d7e7df; border-radius: 8px; background: #f7fbf9; }
.credit-panel.is-hidden { display: none; }
.credit-panel-head, .credit-apply { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9px; color: var(--muted); }
.credit-panel-head strong { color: var(--primary); font-family: var(--mono); }
.credit-apply { margin-top: 6px; }
.credit-apply .mini-money-input { width: 95px; }
.customer-credit { color: var(--primary); font-size: 9px; font-weight: 600; }
.shipment-dot { display: inline-flex; margin-left: 6px; padding: 1px 4px; border-radius: 3px; background: #f2f4f3; color: #8b9993; font-size: 7.5px; vertical-align: middle; }
.shipment-dot.is-shipped { background: #e7f5f2; color: var(--primary); }
.shipment-dot.is-shortage { background: #fff0ee; color: #b13d37; }
.review-banner { display: flex; align-items: flex-start; gap: 7px; margin: 9px 0; padding: 8px 10px; border: 1px solid #f1dcb8; border-radius: 7px; background: #fffbf3; color: #86632a; font-size: 9px; line-height: 1.6; }
.review-banner a { margin-left: 5px; color: var(--primary); font-weight: 600; }
.review-approved-line { display: flex; align-items: center; gap: 5px; margin: 8px 0; color: var(--primary); font-size: 9px; }
.review-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.review-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.review-stat > span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.review-stat strong { display: block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 20px; }
.review-stat small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.review-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.review-toolbar .search-field { flex: 1; }
.review-toolbar .select { width: 170px; }
.review-loading, .review-loading { padding: 24px; color: var(--muted); text-align: center; font-size: 11px; }
.review-table .pending-money { color: #b7791f; }
.review-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.review-detail-box { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.review-detail-box.is-pending { border-color: #f0dfbd; background: #fffcf5; }
.review-detail-box > span { display: block; color: var(--muted); font-size: 8.5px; }
.review-detail-box strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 16px; }
.review-detail-box small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.review-items { margin-top: 12px; }
.review-payment-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; color: var(--ink); font-size: 10px; font-weight: 700; }
.review-payment-title span { color: var(--muted); font-size: 8px; font-weight: 400; }
.review-payments { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.review-payment-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; }
.review-payment-icon { color: var(--primary); }
.review-payment-row > div { flex: 1; min-width: 0; }
.review-payment-row strong { display: block; font-family: var(--mono); font-size: 11px; }
.review-payment-row small { display: block; color: var(--muted); font-size: 8px; }
.review-writeoff { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.review-writeoff strong { font-size: 10px; }
.review-writeoff p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.review-writeoff-input { display: flex; align-items: center; gap: 3px; width: 120px; }
.review-writeoff-input .input { padding: 6px; text-align: right; }
.review-total-hint { margin-top: 7px; color: var(--muted); font-size: 8.5px; }
.customer-detail-stats.has-five { grid-template-columns: repeat(5, 1fr); }
.customer-detail-stats.has-six { grid-template-columns: repeat(6, 1fr); }
.customer-year-spend { color: #3566b8; font-size: 9px; font-weight: 600; white-space: nowrap; }
.customer-order-count { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
@media (max-width: 900px) {
  .customer-detail-stats.has-six { grid-template-columns: repeat(3, 1fr); }
}
.customer-order-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.customer-order-filter-title { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.customer-order-filter-title strong { color: var(--ink); }
.customer-order-filter-title span { color: var(--primary); }
.customer-order-filter-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.customer-order-filter-controls .select { width: 94px; }
.customer-order-filter-controls .input { width: 120px; }
.customer-order-filter-controls .input.is-hidden { display: none; }
.credit-move-list { display: flex; flex-direction: column; gap: 3px; }
.credit-move { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-bottom: 1px solid #f1f5f2; font-size: 8.5px; }
.credit-move-icon { color: var(--primary); }
.credit-move > div { flex: 1; }
.credit-move strong { display: block; font-family: var(--mono); }
.credit-move small { display: block; color: var(--muted); }
.credit-move > span:last-child { color: var(--muted); white-space: nowrap; }
.repay-summary { display: flex; gap: 20px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.repay-summary > div { flex: 1; }
.repay-summary span { display: block; color: var(--muted); font-size: 8px; }
.repay-summary strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 15px; }
.repay-tip { padding: 7px 8px; border-radius: 6px; background: #f8fbfa; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.inline-add-form { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.inline-add-form .input { max-width: 310px; }
.report-summary-grid { grid-template-columns: repeat(6, 1fr) !important; }
.report-summary-card.tone-slate .report-summary-icon { color: #5b6b78; background: #eef2f5; }
.report-summary-card.tone-green .report-summary-icon { color: #2e7d32; background: #edf7ee; }
.profit-cell { color: #2e7d32; font-family: var(--mono); font-weight: 600; }
.report-product-sales-card { margin-top: 12px; }
.product-sales-table { min-width: 680px; }
.inventory-stats.five { grid-template-columns: repeat(5, 1fr) !important; }
.customer-summary { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) {
  .customer-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .customer-summary { grid-template-columns: repeat(2, 1fr); }
}
.view-toggle { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9f8; }
.view-toggle button { display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 9px; cursor: pointer; }
.view-toggle button.is-active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15,31,27,.08); }
.inventory-list { margin-top: 12px; }
.inventory-table-wrap { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inventory-table { min-width: 860px; }
.inventory-table td, .inventory-table th { padding: 7px 8px; white-space: nowrap; }
.inventory-table td:nth-child(1), .inventory-table td:nth-child(2) { white-space: normal; }
.inventory-name { display: flex; align-items: center; gap: 7px; }
.inventory-thumb { width: 34px; height: 34px; flex: 0 0 34px; overflow: hidden; border-radius: 5px; background: #f2f7f5; }
.inventory-thumb img, .inventory-thumb .photo-fallback { width: 100%; height: 100%; object-fit: cover; }
.inventory-name strong { display: block; font-size: 10px; }
.inventory-name small { display: block; color: var(--muted); font-size: 7.5px; }
.product-card .product-category { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge-review { background: #fff0cc !important; color: #8a5c12 !important; border-color: #edd8a6 !important; }
@media (max-width: 900px) {
  .review-stats { grid-template-columns: 1fr 1fr; }
  .report-summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .inventory-stats.five { grid-template-columns: repeat(2, 1fr); }
  .customer-detail-stats.has-five { grid-template-columns: repeat(2, 1fr); }
  .customer-order-filter { align-items: flex-start; flex-direction: column; }
  .review-detail-grid { grid-template-columns: 1fr; }
  .font-scale-btn { display: none; }
}

/* ---- audit trail ---- */
.audit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.audit-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.audit-stat > span { display: block; color: var(--muted); font-size: 9px; }
.audit-stat strong { display: inline-block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 22px; }
.audit-stat small { margin-left: 4px; color: var(--muted); font-size: 8px; }
.audit-filter-card { margin-bottom: 12px; padding: 11px 13px; }
.audit-filter-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.audit-filter-row .search-field { flex: 1; min-width: 240px; }
.audit-filter-row .select { width: 130px; }
.audit-filter-row .input[type="date"] { width: 128px; }
.audit-table-card { padding: 0; overflow: hidden; }
.audit-table { min-width: 980px; }
.audit-table th { padding-top: 10px; padding-bottom: 10px; }
.audit-table td { vertical-align: middle; }
.audit-time { color: var(--muted); font-family: var(--mono); font-size: 8.5px; white-space: nowrap; }
.audit-user { display: flex; align-items: center; gap: 6px; }
.audit-user small { display: block; color: var(--muted); font-size: 7.5px; }
.audit-entity-type { display: inline-flex; padding: 2px 5px; border-radius: 3px; background: #f2f6f4; color: #5d7169; font-size: 8px; }
.audit-summary { display: block; max-width: 480px; color: #3c4c46; font-size: 9px; line-height: 1.55; }
.audit-page-info { color: var(--muted); font-size: 9px; }
.audit-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audit-detail-meta > div { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfb; }
.audit-detail-meta span { display: block; color: var(--muted); font-size: 8px; }
.audit-detail-meta strong { display: block; margin-top: 3px; font-size: 10px; }
.delete-sale-warning { display: flex; align-items: flex-start; gap: 6px; padding: 9px 10px; border: 1px solid #f0cac7; border-radius: 7px; background: #fff8f7; color: #a33f39; }
.delete-sale-warning strong { display: block; font-size: 10px; }
.delete-sale-warning span { display: block; margin-top: 2px; color: #8d5d58; font-size: 8.5px; line-height: 1.5; }
.deleted-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.deleted-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.deleted-stat > span { display: block; color: var(--muted); font-size: 9px; }
.deleted-stat strong { display: inline-block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 22px; }
.deleted-stat small { margin-left: 4px; color: var(--muted); font-size: 8px; }
.deleted-stat.is-warning { background: #fffcf4; border-color: #f0dfbd; }
.deleted-filter { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 11px 13px; }
.deleted-filter .search-field { flex: 1; }
.deleted-table { min-width: 900px; }
.review-check-cell { width: 34px; text-align: center; }
.review-check-cell input { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }
.stat-card.is-clickable { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.stat-card.is-clickable:hover { transform: translateY(-2px); border-color: #c9dbd3; box-shadow: 0 10px 24px rgba(15,31,27,.08); }
.stat-card.is-clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-card.is-clickable .stat-link { pointer-events: none; }
.topbar-warning { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 1px solid #eadbbb; border-radius: 7px; background: #fffaf0; color: #8a651b; font: inherit; font-size: 9px; cursor: pointer; white-space: nowrap; }
.topbar-warning:hover { border-color: #d8c59d; background: #fff7e6; }
.topbar-warning b { min-width: 17px; padding: 1px 4px; border-radius: 8px; background: #f4e4bf; color: #7b5710; font-family: var(--mono); font-size: 8px; text-align: center; }
.topbar-warning.is-unpaid { border-color: #efd0cd; background: #fff7f6; color: #a33f39; }
.topbar-warning.is-unpaid:hover { border-color: #e3b7b3; background: #fff1ef; }
.topbar-warning.is-unpaid b { background: #f4d7d4; color: #9d332d; }
.topbar-warning.is-hidden { display: none; }
@media (max-width: 1120px) {
  .topbar-warning span { display: none; }
  .topbar-warning { padding: 0 6px; }
}
.report-chart-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.report-chart-modes { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #f6f9f7; }
.report-chart-modes button { padding: 4px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-size: 8.5px; cursor: pointer; white-space: nowrap; }
.report-chart-modes button:hover { color: var(--primary); }
.report-chart-modes button.is-active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15,31,27,.08); }
.report-sort-btn { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; }
.report-sort-btn:hover { color: var(--primary); }
.report-sort-arrow { color: #aab7b1; font-family: var(--mono); font-size: 9px; line-height: 1; }
.report-sort-btn.is-active { color: var(--primary); }
.report-sort-btn.is-active .report-sort-arrow { color: var(--primary); }
th.align-right .report-sort-btn { justify-content: flex-end; }
th.align-center .report-sort-btn { justify-content: center; }
.report-list-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 0 0 8px; }
.report-sort-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fafcfb; color: var(--muted); font: inherit; font-size: 8.5px; cursor: pointer; }
.report-sort-chip:hover { border-color: #b9d3c9; color: var(--primary); }
.report-sort-chip.is-active { border-color: #b9d3c9; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.report-sort-chip span { font-family: var(--mono); font-size: 8px; }
.label-preview-card { padding: 10px 12px; border: 1px dashed #b9d3c9; border-radius: 8px; background: #f7fbf9; }
.label-preview-tag { display: block; color: var(--muted); font-size: 8px; }
.label-preview-card strong { display: block; margin-top: 4px; font-size: 13px; }
.label-preview-card p { margin: 2px 0 0; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.label-preview-card b { display: block; margin-top: 3px; color: var(--primary); font-family: var(--mono); font-size: 15px; }
.security-warning { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 12px; padding: 9px 10px; border: 1px solid #f0cac7; border-radius: 7px; background: #fff8f7; color: #a33f39; }
.security-warning strong { display: block; font-size: 10px; }
.security-warning span { display: block; margin-top: 2px; color: #8d5d58; font-size: 8.5px; line-height: 1.5; }
.security-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }
.security-actions .btn { flex: 0 0 auto; }
.audit-detail-device { margin-top: 8px; padding: 7px 9px; border-radius: 7px; background: #f7f8f8; }
.audit-detail-device span { color: var(--muted); font-size: 8px; }
.audit-detail-device p { margin: 3px 0 0; color: #56665f; font-family: var(--mono); font-size: 8px; word-break: break-all; }
.audit-detail-summary { margin-top: 10px; padding: 9px 10px; border-radius: 7px; background: #f7fbf9; }
.audit-detail-summary span { color: var(--muted); font-size: 8px; }
.audit-detail-summary p { margin: 4px 0 0; color: var(--ink); font-size: 10px; line-height: 1.7; }
.audit-change-table { min-width: 540px; }
.audit-before { color: #9b5a53; font-size: 9px; white-space: pre-wrap; word-break: break-word; }
.audit-after { color: #256b55; font-size: 9px; white-space: pre-wrap; word-break: break-word; }
.audit-raw { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.audit-raw summary { color: var(--primary); font-size: 9px; cursor: pointer; }
.audit-raw > div { margin-top: 8px; }
.audit-raw strong { display: block; margin-bottom: 3px; font-size: 9px; }
.audit-raw pre { max-height: 190px; overflow: auto; margin: 0; padding: 7px 8px; border-radius: 5px; background: #f5f8f6; color: #4b5d56; font-family: var(--mono); font-size: 8px; white-space: pre-wrap; word-break: break-word; }
.audit-path { margin-top: 10px; color: var(--muted); font-size: 8px; }
@media (max-width: 900px) {
  .audit-stats { grid-template-columns: 1fr 1fr; }
  .audit-detail-meta { grid-template-columns: 1fr; }
  .audit-filter-row .select, .audit-filter-row .input[type="date"] { flex: 1; min-width: 130px; }
}

/* ---- shipping status / preorders / shortages ---- */
.shipping-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.shipping-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.shipping-stat > span { display: block; color: var(--muted); font-size: 9px; }
.shipping-stat strong { display: inline-block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 22px; }
.shipping-stat small { margin-left: 4px; color: var(--muted); font-size: 8px; }
.shipping-stat.is-warning { background: #fffcf4; border-color: #f0dfbd; }
.shipping-stat.is-danger { background: #fff9f8; border-color: #f0cac7; }
.shipping-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 11px 13px; }
.shipping-tabs { display: inline-flex; gap: 4px; margin-bottom: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9f8; }
.shipping-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 15px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.shipping-tabs button em { min-width: 18px; padding: 1px 5px; border-radius: 8px; background: #e8eeeb; color: #64736d; font-family: var(--mono); font-size: 8px; font-style: normal; text-align: center; }
.shipping-tabs button.is-active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15,31,27,.08); font-weight: 600; }
.shipping-tabs button.is-active em { background: var(--primary-soft); color: var(--primary); }
.shipping-section.is-hidden { display: none; }
.outbound-stats { grid-template-columns: repeat(5, 1fr); }
.outbound-filter-row { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.outbound-filter-row .date-presets { margin-right: 2px; }
.outbound-filter-row .field-inline { min-width: 132px; }
.outbound-filter-row .btn { margin-left: auto; }
@media (max-width: 1000px) {
  .outbound-stats { grid-template-columns: repeat(3, 1fr); }
  .outbound-filter-row .btn { margin-left: 0; }
}
@media (max-width: 650px) {
  .outbound-stats { grid-template-columns: 1fr 1fr; }
}
.shipping-stat.is-clickable { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.shipping-stat.is-clickable:hover { transform: translateY(-1px); border-color: #c8d9d1; box-shadow: 0 6px 16px rgba(15,31,27,.07); }
.shipping-stat.is-clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.shipping-stat.is-selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.shipping-section.is-flashing { animation: sectionFlash 1.2s ease; }
@keyframes sectionFlash { 0%, 100% { box-shadow: none; } 25%, 65% { box-shadow: 0 0 0 3px rgba(15,118,110,.16); } }
.shipping-filter .search-field { flex: 1; }
.shipping-scope { color: var(--muted); font-size: 9px; white-space: nowrap; }
.shipping-section { margin-bottom: 12px; }
.shipping-section .card-head { padding-bottom: 8px; }
.shipping-table { min-width: 860px; }
.shipping-missing { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 4px; background: #fff4e8; color: #a56818; font-size: 8px; white-space: nowrap; }
.shortage-qty { display: inline-flex; min-width: 30px; justify-content: center; padding: 2px 6px; border-radius: 4px; background: #fff0ee; color: #b13d37; font-family: var(--mono); font-weight: 700; }
.shortage-note { color: #b13d37 !important; margin-top: 3px; }
.shortage-confirm-panel { margin-top: 10px; padding: 10px 12px; border: 1px solid #f0cac7; border-radius: 8px; background: #fff9f8; }
.shortage-confirm-panel.is-hidden { display: none; }
.shortage-confirm-head { display: flex; align-items: flex-start; gap: 6px; color: #a33f39; }
.shortage-confirm-head strong { display: block; font-size: 10px; }
.shortage-confirm-head span { display: block; margin-top: 2px; color: #8d5d58; font-size: 8.5px; line-height: 1.5; }
.shortage-confirm-check { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: #6e4d49; font-size: 9px; line-height: 1.5; }
.shortage-confirm-check input { margin-top: 1px; accent-color: #b13d37; }
.shortage-confirm-panel .field { margin-top: 7px; }
.shortage-owner-input { height: 28px; padding: 4px 6px; font-size: 9px; }
.shortage-owner-input:disabled { background: #f6f8f7; color: #b7c2bd; }
.shortage-qty.is-zero { color: #a1aca8; background: #f5f8f6; }
.preorder-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.preorder-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.preorder-stat > span { display: block; color: var(--muted); font-size: 9px; }
.preorder-stat strong { display: inline-block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 20px; }
.preorder-stat.is-warning { background: #fffcf4; border-color: #f0dfbd; }
.preorder-stat.is-danger { background: #fff9f8; border-color: #f0cac7; }
.preorder-filter { margin-bottom: 12px; }
.preorder-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preorder-table { min-width: 1020px; }
.preorder-table td { vertical-align: middle; }
.preorder-items-preview { display: block; color: #4c5c56; font-size: 9px; line-height: 1.5; }
.points-chip, .tracking-chip { display: inline-flex; padding: 2px 5px; border-radius: 4px; font-size: 8px; white-space: nowrap; }
.points-chip { background: #fff8e8; color: #8a651b; }
.tracking-chip { background: #edf7f3; color: #17685a; }
.preorder-form .form-section-title { margin-top: 7px; padding: 5px 0 4px; border-bottom: 1px solid var(--line); color: var(--primary); font-size: 9px; font-weight: 700; letter-spacing: .5px; }
.preorder-add-product { display: flex; gap: 7px; }
.preorder-add-product .select { flex: 1; }
.preorder-items-wrap { border: 1px solid var(--line); border-radius: 7px; }
.preorder-items-wrap table { min-width: 540px; }
.preorder-total-line { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; padding: 5px 2px; }
.preorder-total-line span { color: var(--muted); font-size: 9px; }
.preorder-total-line strong { color: var(--primary); font-family: var(--mono); font-size: 18px; }
.inline-money, .inline-qty { width: 92px; height: 28px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-family: var(--mono); font-size: 9px; text-align: right; }
.inline-qty { width: 60px; text-align: center; }
@media (max-width: 1100px) {
  .shipping-stat-grid { grid-template-columns: 1fr 1fr; }
  .preorder-stats { grid-template-columns: 1fr 1fr; }
  .preorder-filter .filter-main { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .shipping-filter { flex-direction: column; align-items: stretch; }
  .shipping-scope { white-space: normal; }
  .preorder-stats { grid-template-columns: 1fr 1fr; }
}
