/* Lighthouse — Ledger aesthetic. Light theme only. */
:root {
  /* Ink + paper — darker text, less grey, eye-friendly on white */
  --ink:            #0b0f14;   /* near-black primary text */
  --ink-soft:       #1f2937;
  --muted:          #4a5263;   /* darker muted so uppercase labels stay legible */
  --bg:             #f5f7fa;   /* very light cool gray page */
  --surface:        #ffffff;
  --surface-alt:    #f8fafc;
  --border:         #d8dde4;   /* slightly stronger hairline */
  --border-strong:  #b8c0cc;

  /* Accents */
  --accent:         #1c4e80;   /* deep sea */
  --accent-dark:    #153a62;
  --accent-soft:    #e6edf3;
  --danger:         #9e3a2a;   /* terracotta */
  --success:        #3a6b4d;   /* sage */
  --warn:           #a86b1b;

  --radius:         8px;
  --radius-sm:      4px;

  --shadow-card:    0 1px 2px rgba(15,23,42,.04),
                    0 4px 16px -6px rgba(15,23,42,.08);
  --shadow-card-h:  0 1px 2px rgba(15,23,42,.06),
                    0 10px 28px -10px rgba(15,23,42,.14);

  --font-display:   'Fraunces', Georgia, 'Noto Serif SC', serif;
  --font-body:      'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* legacy alias so old rules keep working */
  --font: var(--font-body);
  --bg-soft: var(--surface-alt);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;   /* bumped from 15.5px — easier on the eyes */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
/* no grain texture — the neutral gray bg reads clean on its own */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p  { margin: .4rem 0; }

.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Layout */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.main--full { max-width: 420px; padding-top: 4rem; }

/* Nav */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.nav__inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem 1.25rem;
}
.nav__brand { font-weight: 700; color: var(--ink); font-size: 1rem; white-space: nowrap; flex-shrink: 0; }
.nav__links {
  display: flex; gap: 0; flex: 1 1 auto; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  color: var(--muted); padding: .35rem .55rem;
  border-bottom: 2px solid transparent;
  font-size: .82rem; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .3em;
  flex-shrink: 0;
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__links a.active { border-bottom-color: var(--accent); color: var(--accent); }
/* hide icon labels on medium screens, show only icons */
@media (max-width: 900px) {
  .nav__links a span { display: none; }
  .nav__links a { padding: .35rem .4rem; }
}
.nav__user { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; margin-left: auto; }
.nav__user-name { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Forms */
label {
  display: block;
  font-size: .85rem;
  margin: .7rem 0 .2rem;
  color: var(--ink);
  font-weight: 500;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { resize: vertical; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem;
  font: inherit;
  padding: .55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  margin-top: .5rem;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--outline { background: transparent; border-color: var(--border); color: var(--ink); }
.btn--outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: .3rem .65rem; font-size: .85rem; margin-top: 0; }

/* Cards & tiles */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-soft);
}
.tile__label { font-size: .85rem; color: var(--muted); }
.tile__value { font-size: 1.6rem; font-weight: 600; margin-top: .25rem; }

/* Grid */
.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}

/* Tables */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.table th, .table td {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--border);
}
.table th { background: var(--bg-soft); font-weight: 600; }
.table__row-clickable { cursor: pointer; }
.table__row-clickable:hover { background: var(--bg-soft); }

/* Responsive tables: stacked cards on small screens */
@media (max-width: 599px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem;
    margin-bottom: .5rem;
  }
  .table td {
    border: 0;
    padding: .25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
  }
}

