/* ==========================================================================
   TAWAAQ RECRUITMENT MARKETING (TRM) DESIGN SYSTEM 2026
   Executive Kinetic Matrix — Linear / Supabase / Vercel Caliber Tokens
   ========================================================================== */
:root {
  --brand: #7860F9;
  --brand-hover: #6247E0;
  --brand-active: #5339d6;
  --brand-tint: rgba(120, 96, 249, 0.16);
  --brand-tint-strong: rgba(120, 96, 249, 0.22);
  --brand-border: rgba(120, 96, 249, 0.28);
  --brand-glow: rgba(120, 96, 249, 0.32);

  /* Light Theme Canvas & Surfaces */
  --bg: #F7F6FB;
  --surface: #FFFFFF;
  --surface-alt: #F1EFF9;
  --surface-raised: #FFFFFF;
  --surface-hover: #E9E6F5;
  --surface-active: #E0DCF0;
  --border: #E6E3F2;
  --border-strong: #D5D0E6;
  --border-focus: rgba(120, 96, 249, 0.6);

  /* Typography */
  --text: #201C2E;
  --text-secondary: #4A465B;
  --muted: #6B6780;
  --text-inverted: #FFFFFF;

  /* Semantic Alerts & Indicators */
  --success: #35C98D;
  --success-tint: rgba(53, 201, 141, 0.12);
  --success-border: rgba(53, 201, 141, 0.28);

  --danger: #EF6B57;
  --danger-tint: rgba(239, 107, 87, 0.14);
  --danger-border: rgba(239, 107, 87, 0.28);

  --warning: #F0B13F;
  --warning-tint: rgba(240, 177, 63, 0.14);
  --warning-border: rgba(240, 177, 63, 0.28);

  --info: #0ea5e9;
  --info-tint: rgba(14, 165, 233, 0.12);
  --info-border: rgba(14, 165, 233, 0.25);

  /* WhatsApp Specifics */
  --whatsapp-green: #25D366;
  --whatsapp-green-tint: rgba(37, 211, 102, 0.14);

  /* Layout Chrome */
  --sidebar-canvas: #14111D;
  --sidebar-bg: #14111D;
  --sidebar-surface: #1B1728;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --sidebar-active: rgba(120, 96, 249, 0.22);
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 76px;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 10, 50, 0.04);
  --shadow-sm: 0 2px 6px rgba(20, 10, 50, 0.06);
  --shadow-md: 0 8px 20px -2px rgba(20, 10, 50, 0.08);
  --shadow-lg: 0 16px 36px -6px rgba(20, 10, 50, 0.12);

  /* Sleek Scrollbar Tokens */
  --scrollbar-w: 6px;
  --scrollbar-thumb: rgba(100, 116, 139, 0.28);
  --scrollbar-thumb-hover: rgba(120, 96, 249, 0.65);
  --scrollbar-thumb-active: #7860F9;
  --scrollbar-track: transparent;
  color-scheme: light;

  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] {
  --bg: #14121c;
  --surface: #201e29;
  --surface-alt: #1c1a24;
  --surface-raised: #2b2833;
  --surface-hover: #272433;
  --surface-active: #322e42;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(120, 96, 249, 0.7);

  --text: #EFEDF7;
  --text-secondary: #CBD5E1;
  --muted: #A79FC4;
  --text-inverted: #14121c;

  --sidebar-canvas: #14111D;
  --sidebar-bg: #14111D;
  --sidebar-surface: #1B1728;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(120, 96, 249, 0.22);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.6);

  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-thumb-hover: rgba(120, 96, 249, 0.75);
  --scrollbar-thumb-active: #7860F9;
  --scrollbar-track: transparent;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --scrollbar-thumb: rgba(255, 255, 255, 0.22);
    --scrollbar-thumb-hover: rgba(120, 96, 249, 0.75);
    --scrollbar-thumb-active: #7860F9;
  }
}

/* ==========================================================================
   Universal Sleek Modern Scrollbar
   Replaces bulky default OS/Windows white scrollbars with a thin 6px modern pill
   ========================================================================== */
*, *::before, *::after {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: var(--scrollbar-w, 6px);
  height: var(--scrollbar-w, 6px);
}

::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track, transparent);
}

::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s ease;
}

