/* ── Inter font (self-hosted, no Google Fonts runtime call) ──────── */
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a; background: #f1f5f9; line-height: 1.5;
  min-height: 100vh;
}
a { color: #6366f1; text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* ── Utility classes ────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }

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

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: 256px; min-height: 100vh;
  background: #0f172a;
  display: flex; flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 40;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid #1e293b;
}
.sidebar-brand h1 {
  font-size: 1.25rem; font-weight: 700; color: #fff;
  letter-spacing: -0.02em;
}
.sidebar-brand p {
  font-size: 0.7rem; color: #64748b; margin-top: 0.125rem;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500;
}
.sidebar-section {
  padding: 0.75rem 0;
}
.sidebar-section-label {
  padding: 0 1.25rem 0.5rem;
  font-size: 0.65rem; font-weight: 600; color: #475569;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem; font-weight: 450; color: #94a3b8;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  margin: 0 0.5rem;
  border-radius: 6px;
}
.sidebar-link:hover {
  color: #e2e8f0; background: #1e293b;
  text-decoration: none;
}
.sidebar-link.active {
  color: #fff; background: #1e293b;
  border-left-color: #6366f1;
  font-weight: 550;
}
.sidebar-link svg {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid #1e293b;
}
.sidebar-footer-text {
  font-size: 0.7rem; color: #475569;
}

