/* ═══════════════════════════════════════════════════
   DASE PARK OS — main.css
   Mobile-first | Roles: admin, cajero, operador
   ═══════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────── */
:root {
    /* Paleta principal */
    --color-fondo:        #0f0f1a;
    --color-superficie:   #1a1a2e;
    --color-tarjeta:      #16213e;
    --color-borde:        #2a2a4a;

    /* Acentos */
    --color-primario:     #e94560;
    --color-primario-hover: #c73652;
    --color-secundario:   #0f3460;
    --color-acento:       #533483;

    /* Estado */
    --color-exito:        #2ecc71;
    --color-advertencia:  #f39c12;
    --color-peligro:      #e74c3c;
    --color-info:         #3498db;

    /* Texto */
    --texto-primario:     #e8e8f0;
    --texto-secundario:   #b8b8d0;
    --texto-muted:        #8080a0;

    /* Tipografía */
    --fuente-base:        'Segoe UI', system-ui, -apple-system, sans-serif;
    --fuente-mono:        'Cascadia Code', 'Courier New', monospace;

    /* Espaciado */
    --radio:              8px;
    --radio-lg:           12px;
    --sombra:             0 4px 20px rgba(0,0,0,0.4);
}

/* ── Reset base ─────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--fuente-base);
    background-color: var(--color-fondo);
    color: var(--texto-primario);
    line-height: 1.5;
    min-height: 100vh;
}

/* ── LOGIN ──────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #0f3460 100%);
}

.login-card {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--sombra);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primario);
    letter-spacing: 0.5px;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--texto-secundario);
    margin-top: 0.25rem;
}

.login-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--texto-muted);
    margin-top: 1.5rem;
}

/* ── FORMULARIOS ────────────────────────────────── */
.campo {
    margin-bottom: 1.25rem;
}

.campo label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texto-secundario);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio);
    color: var(--texto-primario);
    font-family: var(--fuente-base);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(233,69,96,0.15);
}

.campo input::placeholder {
    color: var(--texto-muted);
}

/* Campo con botón ojo */
.campo-password {
    position: relative;
    display: flex;
    align-items: center;
}

.campo-password input {
    padding-right: 3rem;
}

.btn-ojo {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--texto-muted);
    padding: 0.25rem;
    line-height: 1;
}

/* ── BOTONES ────────────────────────────────────── */
.btn-primario {
    background: var(--color-primario);
    color: #fff;
    border: none;
    border-radius: var(--radio);
    font-family: var(--fuente-base);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primario:hover {
    background: var(--color-primario-hover);
}

.btn-primario:active {
    transform: scale(0.98);
}

.btn-primario.btn-bloque {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-secundario {
    background: var(--color-superficie);
    color: var(--texto-primario);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio);
    font-family: var(--fuente-base);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.7rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-secundario:hover {
    border-color: var(--color-primario);
    background: var(--color-borde);
}

.btn-peligro {
    background: var(--color-peligro);
    color: #fff;
    border: none;
    border-radius: var(--radio);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-peligro:hover { opacity: 0.85; }

/* ── ALERTAS ────────────────────────────────────── */
.alerta {
    border-radius: var(--radio);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
}

.alerta-error {
    background: rgba(231,76,60,0.12);
    border-color: var(--color-peligro);
    color: #ff8a80;
}

.alerta-exito {
    background: rgba(46,204,113,0.12);
    border-color: var(--color-exito);
    color: #69f0ae;
}

.alerta-advertencia {
    background: rgba(243,156,18,0.12);
    border-color: var(--color-advertencia);
    color: #ffd54f;
}

.alerta-info {
    background: rgba(52,152,219,0.12);
    border-color: var(--color-info);
    color: #80d8ff;
}

/* ── LAYOUT PANELES ─────────────────────────────── */
.panel-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--color-superficie);
    border-right: 1px solid var(--color-borde);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--color-borde);
    margin-bottom: 1rem;
}

.sidebar-logo span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primario);
}

.sidebar-logo small {
    display: block;
    font-size: 0.75rem;
    color: var(--texto-muted);
    margin-top: 0.2rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--texto-secundario);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.activo {
    background: rgba(233,69,96,0.08);
    color: var(--texto-primario);
    border-left-color: var(--color-primario);
}

.sidebar-nav .nav-icono {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

/* Contenido principal */
.panel-contenido {
    margin-left: 240px;
    padding: 2rem;
    flex: 1;
    max-width: calc(100vw - 240px);
}

/* Header de panel */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-borde);
}

.panel-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--texto-primario);
}

.usuario-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--texto-secundario);
}

.usuario-rol {
    background: var(--color-borde);
    color: var(--texto-primario);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ── TARJETAS ────────────────────────────────────── */
.tarjeta {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tarjeta-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--texto-secundario);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Grid de estadísticas */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-tarjeta);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-lg);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-valor {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primario);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--texto-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.4rem;
}

/* ── TABLAS ─────────────────────────────────────── */
.tabla-wrapper {
    overflow-x: auto;
    border-radius: var(--radio);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: var(--color-superficie);
    color: var(--texto-secundario);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-borde);
}

tbody tr {
    border-bottom: 1px solid var(--color-borde);
    transition: background 0.15s;
}

tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

tbody td {
    padding: 0.75rem 1rem;
    color: var(--texto-primario);
}

/* ── BADGES / ETIQUETAS ─────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-exito    { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-peligro  { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.badge-advertencia { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-info     { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-neutro   { background: rgba(144,144,176,0.15); color: #9090b0; }

/* ── MONITOR DE TIEMPOS ─────────────────────────── */
.monitor-card {
    background: var(--color-tarjeta);
    border: 2px solid var(--color-borde);
    border-radius: var(--radio-lg);
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s;
}

.monitor-card.estado-normal   { border-color: var(--color-exito); }
.monitor-card.estado-amarillo { border-color: var(--color-advertencia); }
.monitor-card.estado-rojo     {
    border-color: var(--color-peligro);
    animation: pulso-rojo 1s ease-in-out infinite;
}

@keyframes pulso-rojo {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
    50%       { box-shadow: 0 0 0 8px rgba(231,76,60,0.25); }
}

.monitor-tiempo {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--fuente-mono);
    line-height: 1;
}

.monitor-nombre {
    font-size: 0.9rem;
    color: var(--texto-secundario);
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── UTILIDADES ─────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--texto-muted); }
.text-exito  { color: var(--color-exito); }
.text-peligro { color: var(--color-peligro); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── RESPONSIVE — Cajero / Operador ─────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.abierto {
        transform: translateX(0);
    }

    .panel-contenido {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }

    .grid-stats {
        grid-template-columns: 1fr 1fr;
    }

    .panel-header h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 400px) {
    .grid-stats {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 2rem 1.25rem;
    }
}

/* ── SCROLLBAR personalizada ────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-fondo); }
::-webkit-scrollbar-thumb { background: var(--color-borde); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--texto-muted); }
