/* ===================================================
   Pest Insight Dashboard — 2026 Modern Design System
   =================================================== */

/* ---------- Design Tokens ---------- */
:root {
    /* Primary Palette — Teal-Blue Gradient System */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Accent Colors */
    --accent-teal: #14b8a6;
    --accent-teal-glow: rgba(20, 184, 166, 0.2);
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Semantic Colors */
    --danger: #f43f5e;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #06b6d4;

    /* Background Layers */
    --bg-base: #05080f;
    --bg-surface: #0c1222;
    --bg-card: #111827;
    --bg-card-hover: #1a2236;
    --bg-input: #1e293b;
    --bg-elevated: #1e293b;

    /* Text */
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Borders & Dividers */
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(148, 163, 184, 0.2);
    --border-active: rgba(99, 102, 241, 0.4);

    /* Layout */
    --sidebar-width: 270px;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Subtle gradient background mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(20, 184, 166, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- App Layout ---------- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-base);
    backdrop-filter: blur(12px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent-teal));
    border-radius: var(--radius-sm);
    line-height: 1;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Nav Section Labels */
.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 20px 20px 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
}

.nav-item:hover svg {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(20, 184, 166, 0.08));
    color: var(--primary-light);
    border-color: var(--border-active);
    font-weight: 600;
}

.nav-item.active svg {
    opacity: 1;
    stroke: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--accent-teal));
    border-radius: 0 3px 3px 0;
}

/* Special Links — Admin / User View */
.nav-item.nav-special {
    color: var(--accent-teal);
    background: var(--accent-teal-glow);
    border-color: rgba(20, 184, 166, 0.15);
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 4px;
}

.nav-item.nav-special svg {
    opacity: 1;
    stroke: var(--accent-teal);
}

.nav-item.nav-special:hover {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.3);
    color: #2dd4bf;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 4px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

.logout-btn:hover {
    background: rgba(244, 63, 94, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

/* Header Switch Button */
.header-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: var(--accent-teal-glow);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 20px;
    color: var(--accent-teal);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.header-switch-btn svg {
    width: 14px;
    height: 14px;
}

.header-switch-btn:hover {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.4);
    color: #2dd4bf;
    transform: translateY(-1px);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: var(--header-height);
    background: rgba(12, 18, 34, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-elevated);
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-name {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
}

/* User Profile Badge in Header */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent-teal));
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== CONTENT AREA ========== */
.content-area {
    padding: 28px 32px;
    flex: 1;
}

/* ========== STATS CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Gradient top-border accents per card */
.stat-card:nth-child(1)::before {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--accent-teal), #34d399);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--accent-amber), #fbbf24);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, var(--accent-rose), #fb7185);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: rgba(99, 102, 241, 0.12);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
}

.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.12);
}

.stat-icon.red {
    background: rgba(244, 63, 94, 0.12);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.blue svg {
    stroke: var(--primary-light);
}

.stat-icon.green svg {
    stroke: var(--success);
}

.stat-icon.yellow svg {
    stroke: var(--warning);
}

.stat-icon.red svg {
    stroke: var(--danger);
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--text), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-change {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.stat-change.negative {
    color: var(--danger);
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 24px;
}

/* ========== TABLES ========== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.02);
}

td {
    font-size: 13.5px;
    color: var(--text-secondary);
}

tr {
    transition: background var(--transition-fast);
}

tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

tr:last-child td {
    border-bottom: none;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge.new {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
}

.badge.contacted {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.badge.converted {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.badge.lost {
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
}

.danger-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.danger-badge.low {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.danger-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.danger-badge.high {
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ========== COLOR PICKER ========== */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

.color-picker-group input[type="color"] {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    cursor: pointer;
}

/* ========== CODE BLOCK ========== */
.code-block {
    background: var(--bg-base);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
}

.code-block pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.code-block code {
    color: var(--primary-light);
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    border-radius: 28px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-dim);
    transition: all var(--transition-base);
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: var(--success);
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 32px;
    border: 1px solid var(--border);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-spring);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.auth-modal .modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tab.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    color: var(--primary-light);
}

.auth-error {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 56px;
    height: 56px;
    stroke: var(--text-dim);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ========== STATUS BADGES (Admin) ========== */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.status-inactive {
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.animate-in {
    animation: fadeIn var(--transition-base) ease-out;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 270px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .header {
        padding: 0 20px;
    }

    .content-area {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 18px;
    }
}

/* Mobile overlay when sidebar is open */
@media (max-width: 768px) {
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: var(--sidebar-width);
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* ========== TOGGLE SWITCHES (Standardized) ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: var(--transition-base);
    border-radius: 34px;
    border: 1px solid var(--border);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-spring);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary);
    border-color: var(--primary-light);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
    background-color: white;
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ========== INPUT FIXES (Autofill & Types) ========== */
/* Ensure all input types match the theme */
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

/* Fix browser autofill white background in dark mode */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s;
}