/* Toolbar */
.toolbar {
  display: flex; gap: 1rem; align-items: center;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.toolbar h1 { margin: 0; flex: 1; }
.toolbar input[type=search] { max-width: 280px; }

/* Pager */
.pager {
  display: flex; gap: 1rem; align-items: center; justify-content: center;
  margin-top: 1rem;
}

/* Lists */
.list { list-style: none; padding: 0; margin: 0; }
.list__item {
  display: flex; gap: 1rem; align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.list__item:last-child { border-bottom: 0; }
.list__item a {
  display: flex; gap: 1rem; width: 100%;
  color: var(--ink);
}

/* Back link */
.back { display: inline-block; margin-bottom: .5rem; }

/* Tabs */
.tabs {
  display: flex; gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
}
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .5rem 1rem; font: inherit; color: var(--muted);
  cursor: pointer; white-space: nowrap;
}
.tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Dropzone */
.dropzone {
  margin-top: .75rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  background: var(--bg-soft);
  transition: border-color .15s, background .15s;
}
.dropzone--active {
  border-color: var(--accent);
  background: #eaf2fa;
}
.dropzone p { margin: 0 0 .5rem; color: var(--muted); }

/* Attachments */
.attachments {
  list-style: none; padding: 0; margin: .75rem 0 0;
  display: flex; flex-direction: column; gap: .5rem;
}
.attachment {
  display: flex; gap: .5rem; align-items: center;
  padding: .4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.attachment__name { flex: 1 1 auto; word-break: break-all; font-size: .9rem; }
.thumb {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.pdf-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .7rem; font-weight: 600; color: var(--danger);
}
.pdf-link { display: flex; gap: .5rem; align-items: center; }

/* Progress bar */
.progress {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  transition: width .2s;
}

/* Toasts */
.toasts {
  position: fixed; top: 1rem; right: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 1000;
  max-width: calc(100% - 2rem);
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: .6rem .9rem;
  border-radius: var(--radius);
  font-size: .9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: slideIn .2s ease-out;
}
.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }
.toast--info { background: var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Login */
.login { display: flex; justify-content: center; }
.login .card { width: 100%; }

/* Chart container */
.chart {
  width: 100%;
  overflow: hidden;
  margin-bottom: 1rem;
}
.chart svg { width: 100%; height: auto; display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .dropzone, .progress__bar { transition: none; }
}

/* ---- Icons (SVG sprite) ---- */
.ic {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  vertical-align: -0.18em;
  color: currentColor;
}
.ic--lg { width: 1.8em; height: 1.8em; }
.nav__links a, .btn, .back { display: inline-flex; align-items: center; gap: .4em; }

/* Nav lang + ghost button */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
}
.btn--ghost:hover { background: rgba(0,0,0,.04); }
.nav__lang { margin-right: .4rem; }

/* Search bar with icon */
.search {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 .6em;
}
.search input {
  border: none;
  outline: none;
  padding: .45em 0;
  width: 12rem;
  font: inherit;
  background: transparent;
}
.search .ic { color: var(--muted); }

/* Login lang switcher */
.login__lang { margin-top: 1rem; text-align: center; }

/* PDF icon tint */
.pdf-icon { color: var(--accent); }

/* Addresses + contact on order detail */
.contact { list-style: none; padding: 0; margin: .25rem 0 .75rem; display: flex; flex-direction: column; gap: .2rem; }
.contact__label { color: var(--muted); font-size: .85em; margin-right: .3em; }
.addr {
  font: inherit;
  white-space: pre-wrap;
  background: #f7f9fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  margin: .25rem 0 .9rem;
  line-height: 1.45;
}
.badge {
  display: inline-block;
  font-size: .75em;
  padding: .15em .55em;
  border-radius: 999px;
  margin-left: .5em;
  vertical-align: middle;
  font-weight: 500;
  letter-spacing: .01em;
}
.badge--ok   { background: #e6f4ea; color: #1e7b3a; }
.badge--warn { background: #fff4e5; color: #9a5b00; }

/* Brand mark (lighthouse icon next to wordmark) */
.brand-mark {
  width: 1.6em;
  height: 1.6em;
  flex-shrink: 0;
  color: var(--ink);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
}

/* Login hero: big lighthouse above the card */
.login {
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.login__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: var(--ink);
  margin-top: .5rem;
}
.brand-mark--hero {
  width: 5rem;
  height: 5rem;
}
.brand-wordmark {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Footer bar (all pages, below main) */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: 1rem;
  font-size: .8rem;
  color: var(--muted, #718096);
  border-top: 1px solid #edf2f7;
  margin-top: 2rem;
}
.site-footer a {
  color: #2b6cb0;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* Changelog rendered body */
.changelog__body h1 { font-size: 1.4rem; margin-top: 0; }
.changelog__body h2 { font-size: 1.1rem; margin-top: 1.25rem; padding-top: .5rem; border-top: 1px solid #edf2f7; }
.changelog__body h3 { font-size: 1rem; margin-top: 1rem; }
.changelog__body ul { padding-left: 1.25rem; }
.changelog__body li { margin: .25rem 0; line-height: 1.5; }
.changelog__body p  { line-height: 1.5; }
.changelog__body code {
  background: #f7fafc;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-size: .85em;
}

/* Settings left-sidebar active state */
.settings .btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}


/* ============================================================
 * v10 — Ledger polish. Overrides the base rules above so every
 * section reads as its own distinct block on the cream page.
 * ============================================================ */

/* Typography refresh */
h1, h2, h3, .brand-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
}
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 1.1rem 0 .55rem; }
h3 { font-size: 1rem;    margin: .9rem 0 .4rem; }

code, pre, .mono, .sku { font-family: var(--font-mono); }

/* Page frame */
.main { padding: 1.25rem 1.5rem 2rem; }
@media (min-width: 720px) { .main { padding: 1.5rem 2rem 2.5rem; } }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  background: rgba(255,253,247,.82);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -.005em;
}
.nav__links a {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 500;
  padding: .5rem .7rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: color .15s ease, border-color .15s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.nav__user-name { font-size: .8rem; color: var(--muted); }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease;
}
@media (min-width: 720px) {
  .card:hover { box-shadow: var(--shadow-card-h); }
}
/* Accent ribbon — signature mark of each card */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    var(--accent) 22%,
    rgba(28,78,128,.35) 40%,
    transparent 72%);
  border-radius: var(--radius) var(--radius) 0 0;
}
/* Card title — separator rule underneath */
.card > h2:first-child,
.card > h2:first-of-type {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -.012em;
}
/* Sub-section heading inside a card (Attachments, Add Product, Add Factory…) */
.card h3 {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-soft);
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.card h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* Grid — more breathing room */
.grid2 { gap: 1.25rem; }
@media (min-width: 720px) { .grid2 { gap: 1.5rem; } }

