@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Brand Colors - Nodo ICM */
    --primary: #0d47a1;
    --primary-light: #5472d3;
    --primary-dark: #002171;

    /* Semantic Colors */
    --success: #2e7d32;
    --error: #c62828;
    --warning: #f9a825;
    --info: #0288d1;

    /* Neutrals */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;

    /* Layout & Effects */
    --border-radius: 16px;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-blur: blur(8px);

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
    /* padding-top: 70px;  Manejado dinámicamente vía clase .user-authenticated */
}

/* Clase para cuando el usuario está logueado */
body.user-authenticated {
    padding-top: 70px;
}

body.user-authenticated .main-header {
    display: flex;
}

/* Global Header Support */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1000;
    padding: 0 16px;
    display: none; /* Oculto por defecto en el login */
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header logo image */
.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-dark);
}

.header-right {
    text-align: right;
    gap: 16px;
    display: none;
    /* Oculto por defecto, se muestra vía JS al loguear */
}

.date-time {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustment for header */
@media (max-width: 360px) {
    .date-time {
        display: none;
    }

    .user-name {
        max-width: 60px;
    }
}

/* Logout button */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 18px;
    padding: 5px 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
    line-height: 1;
}

.btn-logout:hover {
    background: rgba(198, 40, 40, 0.08);
    border-color: var(--error);
    color: var(--error);
}

.btn-logout .logout-label {
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .logout-label {
        display: none;
    }

    .date-time {
        display: none;
    }
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
}

/* Primary Button Styling */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-secondary:active {
    background: rgba(13, 71, 161, 0.05);
    transform: scale(0.98);
}

/* Input Styling */
.input-group {
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 16px;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

/* Responsive Container */
main {
    flex: 1;
    padding: 20px;
    width: 100%;
    margin: 0 auto;
    max-width: 500px;
    /* Base para mobile */
}

@media (min-width: 768px) {
    main {
        max-width: 850px;
        /* Más ancho en escritorio */
        padding: 40px 20px;
    }
}

/* Screen basic layout */
.screen {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrado vertical para el login */
}

/* Animated Hero Background */
.hero-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--primary-light) 0%, transparent 60%),
        radial-gradient(circle at 30% 20%, #eff6ff 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #dbeafe 0%, transparent 50%);
    z-index: -1;
    filter: blur(80px);
    animation: rotateBg 20s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Splash Header */
.splash-header {
    text-align: center;
    margin-top: 20px;
    /* Reducido de 40px */
    margin-bottom: 20px;
    /* Reducido de 40px */
}

/* Login screen logo image */
.login-logo {
    width: 100%;
    height: 100%;
    max-height: 150px;
    /* Límite para evitar desplazamiento vertical */
    object-fit: contain;
    padding: 8px;
    border-radius: 16px;
}

/* Logo container en la pantalla de login */
.logo-container {
    width: 110px;
    height: 110px;
    margin: 0 auto 10px;
    /* Reducido de 20px */
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Subtítulo con mejor contraste */
.splash-subtitle {
    color: #e7dddd;
    /* Gris claro para máxima legibilidad */
    font-weight: 700;
    /* Más peso */
    font-size: 16px;
    /* Ligero aumento */
    margin-top: 2px;
}

/* Mantener estilo antiguo por compatibilidad */
.splash-header p {
    color: var(--text-muted);
    font-weight: 400;
}

/* Login Card */
.login-card {
    padding: 32px 24px;
    margin-bottom: 40px;
}

.login-card h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.login-card label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

/* Transitions */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

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

/* Dashboard Specific Styles */
.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-muted);
}

/* Top Nav */
.top-nav {
    padding: 12px 20px;
    margin: 10px;
    border-radius: 20px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 800;
    color: var(--primary);
    font-size: 18px;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-card.success .value {
    color: var(--success);
}

.metric-card.error .value {
    color: var(--error);
}

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

.metric-info .label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-info .value {
    font-size: 20px;
    font-weight: 700;
}

.balance-card {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.balance-card .label {
    color: rgba(255, 255, 255, 0.7);
}

.balance-card .value {
    font-size: 28px;
}

.balance-card .sync-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

/* Search Bar */
.search-container {
    margin-bottom: 24px;
}

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

.search-icon {
    font-size: 18px;
    color: var(--text-muted);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-main);
}

/* Levels Grid (Mobile First: 1 col) */
.levels-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.levels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

/* Desktop override (3 columns) */
@media (min-width: 768px) {
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.level-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition-smooth);
}

.level-card:active {
    transform: scale(0.98);
}

