/* ═══════════════════════════════════════════════════════════
   SecureEye — Accessibility & Components Stylesheet
   Large Font Mode, High Contrast Mode, Confirmation Modals,
   Wizard Progress, Tooltips, Onboarding
   ═══════════════════════════════════════════════════════════ */

/* ── Accessibility Toggle Buttons (Topbar) ───────────────── */
.accessibility-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.topbar-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.topbar-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   LARGE FONT MODE
   ═══════════════════════════════════════════════════════════ */
html.large-font-mode body { font-size: 18px; }
html.large-font-mode .nav-item { font-size: 16px; padding: 14px 22px; }
html.large-font-mode .nav-item .nav-icon { font-size: 20px; width: 24px; }
html.large-font-mode .nav-section-label { font-size: 12px; }
html.large-font-mode .stat-value { font-size: 32px; }
html.large-font-mode .stat-label { font-size: 14px; }
html.large-font-mode label { font-size: 15px; }
html.large-font-mode .form-control,
html.large-font-mode .form-select { font-size: 16px; padding: 12px 14px; }
html.large-font-mode .btn { font-size: 16px; padding: 12px 22px; }
html.large-font-mode .btn-sm { font-size: 14px; padding: 8px 16px; }
html.large-font-mode thead th { font-size: 13px; }
html.large-font-mode tbody td { font-size: 15px; }
html.large-font-mode .page-title { font-size: 19px; }
html.large-font-mode .breadcrumb { font-size: 14px; }
html.large-font-mode .card-header h3 { font-size: 17px; }
html.large-font-mode .topbar-time { font-size: 14px; }
html.large-font-mode .btn-logout { font-size: 15px; }
html.large-font-mode .sidebar-brand .brand-name { font-size: 18px; }
html.large-font-mode .sidebar-brand .brand-sub { font-size: 12px; }
html.large-font-mode .sidebar-user .user-name { font-size: 15px; }
html.large-font-mode .sidebar-user .user-role { font-size: 13px; }
html.large-font-mode .alert { font-size: 15px; }
html.large-font-mode .badge { font-size: 13px; padding: 4px 12px; }
html.large-font-mode .form-text { font-size: 14px; }
html.large-font-mode .audit-entry { font-size: 15px; }
html.large-font-mode .audit-time { font-size: 14px; }
html.large-font-mode .page-header h2 { font-size: 24px; }
html.large-font-mode .page-header p { font-size: 15px; }
html.large-font-mode .empty-state p { font-size: 16px; }
html.large-font-mode .topbar-btn { width: 42px; height: 42px; font-size: 19px; }

/* ═══════════════════════════════════════════════════════════
   HIGH CONTRAST MODE
   ═══════════════════════════════════════════════════════════ */
