:root {
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --secondary: #475569;
    --accent: #fbbf24;
    --bg: #0f172a;
    --text: #f8fafc;
    --card-bg: #1e293b;
    --border: #334155;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

a { text-decoration: none; color: inherit; }

.main-header {
    background-color: #1e3a8a;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.main-header h1 { margin: 0; font-weight: 800; }

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
.form-group label { font-weight: 600; margin-bottom: 0.5rem; }
.form-control, input[type="text"], input[type="number"], input[type="email"], input[type="password"], select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #0f172a;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
}
.form-control:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.form-group label {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 400;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-gradient {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}
.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.6);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}
.table { width: 100%; border-collapse: collapse; min-width: 650px; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }

.badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.875rem; font-weight: 600; }
.badge-creado { background: #334155; color: #cbd5e1; }
.badge-en_curso { background: #166534; color: #dcfce7; }
.badge-finalizado { background: #7f1d1d; color: #fca5a5; }
.badge-pendiente { background: #78350f; color: #fde68a; }
.badge-en_juego { background: #1e3a8a; color: #bfdbfe; }
.badge-entregado { background: #14532d; color: #bbf7d0; }

.header-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Panel Operador */
.panel-layout { display: flex; gap: 1rem; }
.panel-sidebar { width: 220px; flex-shrink: 0; background: var(--card-bg); padding: 1rem; border-radius: 12px; border: 1px solid var(--border); }
.panel-main { flex-grow: 1; background: var(--card-bg); padding: 1rem; border-radius: 12px; border: 1px solid var(--border); }

.numero-gigante {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    background: #0f172a;
    border-radius: 12px;
    padding: 1rem;
    color: var(--primary);
}

.tablero-bingo { display: flex; flex-direction: column; gap: 0.5rem; }
.tablero-fila { display: flex; align-items: center; gap: 1rem; }
.letra-bingo { font-size: 1.5rem; font-weight: 800; color: var(--primary); width: 30px; text-align: center; }
.numeros-fila { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bolilla {
    width: 38px; height: 38px; border-radius: 50%;
    background: #334155; color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; transition: all 0.2s;
}
.bolilla.cantada {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.4);
}

/* Custom Pattern Creator */
.custom-pattern-wrapper {
    display: flex; gap: 20px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap;
}
.grid-creator {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    grid-template-rows: repeat(5, 40px);
    gap: 5px;
    background: #334155;
    padding: 10px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.grid-cell {
    background: #0f172a; border-radius: 4px; cursor: pointer; transition: 0.2s;
    border: 2px solid transparent;
}
.grid-cell:hover { border-color: var(--primary); }
.grid-cell.selected { background: var(--primary); box-shadow: 0 0 10px rgba(59,130,246,0.5); }
.grid-cell.free-cell {
    background: #475569; cursor: not-allowed; display: flex; align-items: center; justify-content: center;
    font-weight: bold; color: white;
}
.custom-pattern-controls { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 10px; }

/* Dashboard Layout AdminLTE-style */
body.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    margin: 0;
}
.sidebar {
    width: 180px;
    background-color: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transition: 0.3s;
    flex-shrink: 0;
}
.sidebar-header {
    padding: 20px;
    background: #1e293b;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #cbd5e1;
    gap: 10px;
    transition: 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background-color: var(--card-bg);
    color: white;
    border-left: 4px solid var(--primary);
}
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0b1121;
    min-width: 0;
    overflow: hidden;
}
.topbar {
    height: 60px;
    background: #1e293b;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto;
    box-sizing: border-box;
}
.badge-plan {
    padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: bold;
}
.badge-plan.premium { background: var(--accent); color: #000; }
.badge-plan.free { background: var(--secondary); color: #fff; }

.mb-0 { margin-bottom: 0 !important; }

@media (max-width: 768px) {
    body.dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .content-wrapper {
        width: 100%;
    }
    .topbar {
        height: auto;
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .main-content {
        padding: 15px;
    }
}
