/* ─── 1. Brand Theme Tokens ─── */
:root {
    --bg: #09090b;
    --surface: #18181b;
    --accent: rgb(27, 181, 111);
    --accent-dark: rgb(19, 132, 84);
    --border: rgba(255, 255, 255, 0.035); /* Extremely subtle border */
    --border-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --card-bg: rgba(24, 24, 27, 0.65);
    --card-bg-end: rgba(12, 12, 14, 0.95);
    --input-bg: #09090b;
    --input-border: rgba(255, 255, 255, 0.055); /* Soft input outline */
    --header-bg: rgba(9, 9, 11, 0.85);
    --sidebar-bg: #111113;
    --sidebar-border: rgba(255, 255, 255, 0.03); /* Soft sidebar split */
    --hover-bg: rgba(27, 181, 111, 0.08);
    --divider: rgba(255, 255, 255, 0.03);
    --table-header-bg: rgba(255, 255, 255, 0.025);
    --table-header-border: rgba(255, 255, 255, 0.08);
    --table-row-border: rgba(255, 255, 255, 0.055);
    --table-row-hover: rgba(27, 181, 111, 0.06);
    --glow-color: rgba(27, 181, 111, 0.12);
    --scrollbar-track: #09090b;
    --scrollbar-thumb: rgba(27, 181, 111, 0.15);
    
    /* Dynamic Shadows */
    --shadow-sm: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
    --shadow-card-hover: 0 20px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-hover);
    
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f6f8f5;
    --surface: #ffffff;
    --accent: rgb(18, 151, 92);
    --accent-dark: rgb(11, 109, 70);
    --border: rgba(15, 72, 48, 0.11);
    --border-hover: rgba(15, 72, 48, 0.18);
    --text-primary: #102018;
    --text-secondary: #496158;
    --text-muted: #7a8b84;
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-bg-end: rgba(248, 251, 247, 0.98);
    --input-bg: #fbfdfb;
    --input-border: rgba(15, 72, 48, 0.14);
    --header-bg: rgba(250, 252, 249, 0.9);
    --sidebar-bg: rgba(255, 255, 255, 0.94);
    --sidebar-border: rgba(15, 72, 48, 0.12);
    --hover-bg: rgba(18, 151, 92, 0.09);
    --divider: rgba(15, 72, 48, 0.09);
    --table-header-bg: rgba(18, 151, 92, 0.075);
    --table-header-border: rgba(15, 72, 48, 0.18);
    --table-row-border: rgba(15, 72, 48, 0.12);
    --table-row-hover: rgba(18, 151, 92, 0.07);
    --glow-color: rgba(18, 151, 92, 0.14);
    --scrollbar-track: #eef4ef;
    --scrollbar-thumb: rgba(18, 151, 92, 0.24);
    
    /* Dynamic Shadows for Light Mode */
    --shadow-sm: inset 0 1px 2px rgba(15, 72, 48, 0.04);
    --shadow-card: 0 18px 45px -32px rgba(16, 32, 24, 0.26), 0 0 0 1px var(--border);
    --shadow-card-hover: 0 24px 55px -34px rgba(16, 32, 24, 0.34), 0 0 0 1px var(--border-hover);
    
    color-scheme: light;
}

/* Theme Toggle UI Rules */
:root[data-theme="light"] .theme-icon-dark { display: none !important; }
:root[data-theme="light"] .theme-icon-light { display: block !important; }

.app-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.app-logo-login {
    max-width: 100%;
    max-height: 76px;
}

.app-logo-sidebar {
    max-width: 100%;
    max-height: 52px;
}

.app-logo-light {
    display: none;
}

.app-logo-dark {
    display: block;
}

:root[data-theme="light"] .app-logo-light {
    display: block;
}

:root[data-theme="light"] .app-logo-dark {
    display: none;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.theme-switcher-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.theme-switcher-track {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 58px;
    height: 30px;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 78%, var(--surface));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-switcher:hover .theme-switcher-track {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

.theme-switcher-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    color: var(--text-muted);
    transition: color 0.25s ease, transform 0.25s ease;
}

.theme-switcher-icon svg {
    width: 14px;
    height: 14px;
}

.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 5px 14px var(--glow-color);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] .theme-switcher-icon.moon,
:root[data-theme="light"] .theme-switcher-icon.sun {
    color: #ffffff;
    transform: scale(1.02);
}

:root[data-theme="light"] .theme-toggle-knob {
    transform: translateX(28px);
}

.theme-switcher-floating {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 50;
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
}

