/* =====================================================================
   GardeniaControl — Estilos principales
   Paleta: verde gardenia (salud + frescura), blanco limpio, grises sobrios
   ===================================================================== */

:root {
    --brand: #2E7D5B;
    --brand-dark: #1F5A3F;
    --brand-light: #E8F5EE;
    --brand-accent: #D4AF37; /* acento dorado sutil */
    --success: #2E7D5B;
    --danger: #C62828;
    --warning: #E67E22;
    --info: #2196F3;
    --body-bg: #F4F6F8;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-muted: #7F8C8D;
    --border: #E5E9EC;
    --sidebar-bg: #1F2A37;
    --sidebar-text: #CBD5E1;
    --sidebar-active: #2E7D5B;
    --sidebar-hover: #2D3949;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5;
}

/* ============ AUTH (login / forgot) ============ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1F5A3F 0%, #2E7D5B 50%, #4CAF85 100%);
    padding: 20px;
}
.auth-wrapper {
    width: 100%;
    max-width: 440px;
}
.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px 36px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-logo {
    width: 64px; height: 64px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 12px;
}
.auth-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 4px;
}
.auth-brand p { color: var(--text-muted); margin: 0; font-size: 13px; }
.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

/* ============ SHELL ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 16px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 16px;
    border-bottom: 1px solid #2D3949;
    margin-bottom: 12px;
    color: white;
    font-weight: 700;
    font-size: 16px;
}
.sidebar-brand i { color: var(--brand-accent); font-size: 22px; }
.nav-section {
    padding: 14px 20px 6px;
    font-size: 10.5px;
    letter-spacing: 1px;
    color: #6B7683;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    border-left: 3px solid transparent;
}
.nav-item i { width: 20px; font-size: 16px; text-align: center; }
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--brand-accent);
}
.main-shell {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-shell { margin-left: 0; }
}

/* ============ TOPBAR ============ */
.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-title { flex: 1; font-weight: 600; color: var(--text); font-size: 15px; }
.topbar-user { display: flex; align-items: center; gap: 14px; }

.badge-caja {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.badge-caja.caja-abierta { background: #E8F5EE; color: #1F5A3F; }
.badge-caja.caja-abierta i { color: #2E7D5B; font-size: 8px; animation: pulse 2s infinite; }
.badge-caja.caja-cerrada { background: #FFF3E0; color: #BF5700; }

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

.btn-user { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-user i { font-size: 22px; color: var(--brand); }

/* ============ CONTENT ============ */
.content { flex: 1; padding: 24px; max-width: 100%; }
.content-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    text-align: center;
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-title i { color: var(--brand); }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ============ CARDS ============ */
.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    font-weight: 600;
}

/* Stat cards (dashboard) */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    height: 100%;
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger  { border-left-color: var(--danger);  }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.info    { border-left-color: var(--info);    }
.stat-card .stat-label {
    text-transform: uppercase;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.stat-card .stat-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.stat-card .stat-icon {
    float: right;
    font-size: 28px;
    opacity: 0.25;
    color: var(--brand);
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-brand {
    background: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}
.btn-outline-primary, .btn-outline-brand {
    color: var(--brand);
    border-color: var(--brand);
}
.btn-outline-primary:hover, .btn-outline-brand:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

/* ============ TABLES ============ */
.table {
    background: white;
    margin: 0;
}
.table thead th {
    background: #F8FAFB;
    color: var(--text);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border);
}
.table tbody tr:hover { background: #FAFBFC; }
.table td { vertical-align: middle; }

/* ============ FORMS ============ */
.form-label { font-weight: 500; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.form-control, .form-select {
    border-radius: 6px;
    border-color: var(--border);
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(46,125,91,0.15);
}
.required::after {
    content: " *";
    color: var(--danger);
}

/* ============ BADGES ============ */
.badge-estado {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-estado.pagada     { background: #E8F5EE; color: #1F5A3F; }
.badge-estado.pendiente  { background: #FFF3E0; color: #BF5700; }
.badge-estado.parcial    { background: #FFF8E1; color: #8B6914; }
.badge-estado.anulada    { background: #FFEBEE; color: #B71C1C; }
.badge-estado.abierta    { background: #E8F5EE; color: #1F5A3F; }
.badge-estado.cerrada    { background: #ECEFF1; color: #455A64; }

/* ============ VENTA CARRITO ============ */
.venta-carrito {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 16px;
}
.carrito-item {
    border-bottom: 1px dashed var(--border);
    padding: 10px 0;
}
.carrito-item:last-child { border-bottom: none; }
.carrito-total {
    background: var(--brand-light);
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 14px;
}
.carrito-total .total-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.carrito-total .total-value { font-size: 26px; font-weight: 700; color: var(--brand-dark); }

/* ============ DASHBOARD CHARTS ============ */
.chart-container { position: relative; height: 280px; }

/* ============ RESPONSIVE UTILITIES ============ */
@media (max-width: 768px) {
    .content { padding: 16px; }
    .page-title { font-size: 17px; }
    .stat-card .stat-value { font-size: 20px; }
}

/* Print friendly (comprobantes) */
@media print {
    .sidebar, .topbar, .content-footer, .no-print { display: none !important; }
    .main-shell { margin-left: 0; }
    .content { padding: 0; }
}
