/* ==========================================================================
   Variables y Reset (Admin)
   ========================================================================== */
   :root {
    --primary-blue: #0A2540;
    --accent-blue: #00AEEF;
    --white: #FFFFFF;
    --light-bg: #F3F4F6;
    --gray-100: #F9FAFB;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --purple: #8B5CF6;
    
    --sidebar-width: 260px;
    --font-main: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); color: var(--gray-800); background-color: var(--light-bg); }
.hidden { display: none !important; }
.mt-4 { margin-top: 2rem; }

/* ==========================================================================
   Login Administrativo
   ========================================================================== */
.login-bg { background-color: var(--primary-blue); display: flex; align-items: center; justify-content: center; min-height: 100vh; background-image: linear-gradient(135deg, #0A2540 0%, #15416e 100%); }
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--white); border-radius: 12px; padding: 40px 30px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header .logo-img { height: 50px; margin-bottom: 10px; }
.login-header .logo-fallback { font-size: 28px; font-weight: 900; color: var(--primary-blue); letter-spacing: 1px; }
.login-subtitle { color: var(--gray-600); font-weight: 500; font-size: 0.95rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon span { position: absolute; left: 12px; color: var(--gray-600); font-size: 20px; }
.input-with-icon input { width: 100%; padding: 12px 12px 12px 40px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.input-with-icon input:focus { border-color: var(--primary-blue); }

.demo-notice { background: #EFF6FF; color: #1E3A8A; padding: 10px 15px; border-radius: 8px; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; border: 1px solid #BFDBFE; font-weight: 500; }
.demo-notice span.material-symbols-outlined { font-size: 18px; }

.btn-primary { width: 100%; background: var(--primary-blue); color: var(--white); border: none; padding: 14px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.3s; display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-primary:hover { background: #0d3156; }
.login-footer { text-align: center; color: rgba(255,255,255,0.7); font-size: 0.8rem; margin-top: 20px; }

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */
.dashboard-body { display: flex; min-height: 100vh; overflow-x: hidden; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--white); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 50; transition: transform 0.3s ease; }
.sidebar-header { padding: 25px 20px; border-bottom: 1px solid var(--gray-200); }
.sidebar-header .logo-fallback { font-weight: 900; color: var(--primary-blue); }
.sidebar-subtitle { font-size: 0.8rem; color: var(--gray-600); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 5px; }
.sidebar-nav { flex: 1; padding: 20px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: var(--gray-600); text-decoration: none; font-weight: 500; transition: all 0.2s; border-left: 4px solid transparent; }
.nav-item:hover { background: var(--gray-100); color: var(--primary-blue); }
.nav-item.active { background: #F0F9FF; color: var(--primary-blue); border-left-color: var(--primary-blue); font-weight: 600; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--gray-200); }
.text-danger { color: var(--danger); }
.text-danger:hover { color: #B91C1C; background: #FEF2F2; }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; width: calc(100% - var(--sidebar-width));}
.topbar { background: var(--white); height: 70px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 40;}
.menu-toggle { display: none; background: none; border: none; color: var(--gray-800); cursor: pointer; font-size: 24px; }
.topbar-search { display: flex; align-items: center; background: var(--light-bg); border-radius: 8px; padding: 8px 15px; width: 350px; }
.topbar-search span { color: var(--gray-600); margin-right: 8px; }
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.9rem; }
.topbar-profile { display: flex; align-items: center; gap: 15px; }
.profile-info { display: flex; flex-direction: column; text-align: right; }
.profile-name { font-weight: 600; font-size: 0.9rem; color: var(--gray-800); }
.profile-role { font-size: 0.75rem; color: var(--gray-600); }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* Dashboard Content */
.dashboard-container { padding: 30px; }
.page-header { margin-bottom: 25px; }
.page-header h2 { color: var(--primary-blue); font-size: 1.8rem; font-weight: 800; }
.page-header p { color: var(--gray-600); font-size: 0.95rem; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.kpi-card { background: var(--white); border-radius: 12px; padding: 25px; box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; gap: 15px; border: 1px solid var(--gray-200); transition: transform 0.2s;}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--white); }
.kpi-icon span { font-size: 26px; }
.bg-blue { background: var(--primary-blue); }
.bg-green { background: var(--success); }
.bg-purple { background: var(--purple); }
.bg-orange { background: var(--warning); }
.kpi-details h3 { font-size: 0.85rem; color: var(--gray-600); font-weight: 600; margin-bottom: 5px; text-transform: uppercase;}
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--gray-800); margin-bottom: 5px; }
.kpi-trend { font-size: 0.8rem; display: flex; align-items: center; gap: 4px; color: var(--gray-600); font-weight: 500;}
.kpi-trend.positive { color: var(--success); }
.kpi-trend.warning { color: var(--warning); }
.kpi-trend span { font-size: 14px; }

/* Data Tables */
.content-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { padding: 20px 25px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { color: var(--primary-blue); font-size: 1.2rem; font-weight: 700; }
.btn-outline-sm { background: transparent; border: 1px solid var(--gray-300); padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--gray-600); transition: all 0.2s;}
.btn-outline-sm:hover { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-400);}
.btn-outline-sm span { font-size: 16px; }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { background: #F8FAFC; padding: 15px 25px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-600); font-weight: 700; border-bottom: 1px solid var(--gray-200); white-space: nowrap;}
.data-table td { padding: 15px 25px; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; color: var(--gray-800); vertical-align: middle; white-space: nowrap;}
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr:last-child td { border-bottom: none; }
.method-cell { display: flex; align-items: center; gap: 8px; font-weight: 500;}

/* Badges de Estado */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge.success { background: var(--success-bg); color: #065F46; }
.badge.warning { background: var(--warning-bg); color: #92400E; }

/* Botones de acción tabla */
.action-btn { background: none; border: none; color: var(--primary-blue); cursor: pointer; padding: 5px; border-radius: 4px; transition: background 0.2s;}
.action-btn:hover { background: var(--light-bg); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.modal-card { background: var(--white); width: 100%; max-width: 400px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-md); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { color: var(--primary-blue); font-size: 1.1rem; }
.close-modal { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-600); }
.modal-body { padding: 20px; }
.mock-voucher { background: var(--light-bg); padding: 15px; border-radius: 8px; font-size: 0.9rem; border: 1px dashed var(--gray-300);}
.mock-voucher hr { border: none; border-top: 1px solid var(--gray-300); margin: 10px 0; }
.mock-voucher em { font-size: 0.8rem; color: var(--gray-600); }

/* Helpers & Animaciones */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: var(--white); animation: spin 1s ease-in-out infinite; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* Responsive */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 10px rgba(0,0,0,0.1);}
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
    .topbar-search { display: none; }
}