/* SFA Internal Management System — UI stylesheet
   Design system: Sparks Fashion Academy (black 60% / off-white 30% / deep red 10% accent).
   Flat editorial: no shadows, no gradients, square blocks, pills for status. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --sfa-black: #090909;
  --sfa-off-white: #FAF9F7;
  --sfa-white: #FFFFFF;
  --sfa-deep-red: #7D0508;

  --surface: var(--sfa-off-white);
  --surface-raised: var(--sfa-white);
  --surface-sunken: #F1EFEB;
  --ink: var(--sfa-black);
  --ink-muted: #5A5A5A;
  --ink-faint: #8A8782;
  --hairline: #E2DED8;
  --hairline-strong: #C9C4BC;
  --accent: var(--sfa-deep-red);
  --on-accent: var(--sfa-off-white);
  --fill-strong: var(--sfa-black);
  --on-fill-strong: var(--sfa-off-white);

  --font-display: "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Times New Roman MT Condensed", "Times New Roman", Times, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --radius-pill: 999px;
  --sidebar-w: 248px;
  --focus: 0 0 0 2px var(--sfa-off-white), 0 0 0 4px var(--sfa-black);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--surface); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-6) 0; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Typography ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.95; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: 14px; letter-spacing: -0.01em; line-height: 1.2; }
.eyebrow { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.editorial { font-family: var(--font-serif); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 400; }
.muted { color: var(--ink-muted); }
.small { font-size: 12px; }
.lead { font-size: 15px; color: var(--ink-muted); max-width: 70ch; }
.prose { max-width: 78ch; line-height: 1.65; }
.prose h2, .prose h3, .prose h4 { margin: var(--space-6) 0 var(--space-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-3); }
.prose table { border-collapse: collapse; width: 100%; margin: var(--space-3) 0; }
.prose td, .prose th { border: 1px solid var(--hairline); padding: 6px 8px; text-align: left; }
.prose blockquote { margin: var(--space-4) 0; padding-left: var(--space-4); border-left: 2px solid var(--accent); }
.list { margin: 0; padding-left: 18px; }
.list li { margin-bottom: 4px; }
.highlight { display: inline-block; background: var(--accent); color: var(--on-accent); padding: 0 6px; }
.text-accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sfa-black); color: var(--sfa-off-white); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 30; display: flex; flex-direction: column; }
.sidebar a { color: inherit; text-decoration: none; }
.brand { display: block; padding: var(--space-6) var(--space-6) var(--space-4); border-bottom: 1px solid #222; }
.brand img { max-height: 40px; display: block; }
.brand-placeholder { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.32em; }
.brand-sub { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #A9A6A1; margin-top: 6px; }
.nav { padding: var(--space-3) 0 var(--space-8); flex: 1; }
.nav-group { padding: var(--space-4) var(--space-6) var(--space-1); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #8C8984; font-weight: 600; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px var(--space-6); font-size: 13px; color: #D9D6D1; border-left: 2px solid transparent; }
.nav a:hover { color: var(--sfa-off-white); background: #141414; }
.nav a.active { color: var(--sfa-off-white); border-left-color: var(--accent); background: #161616; font-weight: 600; }
.nav .count { font-size: 11px; min-width: 20px; text-align: center; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-pill); padding: 0 6px; }
.sidebar-foot { padding: var(--space-4) var(--space-6); border-top: 1px solid #222; font-size: 11px; color: #8C8984; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-8); border-bottom: 1px solid var(--hairline); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: 1px solid var(--hairline-strong); padding: 6px 10px; cursor: pointer; font: inherit; }
.top-link { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bell-count { background: var(--accent); color: var(--on-accent); border-radius: var(--radius-pill); font-size: 11px; padding: 0 6px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .role { font-size: 11px; color: var(--ink-muted); display: block; }
.content { padding: var(--space-8); max-width: 1440px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); margin-bottom: var(--space-8); flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: var(--space-2); display: block; }
.page-head .lead { margin: var(--space-3) 0 0; }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 12px; color: var(--ink-muted); margin-bottom: var(--space-3); }
.breadcrumb a { color: var(--ink-muted); }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: var(--space-6); }
.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-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.card { background: var(--surface-raised); border: 1px solid var(--hairline); padding: var(--space-6); min-width: 0; }
.card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); margin-bottom: var(--space-4); }
.card-head h2 { font-size: 14px; }
.card-flush { padding: 0; }
.card-flush .card-head { padding: var(--space-4) var(--space-6) 0; }
.section { margin-bottom: var(--space-8); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: var(--space-2); margin: 0 0 var(--space-4); }
.panel-dark { background: var(--fill-strong); color: var(--on-fill-strong); border: 0; }
.panel-dark .muted, .panel-dark .eyebrow, .panel-dark dl.meta dt { color: #B5B1AB; }
.panel-dark .avatar { background: var(--sfa-off-white); color: var(--sfa-black); }
.panel-dark .pill-solid { background: var(--sfa-off-white); color: var(--sfa-black); }
.panel-dark .progress { background: #2a2a2a; border-color: #333; }
.panel-dark .progress-fill { background: var(--sfa-off-white); }
.panel-accent { background: var(--accent); color: var(--on-accent); border: 0; }
.panel-accent .muted, .panel-accent .eyebrow { color: #F0D9D9; }

.stat { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.stat-value.is-empty { color: var(--ink-faint); font-size: 22px; }
.stat-meta { font-size: 12px; color: var(--ink-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--hairline); background: var(--surface-raised); margin-bottom: var(--space-6); }
.stats .stat { padding: var(--space-6); border-right: 1px solid var(--hairline); }
.stats .stat:last-child { border-right: 0; }
.stat a { text-decoration: none; display: flex; flex-direction: column; gap: var(--space-2); color: inherit; }
.stat a:hover .stat-value { text-decoration: underline; text-decoration-thickness: 2px; }

dl.meta { display: grid; grid-template-columns: 160px 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
dl.meta dt { color: var(--ink-muted); font-size: 12px; }
dl.meta dd { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; font: 600 13px/1.2 var(--font-body); border: 1px solid var(--ink); background: var(--fill-strong); color: var(--on-fill-strong); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #262626; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: #640407; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; font-weight: 500; cursor: pointer; font: inherit; }
.btn-danger { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: var(--on-accent); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.inline-form { display: inline; }

/* ---------- Pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-pill); padding: 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; border: 1px solid transparent; line-height: 1.6; }
.pill-solid { background: var(--fill-strong); color: var(--on-fill-strong); }
.pill-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.pill-accent { background: var(--accent); color: var(--on-accent); }
.pill-muted { background: var(--surface-sunken); color: var(--ink-muted); border-color: var(--hairline); }
.panel-dark .pill-outline { border-color: var(--on-fill-strong); color: var(--on-fill-strong); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFBFA; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .row-title { font-weight: 600; text-decoration: none; }
.table .row-title:hover { text-decoration: underline; }
.table tfoot td { border-top: 1px solid var(--ink); font-weight: 700; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: var(--space-6); }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: var(--space-6); }

/* ---------- Forms ---------- */
.form { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 12px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--ink-muted); margin: 0; }
.field > .btn, .field > button { align-self: flex-start; }
.req { color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  font: 14px/1.4 var(--font-body); color: var(--ink); background: var(--sfa-white); border: 1px solid var(--hairline-strong); padding: 9px 11px; width: 100%; border-radius: 0; min-height: 40px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.is-invalid { border-color: var(--accent) !important; }
.field-error { color: var(--accent); font-size: 12px; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.check input { margin-top: 3px; accent-color: var(--sfa-black); }
.form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--hairline); flex-wrap: wrap; }
fieldset { border: 1px solid var(--hairline); padding: var(--space-4) var(--space-6) var(--space-6); margin: 0 0 var(--space-6); background: var(--surface-raised); }
legend { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; padding: 0 6px; }
input[type=file] { font-size: 13px; }
.multi-select { min-height: 120px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--space-4); padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--hairline); }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .field label { font-size: 11px; }
.filters input, .filters select { min-height: 36px; padding: 6px 9px; font-size: 13px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--hairline); margin-bottom: var(--space-6); overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 16px; font: 600 13px var(--font-body); text-decoration: none; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; color: var(--ink-muted); white-space: nowrap; }
.tabs a.active, .tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }

/* ---------- Progress & charts ---------- */
.progress { position: relative; height: 18px; background: var(--surface-sunken); border: 1px solid var(--hairline); min-width: 90px; }
.progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--fill-strong); }
.progress.is-below .progress-fill { background: var(--accent); }
.progress-label { position: absolute; right: 6px; top: 0; font-size: 11px; line-height: 16px; font-weight: 600; color: var(--ink); mix-blend-mode: normal; }
.progress-fill + .progress-label { background: var(--surface-raised); padding: 0 4px; top: 1px; line-height: 14px; }
.progress-empty { display: flex; align-items: center; padding: 0 8px; }
.progress-nodata { font-size: 11px; color: var(--ink-faint); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 64px; gap: var(--space-3); align-items: center; font-size: 13px; }
.bar-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--surface-sunken); position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--fill-strong); }
.bar-fill.is-accent { background: var(--accent); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-legend { display: flex; gap: var(--space-4); font-size: 12px; color: var(--ink-muted); margin-top: var(--space-3); flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--fill-strong); }
.swatch.is-accent { background: var(--accent); }
.swatch.is-muted { background: var(--surface-sunken); border: 1px solid var(--hairline-strong); }
.sparkline { width: 100%; height: 64px; display: block; }
.sparkline .line { fill: none; stroke: var(--sfa-black); stroke-width: 2; }
.sparkline .target { stroke: var(--accent); stroke-dasharray: 4 3; stroke-width: 1; }
.sparkline .dot { fill: var(--sfa-black); }
.stacked { display: flex; height: 18px; border: 1px solid var(--hairline); }
.stacked span { display: block; height: 100%; }
.stacked .s-solid { background: var(--fill-strong); }
.stacked .s-outline { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--ink); }
.stacked .s-accent { background: var(--accent); }
.stacked .s-muted { background: var(--surface-sunken); }