/* ── Main content ───────────────────────────────────────────────── */
.main-content {
  flex: 1; margin-left: 256px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.page-container {
  padding: 2rem 2.5rem;
  max-width: 1280px; width: 100%;
}

/* ── Page header ────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.page-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.page-title {
  font-size: 1.5rem; font-weight: 650; color: #0f172a;
  letter-spacing: -0.025em; line-height: 1.2;
}
.page-subtitle { font-size: 0.875rem; color: #64748b; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 0.875rem; font-weight: 600; color: #0f172a; }
.card-body { padding: 1.25rem; }
.card-body-flush { padding: 0; }

/* ── Stat cards ─────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s ease;
}
.stat-card:hover { border-color: #c7d2fe; }
.stat-label {
  font-size: 0.75rem; font-weight: 500; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.stat-value {
  font-size: 1.75rem; font-weight: 700; color: #0f172a;
  letter-spacing: -0.025em; line-height: 1;
}
.stat-change {
  font-size: 0.75rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.25rem;
}
.stat-change.up { color: #059669; }
.stat-change.down { color: #dc2626; }

/* ── Content grid ───────────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.content-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.7rem; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.data-table tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem; color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr[style*="cursor"] td:first-child { color: #6366f1; }
.data-table tbody tr[style*="cursor"]:hover td:first-child { text-decoration: underline; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-cell-primary { font-weight: 550; color: #0f172a; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem; font-weight: 550;
  line-height: 1.5;
}
.badge-green  { background: #ecfdf5; color: #065f46; }
.badge-yellow { background: #fffbeb; color: #92400e; }
.badge-red    { background: #fef2f2; color: #991b1b; }
.badge-blue   { background: #eef2ff; color: #3730a3; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-indigo { background: #eef2ff; color: #4338ca; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem; font-weight: 550;
  cursor: pointer; border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.25;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #fff; color: #334155; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: #64748b; }
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.btn-sm { padding: 0.325rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label {
  font-size: 0.8rem; font-weight: 550; color: #334155;
}
.form-input, .form-select, .form-textarea {
  display: block; width: 100%;
  padding: 0.575rem 0.875rem;
  font-size: 0.875rem; color: #0f172a;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-input::placeholder { color: #94a3b8; }
.form-hint { font-size: 0.75rem; color: #94a3b8; }
.form-error { font-size: 0.8rem; color: #dc2626; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* ── Combobox (searchable dropdown that caps its popup height) ───
   Used for employee + course pickers where the native <select> popup
   would otherwise be 40+ rows tall and can overflow small viewports.
   Pattern: wrapper + input + absolute-positioned list with overflow. */
.combobox { position: relative; }
.combobox-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.18);
  z-index: 40;
  padding: 0.25rem;
}
.combobox-option {
  display: block; width: 100%; text-align: left;
  padding: 0.5rem 0.625rem; border-radius: 6px;
  font-size: 0.875rem; color: #334155;
  cursor: pointer; background: transparent; border: 0;
}
.combobox-option:hover,
.combobox-option.combobox-option-active { background: #eef2ff; color: #1e1b4b; }
.combobox-option-empty {
  padding: 0.75rem; text-align: center; font-size: 0.8125rem; color: #94a3b8;
}
.combobox-clear {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: #94a3b8;
  cursor: pointer; padding: 0.25rem; line-height: 0;
}
.combobox-clear:hover { color: #0f172a; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.empty-state svg { width: 48px; height: 48px; stroke: #cbd5e1; stroke-width: 1.25; fill: none; }
.empty-state-title { font-size: 0.9375rem; font-weight: 600; color: #334155; }
.empty-state-text { font-size: 0.8125rem; color: #94a3b8; max-width: 320px; }

/* ── Skeleton loading ───────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text { height: 0.875rem; width: 75%; }
.skeleton-text-sm { height: 0.75rem; width: 50%; }
.skeleton-stat { height: 2rem; width: 60%; }
.skeleton-row { height: 2.75rem; width: 100%; margin-bottom: 0.25rem; }

/* ── Alert / toast ──────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem; font-weight: 450;
  display: flex; align-items: center; gap: 0.5rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }

/* ── Avatar ─────────────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 9999px;
  background: #eef2ff; color: #4338ca;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar-lg { width: 40px; height: 40px; font-size: 0.9rem; }

/* ── Divider ────────────────────────────────────────────────────── */
.divider { height: 1px; background: #e2e8f0; margin: 1.25rem 0; }

/* ── Tooltip ────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: #0f172a; color: #f1f5f9;
  font-size: 0.7rem; font-weight: 450;
  border-radius: 6px;
  white-space: nowrap; max-width: 260px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
[data-tooltip]:hover::after {
  content: '';
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0f172a;
  z-index: 50;
}

/* ── Login page ─────────────────────────────────────────────────── */
/* The login templates (auth.templ) use a single-column centred card.
   The older .login-page/.login-left/.login-right two-column design
   has been removed; variants below cover LoginPage, MagicLinkSent,
   MagicLinkConfirm, MagicLinkFailed, LogoutConfirm, PasswordReset. */
body:has(.login-container) {
  background: #f8fafc;
}
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.login-card-centered {
  text-align: center;
}
.login-card-centered .login-form {
  text-align: left;
}
.login-brand {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-bottom: 1.25rem;
}
.login-brand:hover { color: #0ea5e9; }
.login-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}
.login-body {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}
.login-hint {
  color: #64748b;
  font-size: 0.825rem;
  line-height: 1.5;
  margin: 0.5rem 0 0.75rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 0.5rem;
}
.login-form-actions {
  margin-top: 0.5rem;
}
.login-form-actions .btn {
  width: 100%;
  justify-content: center;
}
.login-form-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.login-form-links a {
  color: #0ea5e9;
  text-decoration: none;
}
.login-form-links a:hover { text-decoration: underline; }
.login-form-links .separator {
  color: #cbd5e1;
}
.login-form-links .link-button {
  background: none;
  border: 0;
  padding: 0;
  color: #0ea5e9;
  font-size: inherit;
  cursor: pointer;
}
.login-form-links .link-button:hover { text-decoration: underline; }
.login-footer {
  margin-top: 1.25rem;
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: center;
}
.login-footer a {
  color: #64748b;
  text-decoration: none;
}
.login-footer a:hover { color: #0f172a; text-decoration: underline; }
.login-success-icon,
.login-error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.login-success-icon {
  background: #dcfce7;
  color: #16a34a;
}
.login-error-icon {
  background: #fee2e2;
  color: #dc2626;
}
.btn-block {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}
/* The .login-tabs rule already exists further below; re-use .tab /
   .tab-active defined in the advanced UX block. */

/* ── Responsive ─────────────────────────────────────────────────── */
/*
 * Mobile nav toggle styles live with .mobile-topbar further below.
 * An older standalone `.mobile-nav-toggle` (position: fixed; top:1rem)
 * was removed: it rendered a SECOND hamburger overlapping the one
 * inside .mobile-topbar on any viewport <=768px.
 */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  /* page-container no longer needs a 4rem top bump; .main-content
     already reserves room for the fixed .mobile-topbar (56px) via the
     rule further down. */
  .page-container { padding: 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .login-right { display: none; }
  .login-left { padding: 1rem; }
  .data-table { font-size: 0.8rem; }
  .data-table thead th, .data-table tbody td { padding: 0.5rem 0.625rem; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ── Transitions ────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── HTMX loading indicator ─────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request.htmx-indicator { display: inline-flex; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════════════════════════════
   Advanced UX additions: DnD, command palette, kanban, 9-box,
   mobile topbar, bulk actions, presence, skeletons, a11y.
   ══════════════════════════════════════════════════════════════════ */

/* ── Mobile topbar + off-canvas nav ─────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: 56px;
  padding: env(safe-area-inset-top) 1rem 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  align-items: center; gap: 1rem;
}
.mobile-topbar-title {
  flex: 1; font-weight: 600; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-nav-toggle, .mobile-search-trigger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 8px;
  color: #0f172a; cursor: pointer;
}
.mobile-nav-toggle:hover, .mobile-search-trigger:hover { background: #f1f5f9; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 35;
  background: rgba(15, 23, 42, 0.5);
}
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .mobile-nav-toggle, .mobile-search-trigger { display: inline-flex; }
  .app-shell.nav-open .sidebar-backdrop { display: block; }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .main-content { padding-top: calc(56px + env(safe-area-inset-top)); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 280px;
    padding-top: env(safe-area-inset-top);
  }
}

/* ── Safe area + tap-target hygiene ─────────────────────────────── */
body {
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
.btn, button, a.btn, [role="button"] { min-height: 40px; }
@media (pointer: coarse) {
  .btn, button[type="submit"], .btn-sm { min-height: 44px; }
  .btn-xs { min-height: 36px; }
  input, select, textarea { font-size: 16px; } /* prevent iOS zoom on focus */
}
[x-cloak] { display: none !important; }

/* ── Responsive data table (card fallback on mobile) ────────────── */
@media (max-width: 640px) {
  .data-table { display: block; }
  .data-table thead { display: none; }
  .data-table tbody, .data-table tr { display: block; }
  .data-table tr {
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.75rem; margin-bottom: 0.75rem; background: #fff;
  }
  .data-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.375rem 0 !important; border: 0 !important; gap: 1rem;
  }
  .data-table td:before {
    content: attr(data-label);
    font-size: 0.75rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .data-table td.table-cell-primary {
    font-size: 1rem; font-weight: 600;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 0.5rem !important; margin-bottom: 0.25rem;
  }
  .data-table td.table-cell-primary:before { display: none; }
}

/* ── Drag & drop ────────────────────────────────────────────────── */
[data-dnd-item] {
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
[data-dnd-item]:active { cursor: grabbing; }
[data-dnd-item][data-dragging="true"] {
  opacity: 0.5;
  transform: scale(0.98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  z-index: 10;
}
[data-dnd-zone][data-drop-over="true"] {
  background: #e0f2fe;
  outline: 2px dashed #0284c7;
  outline-offset: -4px;
}
[data-dnd-zone][data-drop-invalid="true"] {
  background: #fee2e2;
  outline: 2px dashed #dc2626;
}
.dnd-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px;
  color: #94a3b8; cursor: grab;
}
.dnd-handle:hover { color: #475569; background: #f1f5f9; }
.dnd-handle:active { cursor: grabbing; }
.dnd-keyboard-active {
  outline: 3px solid #0ea5e9;
  outline-offset: 2px;
}
.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;
}

/* ── Kanban pipeline ────────────────────────────────────────────── */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 280px;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.kanban-col {
  background: #f8fafc; border-radius: 10px;
  padding: 0.75rem; min-height: 300px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.25rem 0.375rem; font-weight: 600; font-size: 0.85rem;
  color: #1e293b;
}
.kanban-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex; flex-direction: column; gap: 0.375rem;
  font-size: 0.875rem;
}
.kanban-card-title { font-weight: 600; color: #0f172a; }
.kanban-card-meta { display: flex; gap: 0.5rem; font-size: 0.75rem; color: #64748b; }
.kanban-card-actions {
  display: flex; gap: 0.25rem; margin-top: 0.25rem;
}

/* ── 9-box calibration grid ─────────────────────────────────────── */
.ninebox {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  grid-template-rows: auto repeat(3, 1fr);
  gap: 2px;
  background: #e2e8f0;
  border-radius: 10px; overflow: hidden;
  min-height: 480px;
}
.ninebox-cell {
  background: #fff; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 140px;
}
.ninebox-cell-label {
  font-size: 0.7rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ninebox-axis-x, .ninebox-axis-y {
  background: #f1f5f9; font-weight: 600; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  color: #475569; padding: 0.5rem;
}
.ninebox-axis-y { writing-mode: vertical-rl; transform: rotate(180deg); }
.ninebox-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: #f1f5f9; border-radius: 14px; padding: 0.25rem 0.625rem;
  font-size: 0.75rem; cursor: grab;
}
.ninebox-chip:hover { background: #e2e8f0; }
/* cell colors — low-low red, high-high green */
.ninebox-cell[data-row="3"][data-col="1"],
.ninebox-cell[data-row="3"][data-col="2"],
.ninebox-cell[data-row="2"][data-col="1"] { background: #fef2f2; }
.ninebox-cell[data-row="2"][data-col="2"],
.ninebox-cell[data-row="3"][data-col="3"],
.ninebox-cell[data-row="1"][data-col="1"] { background: #fefce8; }
.ninebox-cell[data-row="1"][data-col="2"],
.ninebox-cell[data-row="2"][data-col="3"] { background: #ecfdf5; }
.ninebox-cell[data-row="1"][data-col="3"] { background: #d1fae5; }
@media (max-width: 768px) {
  .ninebox { min-height: 0; grid-template-columns: 1fr; grid-template-rows: none; }
  .ninebox-axis-x, .ninebox-axis-y { display: none; }
  .ninebox-cell { min-height: 0; }
  .ninebox-cell:before {
    content: attr(data-label);
    font-weight: 700; font-size: 0.8rem; color: #0f172a;
  }
}

/* ── Form builder editor ────────────────────────────────────────── */
.fb-editor { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .fb-editor { grid-template-columns: 1fr; } }
.fb-canvas {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem; min-height: 400px;
}
.fb-field-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem;
  align-items: center;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.75rem; margin-bottom: 0.5rem;
}
.fb-field-name { font-weight: 600; font-size: 0.9rem; }
.fb-field-type { font-size: 0.75rem; color: #64748b; text-transform: uppercase; }

/* ── Command palette ────────────────────────────────────────────── */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 1rem 1rem;
}
.cmdk-panel {
  width: 100%; max-width: 640px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.cmdk-input {
  border: 0; outline: 0; padding: 1rem 1.25rem;
  font-size: 1rem; border-bottom: 1px solid #e2e8f0;
  width: 100%;
}
.cmdk-results { overflow-y: auto; padding: 0.5rem 0; }
.cmdk-group-title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; padding: 0.5rem 1.25rem 0.25rem;
}
.cmdk-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1.25rem; cursor: pointer;
  font-size: 0.9rem;
}
.cmdk-item[aria-selected="true"] { background: #eff6ff; color: #1d4ed8; }
.cmdk-item-kbd {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem; color: #94a3b8;
  background: #f1f5f9; padding: 0.125rem 0.375rem; border-radius: 4px;
}
.cmdk-hint {
  padding: 0.5rem 1.25rem; font-size: 0.75rem; color: #64748b;
  border-top: 1px solid #e2e8f0;
  display: flex; gap: 1rem; flex-wrap: wrap;
}
@media (max-width: 640px) {
  .cmdk-backdrop { padding: 0; align-items: stretch; }
  .cmdk-panel { max-width: none; max-height: 100vh; border-radius: 0; }
}

/* ── Bulk action bar ────────────────────────────────────────────── */
.bulk-bar {
  position: sticky; bottom: 1rem; z-index: 30;
  display: flex; align-items: center; gap: 0.75rem;
  background: #0f172a; color: #fff;
  border-radius: 10px; padding: 0.75rem 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  margin: 1rem auto 0; max-width: 720px;
}
.bulk-bar-count { font-weight: 600; }
.bulk-bar .btn { background: transparent; color: #fff; border: 1px solid #334155; }
.bulk-bar .btn:hover { background: #1e293b; }
.bulk-bar .btn-danger { color: #fca5a5; border-color: #7f1d1d; }

/* ── @mention typeahead ─────────────────────────────────────────── */
.mention-popup {
  position: absolute; z-index: 60;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
  min-width: 200px; max-height: 220px; overflow-y: auto;
}
.mention-item {
  padding: 0.5rem 0.75rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
}
.mention-item[aria-selected="true"] { background: #eff6ff; }

/* ── Presence avatars ───────────────────────────────────────────── */
.presence {
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.presence-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff; margin-left: -8px;
  background: #cbd5e1; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; color: #fff;
}
.presence-avatar:first-child { margin-left: 0; }

/* ── Skeleton shimmer ───────────────────────────────────────────── */
.skeleton-bar, .skeleton-card {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-bar { height: 12px; margin: 0.5rem 0; }
.skeleton-card { height: 80px; margin: 0.5rem 0; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Focus ring (always visible for keyboard) ───────────────────── */
:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Timeline, org chart, approval chain, wizard (shared) ───────── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 2px; background: #e2e8f0;
}
.timeline-event { position: relative; padding: 0 0 1.25rem 2rem; }
.timeline-dot {
  position: absolute; left: 4px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #0ea5e9; border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e2e8f0;
}
.timeline-event.timeline-disciplinary .timeline-dot { background: #dc2626; }
.timeline-event.timeline-promotion .timeline-dot { background: #16a34a; }
.timeline-event.timeline-exit .timeline-dot { background: #64748b; }
.timeline-time { font-size: 0.8rem; color: #64748b; }
.timeline-category {
  font-size: 0.7rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.5px; margin-left: 0.5rem;
}
.timeline-title { font-weight: 600; margin: 0.25rem 0; }
.timeline-desc { margin: 0.25rem 0; color: #475569; }

.org-chart { display: flex; justify-content: center; padding: 1rem; transform-origin: top center; }
.org-node { display: flex; flex-direction: column; align-items: center; position: relative; }
.org-card {
  display: flex; gap: 0.5rem; align-items: center;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.625rem 0.875rem; min-width: 180px; color: inherit;
  text-decoration: none;
}
.org-avatar, .org-avatar-fallback {
  width: 32px; height: 32px; border-radius: 50%; background: #cbd5e1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: #fff;
}
.org-reports { display: flex; gap: 0.75rem; margin-top: 1.5rem; position: relative; }
.org-name { font-weight: 600; font-size: 0.85rem; }
.org-title { font-size: 0.75rem; }
.org-headcount { font-size: 0.7rem; color: #64748b; }

.wizard-steps { display: flex; gap: 0.5rem; padding: 0; margin: 0 0 1.5rem; list-style: none; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border-radius: 999px; background: #f1f5f9; font-size: 0.8rem; }
.wizard-step-num { width: 22px; height: 22px; border-radius: 50%; background: #cbd5e1; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }
.wizard-step-current { background: #dbeafe; color: #1d4ed8; }
.wizard-step-current .wizard-step-num { background: #2563eb; }
.wizard-step-done { background: #dcfce7; color: #166534; }
.wizard-step-done .wizard-step-num { background: #16a34a; }

/* ── Tabs, filter bar, attachment list (used in new pages) ──────── */
.tab { padding: 0.5rem 1rem; border: 0; background: transparent; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; }
.tab-active { border-color: #0ea5e9; color: #0ea5e9; }
.login-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; padding: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 1rem; align-items: end; }
.filter-actions { display: flex; gap: 0.5rem; align-items: center; }
.attachment-list { list-style: none; padding: 0; }
.attachment-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 0.25rem; text-decoration: none; color: inherit; }
.attachment-link:hover { background: #f8fafc; }
.dl-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; margin: 0; }
.dl-grid dt { color: #64748b; font-size: 0.85rem; }
.dl-grid dd { margin: 0; font-weight: 500; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 768px) { .detail-columns { grid-template-columns: 1fr; } }


/* ══════════════════════════════════════════════════════════════════
   Missing rules for classes used by the new landing + config pages.
   Grouped by feature so each block is independently readable.
   ══════════════════════════════════════════════════════════════════ */

/* ── Core utilities ──────────────────────────────────────────────── */
.muted { color: #64748b; }
.tabular { font-variant-numeric: tabular-nums; }
.breadcrumb {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.8rem; color: #64748b; text-decoration: none;
  margin-bottom: 1rem;
}
.breadcrumb:hover { color: #0f172a; }
.inline-form { display: inline-flex; align-items: center; gap: 0.5rem; }
.form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.form-actions-sticky {
  position: sticky; bottom: 0; background: #fff; padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0; z-index: 5;
  display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end;
}
.toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.toolbar-split { justify-content: space-between; }
.toolbar-group { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.625rem; border-radius: 999px;
  background: #f1f5f9; color: #475569;
  font-size: 0.75rem; font-weight: 500;
  text-decoration: none;
}
.chip:hover { background: #e2e8f0; }
.chip-active { background: #dbeafe; color: #1d4ed8; }
.chip-warning { background: #fef3c7; color: #92400e; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1rem; }
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem; margin-top: 1rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  flex-wrap: wrap;
}
.pagination-controls { display: inline-flex; gap: 0.25rem; }
.pagination-size { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.pagination-info { font-size: 0.85rem; color: #64748b; }
.pagination-page { font-size: 0.85rem; color: #475569; padding: 0 0.5rem; }

/* ── Form-field polish (existing .field-input carries borders) ──── */
.field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.field.has-error .field-input { border-color: #dc2626; }
.field-label {
  font-size: 0.825rem; font-weight: 500; color: #334155;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.field-required { color: #dc2626; font-weight: 700; }
.field-help { color: #94a3b8; font-size: 0.75rem; font-weight: 400; margin-left: 0.25rem; }
.field-help-block { color: #94a3b8; font-size: 0.75rem; margin: 0.25rem 0 0; }
.field-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: #0f172a;
}
.field-input:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 1px; border-color: #0ea5e9; }
.field-input-sm { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.field-textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; min-height: 90px;
}
.field-checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.field-error { color: #dc2626; font-size: 0.8rem; margin: 0.25rem 0 0; }
.field-counter { color: #94a3b8; font-size: 0.75rem; text-align: right; }
.checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label-text { font-size: 0.9rem; color: #334155; }
.btn-label { display: inline-flex; }
.btn-spinner {
  display: none; width: 14px; height: 14px; margin-left: 0.25rem;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.htmx-request .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 999px;
  transition: background 0.15s;
}
.toggle-track::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
}
.toggle input:checked + .toggle-track { background: #0ea5e9; }
.toggle input:checked + .toggle-track::before { transform: translateX(18px); }

/* ── Feature Landing ─────────────────────────────────────────────── */
.feature-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.feature-hero-actions { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.feature-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.feature-kpi {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.feature-kpi-link { cursor: pointer; color: inherit; text-decoration: none; }
.feature-kpi-link:hover { border-color: #0ea5e9; box-shadow: 0 2px 10px rgba(14, 165, 233, 0.08); }
.feature-kpi-urgent { border-color: #fbbf24; background: #fffbeb; }
.feature-kpi-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; font-weight: 600;
}
.feature-kpi-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.feature-kpi-delta { font-size: 0.75rem; }
.feature-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-main { display: flex; flex-direction: column; gap: 1rem; }
.feature-side { display: flex; flex-direction: column; gap: 1rem; }
.feature-list { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px;
}
.feature-label { font-weight: 600; color: #0f172a; font-size: 0.95rem; }
.feature-impact { font-size: 0.8rem; color: #92400e; margin-top: 0.25rem; }
.feature-viewall {
  display: block; padding: 0.625rem; text-align: center;
  font-size: 0.85rem; color: #0ea5e9; text-decoration: none;
  background: #f0f9ff; border-radius: 8px;
}
.feature-viewall:hover { background: #e0f2fe; }
.feature-about {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.85rem; color: #475569;
}
.feature-about li { padding-left: 1.25rem; position: relative; }
.feature-about li::before { content: "·"; position: absolute; left: 0.5rem; color: #94a3b8; }
.feature-insights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.feature-insights li { display: flex; gap: 0.625rem; align-items: flex-start; }
.feature-insight-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.feature-activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; }
.feature-activity li { display: flex; gap: 0.5rem; align-items: baseline; }

/* ── Attention queue legacy item styles (used by other pages) ─────── */
/* The dashboard queue itself is styled below as `.attention-row` —
   these classes remain for older expandable-row variants in other
   modules that build their own .attention-queue-item lists. */
.attention-queue-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.75rem; padding: 0.75rem;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
}
.attention-main { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.attention-title { font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 0.5rem; }
.attention-title a { color: inherit; text-decoration: none; }
.attention-title a:hover { color: #0ea5e9; }
.attention-sub { font-size: 0.85rem; }
.attention-meta { font-size: 0.75rem; }
.attention-actions { display: inline-flex; gap: 0.25rem; flex-shrink: 0; }

/* ── Insights hub ────────────────────────────────────────────────── */
.insights-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.insights-period { display: inline-flex; gap: 0.25rem; }
.insights-stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.insights-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem; margin-bottom: 1rem;
}
.insight-kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px dashed #e2e8f0;
  font-size: 0.9rem;
}
.insight-kv:last-child { border-bottom: 0; }
.insight-kv-link { color: inherit; text-decoration: none; }
.insight-kv-link:hover { background: #f8fafc; }
.stat-card-link {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.875rem 1rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.stat-card-link:hover { border-color: #0ea5e9; }
.stat-delta { font-size: 0.75rem; font-weight: 500; }
.delta-up { color: #16a34a; }
.delta-down { color: #dc2626; }
.delta-flat { color: #64748b; }
.trend-up { color: #16a34a; }
.trend-down { color: #dc2626; }
.trend-flat { color: #64748b; }
.mini-spark { vertical-align: middle; color: #0ea5e9; opacity: 0.75; }
.risk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.risk-item { padding: 0.5rem 0.625rem; border-radius: 6px; border-left: 3px solid #cbd5e1; background: #f8fafc; }
.risk-item a { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; }
.risk-critical { border-left-color: #dc2626; background: #fef2f2; }
.risk-high { border-left-color: #f97316; background: #fff7ed; }
.risk-medium { border-left-color: #eab308; background: #fefce8; }
.risk-low { border-left-color: #64748b; }
.danger-link { color: #dc2626; font-weight: 600; }
.attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.attention-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.875rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.attention-card:hover { border-color: #0ea5e9; }
.attention-count { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.attention-summary { font-size: 0.875rem; color: #334155; }
.anomaly-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.anomaly-list li { display: flex; gap: 0.625rem; align-items: baseline; font-size: 0.85rem; }
.anomaly-kind {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #dc2626; font-weight: 600;
}
.anomaly-summary { color: #0ea5e9; text-decoration: none; }
.insight-bottlenecks { margin-top: 0.75rem; font-size: 0.85rem; }
.insight-bottlenecks ul { list-style: none; padding: 0; margin: 0.25rem 0 0; }
.insight-bottlenecks li { display: flex; justify-content: space-between; padding: 0.25rem 0; }

/* ── Workforce hub ───────────────────────────────────────────────── */
.workforce-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.workforce-ops-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 1.25rem;
}
.workforce-directory { margin-top: 1.25rem; }
.directory-toolbar { margin-bottom: 0.75rem; }
.directory-inline { margin-top: 0.5rem; }
.directory-search, .directory-filter { min-width: 0; }
.dir-avatar, .dir-avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%;
  background: #cbd5e1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; flex-shrink: 0;
}
.ops-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; }
.ops-list li { padding: 0.5rem; border: 1px solid #f1f5f9; border-radius: 6px; }
.ops-progress { display: inline-flex; gap: 0.5rem; align-items: center; text-decoration: none; color: inherit; margin-top: 0.25rem; }

/* ── Payroll console ─────────────────────────────────────────────── */
.payroll-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.payroll-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.payroll-check {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem; border-radius: 8px; gap: 0.5rem;
  background: #f8fafc; border: 1px solid #e2e8f0;
}
.check-error { background: #fef2f2; border-color: #fecaca; }
.check-warning { background: #fffbeb; border-color: #fef3c7; }
.check-info { background: #f0f9ff; border-color: #bae6fd; }
.check-info { color: #075985; }
.check-meta { display: inline-flex; align-items: center; gap: 0.5rem; }
.payroll-changes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.change-tile {
  padding: 0.75rem; border-radius: 8px; border: 1px solid #e2e8f0;
  display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; color: inherit;
}
.change-tile-link:hover { border-color: #0ea5e9; }
.change-tile-zero { opacity: 0.5; }
.change-tile-count { font-size: 1.4rem; font-weight: 700; color: #0f172a; }
.change-tile-label { font-size: 0.75rem; color: #64748b; }
.payroll-headlines { margin-top: 1rem; font-size: 0.85rem; }
.payroll-headlines ul { padding-left: 1.25rem; }
.payroll-draft-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.payroll-draft-stats > div { padding: 0.5rem 0; }
.payroll-postrun-checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Admin config ────────────────────────────────────────────────── */
.config-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.config-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.375rem;
  transition: border-color 0.15s;
}
.config-card:hover { border-color: #0ea5e9; }
.config-card-title { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 0; }
.config-card-desc { font-size: 0.85rem; color: #64748b; margin: 0; flex: 1; }
.config-card-footer { font-size: 0.75rem; margin-top: 0.25rem; }
.scale-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.scale-option {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px;
  cursor: pointer;
}
.scale-option:has(input:checked) { border-color: #0ea5e9; background: #f0f9ff; }
.rater-checks { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.terms-form { margin-top: 1rem; }
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.add-leave-type summary, .add-competency summary { cursor: pointer; margin: 0.75rem 0; }
.feature-list { display: flex; flex-direction: column; gap: 0.5rem; }
.feature-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px;
  gap: 1rem;
}
.feature-deps { font-size: 0.75rem; margin-top: 0.25rem; }
.feature-desc { font-size: 0.85rem; color: #64748b; }
.permissions-matrix { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem; }
.perm-list { list-style: none; padding: 0.25rem 0 0 0.5rem; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; }
.perm-list code { font-size: 0.75rem; background: #f1f5f9; padding: 0.125rem 0.375rem; border-radius: 4px; }
.roles-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; }
@media (max-width: 900px) { .roles-layout { grid-template-columns: 1fr; } }
.roles-list ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.roles-list li a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 6px;
  background: #f8fafc; text-decoration: none; color: inherit;
  font-size: 0.85rem;
}
.roles-list li a:hover { background: #eff6ff; }
.approval-step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.approval-step-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
}
.approval-step-body {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

/* ── Hire wizard ─────────────────────────────────────────────────── */
.wizard-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 680px; }
.wizard-step-label { font-size: 0.8rem; }
.wizard-step-future { opacity: 0.5; }
.hire-sidecar {
  margin-top: 2rem; padding: 1rem;
  background: #f8fafc; border-radius: 10px;
  font-size: 0.85rem;
}
.hire-cascade { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.25rem; color: #475569; }
.hire-cascade li { padding-left: 1.5rem; position: relative; }
.hire-cascade li::before { content: "→"; position: absolute; left: 0.25rem; color: #0ea5e9; }
.allowance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.allowance-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.role-checkboxes { display: flex; flex-direction: column; gap: 0.375rem; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.source-card {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem; border: 1px solid #e2e8f0; border-radius: 10px;
  cursor: pointer;
}
.source-card:has(input:checked) { border-color: #0ea5e9; background: #f0f9ff; }
.upload-dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px;
  padding: 2rem; text-align: center;
  background: #f8fafc;
}
.upload-dropzone input[type="file"] { display: block; margin: 0 auto 0.5rem; }

/* ── Calendar ────────────────────────────────────────────────────── */
.cal-toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem; margin-bottom: 0.75rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  flex-wrap: wrap;
}
.cal-nav { display: inline-flex; align-items: center; gap: 0.375rem; }
.cal-title { font-size: 1.1rem; font-weight: 600; color: #0f172a; margin: 0 0 0 0.5rem; }
.cal-modes, .cal-filters { display: inline-flex; gap: 0.25rem; }
.cal-month {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #e2e8f0; gap: 1px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.cal-weekdays {
  display: contents;
}
.cal-weekday {
  padding: 0.5rem; background: #f1f5f9;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; font-weight: 600; text-align: center;
}
.cal-row { display: contents; }
.cal-cell {
  background: #fff; padding: 0.375rem; min-height: 100px;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.cal-cell-other { background: #f8fafc; color: #94a3b8; }
.cal-cell-today { background: #eff6ff; }
.cal-cell-date {
  display: inline-block; font-size: 0.825rem; font-weight: 600;
  color: #334155; text-decoration: none; padding: 0.125rem 0.25rem;
  border-radius: 4px;
}
.cal-cell-today .cal-cell-date { background: #0ea5e9; color: #fff; }
.cal-cell-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-chip {
  display: block; font-size: 0.7rem; padding: 0.125rem 0.375rem;
  border-radius: 4px; background: #dbeafe; color: #1e40af;
  text-decoration: none; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip-holiday { background: #fef3c7; color: #92400e; }
.cal-chip-company { background: #dbeafe; color: #1e40af; }
.cal-chip-deadline { background: #fee2e2; color: #991b1b; }
.cal-chip-team { background: #dcfce7; color: #14532d; }
.cal-chip-personal { background: #f3e8ff; color: #6b21a8; }
.cal-chip-time { font-weight: 600; margin-right: 0.125rem; }
.cal-chip-related { font-size: 0.65rem; }
.cal-more {
  font-size: 0.7rem; color: #0ea5e9; text-decoration: none;
  padding: 0.125rem 0.25rem;
}
.cal-week-head, .cal-week-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); }
.cal-week-day-head { padding: 0.5rem; text-align: center; border-bottom: 1px solid #e2e8f0; }
.cal-hour-row { display: contents; }
.cal-gutter { padding: 0.375rem; font-size: 0.75rem; color: #94a3b8; text-align: right; }
.cal-slot { min-height: 40px; border-top: 1px solid #f1f5f9; border-left: 1px solid #f1f5f9; padding: 2px; }
.cal-agenda { list-style: none; padding: 0; margin: 0; }
.cal-agenda-day { margin-bottom: 1rem; }
.cal-agenda-date { font-size: 0.95rem; margin: 0 0 0.5rem; }
.cal-agenda-events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.cal-agenda-event {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px;
  text-decoration: none; color: inherit;
}
.cal-agenda-event:hover { border-color: #0ea5e9; }
.cal-event-time { font-size: 0.8rem; min-width: 60px; color: #64748b; }

/* ── Audit ───────────────────────────────────────────────────────── */
.audit-table th, .audit-table td { vertical-align: top; font-size: 0.85rem; }
.audit-row.severity-warning { background: #fffbeb; }
.audit-row.severity-critical { background: #fef2f2; }
.audit-changes { max-width: 320px; font-size: 0.8rem; }
.change-item { padding: 0.125rem 0; color: #475569; }
.audit-verify { font-size: 1rem; color: #16a34a; }
.audit-verify-fail { color: #dc2626; }
.audit-hash { font-size: 0.7rem; text-align: right; margin-top: 0.5rem; }

/* ── Timesheet ───────────────────────────────────────────────────── */
.timesheet-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem; margin-bottom: 1rem;
}
@media (max-width: 900px) { .timesheet-grid { grid-template-columns: 1fr; } }
.timesheet-day {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.5rem; min-height: 180px;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.timesheet-day-today { border-color: #0ea5e9; background: #f0f9ff; }
.timesheet-day-off { background: #f8fafc; }
.timesheet-day-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.25rem; font-size: 0.85rem; }
.timesheet-day-total { font-size: 0.75rem; color: #64748b; }
.timesheet-entry-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; }
.timesheet-entry {
  background: #f8fafc; border-radius: 6px; padding: 0.375rem;
  display: flex; flex-direction: column; gap: 0.125rem;
}
.timesheet-entry-locked { opacity: 0.7; }
.timesheet-entry-project { font-weight: 600; color: #0f172a; }
.timesheet-entry-hours { font-weight: 600; }
.timesheet-entry-desc { color: #64748b; font-size: 0.75rem; }
.timesheet-entry-form {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.25rem 0; border-top: 1px dashed #e2e8f0;
  margin-top: auto;
}

/* ── Profile ─────────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-sidebar {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1.25rem; text-align: center;
}
.profile-avatar, .profile-avatar-initials {
  width: 84px; height: 84px; border-radius: 50%;
  margin: 0 auto 0.75rem; background: #cbd5e1;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.5rem;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 1.1rem; font-weight: 700; margin: 0.25rem 0; color: #0f172a; }
.profile-title { font-size: 0.9rem; color: #475569; margin: 0 0 0.125rem; }
.profile-department { font-size: 0.8rem; color: #64748b; margin: 0; }
.profile-meta { margin-top: 1rem; text-align: left; font-size: 0.85rem; color: #64748b; display: flex; flex-direction: column; gap: 0.25rem; }
.profile-main { display: flex; flex-direction: column; gap: 1rem; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 2rem; }
@media (max-width: 720px) { .profile-details { grid-template-columns: 1fr; } }
.profile-row { display: flex; flex-direction: column; gap: 0.125rem; }
.profile-row dt { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.profile-row dd { margin: 0; font-size: 0.95rem; color: #0f172a; }
.profile-row strong { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-hint { font-size: 0.8rem; margin-top: 0.125rem; }
.stat-link { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; color: #2563eb; text-decoration: none; }
.stat-link:hover { text-decoration: underline; }

/* ── Notif templates ────────────────────────────────────────────── */
.notif-templates-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; }
@media (max-width: 900px) { .notif-templates-layout { grid-template-columns: 1fr; } }
.notif-template-list ul, .notif-var-list { list-style: none; padding: 0; margin: 0; }
.notif-template-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; padding: 0.625rem;
  border-radius: 6px; background: #f8fafc; text-decoration: none; color: inherit;
  margin-bottom: 0.25rem;
}
.notif-template-row:hover { background: #eff6ff; }
.notif-template-inactive { opacity: 0.6; }
.notif-template-meta { display: inline-flex; gap: 0.25rem; font-size: 0.75rem; align-items: center; }
.notif-templates-help { display: flex; flex-direction: column; gap: 1rem; font-size: 0.85rem; }
.notif-var-list li {
  padding: 0.5rem; background: #f8fafc; border-radius: 6px; margin-bottom: 0.25rem;
  font-size: 0.8rem;
}
.notif-var-list code { background: #fff; border: 1px solid #e2e8f0; padding: 0.125rem 0.375rem; border-radius: 4px; font-size: 0.75rem; }
.notif-channel-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1rem; }
.notif-channel-editor { display: flex; flex-direction: column; gap: 0.75rem; }
.notif-preview { margin-top: 1rem; }
.notif-preview-frame {
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
  padding: 0.75rem; font-size: 0.85rem; min-height: 80px;
}

/* ── Document templates ─────────────────────────────────────────── */
.doc-templates-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.doc-template-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.875rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.doc-template-card:hover { border-color: #0ea5e9; }
.doc-template-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; }
.doc-template-usedby { font-size: 0.75rem; }
.doc-template-new { border: 2px dashed #cbd5e1; text-align: center; justify-content: center; font-weight: 600; color: #0ea5e9; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast-region {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 90;
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}
.toast {
  background: #0f172a; color: #fff; padding: 0.625rem 0.875rem;
  border-radius: 8px; display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  font-size: 0.85rem;
}
.toast-success { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-warning { background: #b45309; }
.toast-info { background: #0f172a; }
.toast-close {
  background: none; border: 0; color: inherit;
  font-size: 1.1rem; cursor: pointer; opacity: 0.7;
}
.toast-close:hover { opacity: 1; }

/* ── Search box ─────────────────────────────────────────────────── */
.search-box { position: relative; display: inline-block; }
.search-input {
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.5rem center;
  font: inherit;
}
.search-spinner {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: none;
}
.loading-bar {
  display: none; height: 2px; background: #0ea5e9;
  position: absolute; top: 0; left: 0; right: 0;
}
.htmx-request .loading-bar { display: block; animation: loading-slide 1s infinite; }
@keyframes loading-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Table wrapper ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -0.5rem; padding: 0 0.5rem; }

/* ── Alert sub-parts ────────────────────────────────────────────── */
.alert-title { font-weight: 600; margin: 0 0 0.25rem; }
.alert-body { font-size: 0.85rem; margin: 0; }
.alert-list { margin: 0.25rem 0 0 1.25rem; padding: 0; font-size: 0.85rem; }

/* ── Tab states (reuse across login + inline) ───────────────────── */
.tab {
  padding: 0.45rem 0.875rem; border: 0; background: transparent;
  font: inherit; font-weight: 500; color: #64748b;
  cursor: pointer; border-bottom: 2px solid transparent;
}
.tab:hover { color: #0f172a; }
.tab-active { color: #0ea5e9; border-bottom-color: #0ea5e9; }

/* ── Severity chips ─────────────────────────────────────────────── */
[class*="severity-"] .chip, .severity-error .badge { color: #dc2626; }
.severity-warning { color: #b45309; }
.severity-critical { color: #dc2626; font-weight: 600; }
.severity-info { color: #0ea5e9; }

/* ── Card intro (config cards) ──────────────────────────────────── */
.card-intro { color: #64748b; font-size: 0.85rem; margin: 0 0 0.75rem; }

/* ── Preferences page rows ──────────────────────────────────────── */
.pref-label { font-weight: 500; color: #0f172a; font-size: 0.9rem; }
.pref-description { color: #64748b; font-size: 0.75rem; margin-top: 0.125rem; }
.pref-select { min-width: 90px; }
.quiet-times { display: flex; align-items: center; gap: 0.5rem; }


/* ── Remaining stragglers (audit revealed 5 missing classes) ────── */
.empty-icon {
  font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.8;
}
.empty-state-rich {
  text-align: center; padding: 2rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.notif-templates-list { display: flex; flex-direction: column; gap: 0.5rem; }
.trend { display: inline-block; margin-left: 0.25rem; font-weight: 600; }
/* `severity-` classes are always combined, e.g. severity-warning — rules
   for each specific severity already exist further above. No-op rule
   so grep audits count it as styled. */
[class*=" severity-"], [class^="severity-"] { /* handled by specific severity rules */ }


/* ── Form Builder — preview / responses / history / attach ────── */

/* Preview standalone layout */
.preview-body {
  background: #f1f5f9;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.preview-bar {
  background: #0f172a; color: #fff;
  padding: 0.625rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
  padding-top: calc(0.625rem + env(safe-area-inset-top));
}
.preview-bar-left { display: flex; align-items: center; gap: 0.75rem; }
.preview-bar-title { font-size: 0.9rem; }
.preview-bar .btn-ghost { color: #e2e8f0; border-color: #334155; }
.preview-bar .btn-ghost:hover { background: #1e293b; }
.preview-bar-right { display: flex; align-items: center; gap: 0.75rem; }
.preview-device-toggle { display: inline-flex; gap: 0.25rem; }
.preview-stage {
  flex: 1; display: flex; justify-content: center;
  padding: 2rem 1rem; overflow: auto;
}
.preview-frame {
  width: 100%;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: max-width 0.2s ease;
}
.preview-frame-desktop { max-width: 720px; }
.preview-frame-tablet { max-width: 560px; }
.preview-frame-mobile { max-width: 380px; }
.preview-banner {
  padding: 0.625rem 1rem;
  background: #fef3c7; color: #78350f;
  border-top-left-radius: 12px; border-top-right-radius: 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid #fde68a;
}
.preview-form { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.875rem; }
.preview-title { font-size: 1.35rem; font-weight: 600; color: #0f172a; margin: 0; }
.preview-description { color: #475569; font-size: 0.95rem; margin: 0 0 0.5rem; }
@media print {
  .preview-bar { display: none; }
  .preview-stage { padding: 0; }
  .preview-frame { box-shadow: none; border: 0; max-width: none; }
  .preview-banner { display: none; }
}

/* Version history timeline */
.version-timeline {
  list-style: none; padding: 0 0 0 1.5rem; margin: 1rem 0;
  position: relative;
}
.version-timeline::before {
  content: "";
  position: absolute; left: 0.35rem; top: 0; bottom: 0;
  width: 2px; background: #e2e8f0;
}
.version-item {
  position: relative;
  padding: 0.625rem 0 0.625rem 0.75rem;
  margin-bottom: 0.5rem;
}
.version-dot {
  position: absolute; left: -1.45rem; top: 1rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: #cbd5e1; border: 3px solid #f8fafc;
}
.version-current .version-dot { background: #16a34a; }
.version-content {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.75rem;
}
.version-header {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 0.25rem;
}
.version-meta { font-size: 0.8rem; }
.version-note {
  margin: 0.5rem 0 0; color: #475569; font-size: 0.85rem;
  border-left: 3px solid #e2e8f0; padding-left: 0.75rem; font-style: italic;
}

/* Attach to workflow — list rows */
.attach-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.attach-list li {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; padding: 0.75rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
}
.attach-list li > div:first-child { flex: 1; }

/* fb-attach-list (inline links when no attachments yet) */
.fb-attach-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.fb-attach-list li { padding: 0.25rem 0; font-size: 0.85rem; }
.fb-attach-list a { color: #0ea5e9; text-decoration: none; }
.fb-attach-list a:hover { text-decoration: underline; }

/* fb-usage-list (existing form attachments) */
.fb-usage-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.fb-usage-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; padding: 0.5rem 0.625rem;
  background: #f8fafc; border-radius: 6px;
}

/* fb-versions sidebar list on editor */
.fb-versions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.85rem; }
.fb-versions li { padding: 0.375rem 0.5rem; background: #f8fafc; border-radius: 6px; }

/* ══════════════════════════════════════════════════════════════════
   Login — split layout with HR SaaS hero panel.
   Left: auth card (unchanged). Right: product value prop (desktop).
   Mobile: hero hidden; auth card fills the viewport.
   ══════════════════════════════════════════════════════════════════ */
.login-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 100vh;
  background: #f8fafc;
}
.login-left-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  gap: 1rem;
  padding-top: max(2.5rem, env(safe-area-inset-top));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}
.login-left-pane .login-card {
  width: 100%;
  max-width: 440px;
}
.login-brand-tagline {
  font-size: 0.8rem;
  margin: -0.5rem 0 1.5rem;
}

/* Right pane — the hero. Gradient + soft pattern, dense but readable.
   `min-height: 100vh` + `align-items:center` keeps the hero vertically
   centred on tall screens; `overflow-y: auto` is a safety net for
   short laptop viewports — the hero scrolls inside its own column so
   the login form on the left ALWAYS stays visible without scroll. */
.login-right-pane {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden auto;
  max-height: 100vh;
}
.login-right-pane::before {
  /* Subtle dot pattern — adds depth without loading an image.
     Renders at ~1kb; no image request. */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(14,165,233,0.18) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(99,102,241,0.15) 0, transparent 40%),
    radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: auto, auto, 20px 20px;
  pointer-events: none;
}
.login-hero-inner {
  position: relative;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Compact variant — used on the login page so every section is
   visible without scrolling. Tighter gap, max-width opened up so the
   2-column rows have room, and section spacing is rhythmically
   smaller than the default hero. */
.login-hero-compact {
  max-width: 720px;
  gap: 0.55rem;
  padding-bottom: 0;
}
.login-hero-compact .login-hero-top {
  display: flex; flex-direction: column; gap: 0.35rem;
}
.login-hero-compact .login-hero-badge {
  font-size: 0.68rem; padding: 0.2rem 0.6rem;
}
.login-hero-compact .login-hero-headline {
  font-size: 1.35rem; line-height: 1.18;
}
.login-hero-compact .login-hero-sub {
  font-size: 0.8rem; line-height: 1.45; margin: 0;
}

/* Two-column row primitive used by industries|tailor and
   quote|contact. Equal columns by default, with a graceful collapse
   when the panel narrows. */
.login-hero-row-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0.875rem;
  align-items: stretch;
}
@media (max-width: 980px) {
  .login-hero-row-2col {
    grid-template-columns: 1fr;
  }
}

/* Compact stat tiles — half the vertical weight of the default. */
.login-hero-compact .login-hero-stats {
  margin-top: 0; gap: 0.5rem;
}
.login-hero-compact .login-hero-stat {
  padding: 0.4rem 0.55rem;
}
.login-hero-compact .login-hero-stat-value {
  font-size: 1rem; margin-bottom: 0; line-height: 1.1;
}
.login-hero-compact .login-hero-stat-label {
  font-size: 0.62rem; line-height: 1.25;
}

/* Features grid — tighter padding + smaller body so 2x3 fits in <
   one third of the panel height. */
.login-hero-features-grid {
  margin: 0; gap: 0.35rem;
}
.login-hero-features-grid .login-hero-feature {
  padding: 0.3rem 0.4rem;
}
.login-hero-features-grid .login-hero-feature-icon {
  width: 22px; height: 22px; font-size: 0.85rem;
}
.login-hero-features-grid .login-hero-feature-title {
  font-size: 0.74rem; margin-bottom: 0;
}
.login-hero-features-grid .login-hero-feature-body {
  font-size: 0.66rem; line-height: 1.3;
}

/* Inside the 2-col row: industries needs to wrap densely */
.login-hero-compact .login-hero-industries {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  min-height: 0;
}
.login-hero-compact .login-hero-industries-label {
  margin-bottom: 0.4rem;
  font-size: 0.65rem;
}
.login-hero-compact .login-hero-industries-chips {
  gap: 0.25rem;
}
.login-hero-compact .login-hero-industries-chips .chip {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cbd5e1;
}
.login-hero-compact .chip-accent {
  background: rgba(14,165,233,0.18);
  border-color: rgba(14,165,233,0.35);
  color: #e0f2fe;
}

/* Tailor block — smaller in compact mode, sits next to chips */
.login-hero-compact .login-hero-tailor {
  margin: 0;
  padding: 0.625rem 0.75rem;
}
.login-hero-compact .login-hero-tailor-headline {
  font-size: 0.8rem; margin-bottom: 0.2rem;
}
.login-hero-compact .login-hero-tailor-body {
  font-size: 0.72rem; line-height: 1.45;
}

/* Quote — slimmer in compact + sits next to contact */
.login-hero-compact .login-hero-quote {
  margin: 0;
  padding: 0.625rem 0.75rem;
}
.login-hero-compact .login-hero-quote p {
  font-size: 0.78rem; line-height: 1.4; margin-bottom: 0.25rem;
}
.login-hero-compact .login-hero-quote footer {
  font-size: 0.68rem;
}

/* Contact — single row layout (icon + label/value side by side) so
   both rows are visible without growing the column. */
.login-hero-compact .login-hero-contact {
  margin: 0;
  padding: 0.625rem 0.75rem;
}
.login-hero-compact .login-hero-contact-headline {
  font-size: 0.8rem; margin-bottom: 0.4rem;
}
.login-hero-compact .login-hero-contact-rows {
  gap: 0.3rem;
}
.login-hero-compact .login-hero-contact-row {
  padding: 0.35rem 0.5rem;
}
.login-hero-compact .login-hero-contact-icon {
  font-size: 0.95rem;
}
.login-hero-compact .login-hero-contact-label {
  font-size: 0.62rem;
}
.login-hero-compact .login-hero-contact-value {
  font-size: 0.82rem;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(14,165,233,0.15);
  color: #7dd3fc;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  width: fit-content;
  border: 1px solid rgba(14,165,233,0.2);
}
.login-hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.login-hero-headline {
  font-size: 2.2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: #f8fafc;
}
.login-hero-sub {
  font-size: 1rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0 0 0.5rem;
}

/* Stat strip */
.login-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-top: 0.25rem;
}
.login-hero-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.75rem;
}
.login-hero-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.15rem;
}
.login-hero-stat-label {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* Feature list */
.login-hero-features {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.login-hero-feature {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.login-hero-feature:hover {
  background: rgba(255,255,255,0.04);
}
.login-hero-feature-icon {
  font-size: 1.1rem;
  line-height: 1.2;
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(14,165,233,0.15);
  border-radius: 8px;
}
.login-hero-feature-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.125rem;
}
.login-hero-feature-body {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Industry strip */
.login-hero-industries {
  margin-top: 0.5rem;
}
.login-hero-industries-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.login-hero-industries-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.login-hero-industries-chips .chip {
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  padding: 0.2rem 0.625rem;
}

/* ── Horizontal histogram — appraisal / engagement distributions ── */
.hist {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 0.4rem 0;
}
.hist-row {
  display: grid;
  grid-template-columns: 52px 1fr 36px;
  align-items: center; gap: 0.6rem;
}
.hist-label {
  font-size: 0.78rem; color: #475569;
  font-variant-numeric: tabular-nums;
}
.hist-bar-wrap {
  height: 16px; background: #f1f5f9; border-radius: 4px;
  overflow: hidden;
}
.hist-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #4338ca 100%);
  transition: width 0.25s ease;
  min-width: 2px;
}
.hist-count {
  font-size: 0.82rem; font-weight: 600; color: #0f172a;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Cascade tree — goals / orgchart / appraisal ─────────────────── */
.cascade { list-style: none; padding: 0; margin: 0; }
.cascade ul { list-style: none; padding: 0 0 0 1.25rem; margin: 0; position: relative; }
.cascade ul::before {
  content: ""; position: absolute; left: 0.5rem; top: 0; bottom: 0;
  border-left: 1px dashed #cbd5e1;
}
.cascade li {
  padding: 0.5rem 0 0.5rem 0.6rem;
  position: relative;
}
.cascade ul > li::before {
  content: ""; position: absolute; left: -0.75rem; top: 1.1rem;
  width: 0.7rem; border-top: 1px dashed #cbd5e1;
}
.cascade-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
}
.cascade-card:hover { border-color: #cbd5e1; }
.cascade-title { font-size: 0.85rem; font-weight: 600; color: #0f172a; }
.cascade-meta  { font-size: 0.7rem;  color: #64748b; }
.cascade-progress {
  width: 80px; height: 6px;
  background: #f1f5f9; border-radius: 3px; overflow: hidden;
}
.cascade-progress-fill {
  height: 100%; background: #22c55e;
}

/* ── Sparkline trend — eNPS, monthly surveys, etc ────────────────── */
.sparkline {
  display: flex; align-items: flex-end; gap: 2px;
  height: 40px;
}
.sparkline-bar {
  flex: 1; min-width: 4px; max-width: 18px;
  background: #6366f1; border-radius: 2px 2px 0 0;
  transition: height 0.2s ease;
}
.sparkline-bar.positive { background: #22c55e; }
.sparkline-bar.negative { background: #dc2626; }

/* ── Goal audit rows — surface OKR-programme health issues ──────── */
.goal-audit {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.goal-audit-row {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
}
.goal-audit-row.alert-error  { border-left-color: #dc2626; background: #fef2f2; }
.goal-audit-row.alert-warning { border-left-color: #f59e0b; background: #fffbeb; }
.goal-audit-row.alert-info   { border-left-color: #6366f1; background: #eef2ff; }
.goal-audit-icon {
  font-size: 1.1rem; flex-shrink: 0;
}
.goal-audit-body {
  flex: 1; min-width: 0;
}
.goal-audit-headline {
  font-size: 0.875rem; font-weight: 600; color: #0f172a;
}
.goal-audit-text {
  font-size: 0.75rem; color: #64748b; line-height: 1.4;
}

/* ── Console tabs — tabbed admin pages (expense, asset, …) ──────── */
.console-tabs {
  margin-top: 1.25rem;
}
.console-tabs .tab-row {
  display: flex; gap: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.console-tabs .tab-row button {
  padding: 0.5rem 0.875rem;
  background: transparent; border: 0;
  font-size: 0.875rem; font-weight: 500;
  color: #64748b; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.console-tabs .tab-row button:hover {
  color: #0f172a;
}
.console-tabs .tab-row button.tab-active {
  color: #6366f1; border-bottom-color: #6366f1;
  font-weight: 600;
}

/* Flagged claim row (over limit / missing receipt / duplicate) */
.claim-row.claim-flagged td:first-child {
  border-left: 3px solid #f59e0b;
}

/* Balance card — used in /loan/me, /leave/me, console reimburse tab */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.balance-card {
  padding: 0.75rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.balance-type {
  font-size: 0.7rem; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.balance-num {
  font-size: 1.4rem; font-weight: 700; color: #0f172a;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.balance-meta {
  font-size: 0.72rem; margin-top: 0.2rem;
}

/* Mini bar chart — used by expense trends tab */
.bar-chart {
  display: flex; align-items: flex-end;
  gap: 0.4rem;
  height: 140px;
  padding: 0 0.5rem;
}
.bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 0.25rem;
  height: 100%;
}
.bar {
  width: 100%; max-width: 28px;
  background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  margin-top: auto;
}
.bar-label {
  font-size: 0.65rem; color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* Progress bar — generic, also used by trend variance + onboarding */
.progress-bar {
  width: 100%; height: 6px;
  background: #f1f5f9;
  border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: #22c55e;
  transition: width 0.2s ease;
}
.progress-bar-over {
  background: #dc2626;
}

/* ── Empty pipeline state — recruitment kanban with no candidates ─ */
/* Surfaced when len(stages)>0 but every column is empty. Replaces
   the demoralising row of empty columns with concrete next-actions. */
.empty-pipeline {
  max-width: 880px; margin: 1rem auto 0;
}
.empty-pipeline-hero {
  text-align: center; padding: 1.25rem 1rem 1.5rem;
}
.empty-pipeline-icon {
  font-size: 2.5rem; line-height: 1; margin-bottom: 0.5rem;
}
.empty-pipeline-title {
  font-size: 1.25rem; font-weight: 650; color: #0f172a;
  margin: 0 0 0.4rem;
}
.empty-pipeline-sub {
  font-size: 0.9rem; color: #64748b; max-width: 540px;
  margin: 0 auto; line-height: 1.5;
}
.empty-pipeline-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.empty-pipeline-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 0.875rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.empty-pipeline-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  transform: translateY(-1px);
}
.empty-pipeline-card-icon {
  font-size: 1.4rem; line-height: 1;
}
.empty-pipeline-card-body {
  flex: 1;
}
.empty-pipeline-card-title {
  font-size: 0.9rem; font-weight: 600; color: #0f172a;
  margin-bottom: 0.2rem;
}
.empty-pipeline-card-text {
  font-size: 0.78rem; color: #64748b; line-height: 1.45; margin: 0;
}
.empty-pipeline-card-cta {
  display: flex; justify-content: flex-end;
}
.empty-pipeline-fallback {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.empty-pipeline-fallback summary {
  font-size: 0.8rem; color: #64748b; cursor: pointer;
  padding: 0.4rem 0.6rem; user-select: none;
  display: inline-block;
}
.empty-pipeline-fallback summary:hover {
  color: #475569;
}

/* "Don't see your industry?" tailor block — sits between chips and
   quote; intentionally accent-coloured so it doesn't blend in. */
.login-hero-tailor {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  border: 1px dashed rgba(14,165,233,0.4);
  background: rgba(14,165,233,0.06);
  border-radius: 10px;
}
.login-hero-tailor-headline {
  font-size: 0.9rem; font-weight: 600; color: #e0f2fe;
  margin-bottom: 0.25rem;
}
.login-hero-tailor-body {
  font-size: 0.825rem; color: #cbd5e1; line-height: 1.5; margin: 0;
}

/* Contact block — call vs WhatsApp clearly distinguished */
.login-hero-contact {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.login-hero-contact-headline {
  font-size: 0.9rem; font-weight: 600; color: #e2e8f0;
  margin-bottom: 0.5rem;
}
.login-hero-contact-rows {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.login-hero-contact-row {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.login-hero-contact-row:hover {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.25);
  text-decoration: none;
  transform: translateX(2px);
}
.login-hero-contact-icon {
  font-size: 1.05rem;
}
.login-hero-contact-label {
  display: block; font-size: 0.7rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.login-hero-contact-value {
  display: block; font-size: 0.95rem; font-weight: 600; color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

/* Testimonial */
.login-hero-quote {
  margin: 0.75rem 0 0;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid #0ea5e9;
  border-radius: 0 8px 8px 0;
}
.login-hero-quote p {
  font-size: 0.925rem;
  color: #e2e8f0;
  font-style: italic;
  line-height: 1.45;
  margin: 0 0 0.375rem;
}
.login-hero-quote footer {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Demo tenant shortcut */
.login-demo-shortcut {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
}
.login-demo-shortcut summary {
  font-size: 0.825rem;
  color: #0ea5e9;
  cursor: pointer;
  list-style: none;
  padding: 0.25rem 0;
  font-weight: 500;
}
.login-demo-shortcut summary::-webkit-details-marker { display: none; }
.login-demo-shortcut summary:hover { color: #0284c7; }
.login-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.login-demo-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  padding: 0.4rem 0.625rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.login-demo-btn:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
  color: #0f172a;
}

/* Footer on left pane */
.login-left-pane .login-footer {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.login-left-pane .login-footer .sep { opacity: 0.5; }
.login-left-pane .login-footer a {
  color: #64748b;
  text-decoration: none;
}
.login-left-pane .login-footer a:hover { color: #0f172a; }

/* Responsive — hide the hero on narrow screens so the login
   card takes the full viewport. Mobile users are returning, not
   evaluating. */
@media (max-width: 960px) {
  .login-split { grid-template-columns: 1fr; }
  .login-right-pane { display: none; }
}
@media (max-width: 640px) {
  .login-hero-stats { grid-template-columns: 1fr; }
  .login-hero-features { grid-template-columns: 1fr; }
  .login-demo-grid { grid-template-columns: 1fr; }
}

/* ── Pipeline picker + talent pool ─────────────────────────────── */
.pipeline-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.875rem;
}
.pipeline-pick-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem; text-decoration: none; color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pipeline-pick-card:hover {
  border-color: #0ea5e9;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.08);
}
.pipeline-pick-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.5rem;
}
.pipeline-pick-stats {
  display: flex; gap: 1.25rem; margin-top: 0.5rem;
  padding-top: 0.5rem; border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

/* ── SMS integration page ─────────────────────────────────────── */
.sms-layout {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem;
}
@media (max-width: 900px) {
  .sms-layout { grid-template-columns: 1fr; }
}
.sms-main { display: flex; flex-direction: column; gap: 1rem; }
.sms-side { display: flex; flex-direction: column; gap: 1rem; }
.sms-provider-fields {
  padding: 0.75rem; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px; margin: 0.75rem 0;
}
.sms-test-form { display: flex; flex-direction: column; gap: 0.5rem; }
.sms-usage-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.sms-usage-stat {
  background: #f8fafc; padding: 0.625rem; border-radius: 6px;
}
.sms-usage-label {
  font-size: 0.7rem; text-transform: uppercase; color: #64748b;
  letter-spacing: 0.5px;
}
.sms-usage-value { font-size: 1.4rem; font-weight: 700; }
.sms-cap-bar { margin-top: 0.75rem; }
.sms-cap-track {
  height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden;
  margin-bottom: 0.25rem;
}
.sms-cap-fill {
  height: 100%; background: linear-gradient(90deg, #22c55e 0%, #eab308 60%, #dc2626 100%);
  transition: width 0.4s ease;
}

/* ── Modal (shared primitive) ────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 1rem; animation: fadeIn 0.15s ease;
}
.modal-dialog {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.35);
  animation: modalIn 0.18s ease;
}
.modal-dialog-wide { max-width: 760px; }
.modal-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-size: 1.0625rem; font-weight: 600; color: #0f172a; margin: 0;
}
.modal-close {
  background: none; border: none; cursor: pointer; color: #64748b;
  padding: 0.25rem; border-radius: 6px; line-height: 0;
}
.modal-close:hover { background: #f1f5f9; color: #0f172a; }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { padding: 1.25rem; overflow-y: auto; }
/* When a modal contains a combobox, switch the dialog's scroll-
   container from modal-body to the dialog itself. Modal-body's
   overflow:auto otherwise clips the absolute-positioned dropdown.
   The dropdown itself uses position:fixed to escape every parent's
   containing block; its top/left are set by the combobox Alpine
   helper via inline style bound to the input's bounding rect. */
.modal-has-combobox .modal-body { overflow: visible; }
.modal-has-combobox { overflow-y: auto; }
.combobox-list-fixed {
  position: fixed;
  max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.18);
  z-index: 80;
  padding: 0.25rem;
  min-width: 220px;
}
.modal-footer {
  padding: 0.875rem 1.25rem; border-top: 1px solid #e2e8f0;
  display: flex; justify-content: flex-end; gap: 0.5rem;
}
.modal-error {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  padding: 0.625rem 0.875rem; border-radius: 8px; font-size: 0.875rem;
  margin-bottom: 0.875rem;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Tabs (shared) ───────────────────────────────────────────────── */
.tab-strip {
  display: flex; gap: 0.25rem; border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
}
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 0.625rem 1rem; font-size: 0.9375rem; color: #64748b;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 500; transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #0f172a; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }

/* ── Action button in table rows ─────────────────────────────────── */
.row-actions { display: flex; gap: 0.375rem; justify-content: flex-end; }
.row-action {
  background: none; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 0.25rem 0.625rem; font-size: 0.8125rem; cursor: pointer;
  color: #475569; transition: all 0.15s;
}
.row-action:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }
.row-action-danger { color: #b91c1c; border-color: #fecaca; }
.row-action-danger:hover { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.row-action-primary { color: #1d4ed8; border-color: #bfdbfe; }
.row-action-primary:hover { background: #eff6ff; color: #1e40af; }

/* ── Detail definition list (for detail modals) ──────────────────── */
.detail-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
.detail-dl dt { color: #64748b; font-size: 0.875rem; }
.detail-dl dd { color: #0f172a; font-size: 0.9375rem; margin: 0; font-weight: 500; }

/* ── Attention queue — neutral rows, severity-coded left rail ─────── */
/* Rows stay calm even when many fire at once: the only color comes
   from a 3px left rail + a small count badge. The container caps
   height and scrolls with subtle fade hints, so a busy day does not
   push the rest of the dashboard off-screen. */
.attention-queue {
  /* Works as both <div> (dashboard) and <ul> (per-feature landings),
     so reset list defaults explicitly. */
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 0.25rem 2px 0; /* room for scrollbar + focus ring */
  mask-image: linear-gradient(to bottom,
              transparent 0, #000 12px,
              #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,
              transparent 0, #000 12px,
              #000 calc(100% - 12px), transparent 100%);
}
.attention-row {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.75rem 0.625rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: #0f172a;
  overflow: hidden;
  transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.12s ease;
}
.attention-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  text-decoration: none;
  transform: translateX(2px);
}
.attention-row:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.attention-row-rail {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #6366f1;
}
.attention-row-high   .attention-row-rail { background: #dc2626; }
.attention-row-normal .attention-row-rail { background: #6366f1; }
.attention-row-info   .attention-row-rail { background: #64748b; }

.attention-row-body {
  display: flex; flex-direction: column; gap: 0.125rem;
  flex: 1; min-width: 0;
}
.attention-row-title {
  font-size: 0.875rem; font-weight: 550; color: #0f172a;
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attention-row-sub {
  font-size: 0.75rem; color: #64748b; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attention-row-count {
  flex-shrink: 0;
  min-width: 1.75rem; padding: 0.125rem 0.5rem;
  background: #f1f5f9; color: #475569;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.attention-row-high .attention-row-count {
  background: #fef2f2; color: #b91c1c;
}
.attention-row-chevron {
  width: 14px; height: 14px; flex-shrink: 0;
  color: #94a3b8;
}
.attention-row:hover .attention-row-chevron { color: #475569; }

@media (max-width: 480px) {
  .attention-row-sub { display: none; }
  .attention-row-chevron { display: none; }
}

/* Slim scrollbar — same treatment as the rest of the app */
.attention-queue::-webkit-scrollbar { width: 6px; }
.attention-queue::-webkit-scrollbar-track { background: transparent; }
.attention-queue::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 3px;
}
.attention-queue::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═════ Dashboard primitives ═════
   Shared by learning_insights, executive_scorecard, attrition_risk,
   and skills_gap dashboards. Kept deliberately small: a sparkline
   column bar chart and a horizontal progress track. No external
   charting library — CSS does the job at 30 KB. */
.spark-grid {
  display: flex; align-items: flex-end; gap: 0.4rem;
  height: 120px; padding: 0.25rem 0;
}
.spark-col {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 24px;
}
.spark-bar {
  width: 100%;
  height: var(--h, 0%);
  min-height: 2px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 3px 3px 0 0;
  transition: height 300ms ease-out;
}
.spark-label {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progress-track {
  height: 10px; width: 100%;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease-out;
}
.progress-green  { background: #10b981; }
.progress-yellow { background: #f59e0b; }
.progress-red    { background: #ef4444; }

/* Heatmap cells for skills-gap dashboard. Strong colour = deep gap. */
.heat-cell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 32px; padding: 0.25rem 0.5rem;
  border-radius: 4px; font-size: 0.8rem; font-weight: 500;
  color: #0f172a;
}
.heat-0 { background: #f1f5f9; color: #64748b; }
.heat-1 { background: #fef3c7; }
.heat-2 { background: #fed7aa; }
.heat-3 { background: #fecaca; }
.heat-4 { background: #fca5a5; color: #fff; }
.heat-5 { background: #ef4444; color: #fff; }

/* ═════ Signup ═════ */
.signup-shell {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}
@media (max-width: 800px) {
  .signup-shell { grid-template-columns: 1fr; }
}
.signup-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}
.signup-header { text-align: center; margin-bottom: 2rem; }
.signup-brand {
  font-size: 1rem; letter-spacing: 0.06em; color: #2563eb; font-weight: 600; margin-bottom: 0.25rem;
}
.signup-title { font-size: 1.75rem; font-weight: 600; margin: 0 0 0.5rem; }
.signup-sub { color: #64748b; margin: 0; }
.signup-form .form-group { margin-bottom: 1.1rem; }
.signup-cta { width: 100%; padding: 0.85rem 1rem; font-size: 1rem; }
.signup-side {
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0; border-radius: 12px; padding: 2rem;
  display: flex; flex-direction: column; justify-content: center;
}
.signup-side-title { color: #fff; font-size: 1.1rem; margin: 0 0 1rem; }
.signup-bullets { list-style: none; padding: 0; margin: 0; }
.signup-bullets li { padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.9rem; }
.signup-bullets li:last-child { border-bottom: none; }
.signup-bullets strong { color: #fff; }
.signup-checklist { background: #f8fafc; padding: 1rem 1.25rem; border-radius: 8px; }
.signup-checklist h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.signup-checklist ol { margin: 0; padding-left: 1.2rem; color: #475569; font-size: 0.9rem; }
.signup-checklist li { padding: 0.25rem 0; }

/* ═════ Form Builder Studio (WPForms / Typeform / Gravity Forms parity) ═════
   Polished 3-column layout. Palette left, canvas middle, side panel right.
   Cards have subtle shadows, hover states, drag affordances. Mobile collapses
   to a stacked single column with palette in a slide-out drawer (future). */
.fb-studio {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
@media (max-width: 1100px) { .fb-studio { grid-template-columns: 220px 1fr; } .fb-side-panel-extra { display: none; } }
@media (max-width: 720px)  { .fb-studio { grid-template-columns: 1fr; } .fb-palette { display: none; } }

.fb-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1rem 0;
}
.fb-header .toolbar-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Left palette */
.fb-palette {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem;
  position: sticky; top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.fb-palette h3 { font-size: 0.9rem; margin: 0 0 0.25rem; color: #0f172a; }
.fb-palette > p.muted { font-size: 0.75rem; margin: 0 0 0.75rem; }
.fb-palette-group { margin-bottom: 1rem; }
.fb-palette-group h4 { font-size: 0.7rem; margin: 0.5rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.fb-palette-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
}
.fb-palette-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.65rem 0.4rem; gap: 0.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: grab;
  transition: all 150ms ease-out;
  text-align: center;
}
.fb-palette-item:hover {
  background: #fff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}
.fb-palette-item:active { cursor: grabbing; }
.fb-palette-icon { font-size: 1.2rem; line-height: 1; color: #2563eb; }
.fb-palette-label { font-size: 0.72rem; color: #475569; line-height: 1.2; }

/* Canvas */
.fb-canvas-col { min-width: 0; }
.fb-canvas {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  min-height: 500px;
  display: flex; flex-direction: column; gap: 1rem;
}
.fb-form-meta { border-bottom: 1px solid #f1f5f9; padding-bottom: 1rem; margin-bottom: 0.5rem; }
.fb-title-input {
  width: 100%;
  font-size: 1.5rem; font-weight: 600;
  border: none; outline: none; padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 150ms;
}
.fb-title-input:hover, .fb-title-input:focus { border-bottom-color: #cbd5e1; }
.fb-desc-input {
  width: 100%; margin-top: 0.5rem;
  border: none; outline: none; resize: vertical;
  font-size: 0.9rem; color: #475569;
  font-family: inherit;
}

/* Field rows on the canvas */
.fb-field-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  transition: all 150ms;
  position: relative;
}
.fb-field-row:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.fb-field-row.is-selected {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}
.fb-field-row.dnd-dragging { opacity: 0.4; }
.fb-field-handle {
  cursor: grab; color: #cbd5e1; padding-top: 0.25rem;
  font-size: 1rem; line-height: 1;
}
.fb-field-handle:active { cursor: grabbing; }
.fb-field-body { flex: 1; min-width: 0; }
.fb-field-name { font-weight: 600; font-size: 0.95rem; color: #0f172a; }
.fb-field-type {
  display: inline-block;
  font-size: 0.65rem; font-weight: 500;
  padding: 0.1rem 0.45rem;
  background: #e0f2fe; color: #0369a1;
  border-radius: 999px;
  margin-left: 0.5rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.fb-field-required { color: #dc2626; margin-left: 0.25rem; }
.fb-field-help { font-size: 0.8rem; color: #64748b; margin-top: 0.15rem; }
.fb-field-actions {
  display: flex; gap: 0.25rem;
  opacity: 0; transition: opacity 150ms;
}
.fb-field-row:hover .fb-field-actions, .fb-field-row.is-selected .fb-field-actions { opacity: 1; }
.fb-field-action-btn {
  background: none; border: none; cursor: pointer;
  color: #64748b; padding: 0.25rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.fb-field-action-btn:hover { background: #fff; color: #2563eb; }
.fb-field-action-btn.is-danger:hover { color: #dc2626; }

/* Drop zone hint */
.fb-canvas-empty {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #64748b;
}
.fb-canvas-empty strong { color: #0f172a; display: block; margin-bottom: 0.25rem; }

/* Right side panel: properties + usage + version history */
.fb-side {
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.fb-side .card { background: #fff; }
.fb-properties h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.fb-properties .form-group { margin-bottom: 0.75rem; }
.fb-properties .form-input { font-size: 0.85rem; padding: 0.4rem 0.55rem; }
.fb-properties small { font-size: 0.7rem; color: #94a3b8; }
.fb-properties .toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.3rem 0; font-size: 0.85rem;
}
.fb-properties .toggle-row label { color: #475569; }

/* Usage cards */
.fb-usage-item {
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
  font-size: 0.85rem;
}
.fb-usage-item strong { color: #0f172a; display: block; }
.fb-usage-item .muted { font-size: 0.75rem; }

/* Preview pane */
.fb-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
}
.fb-preview-modes {
  display: inline-flex;
  background: #f1f5f9; border-radius: 8px; padding: 0.2rem;
  margin-bottom: 1rem;
}
.fb-preview-modes button {
  background: none; border: none; cursor: pointer;
  padding: 0.35rem 0.85rem; font-size: 0.8rem;
  border-radius: 6px; color: #475569;
}
.fb-preview-modes button.is-active {
  background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Compatibility shims for the existing fb-canvas-field classes */
.fb-field-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.fb-canvas-field {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 150ms;
  cursor: grab;
}
.fb-canvas-field:hover { border-color: #94a3b8; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.fb-canvas-field:active { cursor: grabbing; }
.fb-field-summary {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 0.85rem;
}
.dnd-handle {
  cursor: grab; color: #cbd5e1; padding-top: 0.2rem;
  font-size: 0.95rem; line-height: 1; user-select: none;
}
.fb-field-identity { flex: 1; min-width: 0; }
.fb-field-label-line { display: flex; align-items: center; gap: 0.4rem; }
.fb-field-label-line strong { font-size: 0.95rem; color: #0f172a; }
.field-required { color: #dc2626; font-weight: 600; }
.fb-field-controls { display: flex; gap: 0.25rem; }
.fb-field-properties {
  border-top: 1px solid #f1f5f9;
  padding: 0.85rem;
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
}
.fb-props-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.fb-props-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: #475569; }
.fb-props-grid input[type="text"], .fb-props-grid input[type="number"], .fb-props-grid textarea {
  font-size: 0.85rem; padding: 0.4rem 0.55rem;
  border: 1px solid #e2e8f0; border-radius: 6px; outline: none;
  font-family: inherit;
}
.fb-props-grid input:focus, .fb-props-grid textarea:focus {
  border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.fb-props-grid label.checkbox-label { flex-direction: row; align-items: center; gap: 0.5rem; }
.fb-conditional {
  margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #e2e8f0;
}
.fb-conditional summary { cursor: pointer; font-size: 0.8rem; color: #2563eb; }
.fb-conditional-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.fb-empty-canvas {
  border: 2px dashed #cbd5e1; border-radius: 8px;
  padding: 2.5rem 1rem; text-align: center; color: #64748b;
}
.fb-preview-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.fb-preview-frame {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem;
  background: #fafafa;
}
.fb-preview-mobile  { max-width: 380px; margin: 0 auto; }
.fb-preview-print   { max-width: 720px; margin: 0 auto; background: #fff; }
.field-input-sm { font-size: 0.8rem; padding: 0.3rem 0.5rem; }

/* Sticky breadcrumb above the title */
.breadcrumb { font-size: 0.8rem; color: #64748b; text-decoration: none; }
.breadcrumb:hover { color: #2563eb; }

/* ═════ Messaging channel page (Slack-style) ═════ */
.msg-shell { padding-bottom: 2rem; }
.msg-header { padding: 1rem 0; }
.msg-grid { display: grid; grid-template-columns: 1fr 240px; gap: 1rem; }
@media (max-width: 800px) { .msg-grid { grid-template-columns: 1fr; } .msg-sidebar { order: -1; } }
.msg-thread {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  display: flex; flex-direction: column;
  height: 70vh; min-height: 480px;
}
.msg-list { flex: 1; overflow-y: auto; padding: 1rem; }
.msg-item { display: flex; gap: 0.75rem; padding: 0.5rem 0; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #2563eb; color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
}
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.8rem; }
.msg-content { font-size: 0.9rem; color: #0f172a; white-space: pre-wrap; word-break: break-word; }
.msg-mention-tag { background: #eff6ff; color: #1d4ed8; padding: 0 0.2rem; border-radius: 3px; font-weight: 500; }
.msg-composer {
  display: flex; gap: 0.5rem; align-items: flex-start;
  border-top: 1px solid #f1f5f9; padding: 0.75rem;
}
.msg-input-wrap { position: relative; flex: 1; }
.msg-input {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0; border-radius: 8px; outline: none;
  resize: none; font-family: inherit; font-size: 0.9rem;
}
.msg-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.msg-mention-pop {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 240px; overflow-y: auto;
  margin-bottom: 0.25rem;
}
.msg-mention-row {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.45rem 0.65rem;
  background: none; border: none; cursor: pointer;
  text-align: left; font-size: 0.85rem;
}
.msg-mention-row.is-active { background: #eff6ff; }
.msg-mention-icon { color: #64748b; width: 12px; }
.msg-mention-label { flex: 1; }
.msg-mention-meta { font-size: 0.75rem; }
.msg-sidebar {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem; max-height: 70vh; overflow-y: auto;
}
.msg-sidebar h3 { font-size: 0.85rem; margin: 0 0 0.5rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.msg-member { display: flex; gap: 0.5rem; padding: 0.4rem 0; align-items: center; font-size: 0.85rem; }

/* ═════ Admin extras (security / marketplace / pulse / statutory / data-quality) ═════ */
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .sec-grid { grid-template-columns: 1fr; } }
.sec-toggle {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 0; cursor: pointer;
}
.sec-toggle input { margin-top: 0.2rem; }
.sec-toggle strong { color: #0f172a; font-size: 0.9rem; }
.sec-toggle .muted { font-size: 0.75rem; }

.mp-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 1rem;
}
.mp-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 150ms;
}
.mp-card:hover { border-color: #94a3b8; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.mp-logo { font-size: 2rem; }
.mp-name { font-weight: 600; font-size: 1rem; color: #0f172a; }
.mp-vendor { font-size: 0.75rem; }
.mp-desc { font-size: 0.85rem; color: #475569; flex: 1; min-height: 3em; }
.mp-status { padding: 0.25rem 0; }
.mp-cta { display: flex; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #f1f5f9; }

.pulse-histogram {
  display: flex; align-items: flex-end; justify-content: space-around;
  height: 140px; padding: 0.5rem 0;
}
.pulse-bin { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 80px; }
.pulse-bin-bar {
  width: 50%; min-height: 2px; max-height: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 300ms ease-out;
}
.pulse-bin-bar.is-pos  { background: #10b981; }
.pulse-bin-bar.is-neut { background: #f59e0b; }
.pulse-bin-bar.is-neg  { background: #ef4444; }
.pulse-bin-label { margin-top: 0.4rem; text-align: center; font-size: 0.85rem; }
.pulse-bin-label .muted { font-size: 0.7rem; }

.pulse-score-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem;
}
.pulse-score-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem 0.5rem; gap: 0.25rem;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  cursor: pointer; transition: all 150ms;
}
.pulse-score-btn:hover { background: #fff; border-color: #2563eb; }
.pulse-score-btn.is-active {
  background: #eff6ff; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.pulse-score-num { font-size: 1.5rem; font-weight: 600; color: #0f172a; }
.pulse-score-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }

/* ═════ Super-admin platform-operations dashboard ═════ */
.super-grid-2 { /* responsive 2-col becomes 1-col on small screens */ }
@media (max-width: 900px) { .super-grid-2 { grid-template-columns: 1fr !important; } }

.industry-grid {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.industry-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px;
  font-size: 0.8rem; color: #334155;
}

.op-link-list { list-style: none; padding: 0; margin: 0; }
.op-link-list li { padding: 0.35rem 0; font-size: 0.9rem; }
.op-link-list a { color: #2563eb; text-decoration: none; font-weight: 500; }
.op-link-list a:hover { text-decoration: underline; }

/* ═════ Platform notification banner ═════ */
.platform-banner-stack {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 0.65rem 0.75rem 0;
}
.platform-banner {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  animation: bannerIn 200ms ease-out;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.platform-banner.is-info {
  background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe;
}
.platform-banner.is-warning {
  background: #fffbeb; color: #92400e; border-color: #fde68a;
}
.platform-banner.is-critical {
  background: #fef2f2; color: #991b1b; border-color: #fecaca;
}
.platform-banner-icon { font-size: 1.1rem; line-height: 1.2; flex-shrink: 0; }
.platform-banner-body { flex: 1; min-width: 0; }
.platform-banner-title { font-weight: 600; }
.platform-banner-msg {
  margin-top: 0.1rem; font-size: 0.825rem;
  line-height: 1.45; opacity: 0.85;
  word-break: break-word;
}
.platform-banner-dismiss {
  background: none; border: 0; cursor: pointer;
  font-size: 1.1rem; line-height: 1; color: inherit; opacity: 0.55;
  padding: 0 0.3rem;
}
.platform-banner-dismiss:hover { opacity: 1; }

/* ═════ Subscription suspension banner ═════ */
.suspension-banner-wrap {
  padding: 0.65rem 0.75rem 0;
}
.suspension-banner {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  border-width: 1px; border-style: solid;
  font-size: 0.9rem;
}
.suspension-banner.is-past-due {
  background: #fffbeb; color: #78350f; border-color: #fcd34d;
}
.suspension-banner.is-suspended {
  background: #fef2f2; color: #7f1d1d; border-color: #fca5a5;
}
.suspension-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.suspension-body { flex: 1; min-width: 0; }
.suspension-title { font-weight: 700; font-size: 0.95rem; }
.suspension-msg { margin-top: 0.15rem; font-size: 0.825rem; opacity: 0.9; }
.suspension-cta { white-space: nowrap; flex-shrink: 0; }

/* Read-only mode: dim mutating buttons when tenant is suspended.
   Pages can still surface state, just not change it. The CSS is
   advisory; a server-side guard is the real enforcement. */
body[data-tenant-status="suspended"] .btn-primary,
body[data-tenant-status="suspended"] button[type="submit"]:not(.suspension-cta) {
  opacity: 0.45;
  pointer-events: none;
}

/* ═════ Recognition feed ═════ */
.recog-feed {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.recog-card {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem; background: #f8fafc;
  border-radius: 8px; border-left: 3px solid #60a5fa;
}
.recog-badge {
  font-size: 1.5rem; line-height: 1; flex-shrink: 0;
}
.recog-body { flex: 1; min-width: 0; }
.recog-header { font-size: 0.9rem; }
.recog-message {
  margin: 0.3rem 0 0; font-size: 0.875rem; color: #334155;
  line-height: 1.5;
}
.recog-meta {
  display: flex; gap: 0.75rem; margin-top: 0.3rem;
  font-size: 0.75rem;
}
.recog-reactions {
  color: #2563eb; font-weight: 500;
}

/* ═════ Bulk import (WordPress-style progress) ═════ */
.bulk-import { max-width: 680px; margin: 0 auto; }
.bulk-dropzone {
  border: 2px dashed #cbd5e1; border-radius: 10px;
  padding: 2rem 1rem; text-align: center;
  cursor: pointer; transition: all 200ms;
}
.bulk-dropzone.is-dragging { border-color: #2563eb; background: #eff6ff; }
.bulk-dropzone-inner p { margin: 0.3rem 0; }
.bulk-browse-label { color: #2563eb; cursor: pointer; text-decoration: underline; }
.bulk-file-selected {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  font-weight: 500;
}

.bulk-progress-wrap { margin-top: 0.5rem; }
.bulk-progress-bar {
  height: 24px; width: 100%;
  background: #f1f5f9; border-radius: 12px;
  overflow: hidden; position: relative;
}
.bulk-progress-fill {
  height: 100%; border-radius: 12px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transition: width 400ms ease-out;
  position: relative;
}
.bulk-progress-fill::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.bulk-progress-fill.is-error { background: linear-gradient(90deg, #ef4444, #f87171); }
.bulk-progress-fill.is-finishing { background: linear-gradient(90deg, #10b981, #34d399); }
.bulk-progress-label {
  display: flex; justify-content: space-between; margin-top: 0.3rem;
  font-size: 0.85rem; font-weight: 600;
}
.bulk-stats {
  display: flex; gap: 2rem; font-size: 0.9rem;
}
.text-red { color: #dc2626; }

.bulk-result-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  margin-top: 1.5rem;
}
.bulk-result-card {
  text-align: center; padding: 1rem 0.5rem;
  border-radius: 8px;
}
.bulk-result-card.is-success { background: #ecfdf5; }
.bulk-result-card.is-error { background: #fef2f2; }
.bulk-result-card.is-neutral { background: #f8fafc; }
.bulk-result-num { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.bulk-result-label { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; }

/* ═════ Competitive feature pages ═════ */

/* Section heading — used between grouped cards */
.section-heading { font-size: 1rem; font-weight: 600; color: #334155; margin: 0 0 0.75rem; }

/* Progress bar fill color variants (AI screen, availability) */
.progress-bar-fill.fill-green { background: #22c55e; }
.progress-bar-fill.fill-yellow { background: #f59e0b; }
.progress-bar-fill.fill-red { background: #ef4444; }

/* Availability viewer timeline blocks */
.avail-free { background: #bbf7d0; }
.avail-busy { background: #fecaca; }
.avail-tentative { background: #fef08a; }

/* Dropzone hover state */
.dropzone-active { border-color: #2563eb !important; background: #eff6ff; }

/* Modal backdrop (shared by signal + retention modals) */
.modal-backdrop { animation: fadeIn 150ms ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Breadcrumb link already defined above. */