/* ── Tables: ledger-style ────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.table th, .table td {
  padding: .65rem .7rem;
  vertical-align: middle;
}
.table th {
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--ink);
}
.table td { border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--surface-alt); }
.table__row-clickable:hover { background: var(--accent-soft) !important; }
/* Dirty/pending state for orders with unsaved account toggles */
.table tbody tr.row--pending { background: #fef7e0; }
.table tbody tr.row--pending:hover { background: #fef0c7 !important; }

/* SKU code pill, cleaner */
.table code {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  padding: .18rem .5rem;
  border-radius: 3px;
  letter-spacing: .04em;
}

/* Responsive tables: card-stack on mobile */
@media (max-width: 599px) {
  .table { border: 0; }
  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .75rem;
    margin-bottom: .6rem;
    box-shadow: 0 1px 2px rgba(26,24,20,.04);
  }
}

/* ── Forms ───────────────────────────────────────────────── */
label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
  margin: .85rem 0 .3rem;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], input[type=url],
select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
  font: inherit;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28,78,128,.14);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #a89c85; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: .005em;
  border-radius: var(--radius-sm);
  padding: .5rem .95rem;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 1px 0 rgba(26,24,20,.04);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(26,24,20,.12), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
.btn--sm { padding: .32rem .7rem; font-size: .82rem; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn--ghost:hover { background: rgba(26,24,20,.05); }

/* ── Tiles (dashboard stats) ─────────────────────────────── */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2.5rem; height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 0;
}
.tile__label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.tile__value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: -.02em;
  margin-top: .35rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── Toolbar (page-level title row) ──────────────────────── */
.toolbar h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.015em; }

