/* Hello from Gemini AI */
/* Hello from Gemini AI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --purple: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #10b981;
    --dark: #1e293b;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #8b5cf6;
    --sidebar-hover: #1e293b;
    --sidebar-width: 280px;
    --topbar-height: 60px;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --card-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
    --card-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #f1f5f9; color: var(--text); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ═══════════════════════════════ TOP BAR ═══════════════════════════════ */
#topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.topbar-brand { display: flex; align-items: center; gap: 0.75rem; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--dark); cursor: pointer; padding: 0.25rem; }
.topbar-logo { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), #a78bfa); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.875rem; }
.topbar-logo-img { height: 44px; width: auto; object-fit: contain;  }
.topbar-title { font-weight: 700; font-size: 1.125rem; color: var(--dark); }
.topbar-subtitle { font-size: 0.75rem; color: var(--text-light); }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar-actions button { padding: 0.5rem 1rem; font-size: 0.875rem; border-radius: 8px; border: none; cursor: pointer; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ai { background: linear-gradient(135deg, #8b5cf6, #ec4899); color: white; }
.btn-ai:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: var(--light); color: var(--dark); }


/* ═══════════════════════════════ ANIMATIONS ════════════════════════════ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══════════════════════════════ LAYOUT ════════════════════════════════ */
#app-layout { display: flex; flex: 1; overflow: hidden; }

/* ═══════════════════════════════ SIDEBAR ═══════════════════════════════ */
#sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: width 0.3s ease;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.nav-section { padding: 0.25rem 0; }
.nav-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #475569;
    cursor: pointer;
    user-select: none;
}
.nav-section-header:hover { color: #94a3b8; }
.nav-section-header .section-number { color: var(--primary); margin-right: 0.5rem; font-size: 0.75rem; }
.nav-section-header .chevron { transition: transform 0.2s; font-size: 0.625rem; }
.nav-section-header.collapsed .chevron { transform: rotate(-90deg); }

.nav-items { overflow: hidden; }
.nav-items.collapsed { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 1.25rem;
    font-size: 0.8125rem; color: var(--sidebar-text);
    cursor: pointer; transition: all 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
    line-height: 1.4;
}
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: rgba(139,92,246,0.15); color: white; border-left-color: var(--primary); }
.nav-item .nav-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 0.75rem; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge { background: var(--primary); color: white; font-size: 0.625rem; font-weight: 700; padding: 0.1rem 0.375rem; border-radius: 999px; }
.nav-item .nav-chevron { font-size: 0.625rem; transition: transform 0.2s; flex-shrink: 0; }
.nav-item.open .nav-chevron { transform: rotate(90deg); }

/* Sub-levels indentation */
.nav-sub { overflow: hidden; }
.nav-sub.collapsed { display: none; }
.nav-item.level-2 { padding-left: 2.25rem; font-size: 0.75rem; }
.nav-item.level-3 { padding-left: 3.25rem; font-size: 0.7rem; color: #64748b; }
.nav-item.level-3:hover, .nav-item.level-3.active { color: #94a3b8; }
.nav-item.level-4 { padding-left: 4rem; font-size: 0.675rem; color: #475569; }
.nav-item.level-4:hover, .nav-item.level-4.active { color: #64748b; }
.nav-item.level-5 { padding-left: 4.75rem; font-size: 0.65rem; color: #334155; }
.nav-item.level-5:hover, .nav-item.level-5.active { color: #64748b; }

/* Mobile sidebar overlay */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 89;
    backdrop-filter: blur(1px);
}
#sidebar-overlay.show { display: block; }

/* ═══════════════════════════════ MAIN CONTENT ══════════════════════════ */
#main-content { flex: 1; overflow-y: auto; padding: 2rem; background: #f1f5f9; }
#main-content::-webkit-scrollbar { width: 6px; }
#main-content::-webkit-scrollbar-track { background: transparent; }
#main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Page header */
.page-header { margin-bottom: 2rem; }
.breadcrumb { font-size: 0.75rem; color: var(--text-light); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb span { color: var(--primary); }
.page-title { letter-spacing: -0.02em; font-size: 1.75rem; font-weight: 700; color: var(--dark); }
.page-subtitle { font-size: 0.875rem; color: var(--text-light); margin-top: 0.25rem; }

/* ═══════════════════════════════ CARDS ═════════════════════════════════ */
.card { background: var(--card-bg); border-radius: 16px; box-shadow: var(--card-shadow); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid rgba(0,0,0,0.03); transition: transform 0.3s ease, box-shadow 0.3s ease; overflow-x: auto; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { letter-spacing: -0.01em; font-size: 1rem; font-weight: 600; color: var(--dark); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card-bg); border-radius: 16px; padding: 1.5rem; box-shadow: var(--card-shadow); border-left: 4px solid var(--primary); transition: transform 0.3s ease, box-shadow 0.3s ease; border-top: 1px solid rgba(0,0,0,0.02); border-right: 1px solid rgba(0,0,0,0.02); border-bottom: 1px solid rgba(0,0,0,0.02); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--dark); }
.stat-label { font-size: 0.75rem; color: var(--text-light); margin-top: 0.25rem; }
.stat-card.green { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.red { border-left-color: var(--danger); }

/* ═══════════════════════════════ QUOTE CARDS ═══════════════════════════ */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.quote-card { background: white; padding: 1.5rem; border-radius: 12px; box-shadow: var(--card-shadow); transition: box-shadow 0.2s; }
.quote-card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.status-badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-Draft          { background: #fef3c7; color: #d97706; }
.status-Sent           { background: #dbeafe; color: #2563eb; }
.status-Accepted       { background: #d1fae5; color: #059669; }
.status-Rejected       { background: #fee2e2; color: #dc2626; }
.status-WaitingResult  { background: #ede9fe; color: #7c3aed; }
.status-WaitingSignature { background: #e0f2fe; color: #0369a1; }
.status-Signed         { background: #dcfce7; color: #166534; }

/* ═══════════════════════════════ FORM ELEMENTS ═════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; width: 100%; }
.form-group { display: flex; flex-direction: column; min-width: 0; }
.form-group label { font-weight: 600; font-size: 0.8125rem; margin-bottom: 0.375rem; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-overflow: ellipsis;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

/* ═══════════════════════════════ TABLE ═════════════════════════════════ */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
th { background: var(--light); font-weight: 600; color: var(--text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.line-item-row input, .line-item-row select { width: 100%; padding: 0.375rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.8125rem; font-family: inherit; }
.line-item-row input:focus, .line-item-row select:focus { outline: none; border-color: var(--primary); }

/* ═══════════════════════════════ BUTTONS ═══════════════════════════════ */
.btn { padding: 0.625rem 1.25rem; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; font-size: 0.875rem; font-family: inherit; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); display: inline-flex; align-items: center; gap: 0.375rem; }
.btn:active { transform: scale(0.97); }
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-purple { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.btn-purple:hover { background: var(--primary-hover); }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-red { background: var(--danger); color: white; }
.btn-red:hover { background: #dc2626; }
.btn-green { background: var(--success); color: white; }
.btn-green:hover { background: #059669; }

.action-row { display: flex; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ═══════════════════════════════ FINANCIAL SUMMARY ════════════════════ */
.financial-summary { width: 100%; max-width: 650px; margin: 1.5rem auto 0 auto; background: var(--light); padding: 1.25rem; border-radius: 10px; }
.financial-row { display: flex; justify-content: space-between; padding: 0.375rem 0; font-size: 0.875rem; color: var(--text); }
.financial-total { font-size: 1.25rem; font-weight: 700; color: var(--primary); border-top: 2px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }

/* ═══════════════════════════════ PRINT VIEW ════════════════════════════ */
.print-view-wrapper { background: white; padding: 3rem; max-width: 800px; margin: 0 auto; box-shadow: var(--card-shadow); border-radius: 12px; }
.print-header { display: flex; justify-content: space-between; margin-bottom: 3rem; border-bottom: 4px solid var(--primary); padding-bottom: 1.5rem; }
.company-details h2 { color: var(--primary); font-size: 2rem; margin-bottom: 0.5rem; }
.company-details p { margin: 0.2rem 0; color: var(--text-light); font-size: 0.875rem; }
.quote-meta { text-align: right; }
.client-section { background: var(--light); padding: 1.25rem; border-radius: 8px; margin-bottom: 2rem; }
.terms-section { margin-top: 4rem; font-size: 0.8rem; color: var(--text-light); border-top: 1px solid var(--border); padding-top: 1rem; }
.signature-row { margin-top: 4rem; display: flex; justify-content: space-between; }
.signature-box { border-top: 1px solid #333; width: 45%; padding-top: 0.5rem; font-size: 0.8rem; color: var(--text-light); }

/* ── SIGNATURE PAD NUMÉRIQUE ─────────────────────────────────────────────── */
.sig-pad-wrapper {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    position: relative;
    width: 220px;
    height: 72px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.sig-pad-wrapper:hover { border-color: var(--primary); }
.sig-pad-wrapper canvas {
    width: 220px;
    height: 72px;
    border-radius: 7px;
    touch-action: none;
    display: block;
    cursor: crosshair;
}
.sig-pad-wrapper .sig-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    color: var(--text-light);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0.6;
}
.sig-pad-wrapper.has-sig .sig-hint { display: none; }
[data-theme="dark"] .sig-pad-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .sig-pad-wrapper canvas { background: transparent; }

/* ── TOGGLE 2FA ──────────────────────────────────────────────────────────── */
#profile-mfa-toggle:checked + span { background: var(--primary); }
#profile-mfa-toggle:checked + span #mfa-knob { transform: translateX(24px); }

/* ═══════════════════════════════ PLACEHOLDER ═══════════════════════════ */
.placeholder-page { text-align: center; padding: 4rem 2rem; }
.placeholder-icon { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.4; }
.placeholder-page h2 { color: var(--dark); margin-bottom: 0.75rem; }
.placeholder-page p { color: var(--text-light); max-width: 400px; margin: 0 auto; line-height: 1.6; }
.placeholder-page .coming-badge { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 0.75rem; font-weight: 600; padding: 0.375rem 0.875rem; border-radius: 999px; margin-top: 1.5rem; }

/* ═══════════════════════════════ MODAL ═════════════════════════════════ */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99999 !important; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.open, .modal-overlay.active { display: flex; }

.modal { background: white; padding: 2rem; border-radius: 16px; max-width: 520px; width: 92%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--dark); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-light); font-size: 1.25rem; padding: 0.25rem; border-radius: 4px; }
.modal-close:hover { background: var(--light); color: var(--dark); transform: none; }

/* ═══════════════════════════════ SIDEBAR SEARCH ════════════════════════ */
.sidebar-search-container {
    padding: 1.25rem 1rem 0.5rem 1rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.25s ease;
}
.search-input-wrapper:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.search-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.sidebar-search-input {
    width: 100%;
    padding: 0.6rem 2.25rem 0.6rem 2.25rem;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 0.8rem;
    font-family: inherit;
}
.sidebar-search-input::placeholder {
    color: #475569;
}
.search-icon-svg {
    position: absolute;
    left: 0.75rem;
    width: 14px;
    height: 14px;
    fill: #475569;
    pointer-events: none;
    transition: fill 0.25s;
}
.search-input-wrapper:focus-within .search-icon-svg {
    fill: var(--primary);
}
.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}
.search-clear-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════ RESPONSIVE ════════════════════════════ */
/* ── NOUVELLES CLASSES RESPONSIVES ── */
.grid-responsive-lg { display: grid; gap: 1.5rem; }
.table-responsive-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.5rem; }

@media (max-width: 1024px) {
    .grid-responsive-lg { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    #sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: -100%;
        height: calc(100vh - var(--topbar-height));
        z-index: 90;
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }
    #sidebar.show { left: 0; }
    #main-content { padding: 1rem; }
    .form-grid { grid-template-columns: 1fr !important; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar-title { display: none; }
    .topbar-subtitle { display: none; }
    .financial-summary { width: 100%; }
    
    /* Table Responsive Scroll Fix */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    /* L'ancien hack display:block sur les TR/TD est retiré. Le tableau défilera horizontalement. */
    .line-item-row input, .line-item-row select { width: 100%; }
}

/* ═══════════════════════════════ PRINT MEDIA ═══════════════════════════ */
@media print {
    #topbar, #sidebar, .no-print { display: none !important; }
    #main-content { padding: 0; overflow: visible; }
    body, #app-layout { overflow: visible; height: auto; }
    .print-view-wrapper { box-shadow: none; border-radius: 0; max-width: 100%; padding: 0; }
    @page { margin: 1.5cm; }
}


/* DARK THEME VARIABLES */
[data-theme="dark"] {
    --light: #0f172a;
    --dark: #f8fafc;
    --border: #334155;
    --text: #cbd5e1;
    --text-light: #94a3b8;
    --card-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
    --card-bg: #1e293b;
    background: #09090b;
}

[data-theme="dark"] body {
    background: #09090b;
    color: var(--text);
}

[data-theme="dark"] #topbar {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .topbar-logo-img {
    /* Filters removed for colored logo */
}

[data-theme="dark"] .card, 
[data-theme="dark"] .stat-card,
[data-theme="dark"] .form-control,
[data-theme="dark"] table th,
[data-theme="dark"] table td,
[data-theme="dark"] .modal,
[data-theme="dark"] .header {
    background: #1e293b;
    border-color: #334155;
    color: var(--text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    background: #1e293b;
    border-color: var(--primary);
    outline: none;
}

[data-theme="dark"] .btn-outline {
    background: transparent;
    color: #a78bfa;
    border-color: #a78bfa;
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .page-title,
[data-theme="dark"] .card-title,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] strong {
    color: #f8fafc !important;
}

[data-theme="dark"] .nav-section-header, [data-theme="dark"] .nav-item {
    color: #cbd5e1;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background: #334155;
}

/* Fix CSS switch toggle for dark mode */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }


[data-theme="dark"] #main-content {
    background: #09090b;
}

[data-theme="dark"] .financial-summary,
[data-theme="dark"] .client-section,
[data-theme="dark"] .print-view-wrapper,
[data-theme="dark"] .quote-card {
    background: #1e293b;
    border-color: #334155;
    color: var(--text);
}

.dispatch-zone {
    min-height: 100px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
}
.dispatch-zone.drag-over {
    background: rgba(147, 51, 234, 0.1);
    border-color: var(--primary);
}

/* GPS Pulse Marker Styles */
.gps-pulse-marker {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gps-pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 2;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.gps-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid;
    animation: pulse-ring 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    opacity: 0;
}
.gps-pulse-label {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-weight: 600;
}
@keyframes pulse-ring {
    0% { transform: scale(0.3); opacity: 0.8; }
    80%, 100% { transform: scale(1.5); opacity: 0; }
}



/* ==========================================================================
   PREMIUM AESTHETICS (WOW FACTOR)
   ========================================================================== */

body {
    background-image: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
                      radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
}
.dark-mode body {
    background-image: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
                      radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.05) 0%, transparent 40%);
}

#topbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode #topbar {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.15);
}

.dark-mode .card:hover {
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
}

.btn {
    overflow: hidden;
    position: relative;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    100% { transform: scale(30, 30); opacity: 0; }
}

#sidebar {
    background: linear-gradient(180deg, #111827 0%, #1e1b4b 100%);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.nav-section-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.nav-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    transform: translateX(4px);
}
.nav-item {
    transition: all 0.2s ease;
}

.modal {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.dark-mode .modal {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

