/* ======================================================================
   WORKHUB FRONTEND 5.0
   Editorial intelligence for modern teams.
   Core: ink + parchment · Finance: oxblood + copper · Science: mineral + cobalt
   ====================================================================== */

:root {
  color-scheme: light;
  --wh-paper: #f3efe6;
  --wh-paper-deep: #e9e2d5;
  --wh-surface: #fbf9f4;
  --wh-surface-strong: #ffffff;
  --wh-ink: #171510;
  --wh-ink-soft: #4d4941;
  --wh-muted: #746e64;
  --wh-line: #d8d0c2;
  --wh-line-soft: #e8e2d7;
  --wh-accent: #1d3f8f;
  --wh-accent-strong: #142e6e;
  --wh-accent-wash: #e8edf9;
  --wh-sidebar: #171510;
  --wh-sidebar-text: #eee8dc;
  --wh-sidebar-muted: #aaa397;
  --wh-positive: #2f6b54;
  --wh-warning: #a36020;
  --wh-danger: #9b3b35;
  --wh-radius-xs: 4px;
  --wh-radius-sm: 7px;
  --wh-radius: 12px;
  --wh-radius-lg: 20px;
  --wh-shadow-sm: 0 1px 1px rgba(23, 21, 16, .04), 0 4px 18px rgba(23, 21, 16, .04);
  --wh-shadow: 0 18px 44px rgba(23, 21, 16, .09);
  --wh-font-display: "Cormorant Garamond", Georgia, serif;
  --wh-font-body: "Jost", "Segoe UI", sans-serif;
  --wh-font-mono: "DM Mono", Consolas, monospace;
  --wh-header: 76px;
  --wh-sidebar-mini: 84px;
  --wh-sidebar-wide: 276px;

  --bg-color: var(--wh-paper);
  --bg-color-2: var(--wh-paper-deep);
  --card-bg: var(--wh-surface);
  --text-primary: var(--wh-ink);
  --text-secondary: var(--wh-ink-soft);
  --text-muted: var(--wh-muted);
  --border-color: var(--wh-line);
  --border-light: var(--wh-line-soft);
  --hover-bg: var(--wh-accent-wash);
  --primary-color: var(--wh-accent);
  --primary-hover: var(--wh-accent-strong);
  --gold: var(--wh-accent);
  --gold-light: #5270b7;
  --success-color: var(--wh-positive);
  --warning-color: var(--wh-warning);
  --danger-color: var(--wh-danger);
  --info-color: var(--wh-accent);
  --font-display: var(--wh-font-display);
  --font-body: var(--wh-font-body);
  --font-mono: var(--wh-font-mono);
  --header-height: var(--wh-header);
  --radius-sm: var(--wh-radius-sm);
  --radius-md: var(--wh-radius);
  --radius-lg: var(--wh-radius-lg);
  --shadow-soft: var(--wh-shadow-sm);
  --shadow-hover: var(--wh-shadow);
  --shadow-modal: var(--wh-shadow);
  --bs-primary-rgb: 29, 63, 143;
  --bs-body-color: var(--wh-ink);
  --bs-body-bg: var(--wh-paper);
}

body.wh-finance {
  --wh-paper: #f4eee5;
  --wh-paper-deep: #e8ddcf;
  --wh-surface: #fcf8f2;
  --wh-surface-strong: #fffdf9;
  --wh-ink: #241916;
  --wh-ink-soft: #5c4a43;
  --wh-muted: #806e65;
  --wh-line: #d8c9b9;
  --wh-line-soft: #eadfd3;
  --wh-accent: #7b2f2b;
  --wh-accent-strong: #5e201e;
  --wh-accent-wash: #f3e3df;
  --wh-sidebar: #261716;
  --wh-sidebar-text: #f4e8dc;
  --wh-sidebar-muted: #bea99e;
  --wh-positive: #356552;
  --wh-warning: #a05f2d;
  --bs-primary-rgb: 123, 47, 43;
}

