/* ANVEXIQ Command Centre — premium executive shell.
   All presentation lives here because the CSP forbids inline styles. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  color-scheme: dark;
  --bg: #06101f;
  --bg-deep: #040b15;
  --bg-soft: #08172d;
  --surface: #0c2039;
  --surface-raised: #102845;
  --surface-muted: #0a1b31;
  --text: #f4f8ff;
  --text-muted: #a9bcd3;
  --text-faint: #7f95ae;
  --line: rgba(148, 192, 245, 0.14);
  --line-strong: rgba(148, 192, 245, 0.28);
  --cyan: #16d9f3;
  --blue: #168bff;
  --violet: #7657ff;
  --green: #16d99b;
  --amber: #f7b955;
  --danger: #ff7b93;
  --gradient: linear-gradient(112deg, var(--cyan), var(--blue) 52%, var(--violet));
  --gradient-soft: linear-gradient(135deg, rgba(22, 217, 243, 0.14), rgba(118, 87, 255, 0.08));
  --accent: var(--cyan);
  --accent-soft: rgba(22, 217, 243, 0.12);
  --accent-line: rgba(22, 217, 243, 0.4);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.2);
  --focus: 0 0 0 3px rgba(22, 217, 243, 0.6), 0 0 0 1px rgba(6, 16, 31, 0.9);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-width: 268px;
  --sidebar-rail: 84px;
  --topbar-height: 72px;
  --content-max: 1640px;
  --motion: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --chart-1: #16d9f3;
  --chart-2: #168bff;
  --chart-3: #7657ff;
  --chart-4: #16d99b;
  --chart-5: #f7b955;
  --chart-6: #ff7b93;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fc;
  --bg-deep: #eaf1f9;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f7faff;
  --surface-muted: #eef4fb;
  --text: #0b1b31;
  --text-muted: #4e6077;
  --text-faint: #687b91;
  --line: rgba(25, 63, 105, 0.14);
  --line-strong: rgba(25, 63, 105, 0.28);
  --cyan: #057f95;
  --blue: #0864c7;
  --violet: #5d3fe0;
  --green: #087b58;
  --amber: #986200;
  --danger: #b4233f;
  --gradient: linear-gradient(112deg, #057f95, #0864c7 52%, #5d3fe0);
  --gradient-soft: linear-gradient(135deg, rgba(5, 127, 149, 0.1), rgba(93, 63, 224, 0.07));
  --shadow: 0 18px 50px rgba(31, 64, 101, 0.13);
  --shadow-soft: 0 8px 28px rgba(31, 64, 101, 0.09);
  --focus: 0 0 0 3px rgba(8, 100, 199, 0.55), 0 0 0 1px #fff;
  --chart-1: #057f95;
  --chart-2: #0864c7;
  --chart-3: #5d3fe0;
  --chart-4: #087b58;
  --chart-5: #986200;
  --chart-6: #b4233f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 78% -12%, rgba(22, 139, 255, 0.13), transparent 64%),
    radial-gradient(900px 540px at 0% 100%, rgba(118, 87, 255, 0.1), transparent 62%),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { color: var(--text); line-height: 1.18; letter-spacing: -0.02em; }
p { margin-top: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.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: fixed; left: -999px; top: 8px; z-index: 100;
  background: var(--cyan); color: #04101f; padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 12px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.loading { padding: var(--s8); color: var(--text-muted); }

/* ---------------------------------------------------------------- shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}
.app-shell[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-rail) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-direction: column; gap: var(--s3);
  width: 100%; height: 100vh; padding: 22px 14px 16px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(16, 40, 69, 0.98), rgba(6, 16, 31, 0.99)),
    var(--bg-deep);
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 40px rgba(0, 0, 0, 0.15);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
[data-theme="light"] .sidebar { background: linear-gradient(180deg, #ffffff, #f2f7fd); }

.icon { width: 16px; height: 16px; flex: 0 0 auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 44px; padding: 2px 6px; }
.brand-logo { display: block; width: 178px; max-width: 100%; height: auto; }
.brand-mark { display: none; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-left: 2px; }
.brand-copy .brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.brand-copy .brand-note { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.brand .mark { display: none; }

.sidebar .sidebar-close { display: none; }
.menu-toggle, .topbar .menu-toggle { display: none; }
.topbar-date { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); white-space: nowrap; margin-right: 6px; }
.topbar-date .icon { width: 14px; height: 14px; color: var(--cyan); }
.sidebar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; }
.nav-group { margin: 13px 0 0; }
.nav-group-title {
  display: block; padding: 5px 10px; margin-bottom: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-planned {
  display: flex; align-items: center; gap: 11px;
  min-height: 38px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 550;
  transition: background var(--motion), color var(--motion), border-color var(--motion);
  border: 1px solid transparent;
}
.nav a:hover { background: rgba(22, 217, 243, 0.08); color: var(--text); border-color: var(--line); }
.nav a[aria-current="page"] {
  background: linear-gradient(100deg, rgba(22, 139, 255, 0.2), rgba(118, 87, 255, 0.12));
  border-color: rgba(22, 217, 243, 0.28); color: var(--text); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--cyan);
}
.nav .nav-icon { flex: 0 0 18px; width: 18px; height: 18px; opacity: 0.92; }
.nav a[aria-current="page"] .nav-icon { color: var(--cyan); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-planned { color: var(--text-faint); cursor: default; }
.nav-planned .badge { margin-left: auto; font-size: 9px; }
.nav-sub-group { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }

.quick-actions {
  margin-top: var(--s3); padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: linear-gradient(150deg, rgba(22, 139, 255, 0.1), rgba(118, 87, 255, 0.05));
  flex: 0 0 auto;
}
.quick-actions h2 { margin: 0 0 7px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.quick-actions a { display: flex; align-items: center; gap: 9px; padding: 7px 5px; color: var(--text-muted); text-decoration: none; font-size: 12px; border-radius: 6px; }
.quick-actions a:hover { color: var(--cyan); background: rgba(22, 217, 243, 0.07); }
.quick-actions .icon { width: 15px; height: 15px; }

.sidebar-footer {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-muted);
}
.sidebar-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sidebar-user .avatar { flex: 0 0 32px; }
.sidebar-user-copy { min-width: 0; }
.sidebar-user-copy strong { display: block; color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy span { display: block; font-size: 10px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-signout { margin-left: auto; }

.app-shell[data-sidebar="collapsed"] .sidebar { padding-left: 10px; padding-right: 10px; align-items: center; }
.app-shell[data-sidebar="collapsed"] .brand { justify-content: center; padding: 0; }
.app-shell[data-sidebar="collapsed"] .brand-logo { width: 42px; height: 42px; object-fit: contain; }
.app-shell[data-sidebar="collapsed"] .brand-copy,
.app-shell[data-sidebar="collapsed"] .nav-group-title,
.app-shell[data-sidebar="collapsed"] .nav-label,
.app-shell[data-sidebar="collapsed"] .quick-actions,
.app-shell[data-sidebar="collapsed"] .sidebar-user-copy,
.app-shell[data-sidebar="collapsed"] .nav-planned .badge { display: none; }
.app-shell[data-sidebar="collapsed"] .nav a,
.app-shell[data-sidebar="collapsed"] .nav-planned { justify-content: center; padding: 9px; }
.app-shell[data-sidebar="collapsed"] .nav { gap: 6px; }
.app-shell[data-sidebar="collapsed"] .nav-sub-group { margin-left: 0; padding-left: 0; border-left: 0; }
.app-shell[data-sidebar="collapsed"] .sidebar-footer { justify-content: center; }
.app-shell[data-sidebar="collapsed"] .sidebar-signout { margin-left: 0; }

.sidebar-backdrop { display: none; border: 0; padding: 0; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: var(--topbar-height);
  display: flex; align-items: center; gap: var(--s3);
  padding: 12px clamp(16px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.15);
}
.topbar-spacer { flex: 1 1 auto; }
.topbar-search {
  display: flex; align-items: center; gap: 9px; width: min(360px, 32vw);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: rgba(12, 32, 57, 0.7); color: var(--text-faint); cursor: pointer;
  text-align: left; font-size: 12px;
}
.topbar-search:hover { border-color: var(--line-strong); color: var(--text-muted); }
.topbar-search .icon { width: 16px; height: 16px; color: var(--cyan); }
.topbar-search kbd { margin-left: auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; color: var(--text-faint); }
.topbar-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.topbar-date { font-size: 11px; color: var(--text-faint); white-space: nowrap; margin-right: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(12, 32, 57, 0.7); color: var(--text-muted);
  cursor: pointer; position: relative; transition: all var(--motion);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-raised); }
.icon-btn .icon { width: 17px; height: 17px; }
.notification-count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  display: grid; place-items: center; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #18050a; font-size: 9px; font-weight: 800;
}
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--gradient); color: #03101c;
  font-size: 12px; font-weight: 800; letter-spacing: 0.02em; flex: 0 0 auto;
}
.avatar.small { width: 30px; height: 30px; font-size: 10px; }
.user-trigger { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; padding: 2px; border-radius: var(--radius-pill); }
.user-trigger:hover { background: rgba(22, 217, 243, 0.06); }
.user-trigger-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-trigger-copy strong { font-size: 11px; color: var(--text); }
.user-trigger-copy span { font-size: 9px; color: var(--text-faint); }
.user-trigger .icon { width: 13px; height: 13px; color: var(--text-faint); }

.popover-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: min(340px, calc(100vw - 30px));
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; color: var(--text);
}
.popover h2 { margin: 4px 6px 8px; font-size: 12px; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.popover-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); text-align: left; text-decoration: none; font-size: 12px; cursor: pointer; }
.popover-item:hover { background: rgba(22, 217, 243, 0.08); }
.popover-item .icon { width: 15px; height: 15px; color: var(--cyan); flex: 0 0 auto; }
.popover-item small { display: block; color: var(--text-faint); font-size: 10px; }
.popover-empty { padding: 14px 8px; color: var(--text-muted); font-size: 12px; }
.popover-separator { height: 1px; margin: 6px 0; background: var(--line); }
.user-popover { width: min(280px, calc(100vw - 30px)); }

.content {
  width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  flex: 1 1 auto;
}

/* ---------------------------------------------------------------- typography and primitives */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h1 { margin: 0 0 4px; font-size: clamp(24px, 2.3vw, 34px); font-weight: 760; }
.page-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.page-head .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 15px; }
.section-title a { font-size: 11px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }

.grid { display: grid; gap: var(--s4); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  position: relative; min-width: 0;
  background: linear-gradient(160deg, rgba(16, 40, 69, 0.92), rgba(12, 32, 57, 0.82));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.035), transparent 38%);
}
.card h2 { margin: 0 0 9px; font-size: 14px; font-weight: 700; }
.card h3 { margin: 0 0 6px; font-size: 13px; }
[data-theme="light"] .card { background: linear-gradient(160deg, #ffffff, #f7faff); }

.stat {
  position: relative; min-width: 0; padding: var(--s4);
  background: linear-gradient(150deg, rgba(16, 40, 69, 0.95), rgba(12, 32, 57, 0.82));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
[data-theme="light"] .stat { background: #fff; }
.stat .value { font-size: clamp(23px, 2vw, 30px); font-weight: 780; letter-spacing: -0.04em; line-height: 1.1; }
.stat .label { margin-top: 5px; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.stat .kpi-meta { margin-top: 9px; font-size: 11px; color: var(--text-faint); }
.stat .kpi-icon { position: absolute; top: var(--s4); right: var(--s4); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--gradient-soft); color: var(--cyan); border: 1px solid var(--line); }
.stat .kpi-icon .icon { width: 18px; height: 18px; }
.stat .kpi-link { display: inline-flex; margin-top: 10px; font-size: 11px; font-weight: 700; text-decoration: none; color: var(--cyan); }

/* FMS dashboard KPIs: label, primary value and supporting text are separate rows. */
.fms-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}
.fms-stat {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 8px;
  height: 100%;
  min-height: 156px;
  min-width: 0;
  padding: clamp(16px, 1.65vw, 24px);
  overflow: hidden;
}
.fms-stat .label {
  margin: 0;
  min-width: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.fms-stat .value {
  display: block;
  min-width: 0;
  margin: 0;
  font-size: clamp(24px, 2.25vw, 34px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.fms-stat .fms-stat-hint {
  display: block;
  max-width: 34ch;
  min-width: 0;
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: clamp(11px, 0.82vw, 12px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .grid.fms-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid.fms-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .fms-stat { min-height: 0; }
}

@media (max-width: 720px) {
  .grid.fms-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .fms-stat { min-height: 0; padding: var(--s4); }
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: var(--radius-pill); background: rgba(148, 192, 245, 0.08);
  font-size: 10px; font-weight: 700; color: var(--text-muted); white-space: nowrap;
}
.badge.ok { background: rgba(22, 217, 155, 0.12); color: var(--green); }
.badge.warn, .badge.warning { background: rgba(247, 185, 85, 0.13); color: var(--amber); }
.badge.danger { background: rgba(255, 123, 147, 0.13); color: var(--danger); }
.badge.info { background: rgba(22, 217, 243, 0.12); color: var(--cyan); }
.badge.finance { background: rgba(22, 217, 155, 0.12); color: var(--green); }
.badge.violet { background: rgba(118, 87, 255, 0.15); color: #b9a9ff; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 4px rgba(22, 217, 155, 0.1); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(247, 185, 85, 0.1); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 123, 147, 0.1); }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--s5); color: var(--text-muted); background: rgba(12, 32, 57, 0.35); }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty p { margin: 0; font-size: 12px; }
.notice { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); font-size: 12px; }
.notice[role="alert"] { border-color: rgba(255, 123, 147, 0.4); background: rgba(255, 123, 147, 0.08); color: #ffc3ce; }
.notice[role="status"] { border-color: rgba(22, 217, 155, 0.35); background: rgba(22, 217, 155, 0.07); color: #b7f8df; }
.hint { font-size: 11px; color: var(--text-muted); }
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s4); }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius-sm); background: rgba(12, 32, 57, 0.72); color: var(--text); text-decoration: none; font-size: 12px; }
.alert:hover { border-color: var(--line-strong); color: var(--text); }
.alert.critical { border-left-color: var(--danger); }
.alert.warning { border-left-color: var(--amber); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; background: transparent; }
caption { text-align: left; font-size: 11px; color: var(--text-muted); padding-bottom: 6px; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
th { font-size: 9px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--text-faint); font-weight: 700; background: rgba(6, 16, 31, 0.24); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(22, 217, 243, 0.035); }
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 32, 57, 0.55); }
.table-wrap table { min-width: 640px; }
.table-wrap.caption-right { margin-top: 14px; }
.table-wrap td .badge { margin: 0; }
.table-wrap a { font-weight: 700; }

/* ---------------------------------------------------------------- forms and buttons */
label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 5px; color: var(--text-muted); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: 12px;
  background: rgba(6, 16, 31, 0.55); color: var(--text);
  transition: border-color var(--motion), box-shadow var(--motion);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: var(--focus); outline: none; }
select option { background: var(--surface); color: var(--text); }
.field { margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 8px 13px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--gradient); color: #02101d;
  font: inherit; font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform var(--motion), box-shadow var(--motion), opacity var(--motion);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(22, 139, 255, 0.25); color: #02101d; }
.btn:active { transform: translateY(0); }
.btn.secondary { background: rgba(22, 217, 243, 0.06); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--line-strong); background: rgba(22, 217, 243, 0.1); color: var(--text); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text-muted); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { color: var(--cyan); background: rgba(22, 217, 243, 0.07); }
.btn.danger { background: rgba(255, 123, 147, 0.13); color: #ffc1cc; border-color: rgba(255, 123, 147, 0.3); }
.btn.small { min-height: 27px; padding: 4px 8px; font-size: 10px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 14px; height: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form select { width: auto; min-width: 112px; }
.inline-form .check { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; font-size: 11px; }
.check input { width: auto; }
.check { display: flex; gap: 7px; align-items: flex-start; margin: 0 0 10px; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------------------------------------------------------------- auth and security */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 500px at 50% 0%, rgba(22, 139, 255, 0.13), transparent 60%), var(--bg); }
.auth-card { width: min(440px, 100%); background: linear-gradient(155deg, rgba(16, 40, 69, 0.96), rgba(8, 23, 45, 0.98)); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0 0 12px; }
.auth-card .brand-logo { width: 205px; }
.auth-card h1 { margin: 14px 0 8px; font-size: 22px; }
.auth-card p { color: var(--text-muted); font-size: 12px; }
.auth-card .hint { margin-top: 14px; }
.auth-card code { color: var(--cyan); word-break: break-all; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(2, 8, 16, 0.74); backdrop-filter: blur(8px); }
.modal { position: relative; width: min(460px, 100%); background: linear-gradient(160deg, var(--surface-raised), var(--surface)); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 22px; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.modal-head .icon { width: 22px; height: 22px; color: var(--cyan); flex: 0 0 auto; }
.modal-head h2 { margin: 0 0 3px; font-size: 17px; }
.modal-head p { margin: 0; color: var(--text-muted); font-size: 12px; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.modal-note { padding: 9px 11px; border-radius: var(--radius-sm); background: rgba(22, 217, 243, 0.06); border: 1px solid var(--line); color: var(--text-muted); font-size: 11px; }

/* ---------------------------------------------------------------- dashboard */
.dashboard-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: var(--s5); }
.dashboard-hero h1 { margin: 0 0 4px; font-size: clamp(26px, 2.8vw, 40px); font-weight: 800; letter-spacing: -0.04em; }
.dashboard-hero p { margin: 0; color: var(--text-muted); font-size: 13px; }
.dashboard-date { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.dashboard-date .icon { width: 15px; height: 15px; color: var(--cyan); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding: 4px 9px; border: 1px solid rgba(22, 217, 155, 0.22); border-radius: var(--radius-pill); background: rgba(22, 217, 155, 0.07); color: var(--green); font-size: 10px; font-weight: 700; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card { display: flex; flex-direction: column; min-height: 142px; }
.kpi-card .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-card .kpi-label { color: var(--text-muted); font-size: 11px; font-weight: 650; }
.kpi-card .kpi-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--gradient-soft); border: 1px solid var(--line); color: var(--cyan); }
.kpi-card .kpi-icon .icon { width: 18px; height: 18px; }
.kpi-card .kpi-value { margin-top: 14px; font-size: clamp(22px, 2vw, 31px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.kpi-card .kpi-meta { margin-top: auto; padding-top: 9px; color: var(--text-faint); font-size: 10px; }
.kpi-card .kpi-link { color: var(--cyan); font-weight: 700; text-decoration: none; }

.analytics-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: var(--s4); margin-top: var(--s4); }
.panel { position: relative; min-width: 0; background: linear-gradient(155deg, rgba(16, 40, 69, 0.94), rgba(12, 32, 57, 0.8)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: var(--s4); }
[data-theme="light"] .panel { background: #fff; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0 0 2px; font-size: 14px; }
.panel-head p { margin: 0; color: var(--text-faint); font-size: 10px; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.panel-actions select { width: auto; padding: 5px 8px; font-size: 10px; }
.panel-actions a { font-size: 10px; font-weight: 700; text-decoration: none; color: var(--cyan); }
.chart-frame { min-height: 190px; display: flex; align-items: center; justify-content: center; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg-small { max-height: 110px; }
.chart-bar { fill: var(--chart-2); opacity: 0.92; }
.chart-bar:hover { fill: var(--cyan); }
.chart-column:nth-child(4n) .chart-bar { fill: var(--chart-3); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label, .chart-value { fill: var(--text-faint); font-family: var(--font); font-size: 10px; }
.chart-value { fill: var(--text-muted); font-size: 9px; font-weight: 700; }
.donut-svg { max-width: 210px; margin: 0 auto; }
.donut-track { stroke: rgba(148, 192, 245, 0.1); }
.donut-segment { stroke-linecap: butt; }
.donut-segment-1 { stroke: var(--chart-1); }
.donut-segment-2 { stroke: var(--chart-2); }
.donut-segment-3 { stroke: var(--chart-3); }
.donut-segment-4 { stroke: var(--chart-4); }
.donut-segment-5 { stroke: var(--chart-5); }
.donut-segment-6 { stroke: var(--chart-6); }
.donut-value { fill: var(--text); font-family: var(--font); font-size: 24px; font-weight: 800; }
.donut-label { fill: var(--text-faint); font-family: var(--font); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.chart-legend { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; padding: 0; margin: 8px 0 0; }
.chart-legend li { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 10px; color: var(--text-muted); }
.chart-legend strong { margin-left: auto; color: var(--text); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.legend-dot-1 { background: var(--chart-1); }
.legend-dot-2 { background: var(--chart-2); }
.legend-dot-3 { background: var(--chart-3); }
.legend-dot-4 { background: var(--chart-4); }
.legend-dot-5 { background: var(--chart-5); }
.legend-dot-6 { background: var(--chart-6); }
.chart-data { margin-top: 7px; }
.chart-data summary { color: var(--text-faint); font-size: 10px; }
.chart-data .table-wrap { margin-top: 6px; }
.chart-data table { min-width: 0; }
.chart-data th, .chart-data td { padding: 6px 8px; font-size: 10px; }
.chart-empty { display: grid; place-items: center; min-height: 190px; text-align: center; color: var(--text-faint); font-size: 11px; padding: 16px; }

.action-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: var(--s4); margin-top: var(--s4); align-items: start; }
.action-panel { display: flex; flex-direction: column; }
.action-tabs { display: flex; gap: 3px; flex-wrap: wrap; margin: 0 0 10px; }
.action-tab { border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--text-faint); padding: 4px 9px; font-size: 10px; font-weight: 700; cursor: pointer; }
.action-tab:hover { color: var(--text); background: rgba(22, 217, 243, 0.06); }
.action-tab[aria-pressed="true"] { background: rgba(22, 217, 243, 0.12); border-color: rgba(22, 217, 243, 0.28); color: var(--cyan); }
.action-list { display: flex; flex-direction: column; gap: 2px; }
.action-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.action-row:last-child { border-bottom: 0; }
.action-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: rgba(22, 217, 243, 0.08); color: var(--cyan); border: 1px solid var(--line); }
.action-icon .icon { width: 15px; height: 15px; }
.action-icon.finance { color: var(--green); background: rgba(22, 217, 155, 0.08); }
.action-icon.info { color: var(--cyan); background: rgba(22, 217, 243, 0.08); }
.action-icon.warning { color: var(--amber); background: rgba(247, 185, 85, 0.08); }
.action-icon.danger { color: var(--danger); background: rgba(255, 123, 147, 0.08); }
.action-main { min-width: 0; }
.action-main strong { display: block; font-size: 11px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-main span { display: block; margin-top: 2px; color: var(--text-faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.action-side .badge { font-size: 9px; }
.action-side a { color: var(--cyan); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.action-empty { padding: 30px 8px; text-align: center; color: var(--text-faint); font-size: 11px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 0; position: relative; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 27px; bottom: -7px; width: 1px; background: var(--line); }
.activity-dot { width: 13px; height: 13px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--cyan); background: var(--surface); box-shadow: 0 0 0 3px rgba(22, 217, 243, 0.07); }
.activity-main { min-width: 0; }
.activity-main strong { display: block; font-size: 11px; font-weight: 650; color: var(--text); }
.activity-main span { display: block; margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.activity-main time { display: block; margin-top: 2px; color: var(--text-faint); font-size: 9px; }

.bottom-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: var(--s4); margin-top: var(--s4); }
.mini-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 7px; }
.mini-stat strong { font-size: 22px; letter-spacing: -0.04em; }
.mini-stat span { color: var(--text-faint); font-size: 10px; }
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.health-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 10px; color: var(--text-muted); }
.health-list li:last-child { border-bottom: 0; }
.health-list strong { margin-left: auto; color: var(--text); font-size: 10px; font-weight: 700; }
.health-list .icon { width: 14px; height: 14px; color: var(--text-faint); }
.progress { height: 6px; border-radius: 999px; background: rgba(148, 192, 245, 0.1); overflow: hidden; margin-top: 9px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--gradient); }
.recruit-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.recruit-bar { display: grid; grid-template-columns: 64px minmax(0, 1fr) 25px; align-items: center; gap: 8px; font-size: 10px; color: var(--text-muted); }
.recruit-bar .bar-track { height: 5px; border-radius: 999px; background: rgba(148, 192, 245, 0.1); overflow: hidden; }
.recruit-bar .bar-track span { display: block; height: 100%; background: var(--chart-2); border-radius: inherit; }
.recruit-bar strong { color: var(--text); text-align: right; }

/* ---------------------------------------------------------------- command palette, menu, modal */
.palette-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(2, 8, 16, 0.7); backdrop-filter: blur(9px); padding: 12vh 16px 24px; }
.palette { width: min(650px, 100%); margin: 0 auto; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--surface-raised), var(--surface)); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-search .icon { width: 18px; height: 18px; color: var(--cyan); }
.palette-search input { border: 0; background: transparent; padding: 0; font-size: 14px; box-shadow: none; }
.palette-search input:focus { box-shadow: none; border: 0; }
.palette-results { max-height: min(440px, 55vh); overflow-y: auto; padding: 8px; }
.palette-group { margin: 5px 0; }
.palette-group-title { display: block; padding: 4px 10px; color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); text-align: left; font-size: 12px; cursor: pointer; }
.palette-item:hover, .palette-item[aria-selected="true"] { background: rgba(22, 217, 243, 0.1); color: var(--text); }
.palette-item .icon { width: 16px; height: 16px; color: var(--cyan); }
.palette-item span { flex: 1; }
.palette-item small { color: var(--text-faint); font-size: 9px; }
.palette-hint { padding: 9px 16px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 9px; }
kbd { font-family: var(--font); }

.menu-backdrop { position: fixed; inset: 0; z-index: 45; }

/* ---------------------------------------------------------------- navigation fallbacks */
.nav-group .nav-sub-group .nav-group-title { padding-left: 4px; }
.nav-sub-group .nav a { min-height: 33px; font-size: 12px; }
.nav-sub-group .nav-icon { width: 15px; height: 15px; }
.nav-empty { padding: 10px; color: var(--text-faint); font-size: 11px; }

/* ---------------------------------------------------------------- existing module compatibility */
.panel .card, .card .card { box-shadow: none; }
[data-mt="6"] { margin-top: 6px; }
[data-mt="10"] { margin-top: 10px; }
[data-mt="12"] { margin-top: 12px; }
[data-mt="16"] { margin-top: 16px; }
ul.plain { list-style: none; padding: 0; margin: 8px 0; }
ul.plain li { margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
details summary { cursor: pointer; color: var(--cyan); font-size: 11px; }
details ul { margin-top: 6px; color: var(--text-muted); }
dl { margin: 0; }
dt { color: var(--text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
dd { margin: 2px 0 10px; color: var(--text); font-size: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
legend { color: var(--text-muted); font-size: 11px; padding: 0 5px; }
progress { accent-color: var(--cyan); width: 100%; height: 6px; }
code { color: var(--cyan); background: rgba(22, 217, 243, 0.07); padding: 2px 4px; border-radius: 4px; font-size: 0.9em; }
pre { overflow: auto; background: var(--surface-muted); padding: 12px; border-radius: var(--radius-sm); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--radius-pill); background: rgba(148, 192, 245, 0.08); color: var(--text-muted); font-size: 10px; }

/* ---------------------------------------------------------------- responsive */
[data-theme="light"] .topbar-search,
[data-theme="light"] .icon-btn { background: #ffffff; border-color: var(--line); color: var(--text-muted); }
[data-theme="light"] .topbar-search { background: #f7faff; }
[data-theme="light"] .icon-btn:hover { background: var(--surface-muted); color: var(--text); }
[data-theme="light"] .brand-logo { filter: brightness(0) saturate(100%); }
[data-theme="light"] .notice[role="status"] { background: #e9f8f1; border-color: rgba(8, 123, 88, 0.28); color: #066a4c; }
[data-theme="light"] .notice[role="alert"] { background: #fff1f4; border-color: rgba(180, 35, 63, 0.25); color: #8d1830; }
[data-theme="light"] .auth-card,
[data-theme="light"] .modal { background: #ffffff; color: var(--text); }
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: #ffffff; color: var(--text); }
[data-theme="light"] th { background: var(--surface-muted); }
[data-theme="light"] .table-wrap { background: #ffffff; }
[data-theme="light"] .modal-note { background: var(--surface-muted); }
[data-theme="light"] .topbar { background: rgba(243, 247, 252, 0.88); }
[data-theme="light"] .sidebar { box-shadow: 14px 0 40px rgba(31, 64, 101, 0.08); }

@media (max-width: 1280px) {
  .analytics-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .kpi-card .kpi-icon { width: 32px; height: 32px; }
}

@media (max-width: 1080px) {
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid .panel:first-child { grid-column: 1 / -1; }
  .bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-grid .panel:last-child { grid-column: 1 / -1; }
}

.kpi-card { text-decoration: none; color: inherit; transition: border-color var(--motion), transform var(--motion), box-shadow var(--motion); }
a.kpi-card:hover { color: inherit; border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25); }
.kpi-card .kpi-icon.warning { color: var(--amber); background: rgba(247, 185, 85, 0.08); }
.secondary-kpis .stat { min-height: 86px; padding: 13px 14px; }
.secondary-kpis .stat .label { margin-top: 0; }
.secondary-kpis .stat .value,
.secondary-kpis .stat .small-value { margin-top: 7px; font-size: 19px; line-height: 1.1; }
.secondary-kpis .stat .kpi-meta { margin-top: 4px; }
.recruit-bar .bar-level-0 { width: 0%; }
.recruit-bar .bar-level-1 { width: 10%; }
.recruit-bar .bar-level-2 { width: 20%; }
.recruit-bar .bar-level-3 { width: 30%; }
.recruit-bar .bar-level-4 { width: 40%; }
.recruit-bar .bar-level-5 { width: 50%; }
.recruit-bar .bar-level-6 { width: 60%; }
.recruit-bar .bar-level-7 { width: 70%; }
.recruit-bar .bar-level-8 { width: 80%; }
.recruit-bar .bar-level-9 { width: 90%; }
.recruit-bar .bar-level-10 { width: 100%; }
body.modal-open { overflow: hidden; }
.sidebar-collapse { display: inline-flex; }
.modal-backdrop, .palette-backdrop { animation: fade-in 140ms ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .sidebar-collapse { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(304px, 88vw); height: 100dvh;
    transform: translateX(-105%); transition: transform var(--motion), visibility var(--motion); z-index: 70;
    border-right: 1px solid var(--line-strong); padding-top: 18px; visibility: hidden;
  }
  .sidebar[data-open="true"] { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop[data-open="true"] { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(2, 8, 16, 0.62); backdrop-filter: blur(3px); }
  .sidebar .sidebar-close { display: inline-flex; position: absolute; top: 14px; right: 12px; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar-search { width: auto; flex: 1 1 auto; max-width: 360px; }
  .topbar-date { display: none; }
  .user-trigger-copy { display: none; }
  .app-shell[data-sidebar="collapsed"] .sidebar { width: min(304px, 88vw); padding: 22px 14px 16px; align-items: stretch; }
  .app-shell[data-sidebar="collapsed"] .brand { justify-content: flex-start; }
  .app-shell[data-sidebar="collapsed"] .brand-logo { width: 190px; height: auto; }
  .app-shell[data-sidebar="collapsed"] .brand-copy,
  .app-shell[data-sidebar="collapsed"] .nav-group-title,
  .app-shell[data-sidebar="collapsed"] .nav-label,
  .app-shell[data-sidebar="collapsed"] .quick-actions,
  .app-shell[data-sidebar="collapsed"] .sidebar-user-copy,
  .app-shell[data-sidebar="collapsed"] .nav-planned .badge { display: flex; }
  .app-shell[data-sidebar="collapsed"] .brand-copy { display: flex; }
  .app-shell[data-sidebar="collapsed"] .nav-group-title { display: block; }
  .app-shell[data-sidebar="collapsed"] .nav a,
  .app-shell[data-sidebar="collapsed"] .nav-planned { justify-content: flex-start; padding: 8px 10px; }
  .app-shell[data-sidebar="collapsed"] .nav-sub-group { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
  .app-shell[data-sidebar="collapsed"] .sidebar-footer { justify-content: flex-start; }
  .app-shell[data-sidebar="collapsed"] .sidebar-signout { margin-left: auto; }
  .content { padding: 20px; }
}

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 8px; min-height: 62px; }
  .topbar-search { width: 36px; padding: 8px; border-radius: 50%; }
  .topbar-search span:not(.sr-only), .topbar-search kbd { display: none; }
  .topbar-search .icon { width: 18px; height: 18px; }
  .topbar-actions { gap: 4px; }
  .icon-btn { width: 33px; height: 33px; }
  .content { padding: 16px 14px 30px; }
  .dashboard-hero { flex-direction: column; gap: 8px; }
  .dashboard-date { font-size: 10px; }
  .kpi-grid, .analytics-grid, .action-grid, .bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .analytics-grid .panel:first-child, .bottom-grid .panel:last-child { grid-column: auto; }
  .page-head { flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .page-head h1 { font-size: 26px; }
  .action-row { grid-template-columns: 29px minmax(0, 1fr) auto; gap: 7px; }
  .action-side a { font-size: 9px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  .chart-legend { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .dashboard-hero h1 { font-size: 26px; }
  .kpi-card .kpi-value { font-size: 25px; }
  .chart-legend { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- support & tickets */
.support-overview { border-color: rgba(22, 217, 243, 0.24); }
.support-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.support-recent { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 1px; }
.support-recent li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.support-recent li a { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.support-recent li a strong { color: var(--accent); font-size: 10px; }
.support-recent li a span { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-recent li a small { color: var(--text-faint); font-size: 9px; }
.support-create { margin-top: 16px; }
.support-create .grid { margin-bottom: 4px; }
.support-table table { min-width: 1120px; }
.support-table td { vertical-align: top; }
.support-table td:nth-child(3) { max-width: 300px; }
.support-category-list { display: grid; gap: 7px; margin-top: 12px; }
.support-category-list .inline-form { align-items: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; color: var(--text-muted); font-size: 10px; }
.pagination span { margin-right: auto; }
.ticket-detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 14px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 10px 0 18px; }
.detail-list div { min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.detail-list dt { color: var(--text-faint); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.detail-list dd { margin: 2px 0 0; color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.detail-list a { color: var(--accent); }
.ticket-description { color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.ticket-controls { display: grid; gap: 12px; }
.stack-form { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 13, 26, 0.2); }
.stack-form h3 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.ticket-thread { display: grid; gap: 9px; margin: 12px 0; }
.ticket-message { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(4, 13, 26, 0.2); }
.ticket-message.internal { border-color: rgba(247, 185, 85, 0.35); background: rgba(247, 185, 85, 0.07); }
.ticket-message.public { border-color: rgba(22, 217, 243, 0.22); }
.ticket-message header { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ticket-message header strong { color: var(--text); font-size: 10px; }
.ticket-message header time { margin-left: auto; color: var(--text-faint); font-size: 9px; }
.ticket-message p { margin: 7px 0 0; color: var(--text); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-message small { display: block; margin-top: 6px; color: var(--text-faint); font-size: 9px; }
.ticket-composer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ticket-composer h3 { margin-bottom: 10px; font-size: 13px; }
.ticket-history { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 10px; }
.ticket-history li { margin: 6px 0; }
.ticket-history li strong { color: var(--text); text-transform: capitalize; }
.ticket-history small { display: block; color: var(--text-faint); font-size: 9px; }
.ticket-message .badge, .support-table .badge { white-space: nowrap; }
.support-detail-head .page-actions { align-items: center; }
.support-detail-head h1 { margin-top: 4px; }
.support-detail-head .text-link { display: inline-block; margin-bottom: 4px; }

@media (max-width: 1100px) {
  .support-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .support-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-list { grid-template-columns: minmax(0, 1fr); }
  .pagination { flex-wrap: wrap; }
  .pagination span { width: 100%; }
  .ticket-message header time { margin-left: 0; }
}


/* Team Hub / onboarding navigation */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s4); }
.toolbar .btn { margin: 0; }

/* Communications Team Chat */
.comms-nav { align-items: center; }
.chat-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: 68vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-muted);
}
.chat-sidebar { border-right: 1px solid var(--line); padding: 12px; overflow: auto; max-height: 74vh; }
.chat-sidebar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-sidebar-head h2 { margin: 0; }
.chat-create { border-top: 1px solid var(--line); padding: 10px 0; }
.chat-create summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.chat-create input, .chat-create select { width: 100%; margin: 5px 0; }
.chat-group-members { max-height: 170px; overflow: auto; margin: 8px 0; }
.chat-directory-row, .chat-conversation { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: var(--radius-sm); padding: 7px; text-align: left; color: var(--text); background: transparent; }
.chat-directory-row { justify-content: space-between; }
.chat-directory-row + .chat-directory-row { border-top: 1px solid var(--line); }
.chat-conversation { cursor: pointer; margin: 3px 0; }
.chat-conversation:hover, .chat-conversation.active { background: var(--surface-raised); }
.chat-conversation-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.chat-conversation-copy { display: grid; min-width: 0; flex: 1; }
.chat-conversation-copy strong, .chat-conversation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation-copy small, .chat-directory-row small { color: var(--text-muted); font-size: 11px; }
.chat-conversation-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.chat-header { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-header h2 { margin: 0; }
.chat-manage { padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.chat-manage summary { cursor: pointer; color: var(--accent); }
.chat-member-list { list-style: none; padding: 0; margin: 8px 0; }
.chat-member-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.chat-search { padding: 8px 16px; margin: 0; }
.chat-messages { flex: 1; overflow: auto; padding: 14px 16px; min-height: 280px; max-height: 60vh; }
.chat-empty, .chat-main-empty { padding: 24px; color: var(--text-muted); }
.chat-date-separator { text-align: center; color: var(--text-faint); font-size: 11px; margin: 14px 0 8px; }
.chat-message { max-width: 78%; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); }
.chat-message.own { margin-left: auto; background: var(--accent-soft); border-color: var(--accent-line); }
.chat-message.deleted { opacity: 0.65; }
.chat-message header { display: flex; align-items: baseline; gap: 8px; }
.chat-message header strong { font-size: 12px; }
.chat-message header time, .chat-edited { color: var(--text-faint); font-size: 10px; }
.chat-body { margin: 4px 0; overflow-wrap: anywhere; }
.chat-reply-context { border-left: 2px solid var(--accent); padding-left: 7px; margin: 5px 0; color: var(--text-muted); font-size: 11px; }
.chat-message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 4px; }
.chat-message-actions .text-link { background: none; border: 0; padding: 0; font-size: 10px; cursor: pointer; }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chat-reaction { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); padding: 1px 6px; cursor: pointer; font-size: 11px; }
.chat-reaction.mine { border-color: var(--accent); background: var(--accent-soft); }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chat-attachment { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 6px; font-size: 11px; }
.chat-attachment .icon { width: 14px; height: 14px; }
.chat-typing { color: var(--text-muted); font-size: 11px; margin: 4px 0; }
.chat-composer { border-top: 1px solid var(--line); padding: 10px 16px; }
.chat-composer textarea { width: 100%; resize: vertical; min-height: 48px; }
.chat-composer-reply { display: flex; justify-content: space-between; gap: 8px; border-left: 2px solid var(--accent); padding: 4px 8px; margin-bottom: 6px; color: var(--text-muted); font-size: 11px; }
@media (max-width: 800px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-sidebar { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-messages { max-height: 50vh; }
  .chat-message { max-width: 92%; }
  .chat-header { flex-direction: column; }
}

/* Shared Calendar */
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.calendar-toolbar strong { white-space: nowrap; }
.calendar-layout { display: grid; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); gap: 14px; align-items: start; }
.calendar-sidebar { display: grid; gap: 8px; }
.calendar-main { min-width: 0; }
.calendar-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.calendar-weekday { padding: 7px; background: var(--surface-muted); color: var(--text-muted); font-size: 11px; text-align: center; }
.calendar-day { min-height: 112px; padding: 5px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--surface); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { opacity: 0.45; }
.calendar-day.today { background: var(--accent-soft); }
.calendar-day-number { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; }
.calendar-day-events { display: grid; gap: 3px; }
.calendar-event { display: grid; gap: 1px; width: 100%; border: 0; border-left: 3px solid var(--accent); border-radius: 4px; padding: 3px 5px; background: var(--surface-raised); color: var(--text); text-align: left; cursor: pointer; font-size: 10px; }
.calendar-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-time { color: var(--text-muted); font-size: 9px; }
.calendar-event.cal-color-0 { border-left-color: #16d9f3; }
.calendar-event.cal-color-1 { border-left-color: #168bff; }
.calendar-event.cal-color-2 { border-left-color: #7657ff; }
.calendar-event.cal-color-3 { border-left-color: #16d99b; }
.calendar-event.cal-color-4 { border-left-color: #f7b955; }
.calendar-event.cal-color-5 { border-left-color: #ff7b93; }
.calendar-event.cal-color-6 { border-left-color: #a78bfa; }
.calendar-event.cal-color-7 { border-left-color: #50c878; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; overflow-x: auto; }
.calendar-week-day { min-height: 280px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.calendar-week-day h3, .calendar-agenda-day h3 { margin: 0 0 7px; font-size: 12px; color: var(--text-muted); }
.calendar-agenda { display: grid; gap: 12px; }
.calendar-agenda-day { padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.calendar-agenda-day .calendar-event { max-width: 440px; margin-bottom: 5px; }
.calendar-check { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; }
.calendar-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.calendar-dot.cal-color-0 { background: #16d9f3; } .calendar-dot.cal-color-1 { background: #168bff; } .calendar-dot.cal-color-2 { background: #7657ff; }
.calendar-dot.cal-color-3 { background: #16d99b; } .calendar-dot.cal-color-4 { background: #f7b955; } .calendar-dot.cal-color-5 { background: #ff7b93; }
.calendar-dot.cal-color-6 { background: #a78bfa; } .calendar-dot.cal-color-7 { background: #50c878; }
.calendar-member-picker { max-height: 150px; overflow: auto; margin: 6px 0; }
.calendar-member-form { display: grid; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.calendar-detail { border-left: 3px solid var(--accent); }
.calendar-detail-head { display: flex; justify-content: space-between; gap: 10px; }
.calendar-detail-head h2 { margin: 4px 0; }
.calendar-notifications { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.calendar-form fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin: 10px 0; }
.calendar-form legend { color: var(--text-muted); font-size: 11px; }
@media (max-width: 800px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-month { overflow-x: auto; min-width: 720px; }
  .calendar-day { min-height: 82px; }
}

/* Finance section navigation */
.finance-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 10px 0;
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}
.finance-nav .btn { text-decoration: none; white-space: nowrap; }
.finance-nav .btn[aria-current="page"] { border-color: var(--accent); }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card > summary::marker { color: var(--accent); }
details.card[open] > summary { margin-bottom: var(--s3); }
@media (max-width: 720px) {
  .finance-nav { position: static; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 12px; }
}

/* Meetings */
.meeting-detail { border-left: 3px solid var(--accent); }
.meeting-detail-head { margin: 0 0 var(--s3); }
.meeting-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  padding: 14px;
  background: #050810;
  color: #eaf3ff;
  overflow: auto;
}
.meeting-prejoin-preview { flex: 1; min-height: 260px; display: grid; align-content: center; gap: 10px; }
.meeting-prejoin-preview video { width: 100%; max-height: 62vh; border: 1px solid #24344b; border-radius: 10px; background: #0b1220; object-fit: cover; }
.meeting-stage { display: flex; flex-direction: column; min-height: 0; }
.meeting-stage > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 10px; }
.meeting-stage > header strong { font-size: 18px; }
.meeting-video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; flex: 1; align-content: start; }
.meeting-tile { position: relative; min-height: 180px; border: 1px solid #24344b; border-radius: 10px; overflow: hidden; background: #0b1220; }
.meeting-tile-video, .meeting-tile-video video { width: 100%; height: 100%; min-height: 180px; object-fit: cover; display: block; }
.meeting-tile-label { position: absolute; left: 8px; bottom: 8px; padding: 3px 7px; border-radius: 5px; background: rgba(4, 8, 15, .72); font-size: 11px; }
.meeting-controls { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.meeting-side { border: 1px solid #24344b; border-radius: 10px; padding: 12px; background: #0b1220; }
.meeting-side h2 { font-size: 14px; margin: 0 0 8px; }
.meeting-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12px; }
@media (max-width: 800px) {
  .meeting-overlay { grid-template-columns: 1fr; padding: 8px; }
  .meeting-video-grid { grid-template-columns: 1fr; }
  .meeting-tile { min-height: 150px; }
  .meeting-tile-video, .meeting-tile-video video { min-height: 150px; }
}
.guest-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.guest-link label { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.guest-link input { flex: 1 1 420px; min-height: 42px; padding: 8px 10px; border: 1px solid #2a3c54; border-radius: 7px; background: #071425; color: var(--text); }
.guest-link .btn { flex: 0 0 auto; }

/* Recruitment intake and internal evaluation */
.candidate-form { display: grid; gap: var(--s3); }
.candidate-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 0 var(--s4);
}
.candidate-section > summary {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  cursor: pointer;
  padding: var(--s3) 0;
  font-weight: 700;
  list-style-position: inside;
}
.candidate-section > summary::marker { color: var(--accent); }
.candidate-section[open] > summary { border-bottom: 1px solid var(--line); }
.candidate-section-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  padding: var(--s3) 0 var(--s4);
}
.candidate-section-body .field { margin: 0; }
.candidate-form .field-full { grid-column: 1 / -1; }
.candidate-form .form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.candidate-form input[readonly] { opacity: .78; }
.candidate-form .check { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 600; }
.hidden { display: none !important; }
/* Mail Bridge development view */
.mail-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.mail-sidebar { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s4); }
.mail-sidebar h2 { margin-top: 0; }
.mail-mailbox { display: grid; gap: 2px; padding: 9px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; min-width: 0; }
.mail-mailbox strong { overflow-wrap: anywhere; }
.mail-mailbox span { color: var(--text-muted); font-size: 12px; }
.mail-mailbox:hover, .mail-mailbox.active { background: var(--accent-soft); color: var(--accent); }
.mail-folder { display: block; padding: 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.mail-folder:hover, .mail-folder.active { background: var(--accent-soft); color: var(--accent); }
.mail-content { min-width: 0; display: grid; gap: var(--s4); }
.mail-content .badge { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.mail-compose { padding: var(--s4); }
.mail-compose textarea { min-height: 220px; }
.mail-attachment { display: inline-block; margin: 2px 8px 2px 0; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.mail-compose .inline-form { align-items: center; }
.mail-toolbar { display: flex; justify-content: space-between; gap: var(--s3); align-items: flex-start; }
.mail-toolbar h2 { margin: 0; overflow-wrap: anywhere; }
.mail-list { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.mail-row-wrap { display: flex; align-items: stretch; gap: 8px; background: var(--surface); padding-left: 8px; }
.mail-row-wrap .mail-row { flex: 1; min-width: 0; }
.mail-select { align-self: center; width: 16px; height: 16px; }
.mail-bulk-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.mail-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 2fr) auto; gap: 4px var(--s3); padding: var(--s3); background: var(--surface); color: var(--text); text-decoration: none; }
.mail-row:hover, .mail-row.active { background: var(--accent-soft); }
.mail-from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.mail-preview { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-reader { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s4); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-muted); border-radius: var(--radius-sm); padding: var(--s4); max-height: 55vh; overflow: auto; font-family: var(--font); }
.mail-html-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
@media (max-width: 760px) {
  .mail-shell { grid-template-columns: minmax(0, 1fr); }
  .mail-toolbar { flex-direction: column; align-items: flex-start; }
  .mail-row { grid-template-columns: 1fr auto; }
  .mail-subject { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .candidate-section-body { grid-template-columns: 1fr; }
  .candidate-section > summary { align-items: flex-start; }
}
