/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.text-red { color: #cc0000; }
.font-bold { font-weight: bold; }

/* TICKET STYLES */
.ticket-body {
    background-color: #e0e4e8;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.ticket-container {
    width: 210mm; /* A4 width roughly */
    min-height: 297mm;
    background-color: white;
    padding: 40px 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    color: #000;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.company-name {
    font-family: 'Times New Roman', Times, serif;
    font-size: 36px;
    color: #001a4d; /* Dark blue */
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.company-subinfo {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.header-divider {
    height: 3px;
    background-color: #001a4d;
    margin-top: 10px;
}

/* Meta Info */
.meta-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
}

.order-col {
    font-size: 18px;
}
.order-col span {
    font-size: 22px;
}

/* Section Boxes */
.section-box {
    border: 2px solid #000;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.section-title {
    background-color: #000b29; /* Very dark blue */
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    font-size: 14px;
}

.section-content {
    padding: 10px 15px;
}

.data-row {
    margin-bottom: 6px;
    font-size: 15px;
}

.data-row .label {
    color: #555;
    display: inline-block;
    min-width: 140px;
}

.data-row .value {
    color: #001a4d;
    font-weight: 600;
}

/* Accessories */
.accessories-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.acc-box {
    background-color: #f4f5f7;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    width: 15%;
}

.acc-label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.acc-check {
    width: 24px;
    height: 24px;
    border: 2px solid #000;
    margin: 0 auto;
    background-color: white;
}
.acc-check.checked::after {
    content: 'X';
    font-weight: bold;
    font-size: 18px;
    line-height: 20px;
}

/* Finances */
.finances-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.finance-box {
    width: 31%;
    border-radius: 10px;
    text-align: center;
    padding: 15px;
    border: 2px solid #001a4d;
}

.light-box {
    background-color: white;
    color: #001a4d;
}

.dark-box {
    background-color: #000b29;
    color: white;
}

.fin-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.fin-value {
    font-size: 24px;
    font-weight: bold;
}

/* Signatures */
.signatures-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    margin-top: 50px;
}

.signature-box {
    width: 35%;
    text-align: center;
}

.signature-canvas-container {
    height: 60px;
    display: flex;
    align-items: end;
    justify-content: center;
    margin-bottom: 5px;
}

.staff-name {
    font-weight: bold;
    font-size: 18px;
}

.signature-line {
    border-top: 2px solid #000;
    margin-bottom: 5px;
}

.signature-label {
    font-size: 14px;
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    font-size: 12px;
    color: #333;
}

.conditions {
    margin-top: 15px;
    font-size: 10px;
    text-align: left;
}

/* UI Controls (NO PRINT) */
.controls-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: #001a4d;
    color: white;
}