/* ---------- Alerts / empty ---------- */
.alert { padding: var(--space-3) var(--space-4); border: 1px solid var(--ink); background: var(--surface-raised); margin-bottom: var(--space-4); font-size: 13px; display: flex; gap: var(--space-3); }
.alert-success { border-color: var(--ink); }
.alert-error { border-color: var(--accent); color: var(--accent); }
.alert-info { border-color: var(--hairline-strong); }
.alert-warning { border-color: var(--accent); background: #FBF5F5; }
.alert strong { font-weight: 700; }
.empty { padding: var(--space-12) var(--space-6); text-align: center; color: var(--ink-muted); border: 1px dashed var(--hairline-strong); background: var(--surface-raised); }
.empty h3 { color: var(--ink); margin-bottom: var(--space-2); }
.empty p { margin: 0 auto var(--space-4); max-width: 52ch; }
.empty-inline { color: var(--ink-faint); font-size: 13px; padding: var(--space-4) 0; }
.unconfirmed { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); border: 1px dashed var(--accent); padding: 1px 6px; }

/* ---------- Avatars ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; background: var(--fill-strong); color: var(--on-fill-strong); font-weight: 600; flex-shrink: 0; object-fit: cover; border-radius: var(--radius-pill); }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 88px; height: 88px; font-size: 28px; }
.person { display: flex; align-items: center; gap: 10px; }
.person-name { font-weight: 600; }
.person-sub { font-size: 12px; color: var(--ink-muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: space-between; margin-top: var(--space-4); font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { padding: 4px 10px; border: 1px solid var(--hairline-strong); text-decoration: none; color: var(--ink); }
.pagination span.cur { background: var(--fill-strong); color: var(--on-fill-strong); border-color: var(--ink); }

/* ---------- Timeline / list items ---------- */
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: var(--space-4); align-items: flex-start; }
.items li:last-child { border-bottom: 0; }
.items .item-title { font-weight: 600; text-decoration: none; }
.items .item-sub { font-size: 12px; color: var(--ink-muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--hairline-strong); }
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-3); font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 9px; height: 9px; background: var(--fill-strong); border-radius: 50%; }
.notif-unread { background: #FCFBFA; }
.notif-unread .item-title::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-right: 8px; vertical-align: 1px; }