html.high-contrast-mode {
  --body-bg: #ffffff;
  --text-primary: #000000;
  --text-muted: #222222;
  --sidebar-bg: #000000;
  --sidebar-text: #ffffff;
  --sidebar-hover: #333333;
  --topbar-bg: #ffffff;
  --card-bg: #ffffff;
  --border: #000000;
}
html.high-contrast-mode .sidebar { border-right: 3px solid var(--primary); }
html.high-contrast-mode .nav-item { color: #cccccc; }
html.high-contrast-mode .nav-item:hover { color: #ffffff; background: #333; }
html.high-contrast-mode .nav-item.active { color: #ffffff; background: var(--primary); }
html.high-contrast-mode .nav-section-label { color: #999999; }
html.high-contrast-mode .card { border: 2px solid #000; }
html.high-contrast-mode .form-control,
html.high-contrast-mode .form-select {
  border: 2px solid #000;
  background: #fff;
  color: #000;
}
html.high-contrast-mode .form-control:focus,
html.high-contrast-mode .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,124,30,.4);
}
html.high-contrast-mode a { text-decoration: underline; }
html.high-contrast-mode .nav-item,
html.high-contrast-mode .btn,
html.high-contrast-mode .btn-logout { text-decoration: none; }
html.high-contrast-mode .topbar { border-bottom: 3px solid #000; }
html.high-contrast-mode .sidebar-user { border-top-color: #555; }
html.high-contrast-mode .sidebar-brand { border-bottom-color: #555; }
html.high-contrast-mode .sidebar-user .user-name { color: #fff; }
html.high-contrast-mode .sidebar-user .user-role { color: #ccc; }
html.high-contrast-mode thead th { background: #f0f0f0; color: #000; border-bottom: 2px solid #000; }
html.high-contrast-mode tbody td { border-bottom-color: #666; }
html.high-contrast-mode tbody tr:hover { background: #f5f5f5; }
html.high-contrast-mode .badge { border: 1px solid currentColor; }
html.high-contrast-mode .btn-primary { background: #000; color: #fff; border: 2px solid var(--primary); }
html.high-contrast-mode .btn-primary:hover { background: var(--primary); }
html.high-contrast-mode .btn-outline { border: 2px solid #000; }
html.high-contrast-mode .stat-card { border: 2px solid #000; }
html.high-contrast-mode .alert { border-width: 2px; }

/* ═══════════════════════════════════════════════════════════
   DARK MODE
   Overrides the theme variables, the main components, and the
   common hard-coded inline colors used across the templates.
   ═══════════════════════════════════════════════════════════ */
html.dark-mode {
  --primary-light: #2a1c0e;
  --topbar-bg:     #171c24;
  --body-bg:       #0f141a;
  --card-bg:       #171c24;
  --border:        #2b323d;
  --text-primary:  #e6e9ee;
  --text-muted:    #9aa6b4;
  --shadow:        0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.6), 0 2px 4px -1px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* Core surfaces */
html.dark-mode body:not(.login-page-body) { background: var(--body-bg); color: var(--text-primary); }
html.dark-mode .main-content { background: var(--body-bg); }
html.dark-mode .topbar { background: var(--topbar-bg); border-bottom-color: var(--border); }
html.dark-mode .card,
html.dark-mode .stat-card { background: var(--card-bg); border-color: var(--border); }
html.dark-mode .card-header { border-bottom-color: var(--border); }

/* Top bar controls */
html.dark-mode .topbar-btn { background: #222a35; border-color: var(--border); color: var(--text-muted); }
html.dark-mode .topbar-btn:hover { background: #2a3340; color: var(--primary); border-color: var(--primary); }
html.dark-mode .topbar-btn.active { background: var(--primary); color: #fff; }
html.dark-mode .btn-logout { background: #2a1c0e; color: #f5d0a0; }
html.dark-mode .btn-logout:hover { background: #3a2814; color: #ffe0c0; }

/* Page text */
html.dark-mode .page-title,
html.dark-mode .page-header h2,
html.dark-mode h1, html.dark-mode h2, html.dark-mode h3,
html.dark-mode h4, html.dark-mode h5 { color: var(--text-primary); }
html.dark-mode .breadcrumb,
html.dark-mode .page-header p,
html.dark-mode .topbar-time { color: var(--text-muted); }

/* Forms (skip auth pages — they have their own light input styling) */
html.dark-mode body:not(.login-page-body) .form-control,
html.dark-mode body:not(.login-page-body) .form-select,
html.dark-mode body:not(.login-page-body) input[type="text"],
html.dark-mode body:not(.login-page-body) input[type="password"],
html.dark-mode body:not(.login-page-body) input[type="email"],
html.dark-mode body:not(.login-page-body) input[type="number"],
html.dark-mode body:not(.login-page-body) input[type="date"],
html.dark-mode body:not(.login-page-body) input[type="datetime-local"],
html.dark-mode body:not(.login-page-body) input[type="search"],
html.dark-mode body:not(.login-page-body) textarea,
html.dark-mode body:not(.login-page-body) select {
  background: #11161d !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
html.dark-mode body:not(.login-page-body) .form-control::placeholder,
html.dark-mode body:not(.login-page-body) textarea::placeholder { color: #6b7785 !important; }
html.dark-mode body:not(.login-page-body) .form-control:focus,
html.dark-mode body:not(.login-page-body) .form-select:focus { border-color: var(--primary) !important; }

/* Tables */
html.dark-mode table { color: var(--text-primary); }
html.dark-mode thead th { background: #11161d !important; color: var(--text-muted) !important; border-bottom-color: var(--border) !important; }
html.dark-mode tbody td { border-bottom-color: var(--border) !important; color: var(--text-primary); }
html.dark-mode tbody tr:hover { background: #1d242d !important; }

/* Buttons */
html.dark-mode .btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border); }
html.dark-mode .btn-outline:hover { background: #222a35; }

/* Modals / overlays / onboarding */
html.dark-mode .se-modal,
html.dark-mode .onboarding-card { background: var(--card-bg) !important; color: var(--text-primary); }
html.dark-mode .se-modal-message,
html.dark-mode .onboarding-card p { color: var(--text-muted); }
html.dark-mode .btn-outline.se-modal-btn { color: var(--text-primary); }

/* Code / evidence references */
html.dark-mode code { background: #11161d !important; color: #f5d0a0 !important; }
html.dark-mode .evidence-ref { background: #2a1c0e; color: #f5d0a0; }

/* ── Catch common hard-coded inline colors used in templates ── */
/* Light card / panel backgrounds → dark surfaces */
html.dark-mode [style*="background:#fff"],
html.dark-mode [style*="background: #fff"],
html.dark-mode [style*="background:#ffffff"],
html.dark-mode [style*="background: #ffffff"],
html.dark-mode [style*="background:white"] { background-color: var(--card-bg) !important; }

html.dark-mode [style*="background:#f8fafc"],
html.dark-mode [style*="background: #f8fafc"],
html.dark-mode [style*="background:#f1f5f9"],
html.dark-mode [style*="background: #f1f5f9"],
html.dark-mode [style*="background:#faf6f2"],
html.dark-mode [style*="background:#f7f3ef"],
html.dark-mode [style*="background:#fafafa"],
html.dark-mode [style*="background:#f9fafb"] { background-color: #11161d !important; }

/* Dark text on (now) dark backgrounds → light text */
html.dark-mode [style*="color:#0f172a"],
html.dark-mode [style*="color: #0f172a"],
html.dark-mode [style*="color:#1a0f00"],
html.dark-mode [style*="color:#0f1419"],
html.dark-mode [style*="color:#111"],
html.dark-mode [style*="color:#1e293b"],
html.dark-mode [style*="color:#334155"],
html.dark-mode [style*="color:#0f172a"],
html.dark-mode [style*="color:#475569"] { color: #e6e9ee !important; }

/* Muted greys stay muted but readable on dark */
html.dark-mode [style*="color:#64748b"],
html.dark-mode [style*="color: #64748b"],
html.dark-mode [style*="color:#94a3b8"],
html.dark-mode [style*="color:#7a6050"],
html.dark-mode [style*="color:#a89070"] { color: #9aa6b4 !important; }

/* Light borders → dark borders */
html.dark-mode [style*="border:1px solid #e2e8f0"],
html.dark-mode [style*="border: 1px solid #e2e8f0"],
html.dark-mode [style*="border-bottom:1px solid #f1f5f9"],
html.dark-mode [style*="border-top:1px solid #f1f5f9"],
html.dark-mode [style*="border-bottom: 1px solid #e2e8f0"] { border-color: var(--border) !important; }

/* Login page in dark mode */
html.dark-mode .login-card { background: #171c24; color: var(--text-primary); }
html.dark-mode .login-card h2 { color: var(--text-primary); }
html.dark-mode .login-card .subtitle { color: var(--text-muted); }
html.dark-mode .login-logo .logo-text h1 { color: var(--text-primary); }
html.dark-mode .login-card label { color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   DARK MODE — Premium Visual Language overrides
   Fixes every hard-coded light color added by the new CSS block.
   ══════════════════════════════════════════════════════════════ */

/* Body: force dark bg, not warm parchment gradient (auth pages keep construction_bg.png) */
html.dark-mode body:not(.login-page-body) { background: var(--body-bg) !important; }

/* ── Cards ── */
html.dark-mode .card {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4) !important;
}
html.dark-mode .card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.6) !important;
}

/* Card header: remove cream gradient, use dark surface */
html.dark-mode .card-header {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border) !important;
}
html.dark-mode .card-header h3,
html.dark-mode .card h3 { color: var(--text-primary) !important; }

/* ── Topbar ── */
html.dark-mode .topbar {
  background: var(--topbar-bg) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}
html.dark-mode .topbar-left .page-title { color: var(--text-primary) !important; }
html.dark-mode .topbar-left .breadcrumb { color: var(--text-muted) !important; }

/* ── Stat cards ── */
html.dark-mode .stat-card {
  background: var(--card-bg) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.5) !important;
}
html.dark-mode .stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.6) !important; }
html.dark-mode .stat-card .stat-value { color: var(--text-primary) !important; }
html.dark-mode .stat-card .stat-label { color: var(--text-muted) !important; }
html.dark-mode .stat-card .stat-icon.neutral {
  background: #2a1c0e !important;
  color: #f5a652 !important;
  box-shadow: none !important;
}
html.dark-mode .stat-card.is-warn  .stat-value { color: var(--warning) !important; }
html.dark-mode .stat-card.is-alert .stat-value { color: var(--danger) !important; }

/* ── Chips ── */
html.dark-mode .chip {
  background: #1d242d !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}
html.dark-mode .chip i { color: var(--primary) !important; }

/* ── Task launcher ── */
html.dark-mode .task-launcher { background: var(--card-bg) !important; }
html.dark-mode .task-btn {
  background: #1d242d !important;
  border-color: var(--border) !important;
}
html.dark-mode .task-btn:hover { background: #222a35 !important; border-color: var(--primary) !important; }
html.dark-mode .task-verb { color: var(--text-primary) !important; }
html.dark-mode .task-frs  { color: var(--text-muted) !important; }
/* Task icons: all the light-orange inline backgrounds */
html.dark-mode .task-ico { background: #2a1c0e !important; color: var(--primary) !important; box-shadow: none !important; }

/* ── Buttons ── */
html.dark-mode .btn-primary {
  background: linear-gradient(135deg, #f59332, #e87c1e, #c96a10) !important;
  box-shadow: 0 6px 18px -8px rgba(232,124,30,.5) !important;
}
html.dark-mode .btn-primary:hover { color: #fff !important; }
html.dark-mode .btn-outline {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
html.dark-mode .btn-outline:hover { background: #222a35 !important; }
html.dark-mode .btn-logout {
  background: #2a1c0e !important;
  border-color: rgba(232,124,30,.25) !important;
  box-shadow: none !important;
  color: #f5d0a0 !important;
}
html.dark-mode .btn-logout:hover { background: #3a2814 !important; color: #ffe0c0 !important; }

/* ── Tables ── */
html.dark-mode thead th {
  background: #11161d !important;
  color: var(--text-muted) !important;
  border-bottom-color: var(--border) !important;
}
html.dark-mode tbody tr:hover { background: #1d242d !important; }

/* ── Topbar buttons ── */
html.dark-mode .topbar-btn {
  background: #222a35 !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}
html.dark-mode .topbar-btn:hover { background: #2a3340 !important; color: var(--primary) !important; }

/* ── Sidebar flyout menus ── */
html.dark-mode .rail-flyout {
  background: #171c24 !important;
  border-color: var(--border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}
html.dark-mode .rail-flyout::before { background: #171c24 !important; border-color: var(--border) !important; }
html.dark-mode .flyout-title { color: var(--text-muted) !important; }
html.dark-mode .flyout-link { color: var(--text-primary) !important; }
html.dark-mode .flyout-link i { color: var(--text-muted) !important; }
html.dark-mode .flyout-link:hover { background: #222a35 !important; color: var(--text-primary) !important; }
html.dark-mode .flyout-link.active { background: #2a1c0e !important; color: var(--primary) !important; }

/* ── Materials tabs ── */
html.dark-mode .mtab {
  background: #1d242d !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
html.dark-mode .mtab i,
html.dark-mode .mtab .mtab-sub { color: var(--text-muted) !important; }
html.dark-mode .mtab:hover { border-color: var(--primary) !important; background: #222a35 !important; }
html.dark-mode .mtab.active { background: var(--primary) !important; color: #fff !important; }
html.dark-mode .mtab.active i,
html.dark-mode .mtab.active .mtab-sub { color: rgba(255,255,255,.85) !important; }

/* ── Badges: muted dark versions of all status colours ── */
html.dark-mode .badge-pending    { background: #2a1c0e !important; color: #f5a652 !important; }
html.dark-mode .badge-open       { background: #2a1c0e !important; color: #f5a652 !important; }
html.dark-mode .badge-verified   { background: #052e16 !important; color: #6ee7b7 !important; }
html.dark-mode .badge-resolved   { background: #052e16 !important; color: #6ee7b7 !important; }
html.dark-mode .badge-online     { background: #052e16 !important; color: #6ee7b7 !important; }
html.dark-mode .badge-low        { background: #052e16 !important; color: #6ee7b7 !important; }
html.dark-mode .badge-flagged    { background: #3b0606 !important; color: #fca5a5 !important; }
html.dark-mode .badge-offline    { background: #3b0606 !important; color: #fca5a5 !important; }
html.dark-mode .badge-high       { background: #3b0606 !important; color: #fca5a5 !important; }
html.dark-mode .badge-critical   { background: #450a0a !important; color: #fca5a5 !important; }
html.dark-mode .badge-progress   { background: #1c1300 !important; color: #fcd34d !important; }
html.dark-mode .badge-in_progress { background: #1c1300 !important; color: #fcd34d !important; }
html.dark-mode .badge-medium     { background: #2a1c0e !important; color: #f5a652 !important; }
html.dark-mode .badge-maintenance { background: #1c1300 !important; color: #fcd34d !important; }
html.dark-mode .badge-closed     { background: #1a1f28 !important; color: #94a3b8 !important; }

/* ── Inline text color overrides — dark-coloured text on dark bg ── */
html.dark-mode [style*="color:#111827"],
html.dark-mode [style*="color: #111827"],
html.dark-mode [style*="color:#16181d"],
html.dark-mode [style*="color:#1a0f00"],
html.dark-mode [style*="color:#0f172a"] { color: var(--text-primary) !important; }

html.dark-mode [style*="color:#6b7280"],
html.dark-mode [style*="color: #6b7280"],
html.dark-mode [style*="color:#64748b"],
html.dark-mode [style*="color:#7a5a40"],
html.dark-mode [style*="color:#bf6012"] { color: var(--text-muted) !important; }

/* ── Inline background overrides — light creams/oranges ── */
html.dark-mode [style*="background:#ffe"],
html.dark-mode [style*="background: #ffe"],
html.dark-mode [style*="background:#fdd"],
html.dark-mode [style*="background: #fdd"],
html.dark-mode [style*="background:#fef"],
html.dark-mode [style*="background: #fef"],
html.dark-mode [style*="background:#ffa"],
html.dark-mode [style*="background: #ffa"] { background-color: #1d242d !important; }

/* ═══════════════════════════════════════════════════════════
   CONFIRMATION MODAL
   ═══════════════════════════════════════════════════════════ */
.se-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: se-fade-in .2s ease;
}

@keyframes se-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes se-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.se-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: se-slide-up .25s ease;
}

.se-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.se-modal-icon.icon-danger { background: #fee2e2; color: #ef4444; }
.se-modal-icon.icon-warning { background: #fef3c7; color: #f59e0b; }
.se-modal-icon.icon-info { background: #fff4e8; color: #e87c1e; }

.se-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1a0f00;
  margin-bottom: 8px;
}

.se-modal p {
  font-size: 14px;
  color: #7a6050;
  line-height: 1.6;
  margin-bottom: 24px;
}

.se-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.se-modal-actions .btn {
  min-width: 120px;
  justify-content: center;
  padding: 11px 24px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   WIZARD PROGRESS
   ═══════════════════════════════════════════════════════════ */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all .2s;
  cursor: default;
}

.wizard-step .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8ddd0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}

.wizard-step.active .step-number {
  background: var(--primary);
  color: #fff;
}

.wizard-step.active {
  color: var(--primary);
}

.wizard-step.completed .step-number {
  background: var(--success);
  color: #fff;
}

.wizard-step.completed {
  color: var(--success);
}

.wizard-connector {
  width: 40px;
  height: 2px;
  background: #e8ddd0;
  flex-shrink: 0;
}

.wizard-connector.active {
  background: var(--primary);
}

.wizard-connector.completed {
  background: var(--success);
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
  animation: se-slide-up .3s ease;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.wizard-nav .btn {
  min-width: 140px;
  justify-content: center;
}

.wizard-nav .btn i {
  font-size: 14px;
}

.wizard-field-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wizard-field-error i {
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   TOOLTIPS
   ═══════════════════════════════════════════════════════════ */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  cursor: help;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
}

.help-tip:hover::after,
.help-tip:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a0f00;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  pointer-events: none;
}

.help-tip:hover::before,
.help-tip:focus::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a0f00;
  z-index: 1001;
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING OVERLAY
   ═══════════════════════════════════════════════════════════ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: se-fade-in .3s ease;
}

.onboarding-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: se-slide-up .35s ease;
}

.onboarding-card .ob-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.onboarding-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.onboarding-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.onboarding-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e8ddd0;
  transition: all .2s;
}

.onboarding-dots .dot.active {
  background: var(--primary);
  width: 28px;
  border-radius: 5px;
}

.onboarding-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.onboarding-actions .btn { min-width: 120px; justify-content: center; }

.onboarding-skip {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   HELP / FAQ PAGE
   ═══════════════════════════════════════════════════════════ */
.faq-search {
  position: relative;
  margin-bottom: 24px;
}

.faq-search input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.faq-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,124,30,.15);
}

.faq-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

.faq-section {
  margin-bottom: 20px;
}

.faq-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow .15s;
}

.faq-item:hover { box-shadow: var(--shadow); }

.faq-question {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.faq-question:hover { color: var(--primary); }

.faq-question .faq-toggle {
  font-size: 18px;
  transition: transform .2s;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-question .faq-toggle {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: -2px;
}

.faq-item.open .faq-answer { display: block; }

.faq-no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 15px;
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   TABLET / MOBILE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════ */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-right: 12px;
  color: var(--primary);
  padding: 4px;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: inline-block; }
}

@media (max-width: 768px) {
  .wizard-progress { flex-wrap: wrap; gap: 8px; padding: 14px; }
  .wizard-connector { width: 20px; }
  .wizard-step { font-size: 12px; padding: 6px 10px; }
  .wizard-step .step-number { width: 28px; height: 28px; font-size: 12px; }
  .se-modal { padding: 24px 20px; }
  .se-modal h3 { font-size: 16px; }
  .se-modal p { font-size: 13px; }
  .onboarding-card { padding: 28px 20px; }
  .onboarding-card h2 { font-size: 18px; }
  .onboarding-card .ob-icon { width: 60px; height: 60px; font-size: 28px; }
  .audit-entry { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }
}

@media (max-width: 480px) {
  .topbar-time { display: none; }
  .accessibility-toggles { gap: 4px; }
  .topbar-btn { width: 32px; height: 32px; font-size: 14px; }
  .wizard-progress { flex-direction: column; align-items: stretch; }
  .wizard-connector { width: 100%; height: 2px; }
  .onboarding-card { padding: 24px 16px; }
}

/* Ensure minimum touch targets on mobile */
@media (max-width: 768px) {
  .btn { min-height: 44px; }
  .nav-item { min-height: 44px; }
  .form-control, .form-select { min-height: 44px; }
}

/* ═══════════════════════════════════════════════════════════
   FRIENDLY ERROR MESSAGES
   ═══════════════════════════════════════════════════════════ */
.field-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-error i { font-size: 14px; }
