/* Product mode selector styling - base fallback */
input[type="radio"][name="productMode"]:checked + div {
    border-color: #000000 !important;
    background-color: #f5f5f5 !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="radio"][name="productMode"]:checked + div .font-bold {
    color: #000000;
    transition: color 0.25s ease;
}
input[type="radio"][name="productMode"] + div {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html:not(.app-ready) #authWrapper,
html:not(.app-ready) #dashboardWrapper {
    opacity: 0;
}
#bootSplash {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0f1a;
    color: #ffffff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#bootSplash .box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}
#bootSplash .spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: rgba(255,255,255,.95);
    animation: bootSpin 0.8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
html.app-ready #bootSplash { display: none; }

:root {
  --font-inter: 'Inter', sans-serif;
  --text-strong: #111827;
  --text-muted: #6b7280;
  --badge-font-size: 10px;
  --badge-pad-x: 8px;
  --badge-pad-y: 2px;
  --badge-radius: 999px;
  --badge-border: 1px solid rgba(15,23,42,0.08);
  --badge-shadow: 0 1px 0 rgba(15,23,42,0.04);
  --badge-emerald-bg: #dcfce7;
  --badge-emerald-fg: #15803d;
  --badge-emerald-border: #bbf7d0;
  --badge-amber-bg: #fef3c7;
  --badge-amber-fg: #b45309;
  --badge-amber-border: #fde68a;
  --badge-red-bg: #fee2e2;
  --badge-red-fg: #b91c1c;
  --badge-red-border: #fecaca;
  --badge-slate-bg: #f1f5f9;
  --badge-slate-fg: #475569;
  --badge-slate-border: #e2e8f0;
  --status-new: #60a5fa;
  --status-acknowledged: #6366f1;
  --status-under_review: #a855f7;
  --status-awaiting_reporter: #f59e0b;
  --status-closed: #34d399;
  --status-spam: #94a3b8;
  --filter-bg: rgba(255,255,255,0.10);
  --filter-border: rgba(255,255,255,0.18);
  --filter-hover-bg: rgba(255,255,255,0.16);
  --filter-active-bg: rgba(15,23,42,0.55);
  --filter-radius: 1.5rem;
  --btn-font-size: 12px;
  --btn-pad-x: 12px;
  --btn-pad-y: 8px;
  --btn-radius: 12px;
  --btn-border: #e5e7eb;
  --btn-bg: #ffffff;
  --btn-hover-bg: #f3f4f6;
  --app-bg: #f3f4f6;
  --surface-bg: #ffffff;
  --surface-muted: #f9fafb;
  --surface-elevated: #ffffff;
  --text-main: #111827;
  --text-subtle: #6b7280;
  --border-subtle: #e5e7eb;
  --brand: #111827;
  --brand-contrast: #ffffff;
  --accent: #2563eb;
  --brand-soft: #f3f4f6;
  --hero-dark-start: #1a1a1a;
  --hero-dark-end: #000000;
}

body.mode-edu {
  --app-bg: #eef5ff;
  --surface-bg: #ffffff;
  --surface-muted: #f5f9ff;
  --border-subtle: #d7e6f5;
  --brand: #173b7a;
  --brand-contrast: #ffffff;
  --brand-soft: #e8f1ff;
  --accent: #0f766e;
  --hero-dark-start: #143260;
  --hero-dark-end: #0f2341;
}

body.mode-edu #sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 40%, #e4f0ff 100%) !important;
  border-right: 1px solid rgba(23, 59, 122, 0.10);
  box-shadow: 1px 0 20px rgba(23, 59, 122, 0.04);
}

