/* ==========================================================================
   mck-ui.css — McKenzie & Co. shared UI foundation
   --------------------------------------------------------------------------
   The single source of truth for tokens and base components across every
   internal tool. Drop this file in and either <link> it or paste the :root
   block, then build with the class names below.

   Derived from the three reference tools (Planning Risk Screening, Revenue
   Assurance, Compliance Manager) and Aiden's own src/styles.css, which are
   already ~90% identical. This file harmonises the small drifts so new tools
   line up on the first commit.

   Owner: Aiden (governance). Change this file, not per-tool copies.
   Pairs with: UI-STANDARD.md, UI-COMPLIANCE-TEST.md, UI-ALIGN-PROMPT.md
   ========================================================================== */

/* Aptos is the brand typeface; Inter is the web fallback so tools render
   identically on machines without Aptos.

   LOCAL DEVIATION FROM THE CANONICAL FILE (7 Aug 2026): the Google Fonts
   @import is commented out here. This tool follows the firm security baseline,
   whose Content-Security-Policy is style-src 'self', so the browser blocked the
   import on every page load and threw a console error each time. Inter never
   actually arrived, meaning the import bought nothing and cost a permanent
   error. Aptos is present on managed machines and is the brand face anyway.

   This affects the canonical aiden/ecosystem/mck-ui.css, so it will hit every
   tool that adopts both the UI standard and the security baseline. The proper
   firm-wide fix is to self-host the Inter woff2 files alongside the stylesheet;
   raise it with whoever owns the ecosystem repo rather than fixing it per tool.

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
*/

:root {
  /* ---- Brand palette (the only four brand colours) ---------------------- */
  --moss:        #48773c;   /* primary brand, CTAs, active, "good" */
  --moss-dark:   #3a6130;   /* hover, active text on light */
  --moss-light:  #5a8f4c;   /* borders, hover borders */
  --moss-pale:   #eef3eb;   /* fills, "good" backgrounds, focus ring */
  --wood:        #3d3935;   /* body text, dark surfaces */
  --wood-light:  #5a5552;   /* secondary text */
  --water:       #abc6ca;   /* soft accent */
  --water-light: #d5e3e5;   /* info fills */
  --sand:        #d2cdbe;   /* warm neutral, scrollbar, tracks */
  --sand-light:  #e8e5db;   /* progress tracks */
  --sand-pale:   #f5f3ef;   /* section fills, table hover, neutral pills */

  /* ---- Semantic UI tokens --------------------------------------------- */
  --bg:      #f7f6f3;   /* page background */
  --card:    #ffffff;   /* card / surface */
  --border:  #e5e2db;   /* hairline */
  --text:    #3d3935;   /* = wood */
  --muted:   #8a857d;   /* tertiary text, metadata */

  /* ---- Status layer (semantic state, NOT brand identity) --------------
     The 4 brand colours govern chrome and identity. State — risk, overdue,
     review, info — needs distinct signals, so we add a bounded status layer.
     This is a deliberate, documented exception to "errors in Wood only":
     use these ONLY for state (risk/overdue/error/review/info), never as
     decoration. See UI-STANDARD.md §3. */
  --red:        #c0392b;   /* higher risk, overdue, dispute, error */
  --red-pale:   #faecea;
  --amber:      #d4880f;   /* review, waiting-on-us, due soon */
  --amber-pale: #fef3e0;
  --blue:       #2c6b8a;   /* informational text on water fills */

  /* ---- Geometry & depth ------------------------------------------------ */
  --radius:     10px;   /* cards, panels */
  --radius-sm:  6px;    /* buttons, inputs, tiles */
  --radius-pill:999px;  /* badges, pills */
  --shadow:     0 1px 3px rgba(61, 57, 53, 0.04);
  --shadow-md:  0 4px 12px rgba(58, 97, 48, 0.08);
  --shadow-lg:  0 8px 24px rgba(58, 97, 48, 0.13);
  --transition: 0.15s ease;

  /* ---- Spacing scale --------------------------------------------------- */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  /* ---- Brand-named aliases (for tools using --mck-* naming) ------------ */
  --mck-moss:  var(--moss);
  --mck-wood:  var(--wood);
  --mck-water: var(--water);
  --mck-sand:  var(--sand);
  --mck-red:   var(--red);
}

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

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: 'Aptos', 'Inter', 'Arial', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.01em;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--wood);
  margin: 0;
}

/* ==========================================================================
   TOP BAR + BRAND LOCKUP
   Every tool opens with: wordmark/logo · divider · APP NAME · [actions] · who
   ========================================================================== */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-lockup { display: flex; align-items: center; gap: 14px; }