/* ── List (supplier list, etc.) ──────────────────────────── */
.list__item {
  border-bottom: 1px solid var(--border);
  padding: .85rem .25rem;
}
.list__item:hover { background: var(--surface-alt); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs button {
  background: transparent;
  border: 0;
  padding: .55rem .95rem;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  background: var(--surface-alt);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.dropzone--active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ── Attachments list ────────────────────────────────────── */
.attachment {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
}

/* ── Address + badges ────────────────────────────────────── */
.addr {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.badge {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .72em;
  letter-spacing: .02em;
}
.badge--ok   { background: #e8eee5; color: var(--success); }
.badge--warn { background: #f6ecd8; color: var(--warn); }

/* ── Toasts ──────────────────────────────────────────────── */
.toast {
  background: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px -8px rgba(26,24,20,.35);
  font-weight: 500;
}
.toast--error   { background: var(--danger); }
.toast--success { background: var(--success); }
.toast--info    { background: var(--accent); }

/* ── Search input w/ icon ────────────────────────────────── */
.search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.75rem 1rem 2.25rem;
  font-size: .76rem;
  color: var(--muted);
  background: transparent;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.site-footer::before {
  /* tiny lighthouse glyph flanking the footer text */
  content: "✦";
  color: var(--accent);
  font-size: .9rem;
  opacity: .5;
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-dark); }

/* ── Changelog rendered body ─────────────────────────────── */
.changelog__body h1 { font-family: var(--font-display); font-size: 1.5rem; margin-top: 0; }
.changelog__body h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-top: 1.5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  color: var(--accent);
  letter-spacing: -.01em;
}
.changelog__body h3 { font-family: var(--font-display); font-size: 1rem; color: var(--ink-soft); }
.changelog__body code {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .82em;
}
.changelog__body ul { padding-left: 1.2rem; }
.changelog__body li { margin: .35rem 0; }

/* ── Supplier detail: Transactions card full-width stays wide ── */
.supplier-detail .grid2 > .card.txn-card { grid-column: 1 / -1; }

/* ── Shipments: table layout (prevent days-count columns from clipping) ── */
.table--shipments { min-width: 1200px; }
.table--shipments th,
.table--shipments td { white-space: nowrap; }
.table--shipments th.col-days,
.table--shipments td.col-days {
  min-width: 6.5rem;
  text-align: center;
  padding-right: 1rem;
}
.table--shipments td .badge {
  display: inline-block;
  min-width: 2rem;
  padding: .15rem .5rem;
  text-align: center;
}

/* ── Country badge: Flag + ISO2 + 中文 (always, regardless of UI lang) ── */
.country-badge { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.country-badge__flag { font-size: 1.1rem; line-height: 1; }
.country-badge__code { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.country-badge__zh   { color: var(--ink-soft); font-size: .85rem; }

/* Inline "X days since order" badge on the Orders status cell */
.status-days {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .4rem;
  font-size: .72rem;
  border-radius: var(--radius-sm, 4px);
  background: var(--surface-alt, #f1f3f5);
  color: var(--ink-soft);
}
.status-days--warn   { background: #fff4e5; color: #9a5b00; }
.status-days--danger { background: #fde2e1; color: #a8231b; }

/* ── Shipment status pill: icon + label, with a yellow-sticker variant ── */
.ship-status { display: inline-flex; align-items: center; gap: .3rem; }
.ship-status__icon { font-size: .95rem; line-height: 1; }
.ship-status__label { text-transform: lowercase; letter-spacing: .02em; }
.badge--sticker {
  background: #fef3c7;
  color: #92400e;
  border: 1px dashed #d97706;
  font-weight: 600;
}

/* ── Shipments: expandable rows + order deep links ── */
.order-link {
  font-weight: 500;
  color: var(--accent, #2563eb);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.order-link:hover { color: var(--accent-hover, #1d4ed8); border-bottom-style: solid; }

.ship-row { cursor: pointer; }
.ship-row:hover { background: var(--hover, rgba(0,0,0,.02)); }
.ship-row__detail > td { background: var(--accent-soft, #f3f6fd); padding: .5rem 1rem .75rem; }
.ship-events__list {
  margin: .25rem 0 0;
  padding-left: 1rem;
  list-style: decimal;
  font-size: .85rem;
  line-height: 1.5;
}
.ship-events__list li { margin: .15rem 0; }
.ship-events__time { display: inline-block; min-width: 10rem; }
.ship-events__desc { font-weight: 500; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card, .btn, .tile, input, .dropzone, .table tbody tr { transition: none; }
}