body.mode-edu .glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(23, 59, 122, 0.08);
}
body.mode-edu .nav-item:not(.active):hover {
  background-color: rgba(15,118,110,0.06);
  color: #0f766e;
}
body.mode-edu .nav-item.active {
  background: linear-gradient(135deg, #173b7a, #0f766e);
  box-shadow: 0 4px 14px rgba(15,118,110,0.2);
}

body.mode-compliance {
  --app-bg: #f6f1ec;
  --surface-bg: #fffdfb;
  --surface-muted: #faf5f0;
  --border-subtle: #eadfd2;
  --brand: #6f1d1b;
  --brand-contrast: #fffaf5;
  --brand-soft: #f6e4df;
  --accent: #a16207;
  --hero-dark-start: #5b1c1c;
  --hero-dark-end: #2f0f10;
}

body.mode-compliance #sidebar {
  background: linear-gradient(180deg, #fffcf8 0%, #f8efe4 40%, #f2e4d4 100%) !important;
  border-right: 1px solid rgba(111, 29, 27, 0.10);
  box-shadow: 1px 0 20px rgba(111, 29, 27, 0.03);
}

body.mode-compliance .glass {
  background: rgba(255, 250, 245, 0.85);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(111, 29, 27, 0.08);
}
body.mode-compliance .nav-item:not(.active):hover {
  background-color: rgba(111, 29, 27, 0.05);
  color: #6f1d1b;
}
body.mode-compliance .nav-item.active {
  background: linear-gradient(135deg, #6f1d1b, #92400e);
  box-shadow: 0 4px 14px rgba(111, 29, 27, 0.2);
}

body { font-family: var(--font-inter); background-color: var(--app-bg); color: var(--text-main); }
html, body { max-width: 100%; overflow-x: hidden; }
body.theme-dark {
  --app-bg: #0b0f1a;
  --surface-bg: #0f172a;
  --surface-muted: #111827;
  --surface-elevated: #111827;
  --text-main: #e5e7eb;
  --text-subtle: #94a3b8;
  --text-strong: #e5e7eb;
  --text-muted: #94a3b8;
  --border-subtle: #1f2937;
  --brand: #e5e7eb;
  --brand-contrast: #0b0f1a;
  --accent: #38bdf8;
  --btn-bg: #0f172a;
  --btn-border: #1f2937;
  color: #e5e7eb;
}
body.theme-dark .glass {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
body.theme-dark .nav-item.active {
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(226,232,240,0.15);
}
body.theme-dark .nav-item:not(.active):hover {
  color: #e5e7eb;
  background-color: rgba(148,163,184,0.08);
  transform: translateX(2px);
}
body.theme-dark .bg-white { background-color: #0f172a !important; color: #e5e7eb; }
body.theme-dark .bg-gray-50 { background-color: #0b1220 !important; }
body.theme-dark .text-gray-900 { color: #e5e7eb !important; }
body.theme-dark .text-gray-800 { color: #e2e8f0 !important; }
body.theme-dark .text-gray-700 { color: #cbd5e1 !important; }
body.theme-dark .text-gray-600 { color: #cbd5e1 !important; }
body.theme-dark .text-gray-500 { color: #94a3b8 !important; }
body.theme-dark .border-gray-100 { border-color: #1f2937 !important; }
body.theme-dark .border-gray-200 { border-color: #1f2937 !important; }
body.theme-dark .shadow-sm { box-shadow: 0 8px 30px rgba(2, 6, 23, 0.35) !important; }

/* Dark theme auth overlay */
body.theme-dark .auth-overlay {
  background: linear-gradient(135deg, #0b0f1a 0%, #111827 40%, #0f172a 100%);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(99,102,241,0.06), transparent),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(56,189,248,0.05), transparent),
    linear-gradient(135deg, #0b0f1a 0%, #111827 40%, #0f172a 100%);
}
body.theme-dark #authWrapper [id^="view-"] {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.1),
    0 12px 24px rgba(0,0,0,0.15),
    0 24px 48px rgba(0,0,0,0.2);
}

/* Dark theme filter card refinements */
body.theme-dark .filter-card {
  background-color: #0f172a !important;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.theme-dark .filter-card:not(:disabled):hover {
  background-color: #111827 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
body.theme-dark .filter-card .filter-count { color: #e2e8f0 !important; }
body.theme-dark .filter-card .filter-label { color: #94a3b8 !important; }
body.theme-dark .filter-card .filter-hint { color: #64748b !important; }

/* Dark theme pro card light variant */
body.theme-dark .pro-card-light {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
}
body.theme-dark .pro-card-light .label-text { color: #94a3b8; }
body.theme-dark .pro-card-light .sub-metric { border-color: #1e293b; }

/* Dark theme notification panel */
body.theme-dark .notification-panel {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

/* Dark theme settings tabs */
body.theme-dark .settings-tab {
  color: #94a3b8;
}
body.theme-dark .settings-tab.active {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-dark .settings-tab:not(.active):hover {
  background: rgba(148,163,184,0.08);
  color: #e2e8f0;
}

/* Dark theme quick action buttons */
body.theme-dark .quick-action-btn {
  background: #0f172a;
  border-color: #1e293b;
}
body.theme-dark .quick-action-btn:hover {
  background: #1e293b;
  border-color: #334155;
}
body.theme-dark .quick-action-btn span { color: #e2e8f0; }

/* Dark theme onboarding card */
body.theme-dark .onboarding-card {
  background: #0f172a;
  border-color: #1e293b;
}
body.theme-dark .onboarding-progress { background: #1e293b; }
body.theme-dark .onboarding-progress-fill { background: #e2e8f0; }

/* Dark theme mobile bottom nav */
body.theme-dark .mobile-bottom-nav {
  background: #0b0f1a;
  border-top-color: #1e293b;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}

/* AUTH STYLES */
.auth-overlay {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 40%, #e8ecf4 100%);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(99,102,241,0.04), transparent),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(14,165,233,0.05), transparent),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 40%, #e8ecf4 100%);
  z-index: 100;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}
.hidden-view { display: none !important; }
.fade-in { animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

#authWrapper { padding: 24px; }
#authWrapper > div:not(#authLocaleControl):not(#authFooter) {
  width: min(520px, calc(100% - 48px));
  max-height: none;
  overflow: visible;
  margin-bottom: 48px;
}
#authWrapper [id^="view-"] {
  overflow: visible !important;
  scrollbar-width: none;
}
#authWrapper [id^="view-"]::-webkit-scrollbar { width: 0; height: 0; }
#authWrapper button { white-space: normal; line-height: 1.2; }
#authWrapper svg { flex-shrink: 0; }
#authWrapper input { font-size: 14px; }
#signupOtp, #loginOtp {
  font-size: 24px;
  letter-spacing: 0.3em;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
#signupOtp:focus, #loginOtp:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}
#newEnterKey, #newAccessCodeDisplay { word-break: break-word; }

#authWrapper .p-10 { padding: 28px !important; }
#authWrapper .mb-6 { margin-bottom: 14px !important; }
#authWrapper .my-6 { margin-top: 12px !important; margin-bottom: 12px !important; }
#authWrapper .mt-8 { margin-top: 16px !important; }
#authWrapper .pt-6 { padding-top: 16px !important; }
#authWrapper .space-y-3 > * + * { margin-top: 10px !important; }
#authWrapper .space-y-4 > * + * { margin-top: 12px !important; }

#authWrapper h1,
#authWrapper h2 {
  font-size: clamp(20px, 3vw, 26px);
}
#authWrapper p {
  font-size: clamp(12px, 2.2vw, 14px);
}
#authWrapper label {
  font-size: 10px;
  letter-spacing: 0.06em;
}
#authWrapper .rounded-\[2rem\] { border-radius: 24px !important; }
#authWrapper .text-3xl { font-size: 22px !important; }
#authWrapper .tracking-\[0\.5em\] { letter-spacing: 0.28em !important; }

@media (min-height: 820px) {
  .auth-overlay { align-items: center; }
}

@media (max-height: 760px) {
  #authWrapper .p-10 { padding: 22px !important; }
  #authWrapper .mb-6 { margin-bottom: 10px !important; }
  #authWrapper .space-y-3 > * + * { margin-top: 8px !important; }
  #authWrapper .space-y-4 > * + * { margin-top: 10px !important; }
  #authWrapper .mt-8 { margin-top: 12px !important; }
}

/* AUTH CARD PREMIUM ENHANCEMENTS */
#authWrapper [id^="view-"] {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 4px 6px rgba(0,0,0,0.02),
    0 12px 24px rgba(0,0,0,0.04),
    0 24px 48px rgba(0,0,0,0.06);
}

/* OAuth button enhancements */
#authWrapper .space-y-3 button {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
#authWrapper .space-y-3 button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#authWrapper .space-y-3 button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
/* Google button refinement */
#authWrapper .space-y-3 button:first-child:hover {
  border-color: #d1d5db;
  background: #fafbfc;
}

/* Primary action buttons in auth */
#authWrapper button[onclick*="doSignup"],
#authWrapper button[onclick*="doVerify"],
#authWrapper button[onclick*="doLogin"],
#authWrapper button[onclick*="nav('view-login')"] {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
#authWrapper button[onclick*="doSignup"]:hover,
#authWrapper button[onclick*="doVerify"]:hover,
#authWrapper button[onclick*="doLogin"]:hover,
#authWrapper button[onclick*="nav('view-login')"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Auth input focus enhancements */
#authWrapper input:not([type="radio"]) {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
#authWrapper input:not([type="radio"]):focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.06);
}

/* Product mode selector - EDU selected */
input[type="radio"][name="productMode"]#productModeEdu:checked + div {
  border-color: #0f172a !important;
  background: #f8fafc !important;
  box-shadow: 0 0 0 3px rgba(15,23,42,0.06);
}
input[type="radio"][name="productMode"]#productModeEdu:checked + div .font-bold {
  color: #0f172a;
}
input[type="radio"][name="productMode"]#productModeEdu:checked + div p {
  color: #475569;
}

/* Product mode selector - Compliance selected */
input[type="radio"][name="productMode"]#productModeCompliance:checked + div {
  border-color: #0f172a !important;
  background: #f8fafc !important;
  box-shadow: 0 0 0 3px rgba(15,23,42,0.06);
}
input[type="radio"][name="productMode"]#productModeCompliance:checked + div .font-bold {
  color: #0f172a;
}
input[type="radio"][name="productMode"]#productModeCompliance:checked + div p {
  color: #475569;
}

/* Product mode cards hover */
#productModeEduLabel:hover {
  border-color: #99f6e4 !important;
  background: #f0fdfa;
}
#productModeComplianceLabel:hover {
  border-color: #fde68a !important;
  background: #fffbeb;
}

/* Auth locale select polish */
#authLocaleSelect {
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.85);
  transition: all 0.2s ease;
}
#authLocaleSelect:hover {
  background: rgba(255,255,255,0.95);
  border-color: #d1d5db;
}

/* Auth footer trust line */
.auth-footer {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  pointer-events: none;
  flex-wrap: wrap;
  z-index: 101;
  padding: 0 24px;
}
.auth-footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}
body.theme-dark .auth-footer { color: #475569; }
body.theme-dark .auth-footer-dot { background: #334155; }
@media (max-height: 700px) {
  .auth-footer { display: none; }
}
/* Language toggle inside cards */
.auth-lang-toggle:hover svg { stroke: #1e293b; }

/* SIGNUP WIZARD */
.signup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}
.signup-dot.active {
    background: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15);
}

#signupStep1, #signupStep2 {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#signupStep1.hidden, #signupStep2.hidden {
    display: none;
}

.peer:checked ~ div svg {
    color: #0f172a;
}

#strengthDots > div {
    transition: background-color 0.2s ease;
}

/* Product mode cards responsive text */
@media (max-width: 480px) {
  #productModeEduLabel,
  #productModeComplianceLabel {
    padding: 12px 8px !important;
  }
  #productModeEduLabel .font-bold,
  #productModeComplianceLabel .font-bold {
    font-size: 12px !important;
  }
  #productModeEduLabel p,
  #productModeComplianceLabel p {
    font-size: 9px !important;
  }
}

@media (max-height: 750px) {
    #view-signup,
    #view-invite {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        scrollbar-width: none;
    }
    #view-signup::-webkit-scrollbar,
    #view-invite::-webkit-scrollbar {
        display: none;
    }
}