body.wh-science {
  --wh-paper: #edf2ec;
  --wh-paper-deep: #dce7df;
  --wh-surface: #f8fbf7;
  --wh-surface-strong: #ffffff;
  --wh-ink: #10231f;
  --wh-ink-soft: #405c55;
  --wh-muted: #6b7e77;
  --wh-line: #cbd9d2;
  --wh-line-soft: #dfe9e3;
  --wh-accent: #11675e;
  --wh-accent-strong: #0c4e48;
  --wh-accent-wash: #dfeee8;
  --wh-sidebar: #0c2523;
  --wh-sidebar-text: #e4f1ed;
  --wh-sidebar-muted: #9dbab2;
  --wh-positive: #24725b;
  --wh-warning: #a06a27;
  --bs-primary-rgb: 17, 103, 94;
}

body.wh-tools {
  --wh-paper: #f1eee8;
  --wh-accent: #6b4d8a;
  --wh-accent-strong: #50366d;
  --wh-accent-wash: #eee6f5;
  --wh-sidebar: #211a29;
  --bs-primary-rgb: 107, 77, 138;
}

[data-theme="dark"] {
  color-scheme: dark;
  --wh-paper: #11100d;
  --wh-paper-deep: #181611;
  --wh-surface: #1b1914;
  --wh-surface-strong: #211e18;
  --wh-ink: #f3eee4;
  --wh-ink-soft: #cbc3b6;
  --wh-muted: #9d958a;
  --wh-line: #373229;
  --wh-line-soft: #2b2821;
  --wh-accent: #8da9ef;
  --wh-accent-strong: #b3c4f5;
  --wh-accent-wash: rgba(93, 124, 203, .16);
  --wh-sidebar: #080806;
  --wh-sidebar-text: #f3eee4;
  --wh-sidebar-muted: #948d82;
  --wh-positive: #77b79b;
  --wh-warning: #d79a57;
  --wh-danger: #df817b;
  --bs-primary-rgb: 141, 169, 239;
  --bs-dark-rgb: 243, 238, 228;
  --bs-light-rgb: 27, 25, 20;
}

[data-theme="dark"] body.wh-finance,
body.wh-finance[data-theme="dark"] {
  --wh-accent: #d39578;
  --wh-accent-strong: #efb39a;
  --wh-accent-wash: rgba(178, 91, 70, .16);
}

[data-theme="dark"] body.wh-science,
body.wh-science[data-theme="dark"] {
  --wh-accent: #75c9b7;
  --wh-accent-strong: #a0dfd1;
  --wh-accent-wash: rgba(65, 150, 131, .16);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(113, 102, 83, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 102, 83, .035) 1px, transparent 1px),
    var(--wh-paper) !important;
  background-size: 32px 32px !important;
  color: var(--wh-ink) !important;
  font-family: var(--wh-font-body) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: .002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--wh-accent) 8%, transparent), transparent 28%);
}
::selection { background: var(--wh-accent); color: #fff; }
h1, h2, h3, h4, h5, h6 { color: var(--wh-ink); font-family: var(--wh-font-display) !important; font-weight: 600; letter-spacing: -.025em; }
p, li, label, input, textarea, select, button, td, th { font-family: var(--wh-font-body) !important; }
a { color: inherit; text-underline-offset: 3px; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
*:focus-visible { outline: 3px solid color-mix(in srgb, var(--wh-accent) 42%, transparent) !important; outline-offset: 3px !important; }

.wh-skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9999;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: var(--wh-radius-sm);
  background: var(--wh-ink);
  color: var(--wh-surface);
  font-weight: 650;
}
.wh-skip-link:focus { transform: translateY(0); }

/* ——— APP CHROME ——— */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  height: var(--wh-header);
  padding: 0 24px !important;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--wh-surface) 90%, transparent) !important;
  border-bottom: 1px solid var(--wh-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(130%);
}
#app-header .logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--wh-ink) !important;
  font-family: var(--wh-font-display) !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  letter-spacing: -.04em !important;
}
#app-header .logo::before {
  content: "W";
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--wh-accent) 42%, var(--wh-line));
  border-radius: 50%;
  background: var(--wh-accent);
  color: #fff;
  font-family: var(--wh-font-display);
  font-size: 20px;
  font-style: italic;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--wh-accent) 9%, transparent);
}
#app-header .logo::after {
  content: attr(data-workspace);
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--wh-line);
  color: var(--wh-muted);
  font-family: var(--wh-font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.user-info { display: flex; gap: 5px !important; align-items: center; }
.user-info > button,
.user-info .dropdown > button,
#theme-toggle-btn,
#auto-theme-btn,
.wh-command-trigger {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px !important;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--wh-ink-soft) !important;
  box-shadow: none !important;
}
.user-info > button:hover,
.user-info .dropdown > button:hover,
#theme-toggle-btn:hover,
#auto-theme-btn:hover,
.wh-command-trigger:hover { border-color: var(--wh-line) !important; background: var(--wh-surface-strong) !important; color: var(--wh-accent) !important; }
#logout-btn {
  margin-left: 4px;
  padding: 0 15px !important;
  border-color: color-mix(in srgb, var(--wh-danger) 28%, transparent) !important;
  color: var(--wh-danger) !important;
  font-size: 12px;
  font-weight: 600;
}

