/* ============================================================
   Imperio Track — design system
   Premium-architectural · near-monochrome cool neutrals
   Sans: Hanken Grotesk · Mono: IBM Plex Mono
   ============================================================ */

:root{
  /* surfaces */
  --bg:        oklch(0.972 0.003 255);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.984 0.003 255);
  --surface-3: oklch(0.962 0.004 255);

  /* ink */
  --ink:   oklch(0.215 0.012 258);
  --ink-2: oklch(0.435 0.012 258);
  --ink-3: oklch(0.595 0.010 258);
  --ink-4: oklch(0.715 0.008 258);

  /* lines */
  --line:   oklch(0.912 0.005 258);
  --line-2: oklch(0.862 0.006 258);
  --line-3: oklch(0.808 0.007 258);

  /* accent — glass blue (active / current / primary info) */
  --accent:      oklch(0.545 0.092 238);
  --accent-deep: oklch(0.45 0.088 240);
  --accent-soft: oklch(0.955 0.022 240);
  --accent-line: oklch(0.86 0.045 240);

  /* warn — terracotta (action required / due / reject) */
  --warn:      oklch(0.585 0.132 38);
  --warn-soft: oklch(0.957 0.030 45);
  --warn-line: oklch(0.86 0.06 45);

  /* ok — muted green (paid / verified) */
  --ok:      oklch(0.555 0.072 158);
  --ok-soft: oklch(0.955 0.028 160);

  --r-card: 16px;
  --r-ctrl: 12px;
  --r-sm: 9px;

  --sh-1: 0 1px 2px rgba(20,22,28,.05), 0 1px 1px rgba(20,22,28,.03);
  --sh-2: 0 6px 16px rgba(20,22,28,.10), 0 2px 5px rgba(20,22,28,.06);
  --sh-3: 0 -8px 24px rgba(20,22,28,.10);

  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --hdr-h: 52px;
  --nav-h: 64px;
}

*{ box-sizing:border-box; }

.app{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  background:var(--bg);
  font-family:var(--sans);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  font-size:15px; line-height:1.45;
  letter-spacing:-0.006em;
}

/* scroll region */
.scroll{ flex:1; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
.scroll::-webkit-scrollbar{ width:0; height:0; }

/* ---------- type ---------- */
.mono{ font-family:var(--mono); letter-spacing:-0.01em; font-feature-settings:"tnum" 1; }
.eyebrow{ font-family:var(--mono); font-size:10.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); }
.h1{ font-size:25px; font-weight:700; letter-spacing:-0.022em; line-height:1.15; }
.h2{ font-size:19px; font-weight:650; letter-spacing:-0.018em; }
.h3{ font-size:16px; font-weight:650; letter-spacing:-0.012em; }
.body{ font-size:15px; color:var(--ink-2); }
.sm{ font-size:13px; }
.xs{ font-size:11.5px; }
.muted{ color:var(--ink-3); }
.muted2{ color:var(--ink-4); }
.tnum{ font-variant-numeric:tabular-nums; }

/* ---------- header ---------- */
.hdr{
  display:flex; align-items:center; gap:10px;
  height:var(--hdr-h); padding:0 8px 0 6px; flex-shrink:0;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}
.hdr-title{ font-size:17px; font-weight:650; letter-spacing:-0.014em; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.iconbtn{
  width:40px; height:40px; flex-shrink:0; border:none; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; border-radius:10px; color:var(--ink);
  position:relative; -webkit-tap-highlight-color:transparent;
}
.iconbtn:active{ background:var(--surface-3); }

/* ---------- bottom nav ---------- */
.nav{
  height:var(--nav-h); flex-shrink:0; display:flex;
  background:var(--surface); border-top:1px solid var(--line);
  padding-bottom:2px;
}
.nav-item{
  flex:1; border:none; background:none; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:var(--ink-3); -webkit-tap-highlight-color:transparent; position:relative;
}
.nav-item .nav-lbl{ font-size:10.5px; font-weight:600; letter-spacing:.01em; }
.nav-item.on{ color:var(--ink); }
.nav-dot{
  position:absolute; top:8px; right:calc(50% - 18px);
  width:7px; height:7px; border-radius:50%; background:var(--warn);
  border:1.5px solid var(--surface);
}

/* ---------- cards ---------- */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-card); box-shadow:var(--sh-1);
}
.pad{ padding:16px; }
.pad-lg{ padding:18px; }

.list-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card);
  overflow:hidden; box-shadow:var(--sh-1); }
.row{ display:flex; align-items:center; gap:12px; padding:14px 16px; width:100%;
  border:none; background:none; text-align:left; cursor:pointer; color:inherit; font-family:inherit;
  -webkit-tap-highlight-color:transparent; }
.row:active{ background:var(--surface-3); }
.row + .row{ border-top:1px solid var(--line); }
.row-x{ flex:1; min-width:0; }

