/* Project skin on top of theme.css — SLD Academy red instead of Relay's teal,
   plus the few components that only exist here (certificate preview, import mapper).
   The block below also carries a polish layer: warm-neutral palette + softer,
   layered shadows so the red brand doesn't sit on cool-grey Relay neutrals, and a
   set of refined component overrides at the foot of this file. All of it lives here,
   not in theme.css, so the shared Relay base is untouched. */
:root {
  --accent: #b02318;
  --accent-ink: #7d1811;
  --accent-soft: #fdeceb;
  --accent-hover: #8f1c13;
  --sidebar: #241413;
  --sidebar-ink: #d6c7c5;
  --sidebar-ink-dim: #9b8785;
  --sidebar-active: #3a201e;

  /* Warm-neutral palette — pairs with the warm red instead of Relay's cool greys. */
  --bg: #f6f4f3;
  --surface: #ffffff;
  --surface-2: #f3efed;
  --ink: #26201f;
  --ink-soft: #574e4c;
  --ink-faint: #8b807d;
  --line: #e8e2e0;
  --line-soft: #f1edeb;

  /* Softer, layered elevation — warm-tinted shadows read as lift, not as a hard edge. */
  --radius: 9px; --radius-lg: 14px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(45,22,18,.05), 0 2px 6px rgba(45,22,18,.05);
  --shadow-md: 0 2px 5px rgba(45,22,18,.06), 0 8px 20px rgba(45,22,18,.07);
  --shadow-lg: 0 12px 40px rgba(45,22,18,.16);
  --focus-ring: 0 0 0 3px var(--accent-soft);
}

/* ── Certificate preview pane ── */
.cert-preview {
  position: sticky; top: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
}
.cert-preview .cp-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700;
}
.cert-frame-wrap { background: var(--surface-2); padding: 14px; display: flex; justify-content: center; }
/* The certificate is a fixed 595×842pt page. It is rendered at full size inside the
   iframe and scaled down with a transform, so the preview is the same pixels the PDF
   gets — no reflow, no "it looked fine on screen". */
.cert-frame-box { width: 297px; height: 421px; position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; }
.cert-frame-box iframe { width: 794px; height: 1123px; border: 0; position: absolute; top: 0; left: 0;
  transform: scale(0.374); transform-origin: top left; }
.cert-frame-box.lg { width: 496px; height: 701px; }
.cert-frame-box.lg iframe { transform: scale(0.6247); }

/* ── Import wizard ── */
.imp-step { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.imp-step .st { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.imp-step .st .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.imp-step .st.on { color: var(--accent-ink); }
.imp-step .st.on .n { background: var(--accent); color: #fff; }
.imp-step .sep { flex: 1; height: 1px; background: var(--line); min-width: 12px; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 34px 20px;
  text-align: center; color: var(--ink-faint); cursor: pointer; transition: .15s; background: var(--surface);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.map-cell { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.map-cell .h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-cell .sample { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-cell select { margin-top: 6px; }
.problems { background: #fff8ed; border: 1px solid #f3d9a8; border-radius: var(--radius); padding: 10px 12px; font-size: 12.5px; }
.problems b { color: #92400e; }
.problems li { margin-left: 16px; }

/* ── Misc ── */
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-faint); }
.kv dd { margin: 0; font-weight: 600; }
.inline-edit { border: 1px solid transparent; background: none; font: inherit; color: inherit;
  padding: 3px 6px; border-radius: 5px; width: 100%; }
.inline-edit:hover { border-color: var(--line); background: var(--surface); }
.inline-edit:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.inline-edit[disabled] { color: var(--ink); cursor: not-allowed; }
.code-chip { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 5px; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════════════
   Polish layer — refined component skins on top of theme.css.
   Loaded after theme.css, so equal-specificity rules here win. Brand colours and
   layout are unchanged; this is spacing, elevation, type and state work only.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Content rhythm ── */
.content { padding: 26px 30px 72px; }
.topbar { height: 60px; padding: 0 30px; }
.topbar h1 { font-size: 17.5px; letter-spacing: -0.02em; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }

/* ── Cards: lean on soft elevation, hairline border almost invisible ── */
.card, .table-wrap, .cert-preview, .kpi, .map-cell {
  border-color: var(--line-soft);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px 22px; }

/* ── KPI cards: bigger figure, quieter label, a lift on hover ── */
.kpi { padding: 16px 18px; transition: box-shadow .16s, transform .16s; }
.kpi::before { width: 3px; border-radius: 0 3px 3px 0; opacity: .9; }
.kpi .label { font-size: 10.5px; letter-spacing: .07em; color: var(--ink-faint); }
.kpi .value { font-size: 27px; margin-top: 5px; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ── Buttons: crisper primary, calmer ghost, real focus ring ── */
.btn { padding: 8px 15px; border-radius: var(--radius); transition: background .13s, border-color .13s, box-shadow .13s, transform .04s; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary { box-shadow: 0 1px 2px rgba(125,24,17,.25); }
.btn-primary:hover { box-shadow: 0 2px 8px rgba(125,24,17,.28); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(176,35,24,.30); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 11px; }

/* ── Tables: more air, softer dividers, a warmer hover ── */
table.data th { padding: 12px 18px; background: var(--surface-2); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
table.data tbody tr { transition: background .1s; }
table.data tbody tr.click:hover { background: var(--accent-soft); }
table.data td .primary { font-weight: 650; }

/* ── Pills: softer fill, no harsh ring ── */
.pill { padding: 3px 10px; border-color: transparent; background: var(--surface-2); }
.pill.no-dot { font-weight: 650; }
.code-chip { background: var(--surface-2); border-color: var(--line-soft); border-radius: 6px; padding: 2px 8px; }

/* ── Forms: rounder, gentler ── */
.form-input, .form-select, textarea.form-input { border-radius: var(--radius); border-color: var(--line); }
.form-input:focus, .form-select:focus, textarea.form-input:focus { box-shadow: var(--focus-ring); }

/* ── Empty state: centred, softer, roomier ── */
.empty { padding: 60px 24px; }
.empty svg { opacity: .4; }

/* ── Modal: warmer scrim, softer lift ── */
.modal-back { background: rgba(38,20,17,.42); backdrop-filter: blur(2px); }
.modal { box-shadow: var(--shadow-lg); }
.modal .m-head { padding: 18px 24px; }
.modal .m-body { padding: 22px 24px; }

/* ── Sidebar: quieter idle text, brand-red active, subtle inset on hover ── */
.nav a { border-radius: 8px; transition: background .12s, color .12s; }
.nav a.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sidebar .brand .logo { box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* ── Notices (import warnings, cert rules): warm card, not a flat strip ── */
.problems { border-radius: var(--radius); box-shadow: var(--shadow); }