/* ---------- Org chart ---------- */
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 22px; padding-left: 18px; border-left: 1px solid var(--hairline-strong); }
.org-tree li { position: relative; padding: 6px 0; }
.org-tree ul > li::before { content: ""; position: absolute; left: -18px; top: 26px; width: 14px; border-top: 1px solid var(--hairline-strong); }
.org-node { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--hairline); background: var(--surface-raised); padding: 8px 12px; min-width: 240px; text-decoration: none; }
.org-node.is-head { border-color: var(--ink); }
.org-tree details > summary { list-style: none; cursor: pointer; }
.org-tree details > summary::-webkit-details-marker { display: none; }
.org-tree .toggle { font-size: 11px; color: var(--ink-muted); margin-left: 6px; }
.alignment .level-company { border-left: 3px solid var(--accent); }
.alignment .level-department { border-left: 3px solid var(--sfa-black); }
.alignment .level-individual { border-left: 3px solid var(--hairline-strong); }

/* ---------- Rich text editor ---------- */
.rte { border: 1px solid var(--hairline-strong); background: var(--sfa-white); }
.rte-toolbar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; background: var(--surface); }
.rte-toolbar button { border: 1px solid transparent; background: none; padding: 4px 8px; font: 600 12px var(--font-body); cursor: pointer; }
.rte-toolbar button:hover { border-color: var(--hairline-strong); background: var(--sfa-white); }
.rte-area { min-height: 260px; padding: 12px 14px; outline: none; line-height: 1.6; }
.rte-area:focus { box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Matrix ---------- */
.matrix th.rot { text-align: center; }
.matrix td.cell { text-align: center; }
.matrix select { min-height: 30px; padding: 2px 4px; font-size: 12px; width: auto; }
.matrix .module-row td { background: var(--surface-sunken); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel { background: var(--sfa-black); color: var(--sfa-off-white); padding: var(--space-16); display: flex; flex-direction: column; justify-content: space-between; }
.auth-panel .display { font-size: clamp(36px, 5vw, 64px); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: var(--space-8); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 26px; margin-bottom: var(--space-2); }
.plain { max-width: 640px; margin: 10vh auto; padding: var(--space-8); }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.flex { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--space-4); }
.w-full { width: 100%; }
.hide-mobile { }
.divider-v { width: 1px; align-self: stretch; background: var(--hairline); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(9,9,9,.4); z-index: 25; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-block; }
  .content { padding: var(--space-6) var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-panel { padding: var(--space-8); min-height: 220px; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  dl.meta { grid-template-columns: 1fr; }
  .stats .stat { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .user-chip .who { display: none; }
  .hide-mobile { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 52px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .filters, .actions, .btn, .pagination, .no-print, .menu-toggle { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11px; }
  .card, .stats { border-color: #999; break-inside: avoid; }
  .table th, .table td { padding: 5px 6px; }
  a { text-decoration: none; }
  .print-header { display: block !important; margin-bottom: 12px; }
}
.print-header { display: none; }