.btn-success {
    background-color: #25D366; /* WhatsApp green */
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

/* --- RESPONSIVIDAD PARA DISPOSITIVOS MÓVILES --- */
@media screen and (max-width: 768px) {
    /* Contenedores Principales */
    .panel-container {
        margin: 10px !important;
        padding: 15px !important;
        width: auto !important;
    }

    /* Cabeceras y Flex Layouts */
    .header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    .header-flex > div {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    
    .flex-row {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .flex-col {
        width: 100% !important;
    }

    /* Tablas Deslizables (Scroll horizontal) */
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    th, td { padding: 10px !important; font-size: 13px !important; }

    /* Ajustes específicos de campos e inputs */
    #search-orders {
        width: 100% !important;
        margin-bottom: 0px !important;
    }
    
    .controls-panel {
        position: static !important;
        margin-top: 20px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    
    .btn {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 10px !important;
        box-sizing: border-box;
    }

    /* Dashboard Reportes */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Vista de Ticket en Móvil */
    .ticket-body {
        flex-direction: column !important;
        padding: 5px !important;
    }

    #print-wrapper {
        width: 100% !important;
    }

    .ticket-container {
        width: 100% !important;
        padding: 20px 15px !important;
    }
    .company-name { font-size: 20px !important; text-align: center; }
    .meta-info { flex-direction: column !important; gap: 10px !important; font-size: 13px !important; text-align: center !important; }
    .order-col { font-size: 16px !important; }
    .order-col span { font-size: 18px !important; }
    
    .section-content {
        display: flex !important;
        flex-direction: column !important;
    }

    .data-row { display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 8px; border-bottom: 1px dotted #ccc; padding-bottom: 2px;}
    .data-row .label { min-width: auto; font-size: 11px; }
    .data-row .value { font-size: 11px; text-align: right; }

    .finances-row { flex-direction: column !important; gap: 15px !important; }
    .finance-box { width: 100% !important; display: flex; justify-content: space-between; align-items: center; padding: 10px 15px !important; }
    .fin-label { margin-bottom: 0 !important; font-size: 12px !important; }
    .fin-value { font-size: 18px !important; }
    
    .accessories-grid { flex-wrap: wrap !important; gap: 10px !important; justify-content: space-between !important; }
    .acc-box { width: 48% !important; }

    .signatures-row { flex-direction: column !important; gap: 20px !important; margin-top: 20px !important; }
    .signature-box { width: 100% !important; }

    #ticket-qrcode {
        width: 100% !important;
        align-items: center !important;
        margin-top: 15px !important;
    }

    /* Login */
    .login-card {
        padding: 25px 20px !important;
        margin: 15px !important;
        width: calc(100% - 30px) !important;
        box-sizing: border-box;
    }
}

/* --- PRINT RULES --- */
@media print {
    @page {
        margin: 8mm; 
        size: A4 landscape;
    }
    html, body {
        background-color: white !important;
        padding: 0;
        margin: 0;
    }
    .ticket-body {
        padding: 0 !important;
        background: white !important;
    }
    #print-wrapper {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 281mm;
        max-height: 194mm;
        overflow: hidden;
        box-sizing: border-box;
    }
    .ticket-container {
        box-shadow: none !important;
        width: 138mm;
        max-width: 138mm;
        padding: 5mm !important;
        margin: 0;
        min-height: auto;
        border: none !important;
        border-top: 3px solid #001a4d !important;
        border-image: none !important;
    }
    
    /* Header */
    .header { margin-bottom: 4px !important; padding-bottom: 6px !important; border-bottom: 2px solid #001a4d !important; }
    .company-name { font-size: 18px !important; -webkit-text-fill-color: #001a4d !important; background: none !important; }
    .company-subinfo { font-size: 9px !important; margin-bottom: 1px !important; line-height: 1.3 !important; }
    
    /* Meta info */
    .meta-info { margin-bottom: 6px !important; font-size: 10px !important; padding: 5px 8px !important; border-radius: 4px !important; border-left: 3px solid #001a4d !important; }
    .order-col span { font-size: 16px !important; }
    
    /* Section boxes */
    .section-box { margin-bottom: 4px !important; border-width: 1px !important; }
    .section-title { padding: 3px 8px !important; font-size: 10px !important; }
    .section-content { padding: 4px 8px !important; margin: 0 !important; }
    
    /* New colored rows */
    .tk-row { margin-bottom: 1px !important; font-size: 10px !important; padding: 2px 4px !important; }
    .tk-lbl { min-width: 90px !important; font-size: 10px !important; }
    .tk-val { font-size: 10px !important; }
    
    /* Finances */
    .finances-row { margin-bottom: 6px !important; gap: 6px !important; }
    .finance-box { padding: 5px 8px !important; border-radius: 6px !important; }
    .fin-label { font-size: 9px !important; margin-bottom: 3px !important; }
    .fin-value { font-size: 13px !important; }
    
    /* Signatures */
    .signatures-row { margin-top: 10px !important; margin-bottom: 6px !important; gap: 10px !important; }
    .sig-area { padding: 8px !important; border-radius: 6px !important; }
    .signature-canvas-container { height: 35px !important; }
    .sig-label { font-size: 9px !important; letter-spacing: 1px !important; }
    
    /* Footer */
    .tk-footer { padding: 5px 8px !important; font-size: 8px !important; margin: 0 -5mm -5mm -5mm !important; border-radius: 0 !important; }
    
    .company-logo-img { max-height: 40px !important; }

    .no-print {
        display: none !important;
    }
    /* Forzar colores de fondo */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* --- DARK MODE ENABLEMENT --- */
body.dark-mode {
    background-color: #121212 !important;
    background: #121212 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .navbar, 
body.dark-mode .rpt-navbar {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%) !important;
    border-bottom: 3px solid #00c6ff !important;
}

body.dark-mode .card, 
body.dark-mode .table-card, 
body.dark-mode .stat-card, 
body.dark-mode .kpi-card, 
body.dark-mode .chart-card,
body.dark-mode .search-card,
body.dark-mode .section-box {
    background-color: #1e1e1e !important;
    background: #1e1e1e !important;
    color: #e2e8f0 !important;
    border-color: #333333 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
}

body.dark-mode input, 
body.dark-mode select, 
body.dark-mode textarea {
    background-color: #2c2c2c !important;
    color: #f7fafc !important;
    border-color: #444444 !important;
}

body.dark-mode table th {
    background-color: #2c2c2c !important;
    color: #cbd5e0 !important;
    border-bottom-color: #444444 !important;
}

body.dark-mode table td {
    border-color: #2d2d2d !important;
    color: #cbd5e0 !important;
}

body.dark-mode tr:hover td {
    background-color: #252525 !important;
}

body.dark-mode .btn-nav {
    background-color: #2c2c2c !important;
    border-color: #444444 !important;
}

body.dark-mode .stat-val, 
body.dark-mode .kpi-value {
    color: #4facfe !important;
}

body.dark-mode .stat-lbl, 
body.dark-mode .kpi-label {
    color: #a0aec0 !important;
}

body.dark-mode a {
    color: #4facfe !important;
}

body.dark-mode .login-card {
    background-color: #1e1e1e !important;
    color: #e2e8f0 !important;
}

/* --- APP LAYOUT & SIDEBAR (MODERN REDESIGN) --- */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: #f0f4f8;
}

.sidebar {
    width: 100px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 15px 0 15px 15px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 30px);
    position: sticky;
    top: 15px;
    z-index: 6000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar:hover {
    width: 240px;
}

.sidebar-header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 90px;
    height: 90px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.sidebar-logo {
    max-width: 85px;
    height: auto;
}

.sidebar-menu {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 0;
}

.menu-item {
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    text-decoration: none;
    color: #64748b;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.menu-item i {
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.menu-label {
    margin-left: 15px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .menu-label {
    opacity: 1;
}

.menu-item:hover {
    background: rgba(0, 198, 255, 0.08);
    color: #0088ff;
}

.menu-item.active {
    background: #00c6ff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

.menu-item.active i {
    color: white;
}

/* Tooltip style when sidebar is narrow */
.sidebar:not(:hover) .menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    margin-left: 20px;
    background: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 7000;
}

.sidebar:not(:hover) .menu-item:hover::after {
    opacity: 1;
    visibility: visible;
    margin-left: 12px;
}

.sidebar-footer {
    width: 100%;
    padding: 20px 12px 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.logout-btn {
    width: 100%;
    height: 54px;
    background: #fff1f2;
    border: none;
    border-radius: 16px;
    color: #e11d48;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #e11d48;
    color: white;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

.main-content {
    flex-grow: 1;
    padding: 25px;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Sidebar Toggle for Mobile (Replaced with a more modern version) */
#sidebar-toggle {
    display: none;
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Dark mode adjustments for sidebar */
body.dark-mode .sidebar {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
body.dark-mode .logo-container { background: #1e293b; }
body.dark-mode .menu-item { color: #94a3b8; }
body.dark-mode .menu-item:hover { background: rgba(0, 198, 255, 0.15); }
body.dark-mode .logout-btn { background: rgba(225, 29, 72, 0.1); }
body.dark-mode .sidebar-footer { border-top-color: rgba(255,255,255,0.05); }

/* WhatsApp Status Mini-Pill in Sidebar */
.wa-status-mini {
    position: absolute;
    bottom: -10px;
    right: 15px;
    background: white;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: all 0.3s;
}

.wa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
}

.wa-status-mini:hover {
    transform: scale(1.1);
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        left: -100px;
        top: 0;
        bottom: 0;
        margin: 0;
        height: 100vh;
        border-radius: 0 24px 24px 0;
        transition: left 0.4s;
    }
    .sidebar.open {
        left: 0;
        width: 85px; /* Stay narrow on mobile unless expanded */
    }
    .sidebar.open:active {
        width: 240px;
    }
    #sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    .main-content {
        padding: 15px;
    }
}

/* WhatsApp CTA Section */
.whatsapp-cta-box {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    border: none;
    display: none; /* Se muestra vía JS */
}

.whatsapp-cta-box h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.whatsapp-cta-box p {
    font-size: 13px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.whatsapp-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #128C7E;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
}

.whatsapp-cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

@media print {
    .whatsapp-cta-box {
        display: none !important;
    }
    .whatsapp-cta-btn {
        display: none !important; 
    }
}

/* --- DEBT CONTROL MODERN STYLES --- */
.debt-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.debt-stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-left: 6px solid #ddd;
    transition: transform 0.3s ease;
}

.debt-stat-card:hover {
    transform: translateY(-5px);
}

.debt-stat-card.receivable { border-left-color: #28a745; }
.debt-stat-card.payable { border-left-color: #dc3545; }
.debt-stat-card.balance { border-left-color: #001a4d; }

.debt-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.debt-stat-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debt-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.debt-stat-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

.search-box-container {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
    border-color: #001a4d;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pending { background: #fff7ed; color: #c2410c; }
.status-badge.overdue { background: #fef2f2; color: #b91c1c; }
.status-badge.paid { background: #f0fdf4; color: #15803d; }

.debt-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-view { background: #f1f5f9; color: #475569; }
.btn-view:hover { background: #e2e8f0; }

.btn-pay { background: #f0fdf4; color: #16a34a; }
.btn-pay:hover { background: #dcfce7; }

/* Dark mode overrides for debts */
body.dark-mode .debt-stat-card,
body.dark-mode .search-box-container {
    background: #1e1e1e !important;
    border-color: #333 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}

body.dark-mode .debt-stat-title { color: #94a3b8; }
body.dark-mode .debt-stat-value { color: #f1f5f9; }
body.dark-mode .search-input-wrapper input {
    background: #2c2c2c;
    border-color: #444;
    color: white;
}

@media (max-width: 768px) {
    .debt-stats-grid {
        grid-template-columns: 1fr;
    }
}
/* --- PUNTO DE VENTA (POS) Y TIENDA --- */
.pos-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    height: calc(100vh - 120px);
}

.product-catalog {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
}

.product-card {
    background: #fdfdfd;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #001a4d;
}

.product-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f1f5f9;
}

.product-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    display: block;
    height: auto;
    overflow: visible;
}

.product-price {
    color: #0033cc;
    font-weight: 800;
    font-size: 16px;
}

.product-stock {
    font-size: 11px;
    color: #718096;
    margin-top: 5px;
}

.category-filter {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.cat-pill {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-pill.active {
    background: #001a4d;
    color: white;
}

.cart-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 30px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
}

.cart-summary {
    background: #f8fafc;
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.cart-total-big {
    font-size: 24px;
    font-weight: 800;
    color: #001a4d;
    text-align: right;
}

/* Dark mode for Store */
body.dark-mode .product-catalog,
body.dark-mode .cart-panel {
    background: #1e1e1e;
    color: white;
}

body.dark-mode .product-card {
    background: #2c2c2c;
    border-color: #444;
}

body.dark-mode .product-name { color: #f1f5f9; }
body.dark-mode .cat-pill { background: #333; color: #94a3b8; }
body.dark-mode .cat-pill.active { background: #0033cc; color: white; }
body.dark-mode .cart-summary { background: #2d2d2d; border-color: #444; }

@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* --- MODERN POS 2026 STYLES --- */
.pos-main-layout { width: 100%; margin-bottom: 100px; }

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 10px 0;
}

.modern-search {
    padding: 14px 20px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    width: 300px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    outline: none;
    transition: all 0.3s;
}
.modern-search:focus { border-color: #0052D4; box-shadow: 0 8px 20px rgba(0,82,212,0.1); }

.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    padding: 10px 22px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.cat-pill:hover { background: #e2e8f0; color: #1e293b; }
.cat-pill.active {
    background: #0052D4;
    color: white;
    box-shadow: 0 10px 20px rgba(0,82,212,0.2);
}

.product-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 24px;
    padding: 18px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border-color: #0052D4;
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 15px;
    background: #f8fafc;
}

.product-name { 
    font-weight: 700; 
    color: #0f172a; 
    margin-bottom: 8px; 
    font-size: 16px; 
    min-height: auto;
    height: auto;
    overflow: visible;
    line-height: 1.4;
}
.product-price { font-size: 22px; font-weight: 800; color: #0052D4; letter-spacing: -0.5px; }
.product-stock { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; margin-top: auto; padding-top: 10px; }

/* Bottom Bar */
.cart-bottom-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 50px;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    z-index: 1500;
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.bar-content { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.bar-info { display: flex; align-items: center; gap: 15px; }

.cart-icon-container { position: relative; font-size: 28px; }
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.btn-checkout-fast {
    background: #0052D4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0,82,212,0.2);
    transition: all 0.3s;
}
.btn-checkout-fast:hover { transform: scale(1.05); filter: brightness(1.1); }

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    background: white;
    z-index: 2100;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}
.cart-drawer.open { right: 0; }

.drawer-header {
    padding: 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-close-drawer { font-size: 30px; background: none; border: none; cursor: pointer; color: #94a3b8; }

.drawer-body { flex-grow: 1; overflow-y: auto; padding: 25px; }
.drawer-cart-items { margin-bottom: 30px; }

.checkout-form { background: #f8fafc; padding: 20px; border-radius: 15px; }
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.modern-input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #e2e8f0; outline: none; }

.drawer-footer { padding: 25px; background: white; border-top: 1px solid #f1f5f9; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.total-row span { font-size: 14px; font-weight: 600; color: #64748b; }
.total-val { font-size: 28px; font-weight: 800; color: #0052D4 !important; }

.btn-confirm-sale {
    width: 100%;
    padding: 18px;
    border-radius: 15px;
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,131,176,0.3);
    margin-bottom: 12px;
}
.btn-clear-cart { width: 100%; background: none; border: none; color: #f43f5e; font-size: 13px; font-weight: 600; cursor: pointer; }

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
}
.drawer-overlay.open { display: block; }

@media (max-width: 768px) {
    .cart-drawer { width: 100%; right: -100%; }
    .cart-bottom-bar { width: 95%; }
}

/* --- PROFORMA PREMIUM STYLES --- */
.modern-bg {
    background: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
}

.shop-header-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px 35px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.premium-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #001a4d, #0052D4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premium-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.proforma-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: flex-start;
}

.catalog-section {
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.search-bar-container {
    margin-bottom: 30px;
}

.search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.glass-search {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border-radius: 15px;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    font-size: 15px;
    transition: all 0.3s;
}

.glass-search:focus {
    border-color: #0052D4;
    background: white;
    box-shadow: 0 0 0 5px rgba(0,82,212,0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

.pro-category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    background: #3e4451; /* Charcoal Gray */
    color: #e2e8f0;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: none;
    margin-right: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0;
    overflow: visible;
    height: 38px;
    --cat-color: #ffaf5f; /* Default Premium Orange */
}

.cat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    background: #4e5561; /* Lighter Charcoal */
    filter: brightness(1.15); /* Lighten everything on hover */
}

.cat-pill.active {
    background: #1e293b;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06), 0 0 0 3px color-mix(in srgb, var(--cat-color), transparent 60%);
}

.cat-accent {
    background: var(--cat-color);
    height: 100%;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px 0 0 6px;
    color: #1e293b;
    font-size: 16px;
    flex-shrink: 0;
}

.cat-label {
    padding: 0 16px;
    display: block;
}

.cat-notch {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid #3e4451;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    transition: border-left-color 0.2s;
}

.cat-pill:hover .cat-notch {
    border-left-color: #4e5561;
}

.cat-pill.active .cat-notch {
    border-left-color: #1e293b;
    border-right: 4px solid var(--cat-color);
    right: -10px;
}

.product-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.product-img-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f8fafc;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.5s;
    padding: 10px;
}

.product-card:hover .product-img { transform: scale(1.1); }

.product-info { padding: 20px; }
.product-category-tag { font-size: 10px; color: #0052D4; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; }
.product-name { 
    font-weight: 700; 
    font-size: 15px; 
    color: #1e293b; 
    margin-bottom: 12px; 
    height: auto; 
    min-height: auto;
    overflow: visible; 
    line-height: 1.4;
    display: block;
}
.product-price { font-size: 20px; font-weight: 800; color: #0052D4; }

.add-to-pro-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
}

.product-card:hover .add-to-pro-indicator { opacity: 1; transform: translateY(0); }

/* Sticky Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 30px;
    padding: 25px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
}

.proforma-cart-list {
    min-height: 150px;
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 25px;
    border-radius: 12px;
}

.cart-item-row-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
}

.item-name { font-weight: 700; font-size: 14px; color: #1e293b; }
.item-meta { font-size: 11px; color: #94a3b8; }
.qty-selector { display: flex; align-items: center; background: #f1f5f9; border-radius: 12px; padding: 4px; }
.qty-selector button { border: none; background: white; width: 24px; height: 24px; border-radius: 8px; cursor: pointer; font-weight: 800; }
.qty-selector span { margin: 0 10px; font-weight: 800; font-size: 13px; }
.item-subtotal { font-weight: 800; color: #0052D4; min-width: 60px; text-align: right; }
.item-remove { background: none; border: none; color: #cbd5e1; cursor: pointer; margin-left: 10px; }
.item-remove:hover { color: #f43f5e; }

.proforma-summary { margin: 25px 0; padding: 20px; background: #f8fafc; border-radius: 15px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 600; color: #64748b; }
.total-big { font-size: 22px; font-weight: 800; color: #1e293b; margin-top: 15px; border-top: 2px solid #e2e8f0; padding-top: 15px; }

.btn-generate-proforma {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #001a4d 0%, #0052D4 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,82,212,0.2);
    margin-bottom: 15px;
}

.empty-cart-state { text-align: center; color: #cbd5e1; padding: 40px 0; }
.empty-cart-state i { font-size: 40px; margin-bottom: 10px; }

/* Responsive Proforma */
@media (max-width: 1024px) {
    .proforma-layout { grid-template-columns: 1fr; }
    .sticky-sidebar { position: static; }
}

@media (max-width: 768px) {
    .shop-header-glass { 
        flex-direction: column; 
        text-align: center; 
        padding: 20px; 
        gap: 15px; 
        border-radius: 0;
    }
    .header-left { flex-direction: column; }
    .premium-title { font-size: 22px; }
    .catalog-section { padding: 15px; border-radius: 0; }
    .product-grid-modern { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
    .product-img-wrapper { height: 140px; }
    .sticky-sidebar { padding: 15px; border-radius: 0; }
    .proforma-summary { padding: 15px; }
    .btn-generate-proforma { padding: 15px; font-size: 14px; }
}

/* --- VITRINA DIGITAL (INVENTARIO GALLERY) --- */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

.inventory-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.inventory-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: #4facfe;
}

.card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.inventory-card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #4facfe;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 2;
}

.card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    display: block;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.card-stock-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.stock-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stock-ok { background: #ecfdf5; color: #10b981; }
.stock-low { background: #fff1f2; color: #f43f5e; border: 1px solid #fecaca; }

.card-price-box {
    text-align: right;
}

.price-total {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #0052D4;
}

.price-base {
    font-size: 11px;
    color: #94a3b8;
}

.card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
}

.card-actions .btn {
    flex: 1;
    padding: 8px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Dark mode adjustments for cards */
body.dark-mode .inventory-card {
    background: #1e1e1e;
    border-color: #333;
}
body.dark-mode .card-title { color: #f1f5f9; }
body.dark-mode .card-subtitle { color: #94a3b8; }
body.dark-mode .card-actions { background: #252525; border-color: #333; }
body.dark-mode .price-total { color: #60a5fa; }
body.dark-mode .card-image-wrapper { background: #1a1a1a; border-color: #333; }

/* --- FINANCIAL CONTROL DASHBOARD --- */
.fin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fin-stat-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border-left: 6px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.fin-stat-card:hover {
    transform: translateY(-5px);
}

.fin-stat-card.blue { border-left-color: #3b82f6; }
.fin-stat-card.green { border-left-color: #10b981; }
.fin-stat-card.red { border-left-color: #ef4444; }

.fin-stat-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.fin-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
}

.fin-main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
}

.fin-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

.fin-card-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.trans-table th {
    text-align: left;
    padding: 12px 15px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #f1f5f9;
}

.trans-table td {
    padding: 15px;
    border-bottom: 1px solid #f8fafc;
    font-size: 14px;
}

.type-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.type-income { background: #ecfdf5; color: #059669; }
.type-expense { background: #fff1f2; color: #e11d48; }

@media (max-width: 992px) {
    .fin-main-layout {
        grid-template-columns: 1fr;
    }
}

/* --- RECURRING EXPENSES --- */
.recurring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}
.recurring-item.paid { border-left: 4px solid #10b981; }
.recurring-item.pending { border-left: 4px solid #f59e0b; }
.recurring-item.overdue { border-left: 4px solid #ef4444; }

.recurring-info { display: flex; flex-direction: column; gap: 2px; }
.recurring-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.recurring-status { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.recurring-status.green { color: #059669; }
.recurring-status.gold { color: #d97706; }
.recurring-status.red { color: #dc2626; }

.btn-quick-pay {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.btn-remove-recurring {
    color: #94a3b8;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 0 8px;
    margin-right: 4px;
    transition: all 0.2s ease;
    border-radius: 4px;
}
.btn-remove-recurring:hover {
    color: #e11d48;
    background: #fff1f2;
}

body.dark-mode .fin-stat-card,
body.dark-mode .fin-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}
body.dark-mode .fin-stat-value,
body.dark-mode .fin-card-title {
    color: #f1f5f9 !important;
}
body.dark-mode .trans-table th {
    border-bottom-color: #333 !important;
}
body.dark-mode .trans-table td {
    border-bottom-color: #262626 !important;
    color: #cbd5e1 !important;
}
body.dark-mode .recurring-item {
    background: #262626;
    border-color: #333;
}
body.dark-mode .recurring-name {
    color: #f1f5f9;
}



/* --- FINANCIAL CALENDAR --- */
/* --- MODERN CALENDAR TRANSFORMATION (DESIGN MATCH) --- */
.modern-cal-card {
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    max-width: 650px; /* Further reduced from 800px */
}

.modern-cal-container {
    display: flex;
    min-height: 300px; /* Reduced from 380px */
}

/* Sidebar */
.cal-sidebar {
    width: 100px; /* Reduced from 140px */
    background: white;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
}

.cal-sidebar-day {
    font-size: 34px; /* Reduced from 48px */
    font-weight: 900;
    color: #ff5b3a;
    line-height: 1;
    margin-bottom: 2px;
}

.cal-sidebar-month {
    font-size: 10px; /* Reduced from 12px */
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
}

/* Main Panel */
.cal-main-panel {
    flex: 1;
    background: #f8fafc;
    padding: 10px; /* Reduced from 15px */
}

.cal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cal-view-toggles {
    display: flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 6px;
}

.cal-view-toggles button {
    border: none;
    background: transparent;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px; /* Reduced from 10px */
    font-weight: 700;
    color: #64748b;
}

.cal-month-display {
    font-size: 12px; /* Reduced from 14px */
    font-weight: 800;
    color: #1e293b;
}

/* Grid Wrapper */
.calendar-grid-wrapper {
    background: white;
    border-radius: 10px;
    padding: 8px;
}

.calendar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px; /* Further reduced gap */
}

.calendar-day-head {
    text-align: center;
    font-size: 8px; /* Reduced from 9px */
    font-weight: 900;
    color: #ff5b3a;
    padding: 4px 0;
}

.calendar-day {
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #f1f5f9;
}

.day-number {
    font-size: 10px; /* Reduced from 12px */
    font-weight: 800;
    color: #1e293b;
}

.cal-event-dot {
    width: 5px;
    height: 5px;
}
.cal-event-dot.pending { background: #eab308; }
.cal-event-dot.overdue { background: #ef4444; }
.cal-event-dot.paid { background: #22c55e; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .modern-cal-container { flex-direction: column; }
    .cal-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #f1f5f9; }
    .cal-sidebar-top { text-align: center; margin-bottom: 20px; }
    .cal-sidebar-menu { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* --- QUICK SALE & CASH REGISTER --- */
.quick-shortcuts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-fast {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.btn-fast:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-fast:active {
    transform: translateY(0);
    background: #cbd5e1;
}

.quick-basket {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin-bottom: 15px;
    min-height: 50px;
    padding: 10px;
}

.basket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    margin-bottom: 4px;
    animation: slideIn 0.2s ease-out;
}

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

.basket-item-info {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.basket-item-price {
    font-size: 12px;
    font-weight: 800;
    color: #3b82f6;
    margin-right: 10px;
}

.btn-remove-item {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

/* Modal Simple para Corte de Caja */
.closing-modal-overlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.closing-modal {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.closing-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.closing-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.closing-value {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}