::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active);
}

::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Explicit targeting for textareas, inputs, panels, tables, code editors & dialogs */
textarea,
input,
select,
pre,
code,
.panel,
.chat-messages,
.chat-list,
.table-wrap,
.detail-shell,
dialog,
.code-editor-body,
.ai-guidance-textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

textarea::-webkit-scrollbar,
.ai-guidance-textarea::-webkit-scrollbar {
  width: var(--scrollbar-w, 6px);
  height: var(--scrollbar-w, 6px);
}

textarea::-webkit-scrollbar-track,
.ai-guidance-textarea::-webkit-scrollbar-track {
  background: transparent;
}

textarea::-webkit-scrollbar-thumb,
.ai-guidance-textarea::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

textarea::-webkit-scrollbar-thumb:hover,
.ai-guidance-textarea::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

textarea::-webkit-scrollbar-button,
.ai-guidance-textarea::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Strict Reset & Overflow Containment */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden]{display:none!important}

html, body {
  margin: 0;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  width: 100vw;
  background: var(--bg);
  color: var(--text);
}

.card, .triage-card, .triage-item, .code-editor-card, .dashboard-card,
.kpi-card, .chat-bubble, td, th, .chat-contact, .table-wrap {
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

/* Tactile Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--brand);
  color: #ffffff;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

button:hover {
  background: var(--brand-hover);
  box-shadow: 0 3px 8px rgba(120, 96, 249, 0.35);
}

button:active {
  transform: scale(0.975);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none !important;
}

button.secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

button.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-btn, .icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--shadow-xs);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover, .icon-button:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-icon-dark {
  display: none;
}
[data-theme="dark"] .theme-icon-light {
  display: none;
}
[data-theme="dark"] .theme-icon-dark {
  display: block;
}

/* Authentication Screen */
.auth-loading {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
}

.auth-loading .spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.login-card {
  width: min(420px, 100%);
  padding: 2.2rem;
}

.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.login-card .eyebrow, .login-card h1, .login-card > .muted {
  text-align: center;
}

h1, h2, h3, h4 {
  margin: 0.1rem 0 0.45rem;
  color: var(--text);
}

h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  min-height: 1.2rem;
  font-size: 0.82rem;
}

label {
  display: grid;
  gap: 0.35rem;
  margin: 0.9rem 0;
  font-weight: 600;
  font-size: 0.82rem;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem 0.85rem;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.82rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.login-card > button {
  width: 100%;
  margin-top: 0.6rem;
  justify-content: center;
}

.password-field {
  display: flex;
  position: relative;
}

.password-field input {
  padding-right: 3.4rem;
}

.show-password {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: auto !important;
  margin: 0 !important;
  padding: 0 0.55rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  border: none;
  box-shadow: none !important;
}

.show-password:hover {
  background: var(--surface-alt);
}

/* App Shell Layout */
.app-shell {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
}

aside#sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 40;
}

.app-shell.collapsed aside#sidebar {
  width: var(--sidebar-w-collapsed);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 56px;
}

.sidebar-heading .logo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none !important;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #ffffff;
  box-shadow: none !important;
}

.sidebar-heading .logo-btn:hover {
  background: none !important;
}

.logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7860F9 0%, #a491fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(120, 96, 249, 0.35);
  flex: none;
}

.brand-text {
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  color: #ffffff;
  letter-spacing: -0.015em;
}

.sidebar-heading .sub {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.app-shell.collapsed .brand-text,
.app-shell.collapsed .sidebar-label,
.app-shell.collapsed .sub,
.app-shell.collapsed .nav-badge {
  display: none;
}

.sidebar-heading .spacer {
  flex: 1;
}

#collapse-sidebar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  justify-content: center;
  box-shadow: none;
}

#collapse-sidebar:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  justify-content: center;
  box-shadow: none;
}

nav[aria-label="Admin sections"] {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  background: transparent !important;
  color: var(--sidebar-text);
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  border: 1px solid transparent;
  box-shadow: none !important;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f1f5f9;
}

.nav-button.active {
  background: var(--sidebar-active) !important;
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(120, 96, 249, 0.4);
  box-shadow: inset 0 0 12px rgba(120, 96, 249, 0.15) !important;
}