/* DASHBOARD STYLES */
.glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.3s ease;
}
/* NAVIGATION STYLES */
.nav-item {
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
}
.nav-item span, .nav-item svg { color: inherit; transition: color 0.25s ease; }
.nav-item:not(.active):hover {
    color: var(--text-strong);
    background-color: #f3f4f6;
    transform: translateX(2px);
}
.nav-item.active {
    background-color: var(--brand);
    color: var(--brand-contrast);
    box-shadow: 0 4px 14px rgba(17,24,39,0.28); /* fallback */
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 28%, transparent);
}
.nav-item.active:hover {
    background-color: #1f2937; /* fallback */
    background-color: color-mix(in srgb, var(--brand) 88%, black);
    color: var(--brand-contrast);
    box-shadow: 0 6px 18px rgba(17,24,39,0.32); /* fallback */
    box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 32%, transparent);
}
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: var(--badge-pad-y) var(--badge-pad-x); border-radius: var(--badge-radius); font-size: var(--badge-font-size); font-weight: 700; border: var(--badge-border); box-shadow: var(--badge-shadow); line-height: 1; flex-shrink: 0; }
.badge-emerald { background: var(--badge-emerald-bg); color: var(--badge-emerald-fg); border-color: var(--badge-emerald-border); }
.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-fg); border-color: var(--badge-amber-border); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-fg); border-color: var(--badge-red-border); }
.badge-slate { background: var(--badge-slate-bg); color: var(--badge-slate-fg); border-color: var(--badge-slate-border); }
.loader { border: 2px solid #f3f3f3; border-top: 2px solid #000; border-radius: 50%; width: 20px; height: 20px; animation: spin 0.8s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-select { appearance: none; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 4px 10px; border: 1px solid transparent; }
.status-select:focus { outline: none; border-color: #111827; }
/* FIXED FILTER CARD STYLES */
.filter-card {
    text-align: left;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03), 0 4px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.filter-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--filter-accent, #e5e7eb);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.filter-card:not(:disabled):hover::before {
    opacity: 1;
}

.filter-card:not(:disabled):hover,
.filter-card:not(:disabled):focus,
.filter-card:not(:disabled):active {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
    background-color: #ffffff !important;
    color: #1f2937 !important;
    outline: none;
}

.filter-card[data-status="new"]:hover { border-color: var(--status-new); }
.filter-card[data-status="acknowledged"]:hover { border-color: var(--status-acknowledged); }
.filter-card[data-status="under_review"]:hover { border-color: var(--status-under_review); }
.filter-card[data-status="awaiting_reporter"]:hover { border-color: var(--status-awaiting_reporter); }
.filter-card[data-status="closed"]:hover { border-color: var(--status-closed); }
.filter-card[data-status="spam"]:hover { border-color: var(--status-spam); }

.filter-card .filter-label {
    color: #6b7280 !important;
    font-size: 11px;
    font-weight: 700;
}
.filter-card:hover .filter-label { color: #4b5563 !important; }

.filter-card .filter-count {
    color: #111827 !important;
    font-size: clamp(1.4rem, 4vw, 1.875rem);
    line-height: 2.25rem;
    font-weight: 800;
}

.filter-card .filter-hint {
    color: #9ca3af !important;
    font-size: 10px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-card .filter-hint svg {
    color: #9ca3af;
    transition: color 0.2s;
}
.filter-card:hover .filter-hint svg {
    color: #111827;
}

.filter-card .filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--filter-accent);
    box-shadow: 0 0 0 2px rgba(255,255,255,1);
}

.filter-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6 !important;
}
.filter-card[data-status="new"] { --filter-accent: var(--status-new); }
.filter-card[data-status="acknowledged"] { --filter-accent: var(--status-acknowledged); }
.filter-card[data-status="under_review"] { --filter-accent: var(--status-under_review); }
.filter-card[data-status="awaiting_reporter"] { --filter-accent: var(--status-awaiting_reporter); }
.filter-card[data-status="closed"] { --filter-accent: var(--status-closed); }
.filter-card[data-status="spam"] { --filter-accent: var(--status-spam); }
.btn-outline { border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--text-strong); border-radius: var(--btn-radius); font-size: var(--btn-font-size); padding: var(--btn-pad-y) var(--btn-pad-x); font-weight: 600; line-height: 1.2; transition: all 0.2s ease; }
.btn-outline:hover { background: var(--btn-hover-bg); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.btn-outline.btn-xs { --btn-font-size: 10px; --btn-pad-x: 8px; --btn-pad-y: 4px; --btn-radius: 999px; }

/* PRO DASHBOARD STYLES */
.pro-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.pro-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
}