.theme-switcher-sidebar {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-switcher-sidebar:hover {
    background: var(--hover-bg);
    border-color: var(--border);
    color: var(--text-primary);
}

/* ─── 2. Global Semantic Element Bindings (Natural Specificity) ─── */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#sidebar {
    background-color: var(--sidebar-bg);
    border-color: var(--sidebar-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
}

body header {
    background-color: var(--header-bg);
    border-color: var(--sidebar-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

main {
    background-color: var(--bg);
    transition: background-color 0.3s ease;
}

body input[type="number"],
body input[type="text"],
body input[type="tel"],
body input[type="password"],
body select {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body input[type="number"]:focus,
body input[type="text"]:focus,
body input[type="tel"]:focus,
body input[type="password"]:focus,
body select:focus {
    outline: none !important;
    background-color: var(--input-bg) !important;
    border-color: rgba(27, 181, 111, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(27, 181, 111, 0.1), var(--shadow-sm) !important;
}

body select option {
    background-color: var(--surface) !important;
    color: var(--text-primary) !important;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }

/* Sidebar Responsive closed state */
@media (max-width: 1024px) {
    #sidebar.closed { transform: translateX(-100%); }
}

/* ─── 3. Global CSS Theme Mapping (No !important, Natural Specificity) ─── */

/* Theme backgrounds mapping */
body [class*="bg-slate-950"],
body [class*="bg-[#060807]"],
body [class*="bg-[#09090b]"] {
    background-color: var(--bg) !important;
}

body [class*="bg-slate-900"],
body [class*="bg-slate-800"],
body [class*="bg-[#0c120f]"],
body [class*="bg-[#18181b]"],
body [class*="bg-[#27272a]"] {
    background-color: var(--surface) !important;
}

/* Brand Cards & Panels */
body .bg-\[\#0f2419\],
body .bg-\[\#161e2e\],
body .settings-card,
body .result-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-card) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
}

body .settings-card:hover,
body .result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover) !important;
}

/* Replace busy non-green gradients with semantic app surfaces */
body [class*="bg-gradient-to-"],
body :not(#sidebar):not(#sidebar *) [class*="bg-gradient-to-"] {
    background-image: none !important;
    background-color: var(--surface) !important;
    box-shadow: var(--shadow-card) !important;
}

/* Explicitly restore green brand gradients */
body [class*="bg-gradient-to-"][class*="from-accent"],
body [class*="bg-gradient-to-"][class*="from-indigo-"],
body [class*="bg-gradient-to-"][class*="from-emerald-"],
body :not(#sidebar):not(#sidebar *) [class*="bg-gradient-to-r"][class*="from-accent"],
body :not(#sidebar):not(#sidebar *) [class*="bg-gradient-to-r"][class*="from-indigo-"],
body :not(#sidebar):not(#sidebar *) [class*="bg-gradient-to-r"][class*="from-emerald-"] {
    background-image: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%) !important;
    background-color: transparent !important;
    box-shadow: 0 4px 14px var(--glow-color) !important;
}

body [class*="bg-gradient-to-"][class*="from-accent"],
body [class*="bg-gradient-to-"][class*="from-indigo-"],
body [class*="bg-gradient-to-"][class*="from-emerald-"] {
    color: #ffffff !important;
}

:root[data-theme="light"] body [class*="bg-slate-950"],
:root[data-theme="light"] body [class*="bg-[#060807]"],
:root[data-theme="light"] body [class*="bg-[#09090b]"] {
    background-color: #eef4ef !important;
}

:root[data-theme="light"] body [class*="bg-slate-900"],
:root[data-theme="light"] body [class*="bg-slate-800"],
:root[data-theme="light"] body [class*="bg-[#0c120f]"],
:root[data-theme="light"] body [class*="bg-[#18181b]"],
:root[data-theme="light"] body [class*="bg-[#27272a]"] {
    background-color: var(--surface) !important;
}

/* Badge transparent colors */
body :not(.fomo-popup):not(.fomo-popup *) .bg-\[\#0f2419\/40\],
body :not(.fomo-popup):not(.fomo-popup *) .bg-indigo-500\/10,
body :not(.fomo-popup):not(.fomo-popup *) .bg-indigo-500\/20 {
    background-color: var(--hover-bg);
}

/* Light overlay background */
body #overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Border styling globally mapping */
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) .border,
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) .border-t,
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) .border-b,
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) .border-l,
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) .border-r,
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) [class*="border-slate-"],
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) [class*="border-indigo-"],
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) [class*="border-white"],
body :not(#sidebar):not(#sidebar *):not(.fomo-popup):not(.fomo-popup *) [class*="border-white/"] {
    border-color: var(--border) !important;
}

