/* ==========================================================================
   Egbin Internal Audit — design system
   Brand: #ed2e24 (red) / #f47922 (orange), from the corporate mark.
   One stylesheet, token-driven, no framework. Light and dark are the same
   rules with a different palette, so a component can never look right in one
   theme and broken in the other.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Brand */
  --brand-red: #ed2e24;
  --brand-red-dark: #c41f16;
  --brand-orange: #f47922;
  --brand-gradient: linear-gradient(135deg, #f47922 0%, #ed2e24 100%);

  /* Neutrals */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --surface-3: #f2f3f5;
  --border: #e3e6ea;
  --border-strong: #ccd2d9;

  /* Text */
  --text: #1b1f24;
  --text-muted: #5c6672;
  --text-subtle: #8a939e;
  --text-invert: #ffffff;

  /* Status — chosen for >=4.5:1 on their own tints, and distinguishable
     without relying on hue alone (each pairs with an icon in the markup). */
  --ok: #1c7c4a;
  --ok-bg: #e6f4ec;
  --warn: #9a5b00;
  --warn-bg: #fdf1de;
  --danger: #c0271c;
  --danger-bg: #fdeceb;
  --info: #1b5fa8;
  --info-bg: #e8f1fb;
  --neutral: #5c6672;
  --neutral-bg: #eef0f3;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 2px 8px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .1);
  --ring: 0 0 0 3px rgba(244, 121, 34, .35);

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --space: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14171a;
    --surface: #1c2025;
    --surface-2: #22272d;
    --surface-3: #2a3037;
    --border: #2f353c;
    --border-strong: #434b54;
    --text: #e8eaed;
    --text-muted: #a3acb7;
    --text-subtle: #7c8695;
    --ok: #4ec27f;         --ok-bg: #12291d;
    --warn: #e0a44b;       --warn-bg: #2c2110;
    --danger: #f4776c;     --danger-bg: #2e1614;
    --info: #6cb0f2;       --info-bg: #12212f;
    --neutral: #a3acb7;    --neutral-bg: #262b31;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 8px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171a;
  --surface: #1c2025;
  --surface-2: #22272d;
  --surface-3: #2a3037;
  --border: #2f353c;
  --border-strong: #434b54;
  --text: #e8eaed;
  --text-muted: #a3acb7;
  --text-subtle: #7c8695;
  --ok: #4ec27f;      --ok-bg: #12291d;
  --warn: #e0a44b;    --warn-bg: #2c2110;
  --danger: #f4776c;  --danger-bg: #2e1614;
  --info: #6cb0f2;    --info-bg: #12212f;
  --neutral: #a3acb7; --neutral-bg: #262b31;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
small { font-size: 12px; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }

/* Visible focus everywhere — the previous UI removed outlines and gave
   keyboard users nothing to follow. */
:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.skip-link:focus { left: 8px; }

/* --- App shell ------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-brand img { width: 116px; }
.sidebar-brand .app-name {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 650;
}

.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-section {
  padding: 14px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--danger-bg);
  color: var(--brand-red);
  font-weight: 600;
}
.nav-link .ico { width: 17px; text-align: center; flex: 0 0 17px; font-size: 14px; }
.nav-link .count {
  margin-left: auto;
  background: var(--brand-red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar-user .meta { min-width: 0; flex: 1; }
.sidebar-user .name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .roles {
  font-size: 11.5px; color: var(--text-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user form { display: inline; }
.icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-subtle); padding: 6px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }

/* Main column */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 17px; font-weight: 650; }
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--brand-red); color: #fff;
  font-size: 9.5px; font-weight: 700;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.content { padding: 22px 24px 48px; flex: 1; }
.content-narrow { max-width: 780px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-subtle); margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--text-subtle); }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 12px; margin-bottom: 20px;
}
.page-head .titles { flex: 1; min-width: 240px; }
.page-head h2 { font-size: 20px; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Mobile drawer */
.nav-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45); z-index: 55;
  }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-grid; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 14px; }
}

/* --- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { flex: 1; display: flex; align-items: center; gap: 9px; }
.card-header h3 .ico { color: var(--brand-orange); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

/* --- Stat tiles ----------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.stat:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat-ico {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: var(--radius);
  display: grid; place-items: center; font-size: 17px;
}
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.stat-label { font-size: 12.5px; color: var(--text-muted); }

.tint-info    { background: var(--info-bg);    color: var(--info); }
.tint-warn    { background: var(--warn-bg);    color: var(--warn); }
.tint-danger  { background: var(--danger-bg);  color: var(--danger); }
.tint-ok      { background: var(--ok-bg);      color: var(--ok); }
.tint-neutral { background: var(--neutral-bg); color: var(--neutral); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand-gradient); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14.5px; width: 100%; }
.btn-block { width: 100%; }

/* --- Badges --------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  white-space: nowrap;
}
.badge-planning, .badge-pending, .badge-draft   { background: var(--info-bg);    color: var(--info); }
.badge-execution, .badge-partial, .badge-sent   { background: var(--warn-bg);    color: var(--warn); }
.badge-reporting, .badge-returned               { background: var(--neutral-bg); color: var(--neutral); }
.badge-completed, .badge-received, .badge-final { background: var(--ok-bg);      color: var(--ok); }
.badge-overdue, .badge-poor                     { background: var(--danger-bg);  color: var(--danger); }
.badge-excellent                                { background: var(--ok-bg);      color: var(--ok); }
.badge-satisfactory                             { background: var(--info-bg);    color: var(--info); }
.badge-fair                                     { background: var(--warn-bg);    color: var(--warn); }
.badge-muted                                    { background: var(--neutral-bg); color: var(--neutral); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text-muted);
  font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0;
}

/* Exception ratings 0-3 — colour plus a leading glyph in the markup, so the
   scale is not conveyed by hue alone. */
