:root {
    color-scheme: dark;
    --bg-body: #0f1117;
    --bg-surface: #161920;
    --bg-hover: #1e222b;
    --border: #2a2e39;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
    --teal: #14b8a6;
    --blue: #0ea5e9;
    --purple: #8b5cf6;
    --sidebar-w: 260px;
    --topbar-h: 70px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-main: 'DM Sans', sans-serif;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background: var(--bg-body); color: var(--text-main); line-height: 1.5; font-size: 14px; overflow-x: hidden; }

/* Typography & Utilities */
h1, h2, h3 { font-weight: 700; color: #fff; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* App Layout Grid (More robust than fixed) */
.app-container { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; overflow: hidden; background: var(--bg-body); }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg-surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 1000; transition: transform 0.3s; box-shadow: 10px 0 30px rgba(0,0,0,0.2); }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.logo-placeholder { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--purple)); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 12px; font-weight: 800; }
.sidebar-nav { padding: 20px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-muted); border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; text-decoration: none !important; }
.nav-item i { font-size: 1.3rem; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-main); }
.nav-item.active { background: rgba(59, 130, 246, 0.15); color: var(--primary) !important; border-left: 3px solid var(--primary); padding-left: 13px; }

/* Main Content Container */
.main-content { 
    height: 100vh; 
    display: grid; 
    grid-template-rows: auto auto 1fr; /* Topbar, Filters, ContentArea */
    overflow: hidden; 
}

/* Header & Filter bars (Fixed positions in grid) */
.topbar, .global-filters { 
    z-index: 100;
}

/* Content Sections (Scrollable Area) */
.content-section { 
    overflow-y: auto; 
    padding: 32px; 
    display: none; 
    animation: fadeIn 0.3s ease; 
    height: 100%; /* Ocupa el 1fr del grid */
}
.content-section.active { display: block; }