/* Fallback for rest of body elements (like sidebar) */
body :not(.fomo-popup):not(.fomo-popup *) .border,
body :not(.fomo-popup):not(.fomo-popup *) .border-t,
body :not(.fomo-popup):not(.fomo-popup *) .border-b,
body :not(.fomo-popup):not(.fomo-popup *) .border-l,
body :not(.fomo-popup):not(.fomo-popup *) .border-r,
body :not(.fomo-popup):not(.fomo-popup *) [class*="border-slate-"],
body :not(.fomo-popup):not(.fomo-popup *) [class*="border-indigo-"],
body :not(.fomo-popup):not(.fomo-popup *) [class*="border-white"],
body :not(.fomo-popup):not(.fomo-popup *) [class*="border-white/"] {
    border-color: var(--border);
}

/* Explicit Alert/Danger/Active borders */
body [class*="border-red-"] {
    border-color: rgba(239, 68, 68, 0.1) !important;
}
body [class*="border-indigo-500"] {
    border-color: rgba(27, 181, 111, 0.12) !important;
}

/* Text primary replacements */
body [class*="text-white"] {
    color: var(--text-primary) !important;
}

/* Text secondary replacements */
body [class*="text-slate-200"],
body [class*="text-slate-300"],
body [class*="text-slate-500"] {
    color: var(--text-secondary) !important;
}

/* Text muted replacements */
body [class*="text-slate-400"] {
    color: var(--text-muted) !important;
}

/* Accent texts */
body [class*="text-indigo-300"],
body [class*="text-indigo-400"],
body [class*="text-indigo-500"] {
    color: var(--accent) !important;
}

body .profile-nav-avatar.profile-nav-avatar {
    color: #ffffff !important;
    background-image: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%) !important;
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 8px 22px -10px var(--accent), 0 0 0 3px var(--glow-color) !important;
}

body img.profile-nav-avatar.profile-nav-avatar {
    background-image: none !important;
    background-color: var(--surface) !important;
}

/* Navigation Links interaction */
body nav a.text-slate-400 {
    color: var(--text-secondary);
}
body nav a.text-slate-400:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Range input slider styling */
input[type="range"] {
    accent-color: var(--accent);
}

/* Custom indicator shadow effects mapping */
body .shadow-emerald,
body .shadow-lg {
    box-shadow: 0 4px 14px var(--glow-color);
}

/* ─── 4. Specific Interactive Components ─── */

/* FOMO Notification Popup Styles */
.fomo-popup {
    position: fixed;
    bottom: -150px;
    left: 24px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    padding: 16px 22px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 25px var(--glow-color);
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 9999;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    opacity: 0;
    max-width: 430px;
    pointer-events: none;
}
.fomo-popup.show {
    transform: translateY(-174px);
    opacity: 1;
    pointer-events: auto;
}
@media (max-width: 768px) {
    .fomo-popup {
        left: 16px;
        right: 16px;
        max-width: none;
    }
    .fomo-popup.show {
        transform: translateY(-166px);
    }
}
.fomo-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.fomo-popup.show .verified-scale-anim {
    animation: verifiedScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.fomo-popup.show .verified-check-anim {
    animation: verifiedCheck 0.4s ease-out 0.5s forwards;
}

@keyframes verifiedScale {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes verifiedCheck {
    to { stroke-dashoffset: 0; }
}

.fomo-popup .fomo-divider {
    border-top: 1.5px solid rgba(255, 255, 255, 0.08);
    margin-top: 10px;
    padding-top: 10px;
}

.fomo-label {
    color: var(--text-muted);
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}
.fomo-value {
    color: var(--text-secondary);
}
.fomo-payment-text {
    color: var(--text-secondary);
}

.fomo-just-now {
    font-family: monospace;
    font-size: 8.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 9999px;
    color: var(--text-muted);
    background-color: var(--hover-bg);
    border: 1px solid var(--border);
    line-height: 1;
}

/* ─── 5. Shared Custom Form & UI Components ─── */

/* Remove Spin Buttons on Number Inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--hover-bg);
    border-radius: 999px;
    outline: none;
    transition: background 0.2s;
}
input[type="range"]:hover {
    background: var(--divider);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    cursor: pointer;
    border: 2px solid var(--border);
    box-shadow: 0 0 12px var(--glow-color), 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 18px var(--glow-color), 0 2px 8px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    cursor: pointer;
    border: 2px solid var(--border);
    box-shadow: 0 0 12px var(--glow-color), 0 2px 6px rgba(0,0,0,0.3);
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--divider);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.toggle-switch.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--border);
    box-shadow: 0 0 12px var(--glow-color);
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Tab & Switch Navigation Buttons */
.tab-btn {
    transition: all 0.2s ease;
    color: var(--text-secondary);
}
.tab-btn.active {
    background: var(--text-primary);
    color: var(--bg);
}

/* Result Cards transitions */
.result-card {
    transition: all 0.3s ease;
}

/* Settings Row Divider */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--divider);
    gap: 16px;
}
.setting-row:last-child {
    border-bottom: none;
}