.rating-0 { color: var(--ok); font-weight: 700; }
.rating-1 { color: var(--info); font-weight: 700; }
.rating-2 { color: var(--warn); font-weight: 700; }
.rating-3 { color: var(--danger); font-weight: 700; }

/* --- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }

.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; }
.meta-list dt { color: var(--text-muted); font-weight: 600; }
.meta-list dd { margin: 0; }

/* --- Forms ---------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field > label, .field-label {
  display: block; font-size: 12.5px; font-weight: 650;
  color: var(--text-muted); margin-bottom: 6px;
}
.field .req { color: var(--danger); }

.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="date"], .field input[type="number"], .field input[type="url"],
.field input[type="search"], .field select, .field textarea,
input.control, select.control, textarea.control {
  width: 100%;
  padding: 9px 12px;
  font: inherit; font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus, .field select:focus, .field textarea:focus,
input.control:focus, select.control:focus, textarea.control:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: var(--ring);
}
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: var(--surface-3); color: var(--text-subtle); cursor: not-allowed;
}
.field .help { font-size: 12px; color: var(--text-subtle); margin-top: 5px; }
.field .errors { font-size: 12.5px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--danger);
}

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* Checkbox / radio groups render as tappable cards rather than bare inputs. */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice-group label:hover { border-color: var(--brand-orange); }
.choice-group input { accent-color: var(--brand-red); width: 15px; height: 15px; cursor: pointer; }
.choice-group ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding-top: 6px;
}

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 16px;
}
.filters .control { width: auto; min-width: 200px; }

/* --- Alerts and messages -------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert .ico { flex: 0 0 auto; margin-top: 1px; }
.alert-success { background: var(--ok-bg);     color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warn-bg);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info    { background: var(--info-bg);   color: var(--info);   border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.messages { margin-bottom: 4px; }

/* --- Empty states --------------------------------------------------------- */
.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty .ico { font-size: 30px; color: var(--text-subtle); margin-bottom: 12px; }
.empty h4 { color: var(--text); margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 420px; margin: 0 auto 14px; }

/* --- Phase stepper -------------------------------------------------------- */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 20px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.step-dot {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface); color: var(--text-subtle);
  border: 2px solid var(--border-strong);
}
.step.done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.active .step-dot { background: var(--brand-gradient); border-color: transparent; color: #fff; box-shadow: var(--ring); }
.step-label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--text); font-weight: 650; }
.step-line { flex: 1 1 24px; min-width: 20px; height: 2px; background: var(--border-strong); margin: 0 10px; }
.step-line.done { background: var(--ok); }

/* --- Progress ------------------------------------------------------------- */
.bar { height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-gradient); border-radius: inherit; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }

/* --- Pagination ----------------------------------------------------------- */
.pagination {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  padding: 16px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 6px 11px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 13px; color: var(--text-muted);
}
.pagination a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.pagination .current { background: var(--brand-gradient); color: #fff; border-color: transparent; font-weight: 600; }

/* --- Public (unauthenticated) pages --------------------------------------- */
.public-shell {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(1100px 460px at 50% -10%, rgba(244, 121, 34, .16), transparent 62%),
    var(--bg);
}
.public-card {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 30px;
}
.public-card.wide { max-width: 660px; }
.public-brand { text-align: center; margin-bottom: 24px; }
.public-brand img { width: 132px; margin: 0 auto 14px; }
.public-brand h1 { font-size: 18px; }
.public-brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.public-foot {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: var(--text-subtle);
}

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-subtle); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .07em;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Microsoft sign-in button — Microsoft's own brand guidance: neutral surface,
   their four-square mark, never recoloured to ours. */
.btn-microsoft {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-microsoft:hover { background: var(--surface-3); border-color: var(--text-subtle); text-decoration: none; }
.btn-microsoft svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* --- Utilities ------------------------------------------------------------ */
.stack   { display: flex; flex-direction: column; gap: 12px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-2  { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.muted   { color: var(--text-muted); }
.subtle  { color: var(--text-subtle); }
.small   { font-size: 12px; }
.strong  { font-weight: 650; }
.nowrap  { white-space: nowrap; }
.right   { text-align: right; }
.center  { text-align: center; }
.mt-0 { margin-top: 0; }  .mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

@media print {
  .sidebar, .topbar, .page-actions, .btn, .pagination, .skip-link { display: none !important; }
  .main { margin-left: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