/* ---------- pills / chips ---------- */
.pill{
  display:inline-flex; align-items:center; gap:6px;
  height:24px; padding:0 9px; border-radius:999px;
  font-size:11.5px; font-weight:650; letter-spacing:.005em; white-space:nowrap;
  border:1px solid transparent;
}
.pill .dot{ width:6px; height:6px; border-radius:50%; }
.pill-neutral{ background:var(--surface-3); color:var(--ink-2); border-color:var(--line-2); }
.pill-neutral .dot{ background:var(--ink-3); }
.pill-active{ background:var(--accent-soft); color:var(--accent-deep); border-color:var(--accent-line); }
.pill-active .dot{ background:var(--accent); }
.pill-done{ background:var(--surface-3); color:var(--ink-2); border-color:var(--line-2); }
.pill-done .dot{ background:var(--ink); }
.pill-warn{ background:var(--warn-soft); color:var(--warn); border-color:var(--warn-line); }
.pill-warn .dot{ background:var(--warn); }
.pill-ok{ background:var(--ok-soft); color:var(--ok); border-color:color-mix(in oklab, var(--ok) 28%, white); }
.pill-ok .dot{ background:var(--ok); }

.tag{ font-family:var(--mono); font-size:10.5px; letter-spacing:.04em; color:var(--ink-3);
  border:1px solid var(--line-2); border-radius:6px; padding:2px 6px; background:var(--surface-2); }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:48px; padding:0 18px; border-radius:var(--r-ctrl);
  font-family:var(--sans); font-size:15px; font-weight:650; letter-spacing:-0.006em;
  cursor:pointer; border:1px solid transparent; -webkit-tap-highlight-color:transparent;
  transition:transform .08s ease, background .15s ease; width:100%;
}
.btn:active{ transform:scale(0.985); }
.btn-primary{ background:var(--ink); color:var(--surface); }
.btn-primary:active{ background:var(--ink-2); }
.btn-ghost{ background:var(--surface); color:var(--ink); border-color:var(--line-2); }
.btn-ghost:active{ background:var(--surface-3); }
.btn-approve{ background:var(--ink); color:var(--surface); }
.btn-reject{ background:var(--surface); color:var(--warn); border-color:var(--warn-line); }
.btn-reject:active{ background:var(--warn-soft); }
.btn-sm{ height:40px; padding:0 14px; font-size:13.5px; border-radius:10px; width:auto; }
.btn[disabled]{ opacity:.4; pointer-events:none; }

/* ---------- inputs ---------- */
.field{ width:100%; height:52px; border:1px solid var(--line-2); border-radius:var(--r-ctrl);
  background:var(--surface); padding:0 16px; font-family:var(--sans); font-size:16px; color:var(--ink);
  outline:none; }
.field:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.field::placeholder{ color:var(--ink-4); }
.auth-error{
  width:100%; border:1px solid var(--warn-line); background:var(--warn-soft); color:var(--warn);
  border-radius:var(--r-sm); padding:10px 12px; font-size:12.5px; font-weight:600; line-height:1.35;
  margin-bottom:12px;
}

/* ---------- segmented control ---------- */
.seg{ display:flex; gap:2px; background:var(--surface-3); border:1px solid var(--line);
  border-radius:11px; padding:3px; }
.seg-item{ flex:1; border:none; background:none; cursor:pointer; font-family:var(--sans);
  font-size:13px; font-weight:600; color:var(--ink-3); height:34px; border-radius:8px;
  -webkit-tap-highlight-color:transparent; white-space:nowrap; }
.seg-item.on{ background:var(--surface); color:var(--ink); box-shadow:var(--sh-1); }

/* ---------- timeline ---------- */
.tl{ position:relative; }
.tl-row{ display:flex; gap:14px; position:relative; }
.tl-rail{ width:26px; flex-shrink:0; display:flex; flex-direction:column; align-items:center; }
.tl-node{ width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; z-index:1; background:var(--surface); border:2px solid var(--line-3); color:var(--ink-4); }
.tl-node.done{ background:var(--ink); border-color:var(--ink); color:var(--surface); }
.tl-node.current{ background:var(--accent); border-color:var(--accent); color:#fff;
  box-shadow:0 0 0 4px var(--accent-soft); }
.tl-node.await{ background:var(--warn); border-color:var(--warn); color:#fff;
  box-shadow:0 0 0 4px var(--warn-soft); }
.tl-line{ flex:1; width:2px; background:var(--line-2); margin:2px 0; min-height:14px; }
.tl-line.filled{ background:var(--ink); }
.tl-body{ flex:1; min-width:0; padding-bottom:20px; }
.tl-row:last-child .tl-body{ padding-bottom:0; }
.tl-num{ font-family:var(--mono); font-size:11px; }

/* ---------- progress bar ---------- */
.bar{ height:6px; border-radius:999px; background:var(--surface-3); overflow:hidden; }
.bar > i{ display:block; height:100%; background:var(--accent); border-radius:999px; }
.bar.ink > i{ background:var(--ink); }