/* Danger / Success Buttons & Color Indicators */
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.btn-success {
    background: rgba(27, 181, 111, 0.1);
    border: 1px solid rgba(27, 181, 111, 0.2);
    color: var(--accent);
    transition: all 0.2s;
}
.btn-success:hover {
    background: rgba(27, 181, 111, 0.2);
    border-color: rgba(27, 181, 111, 0.4);
    box-shadow: 0 0 15px rgba(27, 181, 111, 0.15);
}

.profit { color: #34d399; }
.loss { color: #f87171; }

/* Dynamic Toast System */
.settings-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}
.settings-toast.show {
    transform: translateY(0);
    opacity: 1;
}
.settings-toast.success {
    background: rgba(27, 181, 111, 0.15);
    border: 1px solid rgba(27, 181, 111, 0.3);
    color: var(--accent);
    backdrop-filter: blur(12px);
}
.settings-toast.warning {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    backdrop-filter: blur(12px);
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.modal-overlay.show .modal-box {
    transform: scale(1);
}

/* Fade-in animation for settings page cards */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.settings-card {
    animation: fadeInUp 0.5s ease-out both;
}
.settings-card:nth-child(2) { animation-delay: 0.08s; }
.settings-card:nth-child(3) { animation-delay: 0.16s; }
.settings-card:nth-child(4) { animation-delay: 0.24s; }

/* Status Pill Indicators */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 900;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-pill.active {
    background: rgba(27, 181, 111, 0.1);
    border: 1px solid rgba(27, 181, 111, 0.2);
    color: var(--accent);
}
.status-pill.expired {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Specific settings styles */
#profile-avatar-placeholder {
    background-color: var(--bg);
}

/* Table Layout Enhancements & CRM Scrollbars */
.crm-table-container::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.crm-table-container::-webkit-scrollbar-thumb {
    background: var(--hover-bg);
    border-radius: 10px;
}

@keyframes rowHighlight {
    0% { background-color: rgba(27, 181, 111, 0.15); }
    100% { background-color: transparent; }
}
.new-row-glow {
    animation: rowHighlight 2s ease-out forwards;
}

/* Tables: crisp headers and readable row separation */
body :not(#sidebar):not(#sidebar *) table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}
body :not(#sidebar):not(#sidebar *) thead {
    position: relative;
    z-index: 1;
}
body :not(#sidebar):not(#sidebar *) thead tr {
    background-color: var(--table-header-bg) !important;
    box-shadow: inset 0 -1px 0 var(--table-header-border) !important;
}
body :not(#sidebar):not(#sidebar *) tbody tr {
    background-color: transparent !important;
    transition: background-color 0.18s ease, box-shadow 0.18s ease !important;
}
body :not(#sidebar):not(#sidebar *) tbody tr:last-child {
    border-bottom: none !important;
}
body :not(#sidebar):not(#sidebar *) tbody tr:hover {
    background-color: var(--table-row-hover) !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
}
body :not(#sidebar):not(#sidebar *) td {
    padding: 15px 18px !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--table-row-border) !important;
    vertical-align: middle !important;
}
body :not(#sidebar):not(#sidebar *) tbody tr:last-child td {
    border-bottom-color: transparent !important;
}
body :not(#sidebar):not(#sidebar *) th {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    padding: 13px 18px !important;
    border-bottom: 1px solid var(--table-header-border) !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}
body :not(#sidebar):not(#sidebar *) th:first-child,
body :not(#sidebar):not(#sidebar *) td:first-child {
    padding-left: 20px !important;
}
body :not(#sidebar):not(#sidebar *) th:last-child,
body :not(#sidebar):not(#sidebar *) td:last-child {
    padding-right: 20px !important;
}
body :not(#sidebar):not(#sidebar *) thead th:first-child {
    border-top-left-radius: 12px !important;
}
body :not(#sidebar):not(#sidebar *) thead th:last-child {
    border-top-right-radius: 12px !important;
}

/* Ensure padding-left for search input boxes is not overridden by global input padding */
body input[id*="search"],
body input[class*="pl-"] {
    padding-left: 2.5rem !important;
}