.pro-card-dark {
    background: linear-gradient(145deg, var(--hero-dark-start), var(--hero-dark-end));
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.pro-card-dark:hover {
    border-color: rgba(255,255,255,0.14);
    box-shadow: 0 20px 50px -8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.06);
}
.pro-card-dark .sub-metric { border-color: rgba(255,255,255,0.1); }
.pro-card-dark .label-text { color: #9ca3af; }

.pro-card-light {
    background: #ffffff;
    color: #111827;
}
.pro-card-light .sub-metric { border-color: #f3f4f6; }
.pro-card-light .label-text { color: #6b7280; }

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.trend-up { background: #ecfdf5; color: #059669; }
.trend-down { background: #fff1f2; color: #e11d48; }
.trend-neutral { background: #f3f4f6; color: #4b5563; }

.pro-card-dark .trend-up { background: rgba(5, 150, 105, 0.2); color: #34d399; }
.pro-card-dark .trend-down { background: rgba(225, 29, 72, 0.2); color: #fb7185; }

.micro-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
}
.micro-bar {
    flex: 1;
    background: currentColor;
    opacity: 0.2;
    border-radius: 1px;
    transition: height 0.3s ease;
}
.micro-bar.active { opacity: 0.8; }

/* ANALYTICS - unified futuristic style */
.analytics-card{
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(900px 450px at 15% 20%, rgba(0,229,255,0.16), transparent 55%),
    radial-gradient(900px 450px at 85% 10%, rgba(167,139,250,0.16), transparent 55%),
    linear-gradient(180deg, rgba(15,15,18,0.96), rgba(7,7,10,0.96));
  box-shadow: 0 18px 60px rgba(0,0,0,0.40);
  color: #fff;
}

.analytics-card::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(120deg, rgba(0,229,255,0.18), rgba(167,139,250,0.14), rgba(0,229,255,0.18));
  opacity: 0.7;
  filter: blur(20px);
  animation: neonFloat 6s ease-in-out infinite;
  pointer-events:none;
}

@keyframes neonFloat{
  0%,100% { transform: translate3d(0,0,0); opacity: 0.55; }
  50%     { transform: translate3d(0,-6px,0); opacity: 0.85; }
}

.chart-wrap{
  position: relative;
  height: 20rem;
}

.chart-wrap canvas{
  width: 100% !important;
  height: 100% !important;
}

.chart-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-weight:700;
  color: rgba(255,255,255,0.70);
  background:
    radial-gradient(700px 350px at 50% 20%, rgba(255,255,255,0.06), transparent 60%);
  border-radius: 1.5rem;
  pointer-events:none;
}

/* .btn-stable removed — opacity:1 is the default, these rules had no effect */

/* NEW UI ELEMENTS */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.quick-action-btn:hover {
  border-color: #d1d5db;
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border-subtle));
  background: #f9fafb;
  background: color-mix(in srgb, var(--brand-soft) 55%, white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.quick-action-btn span:first-child { font-size: 12px; font-weight: 600; color: var(--text-main); }
.quick-action-btn span:last-child { font-size: 11px; font-weight: 700; color: var(--text-subtle); opacity: 0.7; }

/* View header toolbar — groups title + action buttons */
.view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.view-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Header control groups */
.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-controls .divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 4px;
}

/* Billing placeholder */
.billing-placeholder {
  text-align: center;
  padding: 80px 24px;
  border: 2px dashed var(--border-subtle);
  border-radius: 1.5rem;
  background: var(--surface-muted);
}
.billing-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--text-subtle);
  margin: 0 auto 16px;
  opacity: 0.5;
}
.billing-placeholder h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.billing-placeholder p {
  font-size: 14px;
  color: var(--text-subtle);
  max-width: 360px;
  margin: 0 auto;
}

.onboarding-card {
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-bg);
  padding: 20px;
}
.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.onboarding-step span {
  font-size: 12px;
}
.onboarding-step.completed { color: #059669; }
.onboarding-progress {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: #111827;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 2px;
}
.settings-tab {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-tab:not(.active):hover {
  background: #f3f4f6;
  color: #374151;
}
.settings-tab.active {
  background: #111827;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(17,24,39,0.2);
}

.notification-panel {
  position: fixed;
  top: 80px;
  right: 24px;
  width: min(360px, calc(100vw - 16px));
  max-height: 70vh;
  background: var(--surface-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.04), 0 20px 48px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 9999;
  animation: notifSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
}
.notification-item:last-child { border-bottom: none; }
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  margin-top: 6px;
}

.mobile-only { display: none; }
@media (max-width: 1024px) {
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  #sidebar { display: none !important; }
  .mobile-nav-panel { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
  .mobile-nav-panel.open { transform: translateX(0); }
  .mobile-nav-backdrop { background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  z-index: 10050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}
.tour-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;
  max-width: 360px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.tour-highlight {
  position: fixed;
  border-radius: 16px;
  border: 2px solid #60a5fa;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
  z-index: 10040;
  pointer-events: none;
}

.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wizard-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 8px 16px rgba(0,0,0,0.06), 0 20px 48px rgba(0,0,0,0.14);
  animation: wizardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes wizardIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f3f4f6;
  color: #475569;
}

.theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #e5e7eb;
  position: relative;
  transition: background 0.2s ease;
}
.theme-toggle::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}
.theme-toggle.active { background: #111827; }
.theme-toggle.active::after { transform: translateX(20px); }

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.help-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(2px);
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  background: #111827;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  width: max-content;
  max-width: min(220px, calc(100vw - 32px));
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.help-tip:hover::before,
.help-tip:hover::after,
.help-tip.help-tip--active::before,
.help-tip.help-tip--active::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.help-tip.help-tip--active {
  animation: helpPulse 1.4s ease-in-out infinite;
}
@keyframes helpPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 24, 39, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(17, 24, 39, 0); }
}