/* ---------- doc placeholder ---------- */
.doc-ph{
  position:relative; border-radius:10px; overflow:hidden; border:1px solid var(--line-2);
  background-color:var(--surface-3);
  background-image:repeating-linear-gradient(45deg,
    transparent 0, transparent 9px,
    color-mix(in oklab, var(--ink-4) 18%, transparent) 9px,
    color-mix(in oklab, var(--ink-4) 18%, transparent) 10px);
  display:flex; align-items:center; justify-content:center;
}
.doc-ph-preview{
  background:var(--surface);
  background-image:none;
}
.doc-img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:contain; background:var(--surface);
}
.doc-pdf{
  position:absolute; inset:0; width:100%; height:100%;
  border:0; background:var(--surface); pointer-events:none;
}
.doc-cap{ font-family:var(--mono); font-size:10px; letter-spacing:.03em; color:var(--ink-3);
  background:var(--surface); border:1px solid var(--line-2); border-radius:5px; padding:3px 7px; }
.doc-cap-float{
  position:absolute; left:50%; bottom:12px; transform:translateX(-50%);
  max-width:calc(100% - 24px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  box-shadow:var(--sh-1);
}

/* ---------- banner ---------- */
.banner{ display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:14px;
  border:1px solid var(--warn-line); background:var(--warn-soft); cursor:pointer;
  -webkit-tap-highlight-color:transparent; }
.banner:active{ filter:brightness(.99); }
.banner-ico{ width:32px; height:32px; border-radius:9px; background:var(--warn); color:#fff;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* ---------- sheet / modal ---------- */
.scrim{ position:absolute; inset:0; background:rgba(15,17,22,.42); z-index:40;
  display:flex; align-items:flex-end; animation:fade .18s ease; }
.sheet{ width:100%; background:var(--surface); border-radius:22px 22px 0 0;
  box-shadow:var(--sh-3); max-height:88%; display:flex; flex-direction:column;
  animation:rise .26s cubic-bezier(.22,1,.36,1); }
.sheet-grip{ width:38px; height:4px; border-radius:999px; background:var(--line-3);
  margin:10px auto 4px; flex-shrink:0; }
.sheet-body{ overflow-y:auto; padding:6px 18px 22px; }
.sheet-foot{ padding:14px 18px calc(14px + env(safe-area-inset-bottom)); border-top:1px solid var(--line);
  flex-shrink:0; display:flex; gap:10px; }

@keyframes fade{ from{opacity:0} to{opacity:1} }
@keyframes rise{ from{transform:translateY(100%)} to{transform:translateY(0)} }
@keyframes slidein{ from{transform:translateX(100%)} to{transform:translateX(0)} }

/* ---------- misc ---------- */
.divider{ height:1px; background:var(--line); }
.avatar{ border-radius:50%; background:var(--ink); color:var(--surface);
  display:flex; align-items:center; justify-content:center; font-weight:650; flex-shrink:0;
  font-size:14px; }
.kv{ display:flex; justify-content:space-between; gap:16px; padding:11px 0; }
.kv + .kv{ border-top:1px solid var(--line); }
.kv .k{ color:var(--ink-3); font-size:13.5px; }
.kv .v{ font-weight:600; font-size:13.5px; text-align:right; }
.stack{ display:flex; flex-direction:column; }
.gap6{ gap:6px } .gap8{ gap:8px } .gap10{ gap:10px } .gap12{ gap:12px } .gap14{ gap:14px } .gap16{ gap:16px }
.flex{ display:flex } .col{ flex-direction:column } .ac{ align-items:center } .jb{ justify-content:space-between }
.wrap{ flex-wrap:wrap }
.section-pad{ padding:18px 16px; }
.between + .between{ margin-top:14px; }

.fade-in{ animation:fade .22s ease; }
.slide-screen{ animation:slidein .26s cubic-bezier(.22,1,.36,1); z-index:20; }

/* zoomable image viewer */
.viewer{ position:absolute; inset:0; background:oklch(0.16 0.01 258); z-index:50; display:flex;
  flex-direction:column; animation:fade .2s ease; }
.viewer-stage{ flex:1; overflow:auto; display:flex; align-items:center; justify-content:center; padding:18px; }
.viewer-stage-pdf{ align-items:stretch; padding:12px; }
.viewer-doc{ transition:transform .25s cubic-bezier(.22,1,.36,1); transform-origin:center; }
.viewer-img{
  display:block; width:100%; max-height:72vh; object-fit:contain;
  background:var(--surface); border-radius:10px; box-shadow:0 18px 40px rgba(0,0,0,.22);
}
.viewer-pdf{
  width:100%; height:100%; min-height:68vh; border:0; border-radius:10px;
  background:var(--surface); box-shadow:0 18px 40px rgba(0,0,0,.22);
}