#main-container { display: flex; min-height: calc(100vh - var(--wh-header)); }
#app-sidebar {
  position: sticky;
  top: var(--wh-header);
  z-index: 90;
  width: var(--wh-sidebar-mini);
  height: calc(100vh - var(--wh-header));
  padding: 14px 12px 20px !important;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--wh-sidebar) !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: width .28s cubic-bezier(.2, .7, .2, 1) !important;
}
#app-sidebar.expanded { width: var(--wh-sidebar-wide); }
#hamburger-menu {
  display: flex;
  min-height: 46px;
  margin-bottom: 12px !important;
  padding: 0 14px !important;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--wh-radius-sm);
  color: var(--wh-sidebar-text) !important;
  font-family: var(--wh-font-mono) !important;
  font-size: 10px !important;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
#app-sidebar.expanded #hamburger-menu { justify-content: flex-start; }
#app-sidebar ul { margin: 0 !important; padding: 0 !important; list-style: none; }
#app-sidebar hr { margin: 14px 8px !important; border-color: rgba(255, 255, 255, .13) !important; }
#app-sidebar .nav-item {
  position: relative;
  display: flex;
  min-height: 46px;
  margin: 3px 0;
  padding: 0 14px !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent !important;
  border-radius: var(--wh-radius-sm) !important;
  color: var(--wh-sidebar-muted) !important;
  font-size: 13px;
  font-weight: 430;
  white-space: nowrap;
  cursor: pointer;
}
#app-sidebar.expanded .nav-item { justify-content: flex-start; }
#app-sidebar .nav-item i { width: 22px; color: currentColor; font-size: 15px; text-align: center; }
#app-sidebar .nav-item span { display: none; margin: 0 !important; }
#app-sidebar.expanded .nav-item span { display: inline; }
#app-sidebar .nav-item:hover { background: rgba(255,255,255,.07) !important; color: var(--wh-sidebar-text) !important; }
#app-sidebar .nav-item.active {
  background: color-mix(in srgb, var(--wh-accent) 76%, #fff 0%) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #fff !important;
  box-shadow: none !important;
}
#app-sidebar .nav-item.active::after {
  content: "";
  position: absolute;
  right: -12px;
  width: 3px;
  height: 22px;
  border-radius: 2px 0 0 2px;
  background: #fff;
}
#app-sidebar .custom-finance-icon { width: 18px; height: 18px; object-fit: contain; filter: grayscale(1) brightness(2); }
#main-content {
  width: calc(100% - var(--wh-sidebar-mini));
  max-width: 1780px;
  margin: 0 auto;
  padding: 34px clamp(22px, 3vw, 48px) 64px !important;
  overflow: visible !important;
}
#app-sidebar.expanded ~ #main-content { width: calc(100% - var(--wh-sidebar-wide)); }

