/* ==========================================================================
   Admin panel styles
   ========================================================================== */

@font-face {
  font-family: "Roboto Var";
  src: url("../fonts/roboto-var.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto Mono Var";
  src: url("../fonts/roboto-mono-var.woff2") format("woff2-variations");
  font-weight: 100 700; font-style: normal; font-display: swap;
}

:root {
  /* The public catalogue runs the brand's 60% black. The admin deliberately
     does not: this is where a couple of hundred products get typed in, and a
     light form is easier to work in for an hour at a time. It still wears the
     brand - Industrial Black chrome, Performance Red as the accent, Roboto
     throughout. Red on this paper measures 5.4:1, comfortably past AA, which
     is exactly why it can be the interactive colour here and not on black. */
  --ink:        #0E0E0E;
  --ink-soft:   #4a4a4a;
  --ink-faint:  #767676;
  --paper:      #F5F5F5;
  --surface:    #ffffff;
  --line:       #e0e0e0;
  --line-soft:  #eeeeee;

  --accent:     #C8102E;
  --accent-dk:  #A50C25;
  --accent-wash:#fdeef0;
  --ok:         #1c7a53;
  --ok-wash:    #e8f4ee;
  --warn:       #a3690c;
  --warn-wash:  #fdf3e0;
  --bad:        #b3392f;
  --bad-wash:   #fbebe9;
  --info:       #2a5d9e;
  --info-wash:  #eaf1fa;
  --sidebar:    #0E0E0E;
  --carbon:     #2B2B2B;

  --radius:    3px;
  --radius-sm: 2px;
  --shadow:    0 1px 2px rgba(14,14,14,.06), 0 4px 14px rgba(14,14,14,.05);

  --sans: "Roboto Var", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono Var", "Roboto Mono", ui-monospace, SFMono-Regular,
          Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body.admin {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5;
  background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0 0 .2rem; font-weight: 700; text-transform: uppercase;
     letter-spacing: .01em; }
h2 { font-size: .95rem; margin: 0; font-weight: 700; }
p { margin: 0 0 .8rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.strong { font-weight: 600; color: var(--ink); }
.warn-text { color: var(--warn); font-weight: 600; }

/* --- Top bar ------------------------------------------------------------ */

.adm-top {
  background: var(--sidebar); color: #eef1f4;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem; height: 56px; position: sticky; top: 0; z-index: 30;
}
.adm-top { border-bottom: 2px solid var(--accent); }
.adm-brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.adm-brand:hover { text-decoration: none; }
.adm-brand span { color: #B5B5B5; font-weight: 400; letter-spacing: .06em;
                  text-transform: uppercase; font-size: .78rem; }
/* The wordmark is a transparent PNG keyed off the brand board, so it sits on
   the black bar without a box of its own. */
.adm-mark { height: 16px; width: auto; }
.adm-top-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: .85rem; }
.adm-view-site { color: #B5B5B5; }
.adm-user { color: #8A8A8A; display: none; }
.adm-signout {
  background: transparent; border: 1px solid #3a3a3a; color: #d5d5d5;
  border-radius: var(--radius-sm); padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer;
}
.adm-signout:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.adm-nav-toggle {
  background: transparent; border: 1px solid #3a3a3a; color: #d5d5d5;
  border-radius: var(--radius-sm); padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer;
}

/* --- Shell -------------------------------------------------------------- */

.adm-shell { display: block; }

.adm-side { display: none; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem 0; }
.adm-side.is-open { display: block; }
.adm-side a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1.1rem; color: var(--ink-soft); font-size: .92rem; font-weight: 500;
  border-left: 3px solid transparent;
}
.adm-side a:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.adm-side a.is-current { color: var(--accent); border-left-color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.adm-side .ico { color: var(--ink-faint); font-size: .8rem; width: 1rem; }
.adm-side a.is-current .ico { color: var(--accent); }

/* Two things here are load-bearing once this column holds something wide,
   like the price sheet's table.
   min-width: 0 - a grid item defaults to min-width: auto and will not shrink
     below its content.
   width: 100%  - "margin-inline: auto" cancels the item's default stretch, so
     without an explicit width it sizes to its widest CONTENT and only then
     gets capped by max-width. That pushed this column past its grid track and
     scrolled the whole admin page sideways, cutting off the filter bar,
     instead of letting the table scroll inside its own wrapper. */
.adm-main {
  padding: 1.2rem 1rem 3rem; width: 100%; max-width: 1280px;
  margin-inline: auto; min-width: 0;
}

/* --- Page head ---------------------------------------------------------- */

.adm-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.adm-sub { color: var(--ink-faint); font-size: .88rem; margin: 0; }
.adm-crumbs { font-size: .82rem; margin-bottom: .35rem; }
.adm-crumbs a { color: var(--ink-faint); }
.adm-head-actions { display: flex; gap: .5rem; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--paper); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-danger { color: var(--bad); border-color: #eccdc9; background: #fff; }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-block { width: 100%; }

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

.alert {
  padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  font-size: .9rem; border: 1px solid transparent;
}
.alert-success { background: var(--ok-wash);  border-color: #c6e3d5; color: #17603f; }
.alert-error   { background: var(--bad-wash); border-color: #f0cdc9; color: #93302a; }
.alert-info    { background: var(--info-wash);border-color: #cddff2; color: #234e85; }

/* --- Panels ------------------------------------------------------------- */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.2rem;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.panel-head a, .panel-head .hint { font-size: .8rem; }
.panel-body { padding: 1.1rem; }
.panel-empty { padding: 1.6rem 1.1rem; color: var(--ink-faint); font-size: .9rem; margin: 0; text-align: center; }
.panel-danger { border-color: #eccdc9; }
.panel-danger .panel-head h2 { color: var(--bad); }
.danger-body p { font-size: .88rem; color: var(--ink-soft); }

/* --- Stats -------------------------------------------------------------- */

.stat-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.4rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .1rem;
  color: var(--ink); box-shadow: var(--shadow);
}
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-num { font-size: 1.85rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.stat-note { font-size: .76rem; color: var(--ink-faint); }
.stat-warn .stat-num { color: var(--bad); }

.adm-cols { display: grid; gap: 1.2rem; }

/* --- Tables ------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); padding: .6rem 1.1rem; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-weight: 700;
}
.table td { padding: .6rem 1.1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfd; }
.table .col-img { width: 62px; padding-right: 0; }
.table .col-img img { width: 46px; height: 46px; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper); }
.table-products td .btn { margin-left: .2rem; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem;
  border-radius: 4px; white-space: nowrap;
}
.tag-ok    { background: var(--ok-wash);   color: var(--ok); }
.tag-warn  { background: var(--warn-wash); color: var(--warn); }
.tag-bad   { background: var(--bad-wash);  color: var(--bad); }
.tag-info  { background: var(--info-wash); color: var(--info); }
.tag-muted { background: var(--paper);     color: var(--ink-faint); }

.simple-list { list-style: none; margin: 0; padding: .3rem 1.1rem 1.1rem; }
.simple-list li {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .4rem 0; border-bottom: 1px solid var(--line-soft); font-size: .88rem;
}
.simple-list li:last-child { border-bottom: 0; }

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

.adm-filters {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem; box-shadow: var(--shadow);
}
.adm-filters input, .adm-filters select {
  padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: .875rem; background: var(--surface); color: var(--ink);
}
.adm-filters input[type="search"] { flex: 1 1 200px; min-width: 160px; }

/* --- Forms -------------------------------------------------------------- */

.adm-form.narrow { max-width: 620px; }

.form-cols { display: grid; gap: 1.2rem; }
.form-side { display: grid; gap: 1.2rem; align-content: start; }

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field label, .switch span { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field > label { display: block; margin-bottom: .3rem; }
.req { color: var(--bad); }

.field input[type="text"], .field input[type="number"], .field input[type="password"],
.field input[type="search"], .field select, .field textarea, .alt-input {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: .9rem;
  background: var(--surface); color: var(--ink);
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .alt-input:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.err { color: var(--bad); font-size: .8rem; margin: .3rem 0 0; font-weight: 600; }
.hint { color: var(--ink-faint); font-size: .79rem; margin: .3rem 0 0; }

.field-row { display: grid; gap: 0 1rem; }

.switch { display: flex; align-items: center; gap: .55rem; padding: .35rem 0 .7rem; cursor: pointer; }
.switch input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.form-actions, .side-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.side-actions { display: grid; gap: .5rem; }

/* --- Spec rows ---------------------------------------------------------- */

.spec-rows { display: grid; gap: .5rem; margin-top: .9rem; }
.spec-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: start; }
.spec-row input {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: .85rem; background: var(--surface);
}
.spec-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.remove-spec { align-self: start; }

/* --- Upload ------------------------------------------------------------- */

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); background: #fcfcfd;
  padding: 1.6rem 1rem; text-align: center; transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-wash); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone label { display: block; cursor: pointer; font-size: .9rem; color: var(--ink-soft); }
.dropzone label strong { color: var(--accent); }

.preview-grid, .image-grid {
  display: grid; gap: .8rem; margin-top: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.preview-grid:empty { margin-top: 0; }
.preview-item { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.preview-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.preview-item span { display: block; padding: .3rem .45rem; font-size: .72rem; color: var(--ink-faint);
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.image-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; background: #fcfcfd; }
.image-card.is-primary { border-color: var(--accent); background: var(--accent-wash); }
.image-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.image-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.badge {
  position: absolute; top: .35rem; left: .35rem; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: .12rem .4rem; border-radius: 3px;
  background: var(--ink); color: #fff;
}
.image-card .alt-input { margin-top: .45rem; font-size: .78rem; padding: .35rem .5rem; }
.image-actions { display: flex; gap: .3rem; margin-top: .45rem; flex-wrap: wrap; }

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

.admin-bare { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-wrap { width: 100%; max-width: 380px; }
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.6rem; box-shadow: 0 2px 6px rgba(20,25,30,.06), 0 18px 44px rgba(20,25,30,.10);
}
.login-head { text-align: center; margin-bottom: 1.4rem; }
.login-head .adm-mark { width: 44px; height: 44px; border-radius: 3px; margin: 0 auto .7rem; }
.login-head h1 { font-size: 1.2rem; margin-bottom: .15rem; }
.login-head p { color: var(--ink-faint); font-size: .85rem; margin: 0; }
.login-card label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
.login-card input {
  width: 100%; padding: .6rem .75rem; margin-bottom: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: .95rem; background: var(--surface);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.login-foot { text-align: center; margin: 1.1rem 0 0; font-size: .82rem; }
.login-foot a { color: var(--ink-faint); }

/* --- Pagination --------------------------------------------------------- */

.pagination { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin-top: 1.2rem; }
.page-link {
  min-width: 34px; padding: .35rem .6rem; text-align: center; font-size: .84rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft);
}
.page-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.page-link.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Specification values, prices and SKUs read as data, not prose - the brand
   board reserves Roboto Mono for exactly that. */
.mono, .stat-num, .table .col-sku, .spec-row input { font-family: var(--mono); }

/* --- Breakpoints -------------------------------------------------------- */

@media (min-width: 700px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .spec-row { grid-template-columns: 150px 1fr 1.4fr auto; }
  .adm-user { display: inline; }
}

@media (min-width: 900px) {
  .adm-nav-toggle { display: none; }
  .adm-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); align-items: start; }
  .adm-side {
    display: block; background: var(--surface); border-right: 1px solid var(--line);
    border-bottom: 0; min-height: calc(100vh - 56px); position: sticky; top: 56px; padding-top: .8rem;
  }
  .adm-main { padding: 1.6rem 1.8rem 4rem; }
  .adm-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

@media (min-width: 1100px) {
  .form-cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===========================================================================
   Internal price sheet, enquiries and bulk upload
   =========================================================================== */

/* A standing marker on the navigation entry, so it is obvious at a glance
   which screen carries figures that must not be shown to a buyer. */
.adm-tag {
  margin-left: .4rem; font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: .1rem .3rem; border-radius: 2px;
  background: rgba(255, 255, 255, .12); color: #cfd4d9;
}
.adm-badge {
  margin-left: .4rem; min-width: 1.1rem; padding: 0 .3rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: .68rem; font-weight: 700;
}

.notice {
  padding: .8rem 1rem; border-radius: 3px; margin-bottom: 1.2rem;
  border: 1px solid var(--line); background: var(--surface); font-size: .9rem;
}
.notice-internal { border-left: 3px solid var(--accent); background: var(--accent-wash); }

.stat-alert .stat-num { color: var(--accent); }

/* --- The sheet ------------------------------------------------------------ */
/* A wide table on a narrow screen scrolls inside its own box; the page itself
   must never gain a horizontal scrollbar. */
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; }
/* Wide enough that "per 10kg carton" and a real supplier name are readable
   rather than clipped to "per" and "MAPL Tha". The wrapper scrolls, so the
   page itself never does. */
.sheet { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 82rem; }
.sheet th, .sheet td { padding: .35rem .4rem; text-align: left; vertical-align: middle; }
.sheet thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface); border-bottom: 2px solid var(--line);
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700; white-space: nowrap;
}
.sheet tbody tr { border-bottom: 1px solid var(--line-soft); }
.sheet tbody tr:hover { background: #fafafa; }
.sheet-group th {
  background: #f3f4f5; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); padding: .45rem .5rem;
  position: sticky; top: 1.85rem; z-index: 1;
}
.sheet .col-name { min-width: 15rem; font-weight: 500; }
.sheet-meta {
  display: block; font-size: .72rem; color: var(--ink-faint); font-weight: 400;
}
.sheet input {
  width: 100%; padding: .3rem .35rem; border: 1px solid transparent;
  border-radius: 2px; background: transparent; font: inherit; font-size: .85rem;
  color: var(--ink);
}
/* Transparent until touched keeps 197 rows readable as a document rather than
   a wall of boxes; the border appears on hover and focus so it is still
   obvious that every cell is editable. */
/* A placeholder must not read as a value. At --ink-faint the hints looked
   like every row was already FOB with a 1 x 20ft minimum. */
.sheet input::placeholder { color: #b9bcbf; opacity: 1; }
.sheet input:hover { border-color: var(--line); background: #fff; }
.sheet input:focus {
  border-color: var(--accent); background: #fff;
  outline: 2px solid var(--accent-wash); outline-offset: 0;
}
.sheet .in-num, .sheet .in-cur, .sheet .in-date {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.sheet .col-num  { width: 7rem; }
.sheet .col-cur  { width: 5.5rem; }
.sheet .col-date { width: 10rem; }
.sheet .col-unit { width: 11rem; }
.sheet .col-moq  { width: 9rem; }
.sheet .col-supp { width: 12rem; }
.sheet .in-cur { text-transform: uppercase; }
.sheet tr.is-expired td:first-of-type input { color: var(--bad); font-weight: 600; }
.sheet tr.is-hidden-product .col-name { opacity: .6; }

.sheet-save {
  position: sticky; bottom: 0; margin-top: 0;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1rem; background: var(--surface);
  border: 1px solid var(--line); border-top: 2px solid var(--accent);
  border-radius: 0 0 3px 3px;
}

.field-check { display: flex; align-items: flex-end; }
.field-check label { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
.field-actions { display: flex; align-items: flex-end; gap: .5rem; }

/* --- Enquiries ------------------------------------------------------------ */
.tag-new         { background: var(--accent-wash); color: var(--accent); }
.tag-in_progress { background: var(--warn-wash);   color: var(--warn); }
.tag-quoted      { background: var(--ok-wash);     color: var(--ok); }
.tag-closed      { background: var(--paper);       color: var(--ink-faint); }

.adm-table tr.is-new td:first-child { border-left: 3px solid var(--accent); }
.table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th, .adm-table td {
  padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.adm-table thead th {
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 2px solid var(--line); white-space: nowrap;
}

.adm-col-main { min-width: 0; }
.adm-col-side { min-width: 0; }

.kv { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .8rem; }
.kv dt { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.kv dd { margin: 0; word-break: break-word; }

.panel-danger { border-color: var(--bad); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #922e26; border-color: #922e26; color: #fff; }

.pager { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pager a {
  padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 2px;
  color: var(--ink-soft);
}
.pager a.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

.hint { font-size: .8rem; color: var(--ink-faint); margin: .3rem 0 0; }

@media (max-width: 900px) {
  /* The sticky header row is what makes a long sheet usable, but it eats a
     third of a short viewport - drop it rather than the columns. */
  .sheet thead th, .sheet-group th { position: static; }
}
