/* Ledger — hand-written stylesheet. Light corporate theme: slate neutrals, blue accent. */

:root {
  --radius: 16px;
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --primary-soft: #dbeafe;
  --primary-ink: #1d4ed8;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --text-soft: #334155;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #3b82f6;

  --signal: #16a34a;
  --signal-soft: #dcfce7;
  --signal-ink: #15803d;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;

  --sidebar: #f8fafc;
  --sidebar-border: #e2e8f0;

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); font-size: 12px; background: var(--muted); padding: 1px 5px; border-radius: 4px; }
img { max-width: 100%; }
.icon { flex-shrink: 0; display: block; }

/* ── Utilities ─────────────────────────────────────────────────────────── */
.nums { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.upper { text-transform: uppercase; }
.muted { color: var(--muted-foreground); }
.strong { font-weight: 600; }
.small, small { font-size: 12px; }
.italic { font-style: italic; }
.big { font-size: 16px; }
.right { text-align: right; }
.block { display: block; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min0 { min-width: 0; }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mt-lg { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.m { margin: 16px; }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-signal { color: var(--signal); }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.gap { gap: 16px; }
.gap-sm { gap: 10px; }
.wrap-row { flex-wrap: wrap; }
.push-right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.align-start { align-items: start; }

.bg-signal { background: var(--signal); }
.bg-warn { background: var(--warn); }
.bg-danger { background: var(--danger); }
.bg-primary { background: var(--primary); }
.bg-info { background: var(--info); }
.bg-muted-strong { background: #94a3b8; }
.bg-muted-soft { background: #cbd5e1; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover:not(:disabled) { background: var(--primary-ink); }
.btn-outline { background: var(--card); border-color: var(--border); color: var(--foreground); }
.btn-outline:hover:not(:disabled) { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 12px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-size: 13px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-muted { color: var(--muted-foreground); font-weight: 500; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--foreground);
  background: var(--card); border: 1px solid var(--input); border-radius: 10px;
  padding: 8px 12px; min-height: 38px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(59, 130, 246, .18); border-color: var(--ring); }
input:disabled { background: var(--muted); color: var(--muted-foreground); }
input[type="file"] { width: auto; min-height: 0; border: 0; padding: 0; background: none; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field em { color: var(--danger); font-style: normal; }
.field small { color: var(--muted-foreground); font-size: 11.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13px; }
.check small { display: block; color: var(--muted-foreground); }
.form-card { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: 1fr 1fr 2fr; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert { border-radius: 12px; padding: 11px 16px; font-size: 13.5px; margin-bottom: 4px; }
.alert-success { background: var(--signal-soft); color: var(--signal-ink); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ── App shell ─────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40;
  display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--sidebar-border);
}
.sidebar-brand { height: 78px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-close { display: none; background: none; border: 0; color: var(--muted-foreground); cursor: pointer; padding: 4px; border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: #334155; color: #fff;
}
.brand-text { line-height: 1.2; min-width: 0; }
.brand-text strong { display: block; color: var(--foreground); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small { display: block; color: var(--muted-foreground); font-size: 12px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 22px; }
.nav-group-label { padding: 0 16px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); }
.nav-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-module {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px; margin-bottom: 6px;
  font-size: 15.5px; font-weight: 600; color: var(--text-soft);
}
.nav-module.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-sub { padding-left: 10px !important; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: #475569; transition: background .15s, color .15s; }
.nav-link .icon { color: #64748b; }
.nav-link:hover { background: var(--muted); color: var(--foreground); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav-link.active .icon { color: var(--primary-ink); }
.sidebar-foot { margin: 14px; padding: 14px 16px; border-radius: 14px; background: var(--muted); font-size: 13px; color: var(--muted-foreground); line-height: 1.5; }
.sidebar-foot b { color: var(--foreground); font-weight: 600; }
.avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: #334155; color: #fff; }
.avatar-muted { width: 32px; height: 32px; font-size: 11px; background: var(--muted); color: var(--muted-foreground); }
.avatar-outline { width: 36px; height: 36px; font-size: 12px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); }
.avatar-accent { background: var(--primary); color: #fff; }
.nav-backdrop { display: none; }

.main-col { padding-left: 280px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 78px; display: flex; align-items: center; gap: 16px; padding: 0 30px;
  background: rgba(248, 250, 252, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-search { position: relative; flex: 0 1 480px; min-width: 0; }
.topbar-search .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.topbar-search input { height: 44px; padding-left: 44px; border-radius: 12px; background: #f1f5f9; border-color: var(--border); font-size: 14.5px; }
.topbar-search input:focus { background: var(--card); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-link { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 14.5px; color: #475569; cursor: pointer; }
.topbar-link:hover { background: var(--muted); color: var(--foreground); }
.topbar-link[hidden] { display: none; }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: #475569; cursor: pointer; }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.badge-dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid var(--background); box-sizing: content-box; }
.menu-btn { display: none; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; z-index: 50; padding: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .25);
}
.dropdown-title { padding: 8px 10px 2px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.dropdown-sub { padding: 0 10px 8px; font-size: 12px; color: var(--muted-foreground); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-empty { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 13px; color: var(--signal-ink); }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 13.5px; color: var(--text-soft); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--muted); color: var(--foreground); }
.dropdown-item .icon-tile { width: 32px; height: 32px; border-radius: 9px; }
.dropdown form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 4px; border-radius: 14px; color: #475569; }
.user-chip:hover { background: var(--muted); }
.user-chip-text { line-height: 1.25; }
.user-chip-text strong { display: block; font-size: 15px; font-weight: 600; color: var(--foreground); }
.user-chip-text small { display: block; font-size: 12px; color: var(--muted-foreground); }

.pending-banner { padding: 10px 30px; background: var(--warn-soft); color: #92400e; border-bottom: 1px solid #fde68a; font-size: 13px; }
.content { padding: 34px 30px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1640px; }

/* ── Page header ───────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: 12px; }
.page-title h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
.page-header p { margin-top: 6px; font-size: 15px; color: #475569; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-actions form { display: inline; margin: 0; }
.crumb { margin-bottom: -12px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; }
.subnav { margin-bottom: -4px; }

/* ── Cards & grids ─────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-pad { padding: 26px 28px; }
.card-lift { transition: transform .15s, box-shadow .15s; }
.card-lift:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -16px rgba(15, 23, 42, .3); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card-head p { margin-top: 4px; font-size: 14.5px; color: #475569; }
.card-head.padded { padding: 16px 22px; margin: 0; border-bottom: 1px solid var(--border); align-items: center; }
.card-head.padded h3 { font-size: 15.5px; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.icon-tile { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-tile.tone-blue { background: #dbeafe; color: #2563eb; }
.icon-tile.tone-sky { background: #e0f2fe; color: #0284c7; }
.icon-tile.tone-green { background: #dcfce7; color: #16a34a; }
.icon-tile.tone-emerald { background: #d1fae5; color: #059669; }
.icon-tile.tone-violet { background: #f3e8ff; color: #9333ea; }
.icon-tile.tone-amber { background: #fef3c7; color: #d97706; }
.icon-tile.tone-orange { background: #ffedd5; color: #ea580c; }
.icon-tile.tone-red { background: #fee2e2; color: #dc2626; }
.icon-tile.tone-slate { background: #f1f5f9; color: #475569; }

.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-card); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 44px; }
.stat-label { font-size: 15px; font-weight: 500; color: var(--text-soft); padding-top: 10px; }
.stat-value { margin-top: 14px; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.stat.tone-danger .stat-value { color: var(--danger); }
.stat-hint { margin-top: 10px; font-size: 13px; color: #475569; }

.module-card { display: flex; align-items: center; gap: 18px; padding: 22px 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); transition: transform .15s, box-shadow .15s, border-color .15s; }
.module-card:hover { transform: translateY(-1px); border-color: #bfdbfe; box-shadow: 0 10px 28px -16px rgba(15, 23, 42, .3); }
.module-card strong { display: block; font-size: 17px; font-weight: 600; }
.module-card small { display: block; font-size: 13.5px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-arrow { margin-left: auto; color: #475569; }

.label-caps { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 6px; }
h3.label-caps { font-size: 11.5px; margin-bottom: 12px; }
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fbfdff; }
.tile-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile-foot.three { grid-template-columns: 1fr 1fr 1fr; }
.tile-foot .label-caps { margin-bottom: 2px; }
.tile-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.code-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-ink); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.code-badge.lg { min-width: 42px; height: 42px; font-size: 13px; }
.code-badge.sm { min-width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.icon-badge { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vendor-card { display: block; }
.soft-box { border: 1px solid var(--border); background: #f8fafc; border-radius: 12px; padding: 14px; }
.dashed { border: 1px dashed #cbd5e1; border-radius: 12px; padding: 14px; font-size: 13.5px; }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.kv-grid > div { background: var(--card); padding: 11px 14px; }
.kv-grid .label-caps { margin-bottom: 2px; }
.dl { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.dl > div { display: flex; gap: 12px; }
.dl dt { width: 140px; flex-shrink: 0; color: var(--muted-foreground); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── Overview ──────────────────────────────────────────────────────────── */
.status-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.status-chip { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; background: #f8fafc; font-size: 15px; color: var(--text-soft); }
.status-chip:hover { background: var(--muted); }
.status-chip .icon { color: #475569; }
.count-badge { margin-left: auto; min-width: 30px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-align: center; }
.count-badge.green { background: var(--signal-soft); color: var(--signal-ink); }
.count-badge.blue { background: var(--info-soft); color: var(--primary-ink); }
.count-badge.amber { background: var(--warn-soft); color: #b45309; }
.count-badge.slate { background: var(--muted); color: var(--text-soft); }
.count-badge.red { background: var(--danger-soft); color: var(--danger); }
.ok-line { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-soft); }
.ok-line .icon { color: var(--signal); }
.warranty-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.warranty-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.warranty-list li:last-child { border-bottom: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.overview-col { display: flex; flex-direction: column; gap: 22px; }
.grid-auto { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── Pills, tags, signatures ───────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.info { background: var(--info-soft); color: var(--primary-ink); }
.pill.signal { background: var(--signal-soft); color: var(--signal-ink); }
.pill.warn { background: var(--warn-soft); color: #b45309; }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.muted { background: var(--muted); color: var(--muted-foreground); }
.pill.strike { text-decoration: line-through; }
.tag { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--primary); }
.tag-lg { font-size: 13px; font-weight: 600; }
.signature { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 4px; flex-shrink: 0; }
.signature img { height: 44px; width: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* ── Asset photos ──────────────────────────────────────────────────────── */
.asset-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--border); background: var(--muted); overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted-foreground); }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumb-lg { width: 96px; height: 96px; font-size: 11.5px; font-weight: 500; }
.image-field { display: flex; gap: 16px; align-items: center; }
.asset-hero { display: flex; gap: 16px; align-items: center; }
.asset-photo { width: 160px; height: 160px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--border); background: var(--muted); overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.asset-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.asset-photo:hover img { transform: scale(1.03); }
.asset-photo.is-empty { border-style: dashed; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); }
.asset-photo.is-empty:hover { color: var(--primary); border-color: var(--primary); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 10, 10, .82); }
.lightbox img { display: block; max-width: 92vw; max-height: 92vh; border-radius: 8px; cursor: zoom-out; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-scroll.tall { max-height: 60vh; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #f8fafc; position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.right, .table td.right { text-align: right; }
.table tbody tr:hover { background: #f8fafc; }
.table.clickable tbody tr { cursor: pointer; }
.table td form { display: inline; margin: 0; }
.row-danger { background: rgba(254, 226, 226, .45); }
.row-self { background: rgba(37, 99, 235, .04); }
.cell-wide { max-width: 260px; }
.cell-name { max-width: 220px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; align-items: center; }
.filter-bar input[type="search"] { background: var(--muted); border-color: transparent; min-width: 220px; }
.filter-bar select { width: auto; min-width: 150px; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0 4px; font-size: 13px; color: var(--muted-foreground); }
.summary-strip b { color: var(--foreground); font-weight: 600; }

/* ── Charts, lists ─────────────────────────────────────────────────────── */
.stack-bar { display: flex; height: 10px; width: 100%; border-radius: 999px; overflow: hidden; background: var(--muted); }
.stack-bar span { height: 100%; }
.legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12.5px; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--foreground); font-weight: 500; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bar-track { margin-top: 6px; height: 7px; width: 100%; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar-value { width: 120px; text-align: right; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); }
.progress { width: 96px; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 16px; }
.timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 1px; background: var(--border); }
.timeline li { position: relative; padding-left: 20px; }
.timeline .dot { position: absolute; left: 0; top: 6px; box-shadow: 0 0 0 4px var(--card); }
.timeline p { font-size: 13px; line-height: 1.4; }
.journal, .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.journal li { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.journal li:last-child { border-bottom: 0; padding-bottom: 0; }
.history li { border: 1px solid var(--border); border-radius: 10px; padding: 12px; align-items: flex-start; }
.divided > * + * { border-top: 1px solid var(--border); }
.list-row { padding: 12px 16px; }
.tabs { display: inline-flex; gap: 4px; padding: 5px; background: #eef2f7; border-radius: 12px; align-self: flex-start; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted-foreground); }
.tabs a:hover { color: var(--foreground); }
.tabs a.active { background: var(--card); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.settings-tabs { display: flex; width: fit-content; max-width: 100%; margin-bottom: 20px; }
.settings-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.settings-card h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.settings-card .chip { margin-top: 6px; }

.empty { padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty-title { font-size: 14px; font-weight: 500; }
.empty-desc { margin-top: 4px; max-width: 380px; font-size: 13px; color: var(--muted-foreground); }
.empty-action { margin-top: 16px; }

/* ── Signature pad ─────────────────────────────────────────────────────── */
.signature-box { border: 1px solid var(--border); background: #f8fafc; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.signature-box em { color: var(--danger); font-style: normal; }
.signature-pad { position: relative; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.05); }
.signature-pad canvas { display: block; width: 100%; height: 168px; touch-action: none; cursor: crosshair; user-select: none; }
.pad-label { position: absolute; top: 10px; left: 12px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(100, 116, 139, .6); pointer-events: none; }
.pad-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: rgba(100, 116, 139, .7); pointer-events: none; }

/* ── Import ────────────────────────────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); background: var(--card); border-radius: 12px; padding: 40px 24px; text-align: center; }

/* ── Auth & landing ────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h2 { margin-top: 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted-foreground); }
.auth-foot a { color: var(--primary); font-weight: 500; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.landing-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); background: rgba(248, 250, 252, .85); backdrop-filter: blur(12px); }
.landing-header .wrap { height: 64px; gap: 32px; }
.landing-nav { display: flex; gap: 28px; font-size: 13.5px; color: var(--muted-foreground); }
.landing-nav a:hover { color: var(--foreground); }
.hero { padding: 96px 0 80px; background: radial-gradient(ellipse at top right, rgba(219, 234, 254, .7), transparent 55%); }
.hero h1 { margin-top: 20px; font-size: 54px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.lead { margin: 20px 0 32px; max-width: 640px; font-size: 16.5px; line-height: 1.7; color: var(--muted-foreground); }
.eyebrow-pill { display: inline-flex; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--primary); }
.section { padding-top: 80px; padding-bottom: 80px; }
.section-title { margin: 12px 0 32px; font-size: 36px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; max-width: 720px; }
.section .card h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 6px; }
.band { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band .lead { margin-bottom: 0; }
.landing-footer { padding: 32px 0; font-size: 13px; color: var(--muted-foreground); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1279px) { .hide-xl { display: none; } }
@media (max-width: 1023px) {
  .hide-lg { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .nav-open .sidebar { transform: none; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.4); }
  .sidebar-close { display: block; }
  .main-col { padding-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar, .pending-banner { padding-left: 16px; padding-right: 16px; }
  .topbar { gap: 8px; height: 66px; }
  .topbar-search { flex: 1 1 auto; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .user-chip-text, .user-chip > .icon { display: none; }
  .content { padding: 24px 16px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-3-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3-wide > .span-2 { grid-column: span 2; }
}
@media (max-width: 767px) {
  .hide-md { display: none; }
  .topbar-title p, .scope-badge { display: none; }
  .grid-2, .grid-3, .grid-3-wide, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-3-wide > .span-2, .span-2 { grid-column: auto; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .landing-nav { display: none; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: 36px; }
  .section-title { font-size: 28px; }
}
@media (max-width: 639px) {
  .hide-sm { display: none; }
  .asset-photo { width: 112px; height: 112px; }
  .image-field { align-items: flex-start; }
}
@media (max-width: 1279px) { .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .grid-auto, .status-split { grid-template-columns: minmax(0, 1fr); }
  .topbar-search input { font-size: 14px; }
  .topbar-link span { display: none; }
  .page-title h2 { font-size: 24px; }
  .card-pad { padding: 20px; }
  .dropdown-panel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; }
}

/* ── Print (statements) ────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .nav-backdrop, .subnav, .no-print, .pending-banner, .alert { display: none !important; }
  .main-col { padding: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

.sign-line { height: 48px; border-bottom: 1px solid #94a3b8; margin-bottom: 6px; }
a.list-row:hover { background: #f8fafc; }
.list-row b { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-signal { background: var(--signal); }
.dot-warn { background: var(--warn); }
.stat-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(22px, 1.9vw, 28px); }

/* ── Tags, barcodes & labels ───────────────────────────────────────────── */
.barcode { display: block; max-width: 100%; height: auto; }
.barcode-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.barcode-card .barcode { height: 52px; }
.barcode-card p { font-size: 13px; letter-spacing: .04em; }
.tag-preview { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--primary-ink); background: var(--primary-soft); border-radius: 10px; padding: 9px 12px; min-height: 38px; }
.tag-preview.is-muted { color: var(--muted-foreground); background: var(--muted); font-family: var(--font-sans); font-weight: 500; font-size: 13px; }
.tag-formats { display: flex; flex-direction: column; }
.tag-format-row { display: grid; grid-template-columns: 220px minmax(0, 2fr) 130px minmax(0, 1.4fr); gap: 16px; align-items: end; padding: 16px 0; border-bottom: 1px solid var(--border); }
.tag-format-row:first-child { padding-top: 0; }
.tag-format-row > .row { align-self: center; }
.tag-example { padding: 9px 0; min-height: 38px; overflow-wrap: anywhere; }
.tag-example.is-error { color: var(--danger); font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; }
.token-list { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; color: var(--text-soft); }
.mb-xs { margin-bottom: 4px; }

.labels-page { background: #f1f5f9; }
.labels-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.labels-toolbar select { width: auto; }
.labels-empty { padding: 40px 24px; }
.label-sheet { display: grid; gap: 10px; padding: 24px; max-width: 210mm; margin: 0 auto; }
.label-sheet.size-small { grid-template-columns: repeat(4, 1fr); }
.label-sheet.size-medium { grid-template-columns: repeat(3, 1fr); }
.label-sheet.size-large { grid-template-columns: repeat(2, 1fr); }
.asset-label { background: #fff; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 8px 10px; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.asset-label-head { display: flex; justify-content: space-between; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #475569; }
.asset-label-name { margin: 3px 0 4px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-label .barcode { width: 100%; height: 44px; }
.size-large .asset-label .barcode { height: 60px; }
.size-small .asset-label .barcode { height: 36px; }
.asset-label-tag { margin-top: 3px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
@media print {
  .labels-page { background: #fff; }
  .label-sheet { padding: 0; max-width: none; gap: 2mm; }
  .asset-label { border-color: #e2e8f0; }
  @page { margin: 8mm; }
}

.scanner { width: min(460px, calc(100vw - 24px)); padding: 18px; border: 0; border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .4); }
.scanner::backdrop { background: rgba(15, 23, 42, .6); }
.scanner-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.scanner-head h3 { font-size: 17px; font-weight: 600; }
.scanner-view { position: relative; aspect-ratio: 4 / 3; background: #0f172a; border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 30% 10%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(15, 23, 42, .35); pointer-events: none; }
.scanner .row { margin-top: 10px; }

@media (max-width: 1023px) {
  .tag-format-row { grid-template-columns: 1fr 1fr; }
  .tag-format-row > .row { grid-column: span 2; }
  .asset-hero { flex-wrap: wrap; }
}

/* ── Installed app ─────────────────────────────────────────────────────── */
.offline-banner { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 150%); z-index: 60; padding: 10px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(15, 23, 42, .5); transition: transform .25s; max-width: calc(100vw - 24px); }
.is-offline .offline-banner { transform: translate(-50%, 0); }
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(78px + env(safe-area-inset-top)); }
  .content { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
}
@media print { .offline-banner { display: none; } }

/* ── Employee picker ───────────────────────────────────────────────────── */
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker select[size] { height: auto; min-height: 168px; padding: 4px; }
.picker select[size] option { padding: 7px 10px; border-radius: 8px; }
.picker select[size] option:checked { background: var(--primary-soft) linear-gradient(0deg, var(--primary-soft), var(--primary-soft)); color: var(--primary-ink); }
.picker select[size] optgroup { font-size: 11.5px; color: var(--muted-foreground); font-weight: 600; }
.nowrap { white-space: nowrap; }

/* ── Branding ──────────────────────────────────────────────────────────── */
.brand-logo { height: 44px; width: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.brand-logo img { max-height: 44px; max-width: 44px; object-fit: contain; display: block; }
.brand-wordmark .brand-logo { width: auto; max-width: 210px; }
.brand-wordmark .brand-logo img { max-width: 210px; }
.brand-preview { padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--sidebar); }
.brand-preview .brand { pointer-events: none; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type="color"] { width: 46px; height: 38px; padding: 3px; flex-shrink: 0; cursor: pointer; }
.logo-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed #cbd5e1; border-radius: 12px; }
.logo-drop .brand-logo, .logo-drop .brand-mark { flex-shrink: 0; }

/* ── Signing ───────────────────────────────────────────────────────────── */
.sign-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sign-method { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--card); }
.sign-method:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.sign-method b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.sign-method small { display: block; margin-top: 2px; color: var(--muted-foreground); }
.declaration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.declaration-option { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; }
.declaration-option h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.declaration-option .signature-pad canvas { height: 130px; }
@media (max-width: 1023px) { .declaration-grid, .sign-methods { grid-template-columns: minmax(0, 1fr); } }