/* Text wordmark. Prefer an actual logo.png (height 32px) where available. */
.brand-wordmark {
  color: var(--moss);
  font-size: 1.95rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}
.topbar .logo { height: 32px; width: auto; display: block; }

.logo-divider { width: 1px; height: 28px; background: var(--border); }

.app-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.topbar-meta,
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  flex-wrap: wrap;
}

/* Signed-in user pill: avatar initial + name. Fed from /.auth/me. */
.who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--sand-pale);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 4px;
  border-radius: 18px;
  color: var(--wood);
  font-weight: 600;
}
.who .avatar,
.who .a {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--moss);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.6rem;
}
.signout-link { display: inline-flex; align-items: center; gap: 5px; }

/* ==========================================================================
   HERO BAND + PRIMARY TABS  (Format A/B: horizontal nav)
   ========================================================================== */

.hero,
header.page-header {
  background: linear-gradient(135deg, var(--moss) 0%, var(--moss-dark) 100%);
  color: #fff;
  padding: 22px 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.hero h1, header.page-header h1 {
  margin: 0; font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.02em; color: #fff;
}
.hero p, header.page-header p {
  margin: 3px 0 0; font-size: 0.82rem; opacity: 0.88; max-width: 720px;
}

.tabs {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px; border-radius: 8px; flex-wrap: wrap;
}
.tab {
  padding: 8px 16px; font-size: 0.76rem; font-weight: 700;
  color: #fff; opacity: 0.75; border-radius: 6px; cursor: pointer;
  transition: all var(--transition); border: none; background: transparent;
  letter-spacing: 0.2px;
}
.tab:hover { opacity: 1; }
.tab.active { background: #fff; color: var(--moss-dark); opacity: 1; }

/* Sub-tabs within a module */
.subtabs {
  display: flex; gap: 4px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 4px;
  margin-bottom: 16px; box-shadow: var(--shadow); flex-wrap: wrap; width: fit-content;
}
.subtab {
  padding: 8px 16px; font-size: 0.74rem; font-weight: 700;
  color: var(--muted); border-radius: 7px; cursor: pointer;
  border: none; background: transparent; transition: all var(--transition);
}
.subtab:hover { color: var(--moss-dark); }
.subtab.active { background: var(--moss); color: #fff; }

/* ==========================================================================
   SIDEBAR  (Format C: master-detail / action board)
   ========================================================================== */

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; min-width: 240px;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-brand { padding: 20px 18px 18px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.sidebar-brand .mck-logo { width: 152px; height: auto; display: block; color: var(--moss); }
.sidebar-brand .mck-app {
  font-size: 10px; color: var(--moss); margin-top: 10px; display: block;
  font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; opacity: 0.8;
}
.sidebar-nav { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 1px; }
.nav-section {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--moss); padding: 14px 12px 4px; font-weight: 800; opacity: 0.8;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 500;
  color: var(--wood-light); transition: var(--transition); cursor: pointer;
}
.nav-item:hover { background: var(--moss-pale); color: var(--moss); }
.nav-item.active {
  background: var(--moss-pale); color: var(--moss); font-weight: 700;
  border-left: 3px solid var(--moss); padding-left: 9px;
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 0.62rem; font-weight: 800; line-height: 18px; text-align: center;
}
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 0.68rem; color: var(--muted); }

/* ==========================================================================
   MAIN CONTAINER
   ========================================================================== */

main, .main-content {
  max-width: 1240px;
  margin: 18px auto;
  padding: 0 22px 40px;
}
.main { flex: 1; display: flex; flex-direction: column; }
.main .content { flex: 1; overflow-y: auto; padding: 28px 32px; max-width: 1080px; }

/* ==========================================================================
   STEPPER / WIZARD  (Format A)
   ========================================================================== */

.stepper {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.step {
  display: flex; align-items: center; gap: 8px; font-size: 0.74rem;
  font-weight: 700; color: var(--muted); padding: 6px 12px; border-radius: 18px;
}
.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--sand-pale);
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 900; border: 1px solid var(--border);
}
.step.done { color: var(--moss-dark); }
.step.done .step-num { background: var(--moss); color: #fff; border-color: var(--moss); }
.step.active { color: var(--moss-dark); background: var(--moss-pale); border: 1px solid var(--moss-light); }
.step.active .step-num { background: var(--moss); color: #fff; border-color: var(--moss); }
.step-arrow { color: var(--border); margin: 0 2px; font-weight: 700; }

/* ==========================================================================
   CARDS + SECTION HEADINGS
   ========================================================================== */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-report { border-top: 4px solid var(--moss); }

.card h2 {
  margin: 0 0 10px; font-size: 0.85rem; font-weight: 800; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.eyebrow, .section-lbl {
  font-size: 0.62rem; font-weight: 800; color: var(--moss-dark);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.sub { margin: 0 0 16px; font-size: 0.78rem; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.74rem; }

/* ==========================================================================
   FORMS
   ========================================================================== */

label, .form-group label {
  display: block; font-size: 0.66rem; font-weight: 800; color: var(--wood-light);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.form-group { margin-bottom: 14px; }

input, select, textarea, .form-input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); transition: all var(--transition);
}
input:focus, select:focus, textarea:focus, .form-input:focus {
  outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px var(--moss-pale);
}
textarea, textarea.form-input { min-height: 90px; resize: vertical; }

.search-box, .search-bar input {
  width: 100%; max-width: 440px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px; margin: 0 0 14px;
  display: block; background: #fff; box-shadow: var(--shadow);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn, button.primary, .btn-primary,
.secondary-button, .btn-secondary, button.ghost, .ghost-button, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.2px; padding: 10px 18px;
  border: none; transition: var(--transition);
}
button.primary, .btn-primary { background: var(--moss); color: #fff; }
button.primary:hover, .btn-primary:hover { background: var(--moss-dark); }
button.primary:disabled, .btn-primary:disabled { background: var(--sand); cursor: not-allowed; }

.secondary-button, .btn-secondary {
  background: #fff; color: var(--moss-dark); border: 1px solid var(--moss-light);
}
.secondary-button:hover, .btn-secondary:hover { background: var(--moss-pale); }

button.ghost, .ghost-button {
  background: var(--sand-pale); color: var(--wood); border: 1px solid var(--border);
  padding: 9px 12px; font-size: 0.72rem;
}
button.ghost:hover:enabled, .ghost-button:hover { border-color: var(--moss-light); color: var(--moss-dark); }

/* Destructive: Wood, not red — red is reserved for status signalling. */
.btn-danger { background: var(--wood); color: var(--sand); }
.btn-danger:hover { background: #2a2726; }

.btn-sm { padding: 5px 12px; font-size: 0.72rem; }

.back-link {
  background: none; border: none; color: var(--moss-dark); font-weight: 800;
  font-size: 0.74rem; cursor: pointer; padding: 0; margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ==========================================================================
   TABLES / REGISTERS
   ========================================================================== */

table, table.register {
  width: 100%; border-collapse: collapse; background: #fff; font-size: 0.82rem;
}
table.register {
  border-collapse: separate; border-spacing: 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
th {
  text-align: left; background: var(--sand-pale); color: var(--muted);
  font-weight: 800; font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.7px; padding: 11px 14px; border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--wood); vertical-align: middle; }
tbody tr:hover, tbody tr.clickable:hover td { background: var(--moss-pale); cursor: default; }
tr.clickable, tbody tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable.active { color: var(--moss); }

/* ==========================================================================
   BADGES / PILLS / STATUS
   Semantics: good=moss · warn=amber · bad=red · info=water · neutral=sand
   ========================================================================== */

.badge, .status-chip, .tone-pill, .chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 0.62rem; font-weight: 800; padding: 4px 10px;
  border-radius: var(--radius-pill); text-transform: uppercase;
  letter-spacing: 0.5px; border: 1px solid transparent; white-space: nowrap;
}

/* good */
.tone-pill.good, .badge.good, .badge-approved, .badge-complied, .badge-current, .badge-promised {
  background: var(--moss); color: #fff;
}
.badge-current, .badge-promised { background: var(--moss-pale); color: var(--moss-dark); }
/* warn */
.tone-pill.warn, .badge.warn, .badge-awaiting, .badge-soon, .badge-60 {
  background: var(--amber-pale); color: #8a6a10; border-color: var(--amber);
}
/* bad */
.tone-pill.bad, .badge.bad, .badge-overdue, .badge-disputed, .badge-90 {
  background: var(--red-pale); color: var(--red); border-color: var(--red);
}
/* info */
.tone-pill.info, .badge.info, .badge-followup, .badge-30, .context-chip {
  background: var(--water-light); color: var(--blue); border-color: var(--water);
}
/* neutral */
.tone-pill.neutral, .badge.neutral, .badge-noaction, .status-chip {
  background: var(--sand-pale); color: var(--wood-light); border-color: var(--border);
}

/* Filter chips (interactive) */
.filter-chip {
  padding: 6px 13px; border-radius: 18px; font-size: 0.72rem; font-weight: 700;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  cursor: pointer; transition: all var(--transition);
}
.filter-chip.active { background: var(--moss); color: #fff; border-color: var(--moss); }
.filter-chip:hover:not(.active) { border-color: var(--moss-light); color: var(--wood); }

/* Small square risk indicator (H/M/L) */
.risk { display: inline-flex; align-items: center; justify-content: center; width: 26px; border-radius: var(--radius-sm); font-weight: 800; font-size: 0.66rem; padding: 3px 0; }
.risk.H { background: var(--red-pale); color: var(--red); border: 1px solid var(--red); }
.risk.M { background: var(--amber-pale); color: #8a6a10; border: 1px solid var(--amber); }
.risk.L { background: var(--moss-pale); color: var(--moss-dark); border: 1px solid var(--moss-light); }

/* ==========================================================================
   STAT / METRIC / FACT / DETAIL TILES
   ========================================================================== */

.stat-card, .metric-card, .fact-card, .tile, .detail-grid > div, .detail-list div {
  background: var(--sand-pale); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.stat-card { background: #fff; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--moss-light); box-shadow: var(--shadow-md); }
.stat-label, .metric-label,
.detail-grid span, .detail-list span, .fact-card span {
  display: block; font-size: 0.58rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px;
}
.stat-value { font-size: 1.9rem; font-weight: 900; color: var(--wood); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-card.alert .stat-value { color: var(--red); }
.stat-card.warn .stat-value { color: var(--amber); }
.metric-card strong, .fact-card strong, .detail-grid strong, .detail-list strong { font-size: 0.88rem; color: var(--wood); font-weight: 600; }

.metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.detail-grid, .detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }

/* Status card (full-width banner) */
.status-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 16px;
}
.status-card.good { background: var(--moss-pale); border-color: var(--moss-light); }
.status-card.warn { background: var(--amber-pale); border-color: var(--amber); }
.status-card.bad  { background: var(--red-pale);  border-color: var(--red); }

/* ==========================================================================
   ACTION-ITEM PATTERNS  (Format C: gate tiles + action rows)
   ========================================================================== */

.gate-tile {
  position: relative; text-align: left; flex: 1; min-width: 120px;
  padding: var(--sp-sm) var(--sp-md); border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border); cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.gate-tile:hover { box-shadow: var(--shadow); border-color: var(--moss); }
.gate-tile.ok { background: var(--moss-pale); }
.gate-tile.has-actions { border-color: var(--red); }
.gate-tile.active { border-color: var(--moss); box-shadow: 0 0 0 1px var(--moss) inset; }
.gate-tile .gt-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.gate-tile .gt-status { font-size: 0.75rem; font-weight: 700; color: var(--wood); margin-top: 2px; }
.gate-tile.ok .gt-status { color: var(--moss); }
.count-badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: var(--radius-pill); background: var(--red);
  color: #fff; font-size: 0.62rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Action row: leading state icon · label · due pill · owner avatar */
.action-row {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; margin-bottom: 6px;
}
.action-row.is-overdue { border-color: var(--red); background: var(--red-pale); }
.action-row.is-done { background: var(--sand-pale); }
.action-row.is-done .action-label { color: var(--muted); text-decoration: line-through; }
.action-label { flex: 1; font-size: 0.78rem; font-weight: 500; }

/* Key-value pairs */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.82rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { color: var(--wood); font-weight: 600; margin: 0; }

/* Progress bar */
.progress-track, .compliance-progress-bar { height: 8px; background: var(--sand-light); border-radius: 4px; overflow: hidden; }
.progress-fill, .compliance-progress-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; background: var(--moss); }

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(61, 57, 53, 0.55); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: var(--radius); width: 100%; max-width: 780px;
  box-shadow: var(--shadow-lg); margin: auto; border-top: 4px solid var(--moss);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 2;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h3 { font-size: 1.05rem; }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap;
}
.modal-close { font-size: 1.4rem; color: var(--muted); line-height: 1; padding: 2px 8px; cursor: pointer; background: none; border: none; }

/* ==========================================================================
   TOASTS
   ========================================================================== */

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--wood); color: #fff; padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; box-shadow: var(--shadow-lg); max-width: 360px; animation: mck-slidein 0.3s ease;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--moss); }
@keyframes mck-slidein { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.35; display: block; color: var(--moss); }
.empty-state h3 { font-size: 1rem; margin-bottom: 8px; color: var(--wood-light); }
.empty-state p { font-size: 0.8rem; line-height: 1.5; max-width: 480px; margin: 0 auto; }

/* ==========================================================================
   MISC — scrollbar, selection, focus
   ========================================================================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 3px; }
::selection { background: var(--water); color: var(--wood); }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1260px) {
  .work-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .metric-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hero, .topbar, header.page-header { padding-left: 18px; padding-right: 18px; }
  main, .main-content { padding: 0 14px 28px; }
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar .mck-app, .nav-item span:not(.nav-badge), .nav-section { display: none; }
}