.nav-button svg {
  flex: none;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.nav-button.active .nav-badge {
  background: var(--brand);
  color: #ffffff;
}

.app-shell.collapsed .nav-button {
  justify-content: center;
  padding: 9px 0;
}

.sidebar-actions {
  padding: 10px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-actions button {
  background: transparent !important;
  color: var(--sidebar-text) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.8rem;
  width: 100%;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none !important;
}

.sidebar-actions button:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

.app-shell.collapsed .sidebar-actions button {
  justify-content: center;
  padding: 8px 0;
}

/* Header */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 14px;
  flex: none;
  min-height: 56px;
}

header > div {
  min-width: 0;
}

header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-button {
  display: none;
  background: var(--surface-alt);
  color: var(--text);
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  flex: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: none;
}

.admin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 190px;
  flex-shrink: 0;
}

.admin-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7860f9, #ec4899);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex: none;
}

#admin-email {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-message {
  margin: 0;
  font-size: 0.82rem;
  flex: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#app-message:not(:empty) {
  padding: 8px 24px;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}

.panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
}

.panel-heading, .panel-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.panel-heading > button,
.panel-header-clean > button,
.panel-heading > .actions,
.panel-header-clean > .actions {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.panel-header-clean h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

/* Table Filter & Sort Toolbar */
.table-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}

.filter-left-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.filter-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  width: 100%;
  max-width: 280px;
}

.filter-search-box input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.8rem;
  box-shadow: none !important;
  color: var(--text);
}

.filter-dropdowns-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-inline-box {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 190px;
}

.filter-inline-box input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  box-shadow: none !important;
  color: var(--text);
  width: 100%;
}

.filter-clear-btn {
  padding: 5px 10px !important;
  font-size: 0.76rem !important;
  border-radius: 8px !important;
}

.filter-select {
  width: auto;
  min-width: 130px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.filter-right-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.records-counter-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
  user-select: none;
}

th.sortable-th {
  cursor: pointer;
  transition: color 0.15s ease;
}

th.sortable-th:hover {
  color: var(--brand);
}

th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  color: var(--muted);
}

td {
  padding: 11px 14px;
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}

tr:hover td {
  background: var(--surface-hover);
}

/* Location Column Containment & Formatting */
th.th-location,
th:nth-child(4),
td:nth-child(4) {
  max-width: 170px;
}

.location-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 170px;
}

.location-main {
  font-weight: 500;
  color: var(--text);
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}

.location-sub {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
}

.status, .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  line-height: 1.2;
  white-space: nowrap;
}

.status.active, .badge.success {
  background: var(--success-tint);
  color: var(--success);
  border-color: var(--success-border);
}

.status.stale, .badge.alert, .badge.danger {
  background: var(--danger-tint);
  color: var(--danger);
  border-color: var(--danger-border);
}

.status.not-shareable, .badge.warning {
  background: var(--warning-tint);
  color: var(--warning);
  border-color: var(--warning-border);
}

.badge.brand, .badge.info {
  background: var(--brand-tint);
  color: var(--brand);
  border-color: var(--brand-border);
}

.mono-badge {
  font-family: "JetBrains Mono", monospace;
  width: fit-content;
}

.candidate-app-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.candidate-app-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.candidate-consent-sub {
  font-size: 0.69rem;
  font-weight: 500;
}

.candidate-consent-sub.eligible {
  color: var(--success);
}

.candidate-consent-sub.restricted {
  color: var(--warning);
}

.candidate-app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.vacancy-group-row {
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  border-top: 2px solid color-mix(in srgb, var(--brand) 24%, var(--border));
}

.vacancy-position-row td:first-child {
  padding-left: 28px;
  font-weight: 700;
}

