/* Trailhead Stock — a static port of the original inventory app's look:
   navy sidebar, warm sand page, white cards with a hairline ring, sea-blue actions, orange for "do this now".
   (The original is Tailwind + IBM Plex Sans Arabic; this demo has no web fonts or build step.) */
:root {
  --sand: #f5f3ef;
  --wave: #5c9bc2;
  --sea-50: #eef4fa; --sea-100: #dbe7f3; --sea-200: #b7cde5; --sea-500: #3b6fa3;
  --sea-600: #24578a; --sea-700: #1a4775; --sea-800: #153a61; --sea-900: #0e2a48; --sea-950: #081a2e;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
  --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --orange-50: #fff7ed; --orange-200: #fed7aa; --orange-500: #f97316; --orange-600: #ea580c; --orange-700: #c2410c; --orange-800: #9a3412; --orange-900: #7c2d12;
  --green-50: #ecfdf5; --green-200: #a7f3d0; --green-700: #047857; --green-800: #065f46;
  --red-50: #fef2f2; --red-200: #fecaca; --red-600: #dc2626; --red-700: #b91c1c;
  --sky-50: #f0f9ff; --sky-200: #bae6fd; --sky-700: #0369a1;
  --violet-50: #f5f3ff; --violet-200: #ddd6fe; --violet-700: #6d28d9;
  --ring: 0 0 0 1px rgba(226, 232, 240, .8);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --font: 'IBM Plex Sans', 'IBM Plex Sans Arabic', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bar-h: 34px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding-top: var(--bar-h); background: var(--sand); color: var(--slate-900);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--sea-600); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.tabular, .num, .stat-v, .totals dd { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.muted { color: var(--slate-600); }
.meta { font-size: .78rem; color: var(--slate-500); }
.hint { font-size: .82rem; color: var(--slate-500); margin-bottom: 12px; }
.hint.mt { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.pos { color: var(--green-700); }
.neg { color: var(--red-600); }
.sea { color: var(--sea-800); }
.ms { margin-left: 8px; }
.upper { text-transform: uppercase; }
.ico { flex: none; }
.show-sm { display: none; }

/* ---------- shell (original: lg:flex-row, navy aside w-60) ---------- */
.shell { display: flex; min-height: calc(100dvh - var(--bar-h)); }
.side {
  background: var(--sea-900); color: #fff; width: 240px; flex: none; display: flex; flex-direction: column;
  position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h));
}
.side-top { padding: 24px 20px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark { display: grid; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text b { font-size: 1.15rem; letter-spacing: -.01em; }
.brand-text small { color: var(--sea-200); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-tag { border-radius: 999px; background: rgba(255, 255, 255, .1); padding: 2px 10px; font-size: 11px; font-weight: 500; color: var(--sea-100); }
.side-out-m { display: none; }
.side-nav { padding: 0 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; white-space: nowrap; border-radius: 8px; padding: 8px 12px;
  font-size: .875rem; font-weight: 500; color: var(--sea-100); text-decoration: none; background: none; border: 0; width: 100%;
  transition: background .15s, color .15s;
}
.nav-link .ico { opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, .15); color: #fff; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 12px 16px; display: grid; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 6px; font-size: .84rem; }
.who > span:last-child { display: grid; gap: 3px; min-width: 0; }
.who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sea-700); color: var(--sea-100); font-weight: 600; font-size: .8rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }

#view { flex: 1; min-width: 0; padding: 32px 40px; outline: none; }
.wrap { max-width: 1152px; margin: 0 auto; }
.view-enter .wrap { animation: rise .3s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading { color: var(--slate-500); padding: 40px 0; text-align: center; }
.narrow { max-width: 768px; }

/* ---------- role chips ---------- */
.role { display: inline-block; width: max-content; padding: 1px 8px; border-radius: 999px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.role-owner { background: var(--orange-500); color: #fff; }
.role-warehouse { background: var(--wave); color: #fff; }
.role-sales { background: #d1fae5; color: var(--green-800); }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.ph-text { min-width: 0; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--slate-900); line-height: 1.25; }
.sub { margin-top: 4px; font-size: .875rem; color: var(--slate-500); }
.back { display: inline-block; margin-bottom: 8px; font-size: .875rem; color: var(--slate-500); text-decoration: none; }
.back:hover { color: var(--slate-800); }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.title-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 8px 16px;
  font-size: .875rem; font-weight: 600; white-space: nowrap; border: 0; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.btn.primary { background: var(--sea-700); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover:not(:disabled) { background: var(--sea-800); }
.btn.secondary { background: #fff; color: var(--slate-800); box-shadow: inset 0 0 0 1px var(--slate-300); }
.btn.secondary:hover:not(:disabled) { background: var(--slate-50); }
.btn.danger { background: #fff; color: var(--red-700); box-shadow: inset 0 0 0 1px var(--red-200); }
.btn.danger:hover:not(:disabled) { background: var(--red-50); }
.btn.danger-solid { background: var(--red-600); color: #fff; }
.btn.danger-solid:hover { background: var(--red-700); }
.btn.accent { background: var(--orange-500); color: #fff; box-shadow: var(--shadow); }
.btn.accent:hover:not(:disabled) { background: var(--orange-600); }
.btn.full { width: 100%; }
.link { font-weight: 500; color: var(--sea-700); text-decoration: none; }
.link:hover { color: var(--sea-900); text-decoration: underline; }
.link.small { font-size: .875rem; }
.plain-link { text-decoration: none; }
.plain-link:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--slate-400); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--red-50); color: var(--red-600); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; padding: 2px 8px; font-size: .75rem; font-weight: 500; box-shadow: inset 0 0 0 1px transparent; }
.b-gray { background: var(--slate-100); color: var(--slate-700); }
.b-green { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-200); }
.b-orange { background: var(--orange-50); color: var(--orange-700); box-shadow: inset 0 0 0 1px var(--orange-200); }
.b-red { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1px var(--red-200); }
.b-blue { background: var(--sky-50); color: var(--sky-700); box-shadow: inset 0 0 0 1px var(--sky-200); }
.b-sea { background: var(--sea-50); color: var(--sea-800); box-shadow: inset 0 0 0 1px var(--sea-200); }
.b-violet { background: var(--violet-50); color: var(--violet-700); box-shadow: inset 0 0 0 1px var(--violet-200); }

/* ---------- stats & cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { min-width: 0; border-radius: 12px; padding: 20px; background: #fff; box-shadow: var(--ring), var(--shadow); }
.stat-l { font-size: .875rem; color: var(--slate-500); }
.stat-v { margin-top: 8px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.stat-s { margin-top: 4px; font-size: .875rem; color: var(--slate-500); }
.stat-s b.pos { font-weight: 600; }
.stat.sea { background: var(--sea-800); color: #fff; box-shadow: 0 0 0 1px var(--sea-900), var(--shadow); }
.stat.sea .stat-l { color: var(--sea-100); }
.stat.sea .stat-s { color: var(--sea-200); }

.card { border-radius: 12px; background: #fff; box-shadow: var(--ring), var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--slate-100); }
.card-h h2 { font-size: .875rem; font-weight: 600; color: var(--slate-800); }
.card-f { border-top: 1px solid var(--slate-100); padding: 12px 16px; }
.pad { padding: 20px; }
.empty { padding: 32px 20px; text-align: center; font-size: .875rem; color: var(--slate-500); }
.empty.big { padding: 80px 20px; display: grid; gap: 8px; }
.dot-title { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.orange { background: var(--orange-500); }

.grid-2 { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid-2.tight { margin-top: 0; }
.grid-3 { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 24px; min-width: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--slate-100); }
.rows li:first-child { border-top: 0; }
.rows .grow { min-width: 0; flex: 1; }
.rows .grow .link, .rows .grow .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .end { text-align: right; display: grid; justify-items: end; gap: 4px; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: .875rem; margin-bottom: 4px; }
.bar-label span:first-child { font-weight: 500; color: var(--slate-700); }
.bar-label span:last-child { color: var(--slate-600); }
.bar-track { height: 10px; border-radius: 999px; background: var(--slate-100); }
.bar-fill { height: 10px; border-radius: 999px; background: var(--sea-600); transform-origin: left; animation: grow .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }

.dl { margin: 0; display: grid; gap: 10px; font-size: .875rem; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; }
.dl dt { color: var(--slate-500); }
.dl dd { margin: 0; text-align: right; font-weight: 500; color: var(--slate-800); }
.note { margin-top: 16px; border-top: 1px solid var(--slate-100); padding-top: 12px; font-size: .875rem; color: var(--slate-600); white-space: pre-line; }

/* product thumb (the original shows the photo, or the brand mark faded) */
.thumb { display: inline-grid; place-items: center; flex: none; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--slate-200); }
.thumb svg { width: 58%; height: 58%; }
.thumb-md { width: 44px; height: 52px; }
.thumb-sm { width: 36px; height: 44px; }
.t-gear { color: var(--sea-600); background: var(--sea-50); }
.t-acc { color: var(--slate-500); background: var(--slate-50); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead { background: rgba(248, 250, 252, .7); }
.tbl th { padding: 10px 16px; text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); white-space: nowrap; }
.tbl td { padding: 12px 16px; font-size: .875rem; border-top: 1px solid var(--slate-100); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(248, 250, 252, .6); }
.tbl .num { text-align: right; }
.tbl tfoot { background: rgba(248, 250, 252, .7); }
.tbl tfoot td { border-top: 1px solid var(--slate-200); }
.tbl.plain thead { background: none; }
.tbl.plain th:first-child, .tbl.plain td:first-child { padding-left: 0; }
.tbl.plain th:last-child, .tbl.plain td:last-child { padding-right: 0; }
.prod { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 180px; }
.prod > span:last-child { min-width: 0; }
.onhand { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.tbl.lines td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.tbl.lines td.num { padding-top: 16px; }
.tbl.lines td:last-child { padding-top: 10px; width: 44px; }
.w-prod { min-width: 260px; }
.w-qty { width: 100px; }
.w-price { width: 150px; }
.avail { font-size: .75rem; color: var(--slate-500); margin-top: 4px; min-height: 1em; }
.avail.over { color: var(--red-600); font-weight: 600; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.tabs { display: flex; border-radius: 8px; background: #fff; padding: 4px; box-shadow: inset 0 0 0 1px var(--slate-200); }
.tabs a { border-radius: 6px; padding: 6px 12px; font-size: .875rem; font-weight: 500; color: var(--slate-600); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--slate-900); }
.tabs a.on { background: var(--sea-700); color: #fff; }
.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex: 1; }
.search-form input[name="q"] { max-width: 320px; flex: 1; min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--slate-700); white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--sea-700); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border-radius: 999px; padding: 4px 12px; font-size: .875rem; font-weight: 500; background: #fff; color: var(--slate-600); box-shadow: inset 0 0 0 1px var(--slate-200); text-decoration: none; }
.chip:hover { color: var(--slate-900); }
.chip.on { background: var(--sea-700); color: #fff; box-shadow: inset 0 0 0 1px var(--sea-700); }

/* ---------- forms ---------- */
input, select, textarea {
  display: block; width: 100%; border: 0; border-radius: 8px; background: #fff; padding: 8px 12px; font-size: .875rem; color: var(--slate-900);
  box-shadow: inset 0 0 0 1px var(--slate-300); transition: box-shadow .15s;
}
input[type="checkbox"], input[type="radio"] { width: auto; box-shadow: none; padding: 0; }
input::placeholder, textarea::placeholder { color: var(--slate-400); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--sea-600); }
label { display: block; font-size: .875rem; font-weight: 500; color: var(--slate-700); }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label small { display: block; margin-top: 4px; font-size: .75rem; font-weight: 400; color: var(--slate-500); }
.form-cards { display: grid; gap: 24px; }
.form-stack { display: grid; gap: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid .span-2 { grid-column: span 2; }
.form-error { color: var(--red-600); font-size: .875rem; font-weight: 500; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 12px; }
.seg { display: flex; gap: 8px; margin-bottom: 16px; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border-radius: 8px; padding: 8px 12px; font-size: .875rem; font-weight: 500; background: #fff; color: var(--slate-700); box-shadow: inset 0 0 0 1px var(--slate-300); }
.seg label.on { background: var(--sea-700); color: #fff; box-shadow: inset 0 0 0 1px var(--sea-700); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:focus-within { outline: 2px solid var(--sea-600); outline-offset: 2px; }

.totals { margin: 0 0 0 auto; width: 100%; max-width: 380px; display: grid; gap: 6px; font-size: .875rem; align-self: end; }
#totals { margin-top: 24px; }
.grid-2 #totals { margin-top: 0; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; }
.totals dt { color: var(--slate-500); }
.totals dd { margin: 0; }
.totals .grand { border-top: 1px solid var(--slate-200); padding-top: 8px; font-size: 1rem; font-weight: 700; }
.totals .grand dt { color: var(--slate-900); }

/* ---------- shipments ---------- */
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.steps li { text-align: center; font-size: .75rem; color: var(--slate-500); }
.steps i { display: block; height: 6px; border-radius: 999px; background: var(--slate-200); margin-bottom: 8px; }
.steps li.done i { background: var(--sea-600); }
.steps li.done span { font-weight: 600; color: var(--sea-800); }
.receive { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-radius: 12px; background: var(--orange-50); padding: 20px; box-shadow: inset 0 0 0 1px var(--orange-200); }
.receive .strong { color: var(--orange-900); }
.receive p:not(.strong) { font-size: .875rem; color: var(--orange-800); }
.received { margin-top: 24px; display: flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--green-50); padding: 16px; font-size: .875rem; font-weight: 500; color: var(--green-800); box-shadow: inset 0 0 0 1px var(--green-200); }

/* ---------- invoice ---------- */
.invoice { padding: 32px; }
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px; border-bottom: 1px solid var(--slate-100); padding-bottom: 24px; }
.inv-brand { display: flex; align-items: center; gap: 12px; }
.inv-brand div { display: grid; line-height: 1.2; }
.inv-brand b { font-size: 1.1rem; color: var(--sea-900); }
.inv-brand small { color: var(--slate-500); font-size: .8rem; }
.inv-ref { text-align: right; font-size: .875rem; }
.eyebrow { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); }
.inv-ref .big { font-size: 1.1rem; font-weight: 700; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px 0; font-size: .875rem; }
.inv-parties .eyebrow { margin-bottom: 4px; }
.inv-parties .end { text-align: right; }
.invoice .totals { margin-top: 24px; }
.inv-foot { margin-top: 32px; border-top: 1px solid var(--slate-100); padding-top: 16px; text-align: center; font-size: .75rem; color: var(--slate-500); }

/* ---------- modal & toasts ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(8, 26, 46, .5); animation: fade .15s both; }
.backdrop.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35); animation: pop .2s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-body { margin-top: 8px; color: var(--slate-600); font-size: .9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--sea-900); color: #fff; font-size: .9rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .25s both; }
.toast-ok { background: var(--green-800); }
.toast-error { background: var(--red-700); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }

/* ---------- login (original: centred white card over a navy wash) ---------- */
.login { position: relative; min-height: calc(100dvh - var(--bar-h)); display: grid; place-items: center; padding: 32px 16px; overflow: hidden;
  background: linear-gradient(180deg, var(--sea-950) 0%, var(--sea-900) 55%, var(--sea-950) 100%); }
.login-bg { position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none; }
.login-bg svg { width: 100%; height: 100%; display: block; }
.login-card { position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5); display: grid; gap: 12px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand div { display: grid; line-height: 1.2; }
.login-brand b { font-size: 1.15rem; color: var(--sea-900); }
.login-brand small { font-size: .78rem; color: var(--slate-500); }
.login-card h1 { font-size: 1.25rem; font-weight: 700; }
.login-card .hint { margin: 0; }
.demo-box { display: grid; gap: 8px; margin-top: 4px; }
.demo-acct {
  display: grid; grid-template-columns: 96px 1fr; gap: 2px 12px; align-items: center; text-align: left; padding: 12px 14px;
  border-radius: 10px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--slate-200); transition: box-shadow .15s, background .15s;
}
.demo-acct:hover { background: var(--sea-50); box-shadow: inset 0 0 0 1px var(--sea-200); }
.demo-acct .role { grid-row: span 2; justify-self: start; }
.demo-name { font-weight: 600; font-size: .9rem; }
.demo-blurb { grid-column: 2; font-size: .78rem; color: var(--slate-500); }

/* ---------- responsive (original: sidebar becomes a top bar below lg) ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-lg { display: none; }
}
@media (max-width: 1023px) {
  .shell { flex-direction: column; }
  .side { position: static; width: 100%; height: auto; }
  .side-top { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
  .brand-tag { display: none; }
  .side-out-m { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: none; border: 0; color: var(--sea-100); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
  .side-out-m:hover { background: rgba(255, 255, 255, .1); }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 0 12px 12px; }
  .nav-link { width: auto; }
  .side-foot { display: none; }
  #view { padding: 24px 24px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .hide-md { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  #view { padding: 20px 14px 40px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-v { font-size: 1.1rem; }
  .stat-s { font-size: .78rem; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .prod .thumb-md { display: none; }
  .prod .meta { white-space: nowrap; }
  .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; }
  .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); }
  .fgrid .span-2 { grid-column: auto; }
  .rows li { padding: 12px 14px; }
  .pad { padding: 16px; }
  .invoice { padding: 20px; }
  .inv-parties { grid-template-columns: 1fr; }
  .inv-parties .end { text-align: left; }
  .steps span { font-size: .62rem; }
  .w-prod { min-width: 200px; }
  .prod { min-width: 0; gap: 8px; }
  .search-form input[name="q"] { max-width: none; flex-basis: 100%; }
  .login-card { padding: 22px; }
  .demo-acct { grid-template-columns: 1fr; }
  .demo-acct .role { grid-row: auto; }
  .demo-blurb { grid-column: 1; }
  /* line items become stacked mini-cards */
  .tbl.lines, .tbl.lines tbody { display: block; }
  .tbl.lines thead { display: none; }
  .tbl.lines tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 32px; gap: 8px 10px; padding: 12px 14px; border-top: 1px solid var(--slate-100); }
  .tbl.lines tr:first-child { border-top: 0; }
  .tbl.lines td { display: block; padding: 0 !important; border: 0; width: auto !important; }
  .tbl.lines td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--slate-500); margin-bottom: 3px; text-align: left; }
  .tbl.lines td:first-child { grid-column: 1 / -1; }
  .tbl.lines td:last-child { grid-column: 3; grid-row: 2; align-self: end; padding-bottom: 4px !important; }
  .tbl.lines td.line, .tbl.lines td.landed { grid-column: 1 / 3; display: flex; justify-content: space-between; align-items: baseline; }
  .tbl.lines td.line::before, .tbl.lines td.landed::before { margin: 0; }
  .tbl.lines td.hide-sm { display: none; }
}

/* ---------- demo bar (same as the other FutureLine demos) ---------- */
.demo-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: var(--sea-950); color: var(--sea-200); border-bottom: 1px solid var(--sea-800); font-size: .8rem; line-height: 1;
}
.demo-bar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.demo-bar-msg b { color: var(--orange-500); font-weight: 700; letter-spacing: .02em; }
.demo-bar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.demo-bar-btn { background: none; border: 1px solid var(--sea-700); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: .76rem; font-weight: 700; transition: border-color .15s; }
.demo-bar-btn:hover { border-color: var(--orange-500); }
.demo-bar-link { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.demo-bar-link:hover { color: var(--orange-500); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .demo-bar { padding: 0 10px; gap: 8px; font-size: .74rem; }
  .demo-bar-sep { display: none; }
  .demo-bar-actions { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ---------- print: the invoice only ---------- */
@media print {
  body { background: #fff; padding-top: 0; }
  .demo-bar, .side, #toasts, .no-print, .page-head { display: none !important; }
  #view { padding: 0; }
  .shell { display: block; }
  .invoice { box-shadow: none; padding: 0; }
}