body.theme-dark .help-tip {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-dark .help-tip::before {
  border-bottom-color: #e2e8f0;
}
body.theme-dark .help-tip::after {
  background: #e2e8f0;
  color: #0f172a;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface-bg);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}
.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: none;
  border-radius: 12px;
}
.mobile-bottom-item:active {
  transform: scale(0.95);
}
.mobile-bottom-item.active {
  color: var(--brand);
  background: rgba(17,24,39,0.08); /* fallback */
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.mobile-bottom-item.active svg {
  stroke-width: 2.5;
}

@media (max-width: 1024px) {
  .mobile-bottom-nav { display: flex; }
  /* Add padding to main content so bottom nav doesn't cover it */
  #view-dashboard, #view-analytics, #view-tenants, #view-team, #view-toolkit, #view-oral, #view-billing {
    padding-bottom: 80px !important;
  }
  /* Hide hamburger button on mobile since we have bottom nav */
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  #sidebar { display: none !important; }
  /* Make stats cards stack better */
  .quick-actions { flex-direction: column; }
  .quick-action-btn { width: 100%; }
  /* Ensure modals don't get hidden behind bottom nav */
  .wizard-overlay, .tour-overlay { z-index: 10050; }
}

@media (max-width: 900px) {
  #dashboardWrapper header.glass {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 12px 16px;
    gap: 8px;
  }
  #dashboardWrapper header.glass > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }
  #dashboardWrapper header.glass > div:last-child {
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 6px;
  }
  #keyRotationAlert {
    width: 100%;
    justify-content: space-between;
  }
  #keyRotationAlert a {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  /* Compact padding on small screens */
  #view-dashboard, #view-analytics, #view-tenants, #view-team, #view-toolkit, #view-oral, #view-billing {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  #dashboardWrapper header.glass {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  #dashboardWrapper header.glass h2 {
    font-size: 18px;
  }
  /* Stack notification panel full width */
  .notification-panel {
    right: 8px;
    left: 8px;
    width: auto;
  }
  #toastContainer {
    right: 12px;
    left: 12px;
    top: 12px;
  }
  /* Make auth cards fit small screens */
  #authWrapper > div:not(#authLocaleControl) {
    margin: 16px;
    max-width: calc(100vw - 32px);
    padding: 24px !important;
  }
  #authWrapper {
    overflow-y: auto;
  }
  /* Tables: hide less-important columns on small screens */
  #reportsTable td:nth-child(3),
  #reportsTable ~ thead th:nth-child(3),
  #reportsTable td:nth-child(4),
  #reportsTable ~ thead th:nth-child(4) {
    display: none;
  }
  /* Use the parent table to target both thead th and tbody td */
  table:has(#reportsTable) th:nth-child(3),
  table:has(#reportsTable) td:nth-child(3),
  table:has(#reportsTable) th:nth-child(4),
  table:has(#reportsTable) td:nth-child(4) {
    display: none;
  }
  table:has(#reportsTable) th,
  table:has(#reportsTable) td {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  #searchInput {
    width: 100% !important;
    max-width: 100% !important;
  }
  #statusFilterChip {
    width: 100%;
    justify-content: space-between;
  }
  .settings-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }
  .settings-tab { flex: 0 0 auto; }
  .chart-wrap { height: 16rem; }
  #detailContent { padding: 16px !important; }
  #detailPanel header, #detailPanel > header { padding: 16px !important; }
  /* Scale stat numbers for small screens */
  #dashboardStats .text-5xl { font-size: 2.25rem !important; }
  #dashboardStats .text-4xl { font-size: 1.875rem !important; }
  #dashboardStats .p-8 { padding: 1.25rem !important; }
  #scheduleModal > div,
  #parentPortalModal > div,
  #assignCodesModal > div,
  #tfaBackdrop > div,
  #classModal > div {
    width: 100% !important;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
  }
}