/* Topbar */
.topbar { height: var(--topbar-h); background: var(--bg-surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 90; }
.clock { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px; font-family: var(--font-main); font-weight: 500; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-hover); color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-text { background: transparent; color: var(--primary); font-weight: 600; padding: 8px; }
.btn-text:hover { text-decoration: underline; }
.btn-icon { padding: 6px; background: transparent; color: var(--text-muted); border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.btn-icon:hover { color: var(--text-main); background: var(--bg-hover); border-color: var(--border); }

/* Global Filters */
.global-filters { background: var(--bg-surface); padding: 16px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.filter-group label { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
select, input[type="date"], input[type="text"], input[type="password"], input[type="number"], input[type="month"], textarea { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; font-family: var(--font-main); font-size: 0.9rem; outline: none; transition: border 0.2s; width: 100%; }
select:focus, input:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Alerts */
.alert-box { padding: 16px; border-radius: var(--radius-md); display: flex; gap: 12px; margin-bottom: 24px; align-items: flex-start; line-height: 1.6; }
.alert-box.amber { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--amber); color: #fcd34d; }
.alert-box i { font-size: 1.5rem; }

/* Stats Cards / Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.stat-card { background: var(--bg-surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.blue::before { background: var(--primary); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.purple::before { background: var(--purple); }

/* Activity Feeds */
.feeds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; margin-top: 24px; }
.dashboard-feed-box { background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; height: 450px; box-shadow: var(--shadow-lg); }
.feed-header { padding: 16px 24px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: space-between; }
.feed-header h3 { font-size: 1rem; margin-bottom: 0; display: flex; align-items: center; gap: 8px; }
.feed-content { flex: 1; overflow-y: auto; padding: 0; }
.feed-item { padding: 12px 24px; border-bottom: 1px solid var(--border); transition: background 0.2s; display: flex; align-items: center; gap: 12px; }
.feed-item:hover { background: var(--bg-hover); }
.feed-item:last-child { border-bottom: none; }

/* Custom Scrollbar */
.feed-content::-webkit-scrollbar { width: 6px; }
.feed-content::-webkit-scrollbar-track { background: transparent; }
.feed-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.feed-content::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.stat-title { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: #fff; }

/* Generic Panel Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: var(--bg-surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-title { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 1.1rem; color: #fff; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 24px; }
.chart-container { background: var(--bg-surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.chart-container h3 { margin-bottom: 20px; font-size: 1.1rem; }
.chart-wrapper { position: relative; width: 100%; height: 280px; }
.doughnut-wrapper { position: relative; width: 100%; aspect-ratio: 1; max-height: 280px; margin: 0 auto; }
.custom-legend { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.legend-color { width: 12px; height: 12px; border-radius: 3px; }

/* Datatables */
.table-container { background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow-x: auto; box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 16px 24px; background: rgba(0,0,0,0.2); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; }
.data-table th:hover { color: var(--text-main); }
.data-table th i { font-size: 14px; vertical-align: middle; margin-left: 4px; opacity: 0.5; }
.data-table td { padding: 16px 24px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.td-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; width: 100%; min-height: 32px; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 32px; font-style: italic; }

/* Badges & Colors */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.badge.emitida, .color-green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge.recibida, .color-red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge.teal { background: rgba(20, 184, 166, 0.15); color: var(--teal); }
.badge.pend, .badge.active, .bg-green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge.expired, .bg-red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge.pagd { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.color-purple { color: #a78bfa; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; color: #fff; margin-right: 8px; vertical-align: middle; }
.avatar.empresa { background: var(--primary); }
.avatar.javier { background: var(--purple); }
.avatar.gonzalo { background: var(--amber); }

/* Specific Highlights */
.row-urgent { background: rgba(239, 68, 68, 0.05); border-left: 4px solid var(--red); }
.row-warning { background: rgba(245, 158, 11, 0.05); border-left: 4px solid var(--amber); }
.color-teal { color: var(--teal); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; overflow-y: auto; padding: 40px 20px; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-surface); width: 100%; max-width: 500px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: scale(0.95); transition: transform 0.3s; display: flex; flex-direction: column; margin-bottom: 40px; }
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.btn-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: color 0.2s; }
.btn-close:hover { color: #fff; }
.modal-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; margin-top: auto; }

/* Login UI Enhancements */
#login-overlay .modal {
    background: #1a1d26;
    border-radius: 20px;
}
#password-reqs li {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
#password-reqs li i {
    font-size: 14px;
}
#password-reqs li.met {
    color: var(--green) !important;
}
#strength-bar {
    border-radius: 2px;
}
#login-error {
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
/* Operative Cards (Cobrar) */
.credito-card { background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; margin-bottom: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.credito-card.vencido { border-left: 6px solid var(--red); background: rgba(239, 68, 68, 0.03); }
.credito-card.hoy { border-left: 6px solid var(--amber); background: rgba(245, 158, 11, 0.03); }
.credito-card.normal { border-left: 6px solid var(--primary); }

.c-left { width: 350px; padding: 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between;}
.c-left-header h3 { font-size: 1.2rem; margin-bottom: 4px; color: #fff; }
.c-left-header p { color: var(--text-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; margin-top: 6px;}
.c-actions { display: flex; gap: 8px; margin-top: 24px; }

.c-right { flex: 1; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.fin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.fin-stat { background: var(--bg-body); padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
.fin-stat .lbl { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.fin-stat .val { font-size: 1.1rem; font-weight: 700; color: #fff; }

/* Dashboard Cobranzas Specifics */
.progress-box { background: var(--bg-surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.progress-head { display: flex; justify-content: space-between; align-items: center; }
.p-title { color: var(--text-muted); font-size: 1rem; }
.p-val { font-size: 1.2rem; font-weight: 700; color: #fff;}
.progress-track { width: 100%; height: 12px; background: rgba(0,0,0,0.3); border-radius: 6px; overflow: hidden; position: relative; border: 1px solid var(--border);}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); border-radius: 6px; transition: width 0.5s; width: 0%; }

.layout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
.panel { background: var(--bg-surface); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.panel h3 { margin-bottom: 16px; font-size: 1.1rem; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;}

.list-group { display: flex; flex-direction: column; gap: 12px; max-height: 350px; overflow-y: auto;}
.list-item { padding: 12px; background: var(--bg-body); border-radius: 8px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;}
.list-item.danger { border-left: 3px solid var(--red); }
.list-item.warning { border-left: 3px solid var(--amber); }

.l-left strong { display: block; font-size: 1rem; margin-bottom: 2px;}
.l-left span { font-size: 0.8rem; color: var(--text-muted); }
.l-right { font-weight: 700; font-size: 1.1rem; color: #fff;}

/* Simulators Box (Crear Credito) */
.summary-box { background: rgba(59, 130, 246, 0.05); border: 1px solid var(--primary); padding: 20px; border-radius: var(--radius-md); margin-bottom: 24px; }
.sum-metrics { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .lbl { color: var(--primary); font-size: 0.8rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.metric .val { font-size: 1.5rem; font-weight: 700; color: #fff; }
.client-preview { display: flex; padding: 12px; background: var(--bg-hover); border-radius: 8px; border: 1px solid var(--border); align-items: center; gap: 12px; margin-top: 8px; }
.client-preview i { font-size: 1.5rem; color: var(--primary); }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; text-align: left; }

.search-box { display: flex; gap: 12px; align-items: center; width: 400px; }

/* Print Styles & PDF Mode */
body.pdf-mode {
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --border: #cbd5e1;
    background: #ffffff !important;
}
body.pdf-mode * { color: #000000; }
body.pdf-mode .stat-title { color: #555555 !important; }
body.pdf-mode .stat-value { color: #000000 !important; font-weight: bold !important; }
body.pdf-mode .color-green { color: #16a34a !important; }
body.pdf-mode .color-red { color: #dc2626 !important; }
body.pdf-mode .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-weight: bold !important; }
body.pdf-mode .badge.teal { color: #0f766e !important; }
body.pdf-mode .badge.red { color: #b91c1c !important; }
body.pdf-mode .badge.emitida { color: #1d4ed8 !important; }
body.pdf-mode .badge.recibida { color: #b91c1c !important; }

body.pdf-mode .sidebar, body.pdf-mode .topbar, body.pdf-mode .global-filters, body.pdf-mode .header-actions, 
body.pdf-mode .td-actions, body.pdf-mode .modal-overlay, body.pdf-mode th:last-child, body.pdf-mode td:last-child, 
body.pdf-mode .btn, body.pdf-mode .c-actions { display: none !important; }
body.pdf-mode .main-content { margin-left: 0; width: 100%; background: #ffffff !important; display: flex !important; flex-direction: column !important; }
body.pdf-mode .content-section { display: none !important; margin-bottom: 40px !important; }
body.pdf-mode #sec-dashboard-cobranzas { display: block !important; order: -1; }
body.pdf-mode #sec-operativo, body.pdf-mode #sec-arca, body.pdf-mode #sec-bancos, body.pdf-mode #sec-dashboard { display: block !important; }
body.pdf-mode .stat-card, body.pdf-mode .chart-container, body.pdf-mode .table-container, body.pdf-mode .credito-card { box-shadow: none; border: 1px solid var(--border); background: #ffffff !important; }

@media print {
    @page { margin: 10mm; size: landscape; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #ffffff !important; }
    .content-section { page-break-inside: auto; }
    .table-container, .chart-container, .stat-card, .credito-card { page-break-inside: avoid; }
}

/* Layout Desktop Forzado (v11) - Mantener siempre vista completa estilo PC */
.sidebar {
    transform: translateX(0) !important;
    width: var(--sidebar-w);
    position: sticky;
    top: 0;
    height: 100vh;
}
.mobile-only { display: none !important; }
/* .main-content: margin-left removed because it was redundant with the grid layout */

/* Receipt & Printing */
.receipt-container { 
    width: 440px; 
    margin: 0 auto !important; 
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    color: #000; 
    box-shadow: 0 0 40px rgba(0,0,0,0.1); 
    font-family: 'DM Sans', sans-serif;
    position: relative;
    display: block;
}
.receipt-header { text-align: center; margin-bottom: 24px; border-bottom: 2px solid #000; padding-bottom: 16px; }
.receipt-logo { width: 350px !important; height: auto !important; margin-bottom: 12px; margin: 0 auto; display: block; filter: none !important; }
.receipt-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #ddd; font-size: 0.9rem; }
.receipt-row.bold { font-weight: bold; font-size: 1rem; border-bottom: 2px solid #000; padding: 10px 0; }
.receipt-row.vertical { flex-direction: column; gap: 4px; border-bottom: none; }
.receipt-label { color: #666; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; }
.receipt-cuota-box { margin-top: 24px; background: #f2f2f2; padding: 15px; border-radius: 6px; text-align: center; display: flex; flex-direction: column; gap: 4px; border: 1px solid #ccc; }
.receipt-cuota-label { font-size: 0.7rem; font-weight: 700; opacity: 0.8; }
.receipt-cuota-value { font-size: 1.8rem; font-weight: 800; }
.receipt-footer { margin-top: 20px; text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; color: #000; border-top: 1px solid #000; padding-top: 10px; }

/* Overdue Warning Section */
.receipt-overdue-warning { margin-top: 15px; padding: 12px; background: #fff; border: 2px solid #dc2626; border-radius: 6px; text-align: center; font-family: 'Outfit', sans-serif; display: flex; flex-direction: column; gap: 6px; }
.receipt-overdue-title { color: #dc2626; font-weight: 900; font-size: 1.1rem; text-transform: uppercase; margin: 0; }
.receipt-overdue-days { color: #000; font-weight: 700; font-size: 0.95rem; }
.receipt-overdue-total { background: #dc2626; color: #fff; padding: 6px; border-radius: 4px; font-weight: 800; font-size: 1rem; margin: 4px 0; }
.receipt-overdue-footer { font-weight: 700; color: #000; font-size: 0.85rem; }

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #16a34a;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    z-index: 99999;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(150px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.2);
    font-family: 'Outfit', sans-serif;
}
.toast.active {
    transform: translateY(0);
}
.toast i {
    font-size: 1.5rem;
}

/* Premium Loader Overlay (Unified Sync Shield) */
.sync-shield {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(12px);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.5s, visibility 0.5s;
}
.sync-shield-box {
    text-align: center;
    padding: 60px;
    background: rgba(26, 29, 38, 0.5);
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sync-shield-spinner {
    width: 60px; height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 30px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.sync-shield h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.sync-shield p { color: var(--text-muted); font-size: 1.1rem; }

/* Secured Logout UI */
.logout-secured {
    transition: all 0.3s;
}
.logout-secured.locked {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: var(--green) !important;
}
.logout-secured.unlocked {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: var(--red) !important;
}

/* Gallery Navigation */
.gallery-nav {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: all 0.3s;
    margin: 0 20px;
}
.gallery-nav:hover { background: var(--primary); transform: scale(1.1); }
.gallery-counter {
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.2);
}
.gallery-controls {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