/* ——— EDITORIAL HERO ——— */
.wh-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  min-height: 270px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--wh-line);
  border-radius: 2px var(--wh-radius-lg) var(--wh-radius-lg) var(--wh-radius-lg);
  background: var(--wh-surface);
}
.wh-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 118px;
  height: 4px;
  background: var(--wh-accent);
}
.wh-hero-copy { display: flex; padding: clamp(28px, 4vw, 52px); flex-direction: column; justify-content: center; }
.wh-kicker {
  display: inline-flex;
  margin-bottom: 16px;
  align-items: center;
  gap: 9px;
  color: var(--wh-accent);
  font-family: var(--wh-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.wh-kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.wh-hero h1 { max-width: 770px; margin: 0 0 14px; font-size: clamp(37px, 4.5vw, 68px); font-weight: 500; line-height: .98; letter-spacing: -.055em; }
.wh-hero h1 em { color: var(--wh-accent); font-weight: 500; }
.wh-hero-copy > p { max-width: 690px; margin: 0; color: var(--wh-ink-soft); font-size: 15px; line-height: 1.7; }
.wh-hero-side {
  position: relative;
  display: flex;
  padding: 28px;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--wh-line);
  background:
    radial-gradient(circle at 70% 25%, color-mix(in srgb, var(--wh-accent) 16%, transparent) 0 2px, transparent 3px) 0 0 / 20px 20px,
    var(--wh-paper-deep);
}
.wh-hero-index { color: var(--wh-accent); font-family: var(--wh-font-display); font-size: 72px; font-style: italic; line-height: 1; opacity: .85; }
.wh-hero-meta { display: grid; gap: 11px; }
.wh-hero-meta span { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid color-mix(in srgb, var(--wh-line) 70%, transparent); color: var(--wh-muted); font-family: var(--wh-font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.wh-hero-meta strong { padding-bottom: 7px; color: var(--wh-ink); font-family: var(--wh-font-body); font-size: 12px; font-weight: 560; letter-spacing: 0; text-transform: none; }
.wh-quick-actions { display: flex; margin-top: 24px; gap: 8px; flex-wrap: wrap; }

body.wh-finance .wh-hero { border-radius: 2px 10px 10px 10px; }
body.wh-finance .wh-hero-side { background: linear-gradient(145deg, #ead9c9, #f3e8dd); }
body.wh-finance .wh-hero-index { color: #9d5f3d; }
body.wh-science .wh-hero { border-radius: 2px 26px 26px 26px; }
body.wh-science .wh-hero-side {
  background:
    linear-gradient(90deg, transparent 49%, color-mix(in srgb, var(--wh-accent) 12%, transparent) 50%, transparent 51%) 0 0 / 32px 32px,
    linear-gradient(transparent 49%, color-mix(in srgb, var(--wh-accent) 12%, transparent) 50%, transparent 51%) 0 0 / 32px 32px,
    #dce9e1;
}

.wh-section-heading { display: flex; margin: 31px 0 15px; align-items: end; justify-content: space-between; gap: 18px; }
.wh-section-heading h2 { margin: 0; font-size: 28px; font-weight: 560; }
.wh-section-heading p { margin: 0; color: var(--wh-muted); font-family: var(--wh-font-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

/* Hide the legacy dashboard title after the new hero is mounted. */
.content-section.wh-enhanced > .d-flex:first-child,
.content-section.wh-enhanced > h2:first-child { display: none !important; }

/* ——— CONTENT SYSTEM ——— */
.dashboard-widgets { display: grid !important; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr) !important; gap: 16px !important; align-items: start !important; }
.main-widgets, .side-widgets { display: grid !important; gap: 16px !important; min-width: 0; }
.card,
.widget-item,
.tools-card,
.modal-content,
.dropdown-menu,
.auth-card {
  background: var(--wh-surface) !important;
  border: 1px solid var(--wh-line) !important;
  border-radius: var(--wh-radius) !important;
  box-shadow: var(--wh-shadow-sm) !important;
}
.card { position: relative; padding: 22px !important; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: transparent; transition: background .2s ease; }
.card:hover { transform: none !important; border-color: color-mix(in srgb, var(--wh-accent) 38%, var(--wh-line)) !important; box-shadow: var(--wh-shadow-sm) !important; }
.card:hover::before { background: var(--wh-accent); }
.card h3 { display: flex; margin: 0 0 18px !important; align-items: center; gap: 9px; color: var(--wh-ink) !important; font-family: var(--wh-font-body) !important; font-size: 13px !important; font-weight: 650 !important; letter-spacing: .02em; }
.card h3 i { color: var(--wh-accent); }
.card h4 { color: var(--wh-ink-soft) !important; font-family: var(--wh-font-mono) !important; font-size: 9px !important; font-weight: 500 !important; letter-spacing: .1em; text-transform: uppercase; }
body.wh-finance .card { border-radius: 7px !important; }
body.wh-science .card { border-radius: 18px !important; }
body.wh-science .card:nth-child(2n) { background: color-mix(in srgb, var(--wh-surface) 88%, #dce9e1) !important; }

.content-section > h2,
.content-section > .d-flex:first-child h2 { color: var(--wh-ink) !important; font-size: clamp(28px, 3vw, 42px) !important; font-weight: 520 !important; }
.content-section > h2 i,
.content-section > .d-flex:first-child h2 i { margin-right: 10px; color: var(--wh-accent); }

button, .btn, .primary-btn, .secondary-btn, .action-btn {
  min-height: 40px;
  border-radius: var(--wh-radius-sm) !important;
  font-family: var(--wh-font-body) !important;
  font-size: 12.5px;
  font-weight: 600 !important;
  letter-spacing: .005em;
  transition: transform .16s ease, color .16s ease, background-color .16s ease, border-color .16s ease !important;
}
.primary-btn, .btn-primary {
  border: 1px solid var(--wh-accent) !important;
  background: var(--wh-accent) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.primary-btn:hover, .btn-primary:hover { transform: translateY(-1px); border-color: var(--wh-accent-strong) !important; background: var(--wh-accent-strong) !important; }
.secondary-btn, .btn-outline-primary {
  border: 1px solid var(--wh-line) !important;
  background: var(--wh-surface-strong) !important;
  color: var(--wh-ink-soft) !important;
  box-shadow: none !important;
}
.secondary-btn:hover, .btn-outline-primary:hover { border-color: var(--wh-accent) !important; background: var(--wh-accent-wash) !important; color: var(--wh-accent) !important; }
.btn-link { color: var(--wh-accent) !important; }

input:not([type="checkbox"]):not([type="radio"]), textarea, select, .form-control, .form-select, .text-input {
  min-height: 43px;
  border: 1px solid var(--wh-line) !important;
  border-radius: var(--wh-radius-sm) !important;
  background: var(--wh-surface-strong) !important;
  color: var(--wh-ink) !important;
  box-shadow: none !important;
}
textarea { min-height: 98px; }
input::placeholder, textarea::placeholder { color: var(--wh-muted) !important; opacity: .8; }
input:focus, textarea:focus, select:focus, .form-control:focus, .form-select:focus, .text-input:focus { border-color: var(--wh-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wh-accent) 13%, transparent) !important; }
label { color: var(--wh-ink-soft); font-size: 12px; font-weight: 600; }

.wh-table-scroll, .table-responsive { width: 100%; overflow-x: auto; border: 1px solid var(--wh-line); border-radius: var(--wh-radius-sm); background: var(--wh-surface); }
table, .data-table { width: 100%; border-collapse: separate !important; border-spacing: 0 !important; background: transparent !important; }
table th, .data-table th { padding: 12px 14px !important; border-bottom: 1px solid var(--wh-line) !important; background: var(--wh-paper-deep) !important; color: var(--wh-ink-soft) !important; font-family: var(--wh-font-mono) !important; font-size: 9px !important; font-weight: 500 !important; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
table td, .data-table td { padding: 13px 14px !important; border-bottom: 1px solid var(--wh-line-soft) !important; color: var(--wh-ink-soft) !important; vertical-align: middle; }
table tbody tr:hover td { background: var(--wh-accent-wash) !important; }
.badge { padding: 5px 9px !important; border-radius: 999px !important; font-size: 10px !important; font-weight: 650 !important; }

.dropdown-menu { padding: 8px !important; box-shadow: var(--wh-shadow) !important; }
.dropdown-item { padding: 9px 11px !important; border-radius: var(--wh-radius-sm) !important; color: var(--wh-ink-soft) !important; }
.dropdown-item:hover { background: var(--wh-accent-wash) !important; color: var(--wh-accent) !important; }
#right-sidebar { background: var(--wh-surface) !important; border: 1px solid var(--wh-line) !important; border-radius: var(--wh-radius-lg) 0 0 var(--wh-radius-lg) !important; box-shadow: var(--wh-shadow) !important; }
.right-sidebar-header { border-bottom: 1px solid var(--wh-line) !important; background: var(--wh-paper-deep) !important; }
.modal-content { box-shadow: var(--wh-shadow) !important; }
.modal-header, .modal-footer { border-color: var(--wh-line) !important; }
.swal2-popup { border: 1px solid var(--wh-line) !important; border-radius: var(--wh-radius) !important; background: var(--wh-surface) !important; color: var(--wh-ink) !important; }

/* ——— COMMAND PALETTE ——— */
.wh-command-backdrop { position: fixed; inset: 0; z-index: 1300; display: none; padding: 10vh 16px 20px; background: rgba(18, 16, 12, .62); backdrop-filter: blur(8px); }
.wh-command-backdrop.open { display: block; }
.wh-command {
  width: min(660px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  background: var(--wh-surface);
  box-shadow: var(--wh-shadow);
}
.wh-command-head { display: flex; padding: 16px 18px; align-items: center; gap: 12px; border-bottom: 1px solid var(--wh-line); }
.wh-command-head i { color: var(--wh-accent); }
.wh-command-head input { width: 100%; min-height: 36px !important; padding: 0 !important; border: 0 !important; background: transparent !important; font-family: var(--wh-font-display) !important; font-size: 24px; }
.wh-command-head input:focus { box-shadow: none !important; }
.wh-command-list { max-height: 54vh; padding: 8px; overflow-y: auto; }
.wh-command-item { display: flex; width: 100%; min-height: 48px; padding: 0 12px; align-items: center; gap: 12px; border: 0; border-radius: var(--wh-radius-sm); background: transparent; color: var(--wh-ink-soft); text-align: left; }
.wh-command-item:hover, .wh-command-item:focus { background: var(--wh-accent-wash); color: var(--wh-accent); }
.wh-command-item i { width: 20px; text-align: center; }
.wh-command-empty { padding: 32px; color: var(--wh-muted); text-align: center; }
.wh-command-foot { display: flex; padding: 10px 16px; justify-content: space-between; border-top: 1px solid var(--wh-line); color: var(--wh-muted); font-family: var(--wh-font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

/* ——— AUTH ——— */
body.auth-page {
  display: grid !important;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
  min-height: 100vh;
  overflow: hidden;
  background: var(--wh-paper) !important;
}
.auth-stars, .auth-twinkling { display: none !important; }
.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 76px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #16140f;
  background-size: 42px 42px;
  color: #f3eee4;
}
.auth-brand-panel::before { content: ""; position: absolute; right: -12vw; bottom: -18vw; width: 50vw; height: 50vw; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 5vw rgba(255,255,255,.018), 0 0 0 10vw rgba(255,255,255,.012); }
.auth-brand-mark { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; font-family: var(--wh-font-display); font-size: 24px; font-weight: 600; }
.auth-brand-mark span:first-child { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.26); border-radius: 50%; background: #f3eee4; color: #171510; font-style: italic; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 820px; }
.auth-brand-copy .eyebrow { color: #b8c9f4; font-family: var(--wh-font-mono); font-size: 9px; letter-spacing: .17em; text-transform: uppercase; }
.auth-brand-copy h1 { max-width: 760px; margin: 18px 0 22px; color: #f8f3e9 !important; font-size: clamp(48px, 6vw, 92px); font-weight: 500; line-height: .91; letter-spacing: -.06em; }
.auth-brand-copy h1 em { color: #9cb1e9; font-weight: 500; }
.auth-brand-copy p { max-width: 620px; color: #b8b1a6; font-size: 16px; line-height: 1.75; }
.auth-trust-row { position: relative; z-index: 1; display: flex; gap: 20px; flex-wrap: wrap; color: #928b80; font-family: var(--wh-font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.auth-trust-row span { display: inline-flex; align-items: center; gap: 8px; }
.auth-trust-row i { color: #9cb1e9; }
.auth-page > .auth-card {
  align-self: center;
  justify-self: center;
  width: min(430px, calc(100% - 48px)) !important;
  margin: 0 !important;
  padding: 40px !important;
  border: 0 !important;
  border-radius: 0 var(--wh-radius-lg) var(--wh-radius-lg) var(--wh-radius-lg) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.auth-card h2 { margin: 0 0 8px !important; color: var(--wh-ink) !important; font-size: 38px !important; font-weight: 520 !important; }
.auth-card .auth-subtitle { margin-bottom: 28px !important; color: var(--wh-muted) !important; font-family: var(--wh-font-body) !important; font-size: 14px !important; letter-spacing: 0 !important; text-transform: none !important; }
.auth-input-group { margin-bottom: 13px !important; }
.auth-input-icon { color: var(--wh-muted) !important; }
.auth-btn-submit { width: 100%; min-height: 48px; margin-top: 7px; border: 1px solid var(--wh-ink) !important; border-radius: var(--wh-radius-sm) !important; background: var(--wh-ink) !important; color: var(--wh-surface) !important; font-weight: 620 !important; box-shadow: none !important; }
.auth-btn-submit:hover { background: var(--wh-accent) !important; border-color: var(--wh-accent) !important; }
.auth-theme-controls { top: 18px !important; right: 18px !important; z-index: 10; }
.auth-btn-control { border: 1px solid var(--wh-line) !important; background: var(--wh-surface) !important; color: var(--wh-ink-soft) !important; }

/* ——— STANDALONE MODULES ——— */
.tools-navbar, nav.navbar { min-height: var(--wh-header); background: color-mix(in srgb, var(--wh-surface) 92%, transparent) !important; border-bottom: 1px solid var(--wh-line) !important; box-shadow: none !important; backdrop-filter: blur(16px); }
.navbar-brand { color: var(--wh-ink) !important; font-family: var(--wh-font-display) !important; font-size: 24px !important; letter-spacing: -.035em; }
.container, .container-fluid { --bs-gutter-x: 2rem; }
.wh-mobile-overlay { display: none; position: fixed; inset: var(--wh-header) 0 0; z-index: 87; background: rgba(15, 14, 11, .55); backdrop-filter: blur(3px); }
body.wh-nav-open .wh-mobile-overlay { display: block; }

@media (max-width: 1100px) {
  .dashboard-widgets { grid-template-columns: 1fr !important; }
  .wh-hero { grid-template-columns: 1fr minmax(250px, .42fr); }
}

@media (max-width: 920px) {
  body.auth-page { grid-template-columns: 1fr; overflow: auto; }
  .auth-brand-panel { min-height: 620px; padding: 36px 28px 86px; }
  .auth-brand-copy { margin: 60px 0 30px; }
  .auth-brand-copy h1 { max-width: 700px; font-size: clamp(52px, 11vw, 82px); }
  .auth-page > .auth-card { position: relative; z-index: 2; width: min(560px, calc(100% - 32px)) !important; margin: -46px auto 36px !important; padding: 34px 28px !important; background: var(--wh-surface) !important; box-shadow: var(--wh-shadow) !important; }
  #app-sidebar, #app-sidebar.expanded { position: fixed !important; top: var(--wh-header) !important; bottom: 0; left: 0; z-index: 90; width: min(300px, calc(100vw - 44px)) !important; height: calc(100vh - var(--wh-header)); transform: translateX(-105%); transition: transform .22s ease !important; }
  body.wh-nav-open #app-sidebar { transform: translateX(0); }
  #app-sidebar .nav-item, #app-sidebar.expanded .nav-item, #hamburger-menu { justify-content: flex-start !important; }
  #app-sidebar .nav-item span { display: inline !important; }
  #main-content, #app-sidebar.expanded ~ #main-content { width: 100% !important; padding: 24px 18px 48px !important; }
}

@media (max-width: 720px) {
  #app-header { padding: 0 13px !important; }
  #app-header .logo { font-size: 21px !important; }
  #app-header .logo::after { display: none; }
  #app-header .logo::before { width: 35px; height: 35px; }
  .user-info { gap: 0 !important; }
  #auto-theme-btn, #user-display { display: none !important; }
  #logout-btn { width: 40px; overflow: hidden; padding: 0 !important; color: transparent !important; }
  #logout-btn::before { content: "\f2f5"; color: var(--wh-danger); font-family: "Font Awesome 6 Free"; font-weight: 900; }
  .wh-command-trigger span { display: none; }
  .wh-hero { display: block; min-height: auto; }
  .wh-hero-copy { padding: 29px 23px 32px; }
  .wh-hero h1 { font-size: clamp(39px, 13vw, 58px); }
  .wh-hero-side { padding: 22px; border-top: 1px solid var(--wh-line); border-left: 0; }
  .wh-hero-index { display: none; }
  .card { padding: 18px !important; }
  .auth-brand-panel { min-height: 560px; padding: 28px 22px 80px; }
  .auth-brand-copy { margin-top: 52px; }
  .auth-brand-copy h1 { font-size: clamp(47px, 14vw, 64px); }
  .auth-trust-row { gap: 10px 16px; }
  .auth-page > .auth-card { padding: 29px 22px !important; }
}

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

@media print {
  #app-header, #app-sidebar, #right-sidebar, .wh-mobile-overlay, .wh-command-backdrop, .auth-theme-controls { display: none !important; }
  #main-content { width: 100% !important; max-width: none; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .wh-hero { break-inside: avoid; box-shadow: none !important; }
}