@media (max-width: 768px) {
  #detailContent .grid {
    grid-template-columns: 1fr !important;
  }
  #detailContent .text-lg { font-size: 16px !important; }
  #detailContent .p-8 { padding: 16px !important; }
  .billing-actions { flex-direction: column; }
  .billing-card { padding: 24px; }
  .billing-includes { padding: 20px 24px; }
  .billing-price { font-size: 32px; }
}

@media (max-width: 480px) {
  #authWrapper { padding: 16px; }
  #authWrapper > div:not(#authLocaleControl) {
    padding: 20px !important;
    border-radius: 20px !important;
  }
  #authWrapper h1, #authWrapper h2 { font-size: 20px; }
  #authWrapper p { font-size: 12px; }
  #authWrapper button { padding-top: 12px; padding-bottom: 12px; }
  #signupOtp, #loginOtp { font-size: 20px; letter-spacing: 0.2em; }
  #backupCodesList { grid-template-columns: 1fr !important; }
}

/* ── Compliance Detail Panel Enhancements ── */
.group\/note:hover .opacity-0 {
  opacity: 1 !important;
}

/* SLA indicator pulse */
@keyframes slaPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.sla-overdue { animation: slaPulse 2s ease-in-out infinite; }

/* Legal hold badge */
.legal-hold-active {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Timeline connector */
.timeline-connector::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 24px;
  bottom: 0;
  width: 1px;
  background: #e5e7eb;
}