.district-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.requirements-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.requirements-preview > span {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.publication-review {
  border-color: rgba(120, 96, 249, 0.5);
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.review-summary > div {
  background: var(--surface-alt);
  border-radius: 9px;
  padding: 10px;
}

.review-summary dt {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.review-summary dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.requirement-review-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.requirement-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.requirement-heading h4 {
  margin: 0;
}

.review-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
}

/* ==========================================================================
   VIEW 1: OPERATIONS COMMAND CENTER DASHBOARD
   ========================================================================== */
.dashboard-hero {
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(120, 96, 249, 0.12) 0%, rgba(120, 96, 249, 0.02) 100%), var(--surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  gap: 14px;
  flex-wrap: wrap;
}

.dashboard-hero-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 3px;
  letter-spacing: -0.02em;
}

.dashboard-hero-title p {
  margin: 0;
  font-size: 0.8rem;
}

.dashboard-badge.live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-tint);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--success-border);
  margin-bottom: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(53, 201, 141, 0.7);
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(53, 201, 141, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(53, 201, 141, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(53, 201, 141, 0); }
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-action-btn.alert {
  background: var(--warning-tint);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.action-pill {
  background: var(--warning);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-border);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.kpi-card.tone-brand .kpi-icon-wrap { background: var(--brand-tint); color: var(--brand); }
.kpi-card.tone-success .kpi-icon-wrap { background: var(--success-tint); color: var(--success); }
.kpi-card.tone-danger .kpi-icon-wrap { background: var(--danger-tint); color: var(--danger); }
.kpi-card.tone-warning .kpi-icon-wrap { background: var(--warning-tint); color: var(--warning); }
.kpi-card.tone-info .kpi-icon-wrap { background: var(--info-tint); color: var(--info); }

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.kpi-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-top: 2px;
  flex-wrap: wrap;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 5px;
}

.trend-chip.up {
  background: var(--success-tint);
  color: var(--success);
}

/* Dashboard Main Grid (Chart & Funnel) */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.dashboard-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-card .card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dashboard-chart-container {
  width: 100%;
  height: 200px;
}

.dashboard-chart-svg {
  width: 100%;
  height: 100%;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-dasharray: 3 3;
}

.chart-axis-line {
  stroke: var(--border);
}

.chart-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-bar-inbound {
  fill: var(--brand);
  opacity: 0.85;
}

.chart-bar-outbound {
  fill: var(--success);
  opacity: 0.85;
}

.chart-line-apps {
  fill: none;
  stroke: var(--warning);
  stroke-width: 2;
}

.chart-dot-apps {
  fill: var(--warning);
}

.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.funnel-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 4px;
  gap: 6px;
}

.funnel-bar-bg {
  height: 8px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7860F9 0%, #a491fb 100%);
}

/* Dashboard Secondary Grid (Urgent, Top Vacancies, Demographics) */
.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.urgent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.urgent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.urgent-item-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.urgent-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.urgent-badge.alert {
  background: var(--danger-tint);
  color: var(--danger);
}

.urgent-badge.paused {
  background: var(--warning-tint);
  color: var(--warning);
}

.urgent-item-sub {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 4px;
}

.top-vacancies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.top-vacancy-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.top-vacancy-item:hover {
  border-color: var(--brand);
  background: var(--surface);
}

.top-vacancy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.top-vacancy-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-vacancy-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.top-vacancy-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.demographics-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.demographics-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.district-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.district-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text);
}

.district-stat-count {
  font-weight: 700;
  color: var(--brand);
}

.breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}

.breakdown-meter-bg {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.breakdown-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

/* ==========================================================================
   VIEW 2: AI INTELLIGENCE & QUALITY HUB
   ========================================================================== */
.ai-hub-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.ai-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ai-hub-header h2 {
  margin: 0 0 2px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ai-hub-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--brand-border);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.ai-hub-model-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex: none;
}

.code-editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.code-editor-header {
  padding: 9px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.code-editor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.window-dots {
  display: flex;
  gap: 5px;
  flex: none;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.window-dots span:nth-child(1) { background: #ff5f56; }
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #27c93f; }

.file-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--brand);
}

.code-editor-body {
  position: relative;
  display: flex;
  background: var(--surface);
  max-height: 380px;
  overflow: hidden;
  width: 100%;
}

.code-editor-gutter {
  padding: 12px 10px;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
  line-height: 1.6;
  text-align: right;
  opacity: 0.6;
  flex: none;
  overflow: hidden;
}

.ai-guidance-textarea {
  flex: 1;
  min-height: 220px;
  max-height: 380px;
  resize: vertical;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  box-shadow: none !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

.ai-guidance-textarea:focus {
  outline: none;
}

.code-editor-footer {
  padding: 8px 14px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

.ai-hub-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.triage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
}

.triage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.triage-card-header h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.triage-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.triage-item:hover {
  border-color: var(--brand-border);
  transform: translateY(-1px);
}

.triage-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 6px;
  flex-wrap: wrap;
}

.triage-item-question {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.triage-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Dialog Styles */
dialog {
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: min(600px, 92vw);
  max-height: 88vh;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(10, 6, 25, 0.55);
  backdrop-filter: blur(4px);
}

dialog > form, .detail-shell {
  padding: 20px 24px;
  max-height: 88vh;
  overflow-y: auto;
}

.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
   AI INTELLIGENCE SUITE: PRE-COMPUTED CARDS & DAILY METRICS
   ========================================================================== */
.conversation-ai-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease-out;
}

.conversation-ai-banner[hidden] {
  display: none !important;
}

.ai-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
}

