/* ── 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;
}

/* ── 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. */

/* ── Mobile nav toggle ──────────────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  position: fixed; top: 1rem; left: 1rem;
  z-index: 50;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 0.5rem;
  cursor: pointer;
}
.mobile-nav-toggle svg {
  width: 20px; height: 20px; stroke: #334155; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 35;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@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); }
  .sidebar-overlay.open { display: block; }
  .mobile-nav-toggle { display: block; }
  .main-content { margin-left: 0; }
  .page-container { padding: 1.25rem; padding-top: 4rem; }
  .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 ─────────────────────────────────────────────── */
.attention-queue { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.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: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.profile-row { display: flex; flex-direction: column; gap: 0.125rem; }
.profile-row strong { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ── 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. */
.login-right-pane {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.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;
}

.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;
}

/* 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; }
.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; }