.level-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.level-balance {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.level-balance .currency {
    font-size: 18px;
    font-weight: 700;
}

.level-balance .amount {
    font-size: 32px;
    font-weight: 800;
}

.status-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Semáforo Logic */
.saldo-positivo {
    background: rgba(46, 125, 50, 0.08) !important;
    border-color: rgba(46, 125, 50, 0.2);
}

.saldo-positivo .level-balance,
.saldo-positivo .status-label {
    color: var(--success);
}

.saldo-alerta {
    background: rgba(249, 168, 37, 0.08) !important;
    border-color: rgba(249, 168, 37, 0.2);
}

.saldo-alerta .level-balance,
.saldo-alerta .status-label {
    color: var(--warning);
}

.saldo-negativo {
    background: rgba(198, 40, 40, 0.08) !important;
    border-color: rgba(198, 40, 40, 0.2);
}

.saldo-negativo .level-balance,
.saldo-negativo .status-label {
    color: var(--error);
}

/* Entry Section & Form */
.entry-section {
    margin-bottom: 32px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.section-header p {
    font-size: 14px;
    color: var(--text-muted);
}

#movement-form {
    padding: 24px;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Large Padding for Touch - Base field already has 14px 16px */
.select-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.submit-btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    /* Larger for focus */
    font-size: 16px;
}

/* Desktop override for form */
@media (min-width: 768px) {
    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .full-width {
        grid-column: span 2;
    }

    .submit-btn {
        width: auto;
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

.modal-content h3 {
    font-size: 22px;
    font-weight: 700;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.modal-actions .btn {
    padding: 10px 20px;
    font-size: 14px;
}

textarea.input-field {
    resize: none;
}

/* Clean up legacy */
.quick-actions,
.bottom-nav {
    display: none !important;
}

/* Admin Dashboard Specifics */
.admin-dashboard {
    width: 100%;
}

.admin-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 12px;
}

.nav-tab {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.2);
}

/* Tab Visibility Logic */
.admin-tab {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.admin-tab.active {
    display: block;
}

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

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

/* Sectores Grid */
.sectores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sector-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.status-badge {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sector-card h3 {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 600;
}

.sector-card .saldo {
    font-size: 28px;
    font-weight: 700;
    color: var(--success);
    margin: 4px 0;
}

.sector-card .desglose {
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px dashed #eee;
    padding-top: 12px;
}

/* Semáforo Utility Colors (con fondo suave) */
.text-verde {
    color: var(--success) !important;
}

.bg-soft-verde {
    background: rgba(46, 125, 50, 0.1) !important;
}

.text-amarillo {
    color: #b8860b !important;
}

.bg-soft-amarillo {
    background: rgba(249, 168, 37, 0.1) !important;
}

.text-rojo {
    color: var(--error) !important;
}

.bg-soft-rojo {
    background: rgba(198, 40, 40, 0.1) !important;
}

/* Analytics Section */
.analytics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.chart-container {
    padding: 24px;
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-container h4 {
    margin-bottom: 20px;
    color: var(--text-main);
    font-size: 16px;
}

/* Formulario Carga Central - Desktop Optimization */
@media (min-width: 900px) {
    .admin-carga-form .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .admin-carga-form .full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nav-tab {
        padding: 8px 16px;
        font-size: 14px;
    }

    .sector-card .saldo {
        font-size: 24px;
    }
}

/* --- Módulo de Reportes --- */
.reports-container {
    padding: 20px;
}

.report-filters {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.summary-card {
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kpi-label {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
}

.kpi-ingresos {
    border-left: 5px solid var(--success);
}

.kpi-ingresos .kpi-value {
    color: var(--success);
}

.kpi-egresos {
    border-left: 5px solid var(--error);
}

.kpi-egresos .kpi-value {
    color: var(--error);
}

.kpi-neto {
    border-left: 5px solid var(--primary);
}

.kpi-neto .kpi-value {
    color: var(--primary);
}

.report-preview-table {
    animation: slideUp 0.5s ease-out;
}

.table-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.table-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

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

th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.pdf-btn {
    background: #ef4444 !important;
    color: white !important;
}

.excel-btn {
    background: #10b981 !important;
    color: white !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* --- Módulo de Ajustes --- */
.ajustes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px;
}

@media (min-width: 900px) {
    .ajustes-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.ajuste-panel {
    padding: 20px;
    border-radius: 16px;
}

.ajuste-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ajuste-panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 13px !important;
    height: auto !important;
    border-radius: 8px !important;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.07);
}

.nuevo-rubro-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    background: rgba(13, 71, 161, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
}

.nuevo-rubro-inputs .input-field {
    flex: 1;
    min-width: 130px;
}

/* Usuario Cards */
.usuarios-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usuario-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usuario-info strong {
    display: block;
    font-size: 15px;
}

.usuario-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.usuario-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.control-group .input-field {
    padding: 6px 10px;
    font-size: 13px;
    height: auto;
}

/* Toggle Switch */
.toggle-group {
    align-items: flex-start;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked+.slider {
    background-color: var(--success);
}

.switch input:checked+.slider:before {
    transform: translateX(22px);
}

/* Badges de Usuario */
.usuario-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.badge-sector,
.badge-rol {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* --- Módulo de Arqueo de Caja Diario --- */
.arqueo-card {
    padding: 24px;
    margin-top: 10px;
}

.arqueo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.fondo-inicio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.fondo-inicio-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0;
}

.input-sm {
    width: 100px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    height: auto !important;
}

.saldos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.saldo-block {
    background: rgba(255, 255, 255, 0.5);
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-smooth);
}

.saldo-block .label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.saldo-block .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.saldo-block.neto {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
}

.saldo-block.neto .label,
.saldo-block.neto .value {
        color: white;
}

.saldo-block.action-block {
    justify-content: center;
    border: 1.5px dashed var(--primary-light);
    background: rgba(13, 71, 161, 0.03);
}

.btn-export-pdf {
    width: 100%;
    font-size: 13px !important;
    padding: 10px !important;
    border-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    background: white !important;
    transition: var(--transition-smooth);
}

.btn-export-pdf:hover {
    background: var(--primary-dark) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Ocultar flechas en inputs numéricos */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

@media (max-width: 600px) {
    .arqueo-header { flex-direction: column; align-items: stretch; }
    .fondo-inicio-group { justify-content: space-between; }
}

/* --- Pantalla de Carga (Loader) --- */
#pantalla-carga {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#pantalla-carga .loader-logo {
    width: 150px; /* Tamaño adaptable mobile-first */
    max-width: 80%;
    animation: latido 1.5s infinite ease-in-out;
}

@keyframes latido {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.oculto {
    opacity: 0 !important;
    visibility: hidden !important;
}