/* Sistema de Sorteo - Estilos personalizados · Casino Potosí */

:root {
    --primary: #8b1a1a;
    --primary-dark: #5c0f0f;
    --oro: #ffd700;
    --oro-suave: #c9a227;
    --success: #198754;
    --bg-dark: #12080c;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
}

main {
    flex: 1;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

.badge-role-superadmin { background-color: #dc3545; }
.badge-role-admin { background-color: #fd7e14; }
.badge-role-vendedor { background-color: #0d6efd; }

.numero-sorteo {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.premio-grande {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}

.ganador-card {
    border-left: 5px solid var(--success);
    background: linear-gradient(135deg, #d1e7dd 0%, #fff 100%);
}

.acumulado-card {
    border-left: 5px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #fff 100%);
}

/* Modal de confirmación */
.modal-confirm .modal-header {
    background-color: #dc3545;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    .premio-grande {
        font-size: 1.75rem;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Tabla responsive */
.table-responsive {
    border-radius: 0.5rem;
}

/* =====================================================
   Casino Potosí - Tema visual unificado
   ===================================================== */

body.sistema-potosi {
    background-color: #12080c !important;
    background-image:
        linear-gradient(rgba(12, 6, 10, 0.88), rgba(12, 6, 10, 0.92)),
        url('../img/fondo-potosi.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

/* Navbar casino (rojo oscuro + dorado) */
body.sistema-potosi .navbar {
    background: linear-gradient(180deg, #3d1015 0%, #1a080c 100%) !important;
    border-bottom: 2px solid var(--oro-suave);
    box-shadow: 0 4px 20px rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
}
body.sistema-potosi .navbar .navbar-brand {
    color: var(--oro) !important;
    letter-spacing: 0.04em;
}
body.sistema-potosi .navbar .nav-link {
    color: rgba(245, 230, 200, 0.9) !important;
    transition: color 0.2s ease;
}
body.sistema-potosi .navbar .nav-link:hover,
body.sistema-potosi .navbar .nav-link:focus {
    color: var(--oro) !important;
}
body.sistema-potosi .navbar .dropdown-menu {
    background: #1a0a0e;
    border: 1px solid var(--oro-suave);
}
body.sistema-potosi .navbar .dropdown-item {
    color: #f5e6c8;
}
body.sistema-potosi .navbar .dropdown-item:hover {
    background: rgba(201,162,39,.2);
    color: var(--oro);
}
body.sistema-potosi .navbar .btn-outline-light {
    border-color: var(--oro-suave);
    color: var(--oro);
}
body.sistema-potosi .navbar .btn-outline-light:hover {
    background: var(--oro);
    color: #1a080c;
    border-color: var(--oro);
}

/* Info bar */
body.sistema-potosi .bg-light.border-bottom {
    background: rgba(26, 10, 14, 0.92) !important;
    border-bottom: 1px solid rgba(201,162,39,.35) !important;
    color: #f5e6c8 !important;
}
body.sistema-potosi .bg-light.border-bottom .text-muted {
    color: rgba(201,162,39,.75) !important;
}
body.sistema-potosi .bg-light.border-bottom .text-success {
    color: var(--oro) !important;
}
body.sistema-potosi .bg-light.border-bottom .text-primary {
    color: #7dffa8 !important;
}
body.sistema-potosi .bg-light.border-bottom .text-dark,
body.sistema-potosi .bg-light.border-bottom strong {
    color: #f5e6c8 !important;
}

/* Cards sobre fondo oscuro */
body.sistema-potosi .card {
    background: rgba(26, 10, 14, 0.88);
    color: #f5e6c8;
    border: 1px solid rgba(201,162,39,.3);
    backdrop-filter: blur(6px);
}
body.sistema-potosi .card-header {
    background: rgba(61, 16, 21, 0.9);
    border-bottom: 1px solid rgba(201,162,39,.35);
    color: var(--oro);
}
body.sistema-potosi .card .text-muted {
    color: rgba(245,230,200,.55) !important;
}
body.sistema-potosi .table {
    color: #f5e6c8;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,.03);
    --bs-table-hover-bg: rgba(201,162,39,.08);
}
body.sistema-potosi .table th {
    color: var(--oro-suave);
    border-color: rgba(201,162,39,.25);
}
body.sistema-potosi .table td {
    border-color: rgba(255,255,255,.06);
}
body.sistema-potosi .form-control,
body.sistema-potosi .form-select {
    background: rgba(0,0,0,.35);
    border-color: rgba(201,162,39,.4);
    color: #f5e6c8;
}
body.sistema-potosi .form-control:focus,
body.sistema-potosi .form-select:focus {
    background: rgba(0,0,0,.45);
    border-color: var(--oro);
    color: #f5e6c8;
    box-shadow: 0 0 0 0.2rem rgba(255,215,0,.15);
}
body.sistema-potosi .form-control::placeholder {
    color: rgba(245,230,200,.4);
}
body.sistema-potosi .form-label {
    color: rgba(245,230,200,.85);
}
body.sistema-potosi .input-group-text {
    background: rgba(61,16,21,.8);
    border-color: rgba(201,162,39,.4);
    color: var(--oro);
}
body.sistema-potosi .btn-primary {
    background: linear-gradient(180deg, #a52a2a, #6b1515);
    border-color: var(--oro-suave);
}
body.sistema-potosi .btn-primary:hover {
    background: linear-gradient(180deg, #c0392b, #8b1a1a);
    border-color: var(--oro);
}
body.sistema-potosi .btn-success {
    background: linear-gradient(180deg, #1e7e4a, #0f5c32);
    border-color: #2ecc71;
}
body.sistema-potosi .btn-warning {
    background: linear-gradient(180deg, #c9a227, #8b6914);
    border-color: var(--oro);
    color: #1a080c;
}
body.sistema-potosi .alert-success {
    background: rgba(25,135,84,.2);
    border-color: #198754;
    color: #a3e4c0;
}
body.sistema-potosi .alert-danger {
    background: rgba(220,53,69,.2);
    border-color: #dc3545;
    color: #f5c2c7;
}
body.sistema-potosi .alert-warning {
    background: rgba(255,193,7,.15);
    border-color: #ffc107;
    color: #ffe69c;
}
body.sistema-potosi .alert-info {
    background: rgba(13,202,240,.12);
    border-color: #0dcaf0;
    color: #9eeaf9;
}

/* Footer */
body.sistema-potosi footer.bg-dark {
    background: linear-gradient(180deg, #1a080c, #0d0406) !important;
    border-top: 1px solid rgba(201,162,39,.3);
    color: rgba(245,230,200,.7) !important;
}

/* Animación de sorteo (overlay) */
.sorteo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8,2,4,.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.sorteo-overlay.show {
    display: flex;
}
.sorteo-spin-num {
    font-family: 'Cinzel', Georgia, 'Courier New', monospace;
    font-size: clamp(4rem, 18vw, 9rem);
    font-weight: 800;
    color: var(--oro);
    text-shadow: 0 0 40px rgba(255,215,0,.6), 0 4px 12px rgba(0,0,0,.5);
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
    animation: spinGlow 0.15s ease infinite alternate;
}
@keyframes spinGlow {
    from { text-shadow: 0 0 20px rgba(255,215,0,.4); transform: scale(1); }
    to   { text-shadow: 0 0 50px rgba(255,215,0,.8); transform: scale(1.03); }
}
.sorteo-spin-label {
    color: var(--oro-suave);
    letter-spacing: 0.3em;
    font-size: 0.95rem;
    margin-top: 1rem;
    text-transform: uppercase;
}


/* =====================================================
   Tablas y listados – tema oscuro legible
   ===================================================== */
body.sistema-potosi .table {
    color: #f0e6d0;
    --bs-table-bg: transparent;
    --bs-table-color: #f0e6d0;
    --bs-table-border-color: rgba(201,162,39,.18);
    --bs-table-striped-bg: rgba(255,255,255,.03);
    --bs-table-striped-color: #f0e6d0;
    --bs-table-hover-bg: rgba(201,162,39,.10);
    --bs-table-hover-color: #fff8e7;
    margin-bottom: 0;
}

body.sistema-potosi thead.table-dark-casino,
body.sistema-potosi thead.table-light {
    background: linear-gradient(180deg, #3d151a 0%, #2a0e12 100%) !important;
    color: #ffd700 !important;
}
body.sistema-potosi thead.table-dark-casino th,
body.sistema-potosi thead.table-light th {
    background: transparent !important;
    color: #ffd700 !important;
    border-bottom: 2px solid rgba(201,162,39,.45) !important;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

body.sistema-potosi .table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: rgba(255,255,255,.06);
    color: #f0e6d0;
}
body.sistema-potosi .table tbody tr {
    transition: background 0.15s ease;
}
body.sistema-potosi .table tbody tr:hover td {
    background: rgba(201,162,39,.08);
}

/* Código / números en tablas */
body.sistema-potosi .table code,
body.sistema-potosi .table .numero-sorteo {
    color: #ffd700;
    background: rgba(0,0,0,.25);
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    font-weight: 700;
}

/* Badges más legibles */
body.sistema-potosi .badge.bg-success { background-color: #1a7a45 !important; }
body.sistema-potosi .badge.bg-secondary { background-color: #5a4a3a !important; }
body.sistema-potosi .badge.bg-danger { background-color: #a02828 !important; }
body.sistema-potosi .badge.bg-warning { background-color: #c9a227 !important; color: #1a080c !important; }

/* Botones outline en listados */
body.sistema-potosi .btn-outline-primary {
    color: #e8c84a;
    border-color: rgba(201,162,39,.55);
}
body.sistema-potosi .btn-outline-primary:hover {
    background: rgba(201,162,39,.2);
    border-color: #ffd700;
    color: #ffd700;
}
body.sistema-potosi .btn-outline-warning {
    color: #f0c14a;
    border-color: rgba(240,193,74,.5);
}
body.sistema-potosi .btn-outline-warning:hover {
    background: rgba(240,193,74,.2);
    color: #ffd700;
    border-color: #ffd700;
}
body.sistema-potosi .btn-outline-success {
    color: #6ddea0;
    border-color: rgba(46,204,113,.45);
}
body.sistema-potosi .btn-outline-success:hover {
    background: rgba(46,204,113,.18);
    color: #7dffa8;
    border-color: #2ecc71;
}
body.sistema-potosi .btn-outline-danger {
    color: #f0a0a0;
    border-color: rgba(231,76,60,.45);
}
body.sistema-potosi .btn-outline-danger:hover {
    background: rgba(231,76,60,.18);
    color: #ffb3ab;
    border-color: #e74c3c;
}
body.sistema-potosi .btn-outline-secondary {
    color: rgba(245,230,200,.75);
    border-color: rgba(245,230,200,.3);
}
body.sistema-potosi .btn-outline-secondary:hover {
    background: rgba(255,255,255,.08);
    color: #f5e6c8;
    border-color: rgba(245,230,200,.5);
}

/* Card con tabla sin padding raro */
body.sistema-potosi .card .card-body.p-0 .table-responsive {
    border-radius: 0 0 0.5rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Títulos de página legibles */
body.sistema-potosi h4 {
    color: #ffd700;
}
body.sistema-potosi h4 + .text-muted,
body.sistema-potosi .text-muted {
    color: rgba(245,230,200,.55) !important;
}

/* Paginación */
body.sistema-potosi .pagination .page-link {
    background: rgba(26,10,14,.85);
    border-color: rgba(201,162,39,.35);
    color: #f0e6d0;
}
body.sistema-potosi .pagination .page-link:hover {
    background: rgba(201,162,39,.2);
    border-color: #c9a227;
    color: #ffd700;
}
body.sistema-potosi .pagination .page-item.active .page-link {
    background: linear-gradient(180deg, #a52a2a, #6b1515);
    border-color: #c9a227;
    color: #ffd700;
}
body.sistema-potosi .pagination .page-item.disabled .page-link {
    background: rgba(0,0,0,.25);
    border-color: rgba(201,162,39,.15);
    color: rgba(245,230,200,.3);
}

/* Empty state */
body.sistema-potosi .table .text-muted {
    color: rgba(245,230,200,.45) !important;
}

/* Small text in tables */
body.sistema-potosi .table small {
    color: rgba(245,230,200,.7);
}

/* Mejor spacing en acciones */
body.sistema-potosi .table .btn-sm {
    padding: 0.25rem 0.5rem;
    margin-left: 0.15rem;
}


/* Dashboard cards – colores legibles en oscuro */
body.sistema-potosi .card .text-success { color: #ffd700 !important; }
body.sistema-potosi .card .text-primary { color: #7dffa8 !important; }
body.sistema-potosi .card .text-info { color: #7ec8e3 !important; }
body.sistema-potosi .card .text-secondary { color: rgba(245,230,200,.7) !important; }
body.sistema-potosi .card h3 { color: #f5e6c8; }
body.sistema-potosi .premio-grande { color: #ffd700 !important; }

/* Enlaces dentro de cards */
body.sistema-potosi .card a:not(.btn) {
    color: #e8c84a;
}
body.sistema-potosi .card a:not(.btn):hover {
    color: #ffd700;
}

/* ============================================================
   Responsive tables - mobile
   ============================================================ */
@media (max-width: 767.98px) {
    body.sistema-potosi .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    body.sistema-potosi .table-responsive > .table {
        min-width: 680px;
        margin-bottom: 0;
    }

    body.sistema-potosi .table-responsive td,
    body.sistema-potosi .table-responsive th {
        white-space: nowrap;
        vertical-align: middle;
    }

    body.sistema-potosi .table-responsive .btn {
        white-space: nowrap;
    }

    body.sistema-potosi .table-responsive + .pagination,
    body.sistema-potosi .pagination {
        flex-wrap: wrap;
        gap: .25rem;
    }
}

/* ===== Layout v5.3: sidebar + info bar + nav active ===== */
/* Barra de resumen: contraste alto (tema casino) */
.info-bar-compact {
    background: linear-gradient(180deg, #2a1218 0%, #1a0a0e 100%);
    border-bottom: 1px solid rgba(201, 162, 39, 0.45) !important;
    font-size: 0.92rem;
    color: #f5e6c8;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.info-bar-compact .ib-label {
    color: rgba(201, 162, 39, 0.85);
    font-weight: 500;
    margin-right: 0.25rem;
}
.info-bar-compact .ib-value {
    color: #fff8e7;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.info-bar-compact .ib-value.ib-premio {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}
.info-bar-compact .ib-value.ib-libres {
    color: #7dffa8;
}
.info-bar-compact .ib-value.ib-asig {
    color: #fff8e7;
}
.info-bar-compact .ib-sep {
    color: rgba(201, 162, 39, 0.35);
    user-select: none;
}
.info-bar-compact .ib-date {
    color: rgba(245, 230, 200, 0.75);
    font-variant-numeric: tabular-nums;
}
body.sistema-potosi .info-bar-compact .text-muted {
    color: rgba(201, 162, 39, 0.85) !important;
}
body.sistema-potosi .info-bar-compact .text-success,
body.sistema-potosi .info-bar-compact strong.text-success {
    color: #ffd700 !important;
}
body.sistema-potosi .info-bar-compact .text-primary,
body.sistema-potosi .info-bar-compact strong.text-primary {
    color: #7dffa8 !important;
}
body.sistema-potosi .info-bar-compact strong {
    color: #fff8e7 !important;
}
.navbar .nav-link.active {
    color: #ffd700 !important;
    font-weight: 600;
    border-bottom: 2px solid #c9a227;
}
.app-shell { min-height: calc(100vh - 140px); }
.app-sidebar {
    width: 220px;
    min-width: 220px;
    background: #1a0a0e;
    color: #f5e6c8;
    padding-bottom: 2rem;
}
.app-sidebar .side-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    color: #e8d5b5;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}
.app-sidebar .side-link:hover {
    background: rgba(201, 162, 39, 0.12);
    color: #ffd700;
}
.app-sidebar .side-link.active {
    background: rgba(201, 162, 39, 0.18);
    border-left-color: #c9a227;
    color: #ffd700;
    font-weight: 600;
}
.app-main { max-width: 100%; }
body.role-vendedor .app-main { max-width: 1400px; margin: 0 auto; }

/* Dropdown acciones en tablas */
.btn-actions-toggle {
    padding: 0.2rem 0.5rem;
    line-height: 1;
}

/* Modal asignación rápida tablero — alto contraste legible */
#modalAsignarRapido .modal-content {
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.25);
}
#modalAsignarRapido .modal-header {
    background: linear-gradient(90deg, #4a1518, #1a0508);
    color: #ffd700;
    border-bottom: 1px solid rgba(201,162,39,.4);
}
#modalAsignarRapido .modal-title {
    color: #ffd700 !important;
    font-weight: 700;
}
#modalAsignarRapido .modal-title .numero-sorteo {
    color: #fff !important;
    background: rgba(0,0,0,.35);
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
}
#modalAsignarRapido .modal-body {
    background: #ffffff !important;
    color: #212529 !important;
}
#modalAsignarRapido .modal-body .form-label {
    color: #343a40 !important;
    font-weight: 600;
}
#modalAsignarRapido .modal-body .form-control,
#modalAsignarRapido .modal-body .form-select {
    background: #fff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}
#modalAsignarRapido .modal-body .form-control:focus {
    background: #fff !important;
    color: #212529 !important;
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.2) !important;
}
#modalAsignarRapido .modal-body .form-control::placeholder {
    color: #6c757d !important;
}
#modalAsignarRapido .modal-body .text-muted,
#modalAsignarRapido #modalClienteInfo {
    color: #6c757d !important;
}
#modalAsignarRapido #modalSugerencias {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}
#modalAsignarRapido #modalSugerencias .list-group-item {
    background: #fff;
    color: #212529;
    border-color: #f0f0f0;
}
#modalAsignarRapido #modalSugerencias .list-group-item:hover {
    background: #e9f2ff;
    color: #212529;
}
#modalAsignarRapido .btn-outline-secondary {
    color: #495057 !important;
    border-color: #adb5bd !important;
    background: #fff !important;
}
#modalAsignarRapido .btn-outline-secondary:hover {
    color: #212529 !important;
    background: #e9ecef !important;
}

button.tablero-num {
    cursor: pointer;
    font: inherit;
    padding: 0;
}



/* ===== Modal asignación rápida — contraste forzado (v5.7) ===== */
body.sistema-potosi #modalAsignarRapido .modal-content {
    background: #f8f9fa !important;
    color: #212529 !important;
}
body.sistema-potosi #modalAsignarRapido .modal-header {
    background: linear-gradient(90deg, #4a1518, #1a0508) !important;
    color: #ffd700 !important;
}
body.sistema-potosi #modalAsignarRapido .modal-title,
body.sistema-potosi #modalAsignarRapido .modal-title * {
    color: #ffd700 !important;
}
body.sistema-potosi #modalAsignarRapido .modal-body,
body.sistema-potosi #modalAsignarRapido .modal-body p,
body.sistema-potosi #modalAsignarRapido .modal-body .form-label,
body.sistema-potosi #modalAsignarRapido .modal-body label {
    color: #212529 !important;
}
body.sistema-potosi #modalAsignarRapido .modal-body .form-control,
body.sistema-potosi #modalAsignarRapido .modal-body .form-select {
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}
body.sistema-potosi #modalAsignarRapido .modal-body .text-muted,
body.sistema-potosi #modalAsignarRapido #modalClienteInfo {
    color: #6c757d !important;
}
body.sistema-potosi #modalAsignarRapido .list-group-item {
    background: #fff !important;
    color: #212529 !important;
}