.ai-intent-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-intent-badge.jobseeker {
  background: rgba(120, 96, 249, 0.12);
  color: var(--brand);
  border: 1px solid rgba(120, 96, 249, 0.3);
}
.ai-intent-badge.employer_lead {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.ai-intent-badge.general_inquiry {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ai-lead-score-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.ai-banner-summary {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}

.ai-banner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.ai-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}
.ai-chip strong {
  color: var(--text);
}

.ai-banner-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  padding: 6px 10px;
  background: rgba(120, 96, 249, 0.06);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  color: var(--text);
}

.ai-banner-status-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.ai-hub-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.ai-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.ai-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.ai-kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.ai-kpi-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Executive Management Intelligence Reports */
.ai-report-container-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.ai-report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
  margin-bottom: 16px;
}

.ai-report-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-period-toggle-group {
  display: flex;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.ai-period-btn {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-period-btn:hover {
  color: var(--text);
}

.ai-period-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

.ai-report-kpi-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ai-report-kpi-item {
  display: flex;
  flex-direction: column;
}

.ai-report-kpi-item .label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}

.ai-report-kpi-item .val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.ai-report-narrative-box {
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.ai-report-narrative-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.ai-report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ai-report-col {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.ai-report-bullet-list,
.ai-report-num-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary, #334155);
}

.ai-report-bullet-list li,
.ai-report-num-list li {
  margin-bottom: 6px;
}

.ai-report-bullet-list li:last-child,
.ai-report-num-list li:last-child {
  margin-bottom: 0;
}



/* ==========================================================================
   RESPONSIVE POLISH & STRICT COLLAPSED SIDEBAR RULES (TEST MATCH)
   ========================================================================== */
@media(max-width:900px){
  .menu-button{display:flex}
  aside#sidebar{position:fixed;top:0;left:0;bottom:0;width:266px!important;transform:translateX(-100%);z-index:60;box-shadow:24px 0 60px rgba(10,6,25,.25);transition:transform .22s ease}
  .app-shell.collapsed .brand-text,.app-shell.collapsed .sidebar-label{display:inline}
  .app-shell.collapsed .nav-button,.app-shell.collapsed .sidebar-actions button{justify-content:flex-start}
  #sidebar.open{transform:translateX(0)}
  .sidebar-close{display:flex}
  #collapse-sidebar{display:none}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(10,6,25,.5);z-index:59}
  header{padding:10px 16px}
  .panel{padding:14px 14px 36px}
  .panel.chat-panel{padding:0!important;overflow:hidden!important}
  .two-columns,.review-summary{grid-template-columns:1fr}
  #admin-email{max-width:110px}
  .dashboard-main-grid,
  .dashboard-secondary-grid,
  .ai-hub-secondary-grid {
    grid-template-columns: 1fr;
  }
  .table-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-left-controls {
    flex-direction: column;
    min-width: 100%;
  }
  .filter-search-box {
    max-width: 100%;
  }
  .filter-select {
    width: 100%;
  }
  .filter-right-meta {
    justify-content: space-between;
  }
  .panel-header-clean h2 {
    font-size: 1.05rem;
  }
  .panel-heading > button,
  .panel-header-clean > button {
    margin-left: auto;
    font-size: 0.82rem;
    padding: 7px 12px;
  }
  dialog {
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 12px !important;
  }
  dialog > form, .detail-shell {
    padding: 16px 14px !important;
  }
}

@media(max-width:480px){
  #admin-email{display:none}
}
