/* ============================================
   SISTEMA CASINO - Estilos principales
   Inspirado en diseño Gestop (Azul + Teal + Rojo)
   ============================================ */

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

:root {
    --primary:    #1976D2;
    --primary-dk: #1565C0;
    --teal:       #00897B;
    --teal-lt:    #26A69A;
    --red:        #E53935;
    --orange:     #FB8C00;
    --purple:     #7B1FA2;
    --bg:         #F0F2F5;
    --white:      #FFFFFF;
    --card:       #FFFFFF;
    --text:       #212121;
    --text-2:     #616161;
    --border:     #E0E0E0;
    --sidebar-w:  280px;
    --header-h:   60px;
    --radius:     12px;
    --shadow:     0 2px 8px rgba(0,0,0,0.10);
    --shadow-lg:  0 4px 20px rgba(0,0,0,0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- HEADER ---- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: var(--primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header .app-name { color: #fff; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.5px; }
.btn-menu { background: none; border: none; cursor: pointer; color: #fff; font-size: 1.4rem; line-height:1; padding: 4px; }
.btn-logout { background: none; border: none; cursor: pointer; color: #fff; font-size: 1.4rem; padding: 4px; text-decoration: none; }

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 90;
    width: var(--sidebar-w);
    background: var(--white);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.sidebar.open { transform: translateX(0); }

.sidebar-user {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-user .avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem;
}
.sidebar-user .user-info .name { font-weight: 700; font-size: 0.95rem; }
.sidebar-user .user-info .role { font-size: 0.78rem; color: var(--text-2); }

.sidebar-section { padding: 10px 12px 4px; font-size: 0.72rem; font-weight: 700; color: var(--text-2); letter-spacing: 1px; text-transform: uppercase; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px;
    text-decoration: none; color: var(--text);
    font-size: 0.93rem; font-weight: 600;
    border-radius: 8px; margin: 2px 8px;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #E3F2FD; color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .nav-icon { font-size: 1.2rem; width: 24px; text-align: center; }

/* ---- OVERLAY ---- */
.overlay {
    display: none; position: fixed; inset: 0; z-index: 80;
    background: rgba(0,0,0,0.35);
}
.overlay.show { display: block; }

/* ---- MAIN CONTENT ---- */
.main {
    margin-top: var(--header-h);
    padding: 28px 24px;
    min-height: calc(100vh - var(--header-h));
}

/* ---- CARDS ---- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.card-header .ch-icon { font-size: 1.6rem; }
.card-header h2 { font-size: 1.15rem; font-weight: 800; }

/* ---- WELCOME ---- */
.welcome-card {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 40px 30px;
    text-align: center;
    max-width: 480px;
    margin: 60px auto;
}
.welcome-card .logo { font-size: 5rem; margin-bottom: 16px; }
.welcome-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.welcome-card p { color: var(--text-2); }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border: none; border-radius: 40px;
    font-family: 'Nunito', sans-serif; font-size: 0.82rem; font-weight: 700;
    cursor: pointer; text-decoration: none; letter-spacing: 0.5px; text-transform: uppercase;
    transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-teal      { background: var(--teal); color: #fff; }
.btn-red       { background: var(--red); color: #fff; }
.btn-orange    { background: var(--orange); color: #fff; }
.btn-purple    { background: var(--purple); color: #fff; }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-sm        { padding: 6px 13px; font-size: 0.78rem; }
.btn-icon      { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1rem; }

/* ---- TOOLBAR ---- */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 18px;
}
.search-box {
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--border); border-radius: 40px;
    padding: 7px 16px; background: #fff;
    font-family: 'Nunito', sans-serif; font-size: 0.88rem;
}
.search-box input { border: none; outline: none; width: 160px; font-family: inherit; }

.date-field {
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--border); border-radius: 40px;
    padding: 7px 16px; background: #fff;
    font-family: 'Nunito', sans-serif; font-size: 0.88rem;
}
.date-field label { font-size: 0.75rem; color: var(--text-2); white-space: nowrap; }
.date-field input { border: none; outline: none; font-family: inherit; font-size: 0.88rem; }

.per-page {
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--border); border-radius: 40px;
    padding: 7px 14px; background: #fff;
    font-size: 0.88rem;
}
.per-page select { border: none; outline: none; font-family: inherit; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 10px 14px; text-align: left;
    font-size: 0.82rem; font-weight: 700; color: var(--text-2);
    border-bottom: 2px solid var(--border);
}
.th-icon { display: inline-flex; align-items: center; gap: 7px; }
.th-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; font-size: 0.9rem;
}
.th-blue   { background: var(--primary); color: #fff; }
.th-teal   { background: var(--teal); color: #fff; }
.th-red    { background: var(--red); color: #fff; }
.th-orange { background: var(--orange); color: #fff; }
.th-purple { background: var(--purple); color: #fff; }
.th-gray   { background: #757575; color: #fff; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: #F5F5F5; }
tbody td { padding: 12px 14px; font-size: 0.9rem; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ---- BADGES ---- */
.badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700;
}
.badge-green  { background: #E8F5E9; color: #2E7D32; }
.badge-red    { background: #FFEBEE; color: #C62828; }
.badge-blue   { background: #E3F2FD; color: #1565C0; }
.badge-orange { background: #FFF3E0; color: #E65100; }
.badge-purple { background: #F3E5F5; color: #6A1B9A; }
.badge-gray   { background: #F5F5F5; color: #424242; }

/* ---- INFO BANNER ---- */
.info-banner {
    background: #E3F2FD; border-radius: 8px;
    padding: 12px 18px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; color: var(--primary); font-weight: 600;
}
.info-banner.teal { background: #E0F2F1; color: var(--teal); }
.alert-banner {
    background: #FFEBEE; border-radius: 8px;
    padding: 12px 18px; margin-bottom: 16px;
    color: var(--red); font-weight: 600; font-size: 0.9rem;
}
.success-banner {
    background: #E8F5E9; border-radius: 8px;
    padding: 12px 18px; margin-bottom: 16px;
    color: #2E7D32; font-weight: 600; font-size: 0.9rem;
}

/* ---- ACCORDION (solicitudes) ---- */
.accordion-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.accordion-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; cursor: pointer;
    background: #fff; transition: background 0.12s;
}
.accordion-header:hover { background: #F5F5F5; }
.accordion-icon { font-size: 1.4rem; }
.accordion-title { font-weight: 700; flex: 1; font-size: 0.9rem; }
.accordion-chips { display: flex; gap: 7px; align-items: center; }
.chip {
    padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.chip-user   { background: #FFF3E0; color: #E65100; }
.chip-type   { background: #F3E5F5; color: #6A1B9A; }
.chip-status { background: #E3F2FD; color: var(--primary); }
.accordion-toggle { font-size: 1rem; color: var(--text-2); transition: transform 0.2s; }
.accordion-toggle.open { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.accordion-body.show { display: block; }

/* ---- MODAL ---- */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: #fff; border-radius: 16px; padding: 0;
    width: 90%; max-width: 460px; box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    padding: 18px 22px;
    font-size: 1.05rem; font-weight: 800;
    display: flex; align-items: center; gap: 10px;
    background: var(--teal); color: #fff;
}
.modal-body { padding: 22px; }
.modal-footer { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 16px;
    border: 1.5px solid var(--border); border-radius: 40px;
    font-family: 'Nunito', sans-serif; font-size: 0.9rem; color: var(--text);
    outline: none; transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23616161'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; }
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: #ccc; border-radius: 24px; cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider:before {
    content: ''; position: absolute; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background: white; border-radius: 50%;
    transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--teal); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 60%, #01579B 100%);
}
.login-card {
    background: #fff; border-radius: 20px; padding: 36px 32px;
    width: 90%; max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    text-align: center;
}
.login-logo { font-size: 4rem; margin-bottom: 8px; }
.login-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; color: var(--primary); }
.login-subtitle { color: var(--text-2); font-size: 0.85rem; margin-bottom: 26px; }
.login-card .form-control { border-radius: 10px; text-align: left; }
.login-tip {
    background: #E3F2FD; border-radius: 8px; padding: 10px 14px;
    font-size: 0.8rem; color: var(--primary); margin-bottom: 16px; text-align: left;
    display: flex; gap: 7px;
}
.btn-login {
    width: 100%; padding: 13px; border-radius: 10px; font-size: 1rem;
    background: var(--primary); color: #fff; border: none; cursor: pointer;
    font-family: 'Nunito', sans-serif; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 0.15s;
}
.btn-login:hover { background: var(--primary-dk); }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-2); font-size: 1rem; background: none; border: none; }

/* ---- STATS ROW ---- */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
    flex: 1; min-width: 140px;
    background: #fff; border-radius: 12px; padding: 18px 20px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat-icon { font-size: 2rem; }
.stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.page-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--border);
    background: #fff; cursor: pointer; font-family: 'Nunito', sans-serif;
    font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; justify-content: center;
    transition: background 0.12s;
}
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover:not(.active) { background: #E3F2FD; }

/* ---- PEDIDO FORM ---- */
.pedido-row {
    display: grid; grid-template-columns: 130px repeat(4, 1fr); gap: 10px;
    align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.pedido-row-header { font-weight: 700; font-size: 0.82rem; color: var(--text-2); padding-bottom: 8px; }
.pedido-fecha { font-size: 0.88rem; font-weight: 600; }
.pedido-input {
    width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
    font-family: 'Nunito', sans-serif; font-size: 0.9rem; text-align: center;
}
.pedido-input:focus { outline: none; border-color: var(--primary); }

/* ---- MATERIAL ICONS ---- */
.material-icons { font-size: inherit; vertical-align: middle; line-height: 1; }

/* ---- NAV ITEMS con iconos circulares ---- */
.nav-icon-wrap {
    width: 34px; height: 34px; border-radius: 50%;
    background: #F0F4FF;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.nav-icon-wrap .nav-mi { font-size: 1.2rem; color: var(--primary); }
.nav-item:hover .nav-icon-wrap { background: #BBDEFB; }
.nav-item.active .nav-icon-wrap,
.nav-icon-active { background: rgba(255,255,255,0.25) !important; }
.nav-item.active .nav-icon-wrap .nav-mi { color: #fff; }

/* Colores específicos por módulo (igual que original) */
.nav-item:nth-child(1) .nav-icon-wrap { background: #E0F7FA; } /* registro consumo - cyan */
.nav-item:nth-child(1) .nav-mi        { color: #00838F; }
.nav-item:nth-child(2) .nav-icon-wrap { background: #E8F5E9; } /* enrolamiento - verde */
.nav-item:nth-child(2) .nav-mi        { color: #2E7D32; }
.nav-item:nth-child(3) .nav-icon-wrap { background: #E3F2FD; } /* reporte - azul claro */
.nav-item:nth-child(3) .nav-mi        { color: #1565C0; }
.nav-item:nth-child(4) .nav-icon-wrap { background: #FFF3E0; } /* solicitud - naranja */
.nav-item:nth-child(4) .nav-mi        { color: #E65100; }
.nav-item:nth-child(5) .nav-icon-wrap { background: #F3E5F5; } /* listar - morado */
.nav-item:nth-child(5) .nav-mi        { color: #6A1B9A; }
.nav-item:nth-child(6) .nav-icon-wrap { background: #E8EAF6; } /* areas - indigo */
.nav-item:nth-child(6) .nav-mi        { color: #283593; }
.nav-item:nth-child(7) .nav-icon-wrap { background: #E0F7FA; } /* adicional - teal */
.nav-item:nth-child(7) .nav-mi        { color: #006064; }
.nav-item:nth-child(8) .nav-icon-wrap { background: #FFF8E1; } /* cambiar clave - ambar */
.nav-item:nth-child(8) .nav-mi        { color: #F57F17; }
.nav-item:nth-child(9) .nav-icon-wrap { background: #FCE4EC; } /* rectificar - rosa */
.nav-item:nth-child(9) .nav-mi        { color: #880E4F; }
.nav-item:nth-child(10) .nav-icon-wrap { background: #E8F5E9; } /* usuarios */
.nav-item:nth-child(10) .nav-mi        { color: #1B5E20; }

.nav-item.active .nav-icon-wrap { background: rgba(255,255,255,0.22) !important; }
.nav-item.active .nav-mi        { color: #fff !important; }

/* ---- TH BADGES con Material Icons ---- */
.th-badge { width: 30px; height: 30px; }
.th-badge .material-icons { font-size: 1rem; }
    .main { padding: 16px 12px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .stats-row { flex-direction: column; }
    .pedido-row { grid-template-columns: 100px repeat(4, 1fr); gap: 6px; }
}
/* Responsive */
@media (max-width: 600px) {
    .main { padding: 16px 12px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .stats-row { flex-direction: column; }
    .pedido-row { grid-template-columns: 100px repeat(4, 1fr); gap: 6px; }
}