/* ============================================
   TRIAL BANNER
   ============================================ */
.trial-banner {
  padding: 0;
  transition: all 0.3s ease;
}
.trial-banner.hidden { display: none; }
.trial-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  font-size: 13px;
}
.trial-banner-free {
  background: linear-gradient(135deg, #eff6ff, #f0f4ff);
  border-bottom: 1px solid #bfdbfe;
}
.trial-banner-trial {
  background: linear-gradient(135deg, #f0fdf4, #f0fff4);
  border-bottom: 1px solid #bbf7d0;
}
.trial-banner-urgent {
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
  border-bottom: 1px solid #fed7aa;
}
.trial-banner-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trial-banner-free .trial-banner-icon { background: #dbeafe; color: #2563eb; }
.trial-banner-trial .trial-banner-icon { background: #dcfce7; color: #16a34a; }
.trial-banner-urgent .trial-banner-icon { background: #fde68a; color: #d97706; }
.trial-banner-text {
  flex: 1;
  color: #374151;
  line-height: 1.4;
}
.trial-banner-text strong { color: #111827; }
.trial-banner-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.trial-banner-free .trial-banner-btn {
  background: #111827;
  color: #fff;
}
.trial-banner-free .trial-banner-btn:hover { background: #1f2937; }
.trial-banner-trial .trial-banner-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.trial-banner-urgent .trial-banner-btn {
  background: #dc2626;
  color: #fff;
}
.trial-banner-urgent .trial-banner-btn:hover { background: #b91c1c; }

/* ============================================
   BILLING VIEW
   ============================================ */
.billing-hero {
  text-align: center;
  padding: 40px 0 32px;
}
.billing-hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #6b7280;
  margin-bottom: 16px;
}
.billing-hero-title {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.billing-hero-desc {
  font-size: 15px;
  color: #6b7280;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 4px;
  max-width: 320px;
  margin: 0 auto 32px;
}
.billing-toggle-btn {
  flex: 1;
  padding: 10px 20px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: #6b7280;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.billing-toggle-btn.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.billing-save-badge {
  font-size: 9px;
  font-weight: 800;
  background: #dcfce7;
  color: #16a34a;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.billing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 720px;
  margin: 0 auto 32px;
}
.billing-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  padding: 32px;
  position: relative;
  transition: all 0.3s;
}
.billing-card:hover { border-color: #d1d5db; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.billing-card-featured {
  border-color: #111827;
}
.billing-card-featured:hover { border-color: #111827; }
.billing-card-dimmed { opacity: 0.6; }
.billing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #111827;
  color: #fff;
}
.billing-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.billing-price {
  font-size: 42px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1;
}
.billing-price span {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  margin-left: 4px;
}
.billing-card-note {
  font-size: 12px;
  color: #9ca3af;
  margin: 8px 0 20px;
}
.billing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.billing-features li {
  font-size: 13px;
  color: #374151;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}
.billing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
  font-size: 12px;
}
.billing-cta {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #111827;
}
.billing-cta:hover { background: #f9fafb; border-color: #d1d5db; }
.billing-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.billing-cta-featured {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.billing-cta-featured:hover { background: #1f2937; }
.billing-fine-print {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  margin-top: 12px;
}

.billing-tiers {
  max-width: 520px;
  margin: 0 auto 40px;
  background: #f9fafb;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #f3f4f6;
}
.billing-tiers-title {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
}
.billing-tier-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}
.billing-tier-row:last-child { border-bottom: none; }
.billing-tier-row span { color: #6b7280; }
.billing-tier-row strong { color: #111827; font-weight: 700; }

.billing-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 0;
}
.billing-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 600;
}

/* Billing status card (for Plus users) */
.billing-status-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
}
.billing-status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.billing-plan-name {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.billing-plan-interval {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}
.billing-plan-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.03em;
}
.plan-badge-active { background: #dcfce7; color: #16a34a; }
.plan-badge-trial { background: #dbeafe; color: #2563eb; }
.plan-badge-warn { background: #fef3c7; color: #d97706; }
.plan-badge-danger { background: #fee2e2; color: #dc2626; }

.billing-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.billing-detail {
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px 16px;
}
.billing-detail-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 4px;
}
.billing-detail-value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.billing-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}
.billing-manage-btn, .billing-invoice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.billing-manage-btn {
  background: #111827;
  color: #fff;
}
.billing-manage-btn:hover { background: #1f2937; }
.billing-invoice-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.billing-invoice-btn:hover { background: #e5e7eb; }

.billing-includes {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 28px 32px;
}
.billing-includes h4 {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 16px;
}
.billing-includes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.billing-include-item {
  font-size: 13px;
  color: #374151;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.billing-check {
  color: #16a34a;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 640px) {
  .billing-cards { grid-template-columns: 1fr; }
  .billing-details-grid { grid-template-columns: 1fr; }
  .billing-includes-grid { grid-template-columns: 1fr; }
  .billing-actions { flex-direction: column; }
  .trial-banner-content { flex-wrap: wrap; }
  .trial-banner-btn { width: 100%; text-align: center; }
}

/* Dark mode override for hardcoded bg-[#F9FAFB] on main content */
body.theme-dark #dashboardWrapper { background: var(--app-bg) !important; }
body.theme-dark #dashboardWrapper main { background: var(--app-bg) !important; }

/* Print styles */
@media print {
  #sidebar, #mobileBottomNav, #mobileNavPanel, #mobileNavBackdrop,
  .auth-overlay, .auth-footer, header, .toast-container { display: none !important; }
  body, body.theme-dark { background: white !important; color: black !important; }
  * { box-shadow: none !important; }
  #dashboardWrapper { margin: 0 !important; padding: 0 !important; }
}
