/* ==========================================================================
   ESTILOS CONTROL DE ACCESO - SALAS DE JUEGO
   COLORES CORPORATIVOS: NEGRO, NARANJA (#ff8500), BLANCO (#ffffff)
   ========================================================================== */

:root {
    /* Paleta corporativa */
    --brand-black: #000000;
    --brand-dark: #09090b;
    --brand-card: #121214;
    --brand-border: #27272a;
    --brand-border-focus: #ff8500;
    
    --brand-orange: #ff8500;
    --brand-orange-hover: #ffa033;
    --brand-orange-active: #e67700;
    --brand-orange-glow: rgba(255, 133, 0, 0.3);
    --brand-orange-subtle: rgba(255, 133, 0, 0.12);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Estados de acceso funcionales */
    --color-admitido: #10b981;
    --color-admitido-bg: rgba(16, 185, 129, 0.15);
    --color-admitido-border: #059669;

    --color-prohibido: #ef4444;
    --color-prohibido-bg: rgba(239, 68, 68, 0.18);
    --color-prohibido-border: #dc2626;

    --color-error: #f59e0b;
    --color-error-bg: rgba(245, 158, 11, 0.15);
    --color-error-border: #d97706;

    --btn-primary: var(--brand-orange);
    --btn-primary-hover: var(--brand-orange-hover);
    --font-stack: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
    background-color: var(--brand-dark);
    background-image: radial-gradient(circle at 50% 0%, rgba(255, 133, 0, 0.08) 0%, transparent 60%);
    color: var(--text-primary);
    font-family: var(--font-stack);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.app-container {
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Encabezado */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.brand-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
}

.brand-logo {
    width: 126px;
    height: 126px;
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--brand-orange-glow);
    border: 2px solid rgba(255, 133, 0, 0.45);
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-logo:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 36px rgba(255, 133, 0, 0.55);
}

.logo-area {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.badge-system {
    background-color: var(--brand-orange);
    color: #000000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.06em;
}

.badge-mock {
    background-color: #27272a;
    color: #fbbf24;
    border: 1px solid #d97706;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
}

.badge-live {
    background-color: #064e3b;
    color: #34d399;
    border: 1px solid #059669;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
}

.main-title {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Tarjeta principal */
.main-card {
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 1.25rem;
    padding: 2.25rem;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.8), 0 0 20px -5px rgba(255, 133, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.input-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.dni-input {
    width: 100%;
    padding: 1.15rem 1.25rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    background-color: var(--brand-black);
    border: 2px solid var(--brand-border);
    border-radius: 0.85rem;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.dni-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 4px var(--brand-orange-glow);
    background-color: #050505;
}

.dni-input:disabled {
    background-color: #18181b;
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.dni-input.input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
    animation: shake 0.3s ease-in-out;
}

.btn-consultar {
    width: 100%;
    margin-top: 1rem;
    padding: 1.15rem;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #000000;
    background-color: var(--brand-orange);
    border: none;
    border-radius: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--brand-orange-glow);
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s, opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-consultar:hover:not(:disabled) {
    background-color: var(--brand-orange-hover);
    box-shadow: 0 6px 20px rgba(255, 133, 0, 0.45);
}

.btn-consultar:active:not(:disabled) {
    transform: scale(0.98);
    background-color: var(--brand-orange-active);
}

.btn-consultar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* Área de resultados */
.status-container {
    min-height: 140px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border: 2px dashed var(--brand-border);
}

.status-idle {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Estado Cargando */
.status-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--brand-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--brand-orange);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Visualización de resultado */
.result-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    width: 100%;
}

.result-icon {
    font-size: 3.25rem;
    line-height: 1;
}

.result-text {
    font-size: 2.15rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.result-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 90%;
}

/* Variantes de resultado */
.status-admitido {
    background-color: var(--color-admitido-bg);
    border: 2px solid var(--color-admitido-border);
    border-style: solid;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.status-admitido .result-text {
    color: var(--color-admitido);
}

.status-prohibido {
    background-color: var(--color-prohibido-bg);
    border: 3px solid var(--color-prohibido-border);
    border-style: solid;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
    animation: shake 0.3s ease-in-out;
}

.status-prohibido .result-text {
    color: var(--color-prohibido);
}

.status-error {
    background-color: var(--color-error-bg);
    border: 2px solid var(--color-error-border);
    border-style: solid;
}

.status-error .result-text {
    color: var(--color-error);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Guía de pruebas */
.mock-guide {
    background-color: #121214;
    border: 1px solid var(--brand-border);
    border-radius: 0.85rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mock-guide-header {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mock-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.btn-test {
    padding: 0.65rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: 1px solid var(--brand-border);
    background-color: var(--brand-black);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
    text-align: center;
}

.btn-test:hover {
    background-color: #1c1c1f;
    border-color: var(--brand-orange);
    transform: translateY(-1px);
}

.mock-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Utilidades */
.hidden {
    display: none !important;
}

/* ==========================================================================
   ESTILOS HISTORIAL & AUDITORÍA DE SALAS (ESTÉTICA CORPORATIVA)
   ========================================================================== */

.btn-nav-historial-box {
    margin-top: 0.5rem;
    text-align: center;
}

.btn-nav-historial {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-orange);
    background-color: rgba(255, 133, 0, 0.08);
    border: 1px solid rgba(255, 133, 0, 0.35);
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

.btn-nav-historial:hover {
    background-color: var(--brand-orange);
    color: #000000;
    box-shadow: 0 4px 14px var(--brand-orange-glow);
    transform: translateY(-1px);
}

.body-historial {
    align-items: flex-start !important;
    padding: 2rem 1.5rem !important;
}

.historial-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.historial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.historial-title-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo-mini {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 14px var(--brand-orange-glow);
    border: 1px solid rgba(255, 133, 0, 0.5);
}

.historial-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.historial-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.btn-refresh {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
    background-color: var(--brand-orange);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background-color: var(--brand-orange-hover);
    box-shadow: 0 2px 10px var(--brand-orange-glow);
}

/* Alerta Multisala */
.alert-multisala-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(255, 133, 0, 0.1) 100%);
    border: 2px solid #ef4444;
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: pulse 2s infinite ease-in-out;
}

.alert-icon {
    font-size: 2rem;
    line-height: 1;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.alert-heading {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ef4444;
    margin-bottom: 0.25rem;
}

.alert-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.btn-dismiss-alert {
    background: #18181b;
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-dismiss-alert:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.alert-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.alert-item-card {
    background-color: #000000;
    border: 1px solid #ef4444;
    border-radius: 0.65rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 320px;
    max-width: 480px;
}

.alert-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-item-dismiss {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4d4d8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-item-dismiss:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #34d399;
}

.alert-dni {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 900;
    color: #ff8500;
    cursor: pointer;
    text-decoration: underline;
}

.alert-badge-count {
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

.alert-salas-list {
    font-size: 0.8rem;
    color: #fca5a5;
}

.alert-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.kpi-card {
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.text-white { color: #ffffff; }
.text-danger { color: #ef4444; }
.text-success { color: #10b981; }
.text-orange { color: var(--brand-orange); }

/* Filtros */
.filters-card {
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1.25rem;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1 1 0px;
    min-width: 140px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select, .filter-input, .filter-input-date {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    background-color: var(--brand-black);
    border: 1px solid var(--brand-border);
    color: #ffffff;
    padding: 0 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 42px;
}

.filter-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px;
    padding-right: 2.2rem;
    cursor: pointer;
}

.filter-select option {
    background-color: #18181b;
    color: #ffffff;
    padding: 0.5rem;
}

.filter-input-date {
    color-scheme: dark;
}

.filter-select:focus, .filter-input:focus, .filter-input-date:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px var(--brand-orange-glow);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 44px;
    margin-bottom: 0;
}

.btn-filtrar {
    box-sizing: border-box;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: #000000;
    background-color: var(--brand-orange);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-filtrar:hover {
    background-color: var(--brand-orange-hover);
}

.btn-limpiar {
    box-sizing: border-box;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--brand-black);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-limpiar:hover {
    color: #ffffff;
    border-color: #52525b;
}

/* Tabs */
.view-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: var(--brand-orange);
    color: #000000;
    border-color: var(--brand-orange);
}

/* Tabla */
.table-card {
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-header-info {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: rgba(0, 0, 0, 0.2);
}

.table-responsive {
    overflow-x: auto;
}

.historial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.historial-table th {
    background-color: #0a0a0c;
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--brand-border);
}

.historial-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.historial-table tr:hover {
    background-color: rgba(255, 133, 0, 0.03);
}

.cell-nowrap { white-space: nowrap; font-family: monospace; font-size: 0.85rem; }
.cell-ip { font-family: monospace; font-size: 0.8rem; color: var(--text-muted); }
.cell-msg { font-size: 0.82rem; color: var(--text-secondary); max-width: 250px; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

/* Estados en tabla */
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.badge-row-admitido {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #059669;
}

.badge-row-prohibido {
    background-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border: 1px solid #ef4444;
}

.badge-row-error {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid #d97706;
}

.badge-mini {
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    font-weight: 700;
    font-size: 0.78rem;
}
.badge-mini-admitido { background-color: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-mini-prohibido { background-color: rgba(239, 68, 68, 0.25); color: #f87171; font-weight: 800; }
.badge-mini-error { background-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.doc-click {
    font-family: monospace;
    font-weight: 700;
    cursor: pointer;
    color: #93c5fd;
    text-decoration: underline;
}

.doc-prohibido-click {
    font-family: monospace;
    font-weight: 900;
    cursor: pointer;
    color: #ff8500;
    text-decoration: underline;
    background-color: rgba(255, 133, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 133, 0, 0.3);
}

.btn-table-action {
    background-color: #18181b;
    border: 1px solid var(--brand-border);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-table-action:hover {
    background-color: var(--brand-orange);
    color: #000000;
    border-color: var(--brand-orange);
}

/* Paginación */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--brand-border);
    background-color: rgba(0, 0, 0, 0.2);
}

.btn-page {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
    background-color: var(--brand-orange);
    color: #000000;
    border-color: var(--brand-orange);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   ESTILOS DE USUARIO, BLOQUEO POR PIN Y MODALES DE CONFIGURACIÓN
   ========================================================================== */

/* Barra de navegación superior derecha */
.historial-nav-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.user-badge-box {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background-color: #18181b;
    border: 1px solid var(--brand-orange);
    border-radius: 9999px;
    font-size: 0.82rem;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 133, 0, 0.15);
}

.user-badge-name {
    font-weight: 700;
    color: #ffffff;
}

.btn-action-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #18181b;
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-tool:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
    background-color: rgba(255, 133, 0, 0.08);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background-color: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Modales y Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-dialog {
    background-color: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 1.25rem;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.modal-dialog-lg {
    max-width: 850px;
}

.modal-dialog-md {
    max-width: 650px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--brand-border);
    background-color: #0c0c0e;
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-header-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--brand-border);
    background-color: #0c0c0e;
}

.btn-modal-close-footer {
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--brand-black);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-close-footer:hover {
    color: #ffffff;
    border-color: #52525b;
}

/* Formulario en Modales */
.modal-form-box {
    background-color: #0f0f12;
    border: 1px solid var(--brand-border);
    border-radius: 0.85rem;
    padding: 1.25rem;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand-orange);
    margin-bottom: 1rem;
}

.form-grid-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 200px;
}

.form-col-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-form-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.modal-input {
    background-color: #000000;
    border: 1px solid var(--brand-border);
    color: #ffffff;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px var(--brand-orange-glow);
}

select.modal-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px;
    padding-right: 2.2rem;
    cursor: pointer;
}

select.modal-input option {
    background-color: #18181b;
    color: #ffffff;
}

.input-with-action {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-chip-ip {
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: rgba(255, 133, 0, 0.12);
    color: var(--brand-orange);
    border: 1px solid rgba(255, 133, 0, 0.35);
    border-radius: 0.4rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-chip-ip:hover {
    background-color: var(--brand-orange);
    color: #000000;
}

.btn-modal-save {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: #000000;
    background-color: var(--brand-orange);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-save:hover {
    background-color: var(--brand-orange-hover);
}

.btn-modal-cancel {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-modal-cancel:hover {
    color: #ffffff;
}

/* Feedback messages */
.feedback-msg {
    margin-top: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.feedback-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid #059669;
}

.feedback-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid #ef4444;
}

/* Tablas en Modales */
.modal-list-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.modal-table-scroll {
    max-height: 300px;
    border: 1px solid var(--brand-border);
    border-radius: 0.65rem;
}

.code-ip {
    font-family: monospace;
    font-size: 0.85rem;
    color: #93c5fd;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.cell-actions {
    text-align: right;
    white-space: nowrap;
}

.table-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    vertical-align: middle;
}

.btn-action-edit, .btn-action-delete {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-edit {
    background-color: #27272a;
    border: 1px solid var(--brand-border);
    color: #ffffff;
}

.btn-action-edit:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.btn-action-delete {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-action-delete:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.pin-display-cell {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--brand-orange);
}

.btn-toggle-eye {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    vertical-align: middle;
}

.btn-toggle-eye:hover {
    opacity: 1;
}

.badge-role {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background-color: #27272a;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.badge-role-admin {
    background-color: rgba(255, 133, 0, 0.15);
    color: var(--brand-orange);
    border-color: rgba(255, 133, 0, 0.4);
}

.badge-role-supervisor {
    background-color: #1f1f23;
    color: #a1a1aa;
    border-color: #3f3f46;
}

.badge-yo {
    font-size: 0.65rem;
    font-weight: 800;
    background-color: #10b981;
    color: #000000;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    margin-left: 0.35rem;
}

.badge-privado {
    font-size: 0.85rem;
    opacity: 0.7;
    cursor: help;
}

.text-muted-xs {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   PANTALLA DE BLOQUEO POR PIN (CARD & KEYPAD)
   ========================================================================== */

.pin-card {
    background-color: #0c0c0e;
    border: 2px solid var(--brand-border);
    border-radius: 1.5rem;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

.pin-card-icon {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 10px rgba(255, 133, 0, 0.3));
}

.pin-card-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.pin-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    margin-bottom: 1.5rem;
}

/* Puntos indicadores del PIN */
.pin-dots-row {
    display: flex;
    gap: 1.25rem;
    margin: 1.25rem 0 1.5rem 0;
}

.pin-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid #3f3f46;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
    box-shadow: 0 0 14px var(--brand-orange-glow);
    transform: scale(1.2);
}

/* Mensaje de error */
.pin-error-msg {
    margin-bottom: 1.25rem;
    padding: 0.5rem 0.85rem;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Teclado numérico táctil */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    width: 100%;
    max-width: 300px;
    margin-bottom: 1.5rem;
}

.keypad-btn {
    aspect-ratio: 1.25;
    min-height: 58px;
    background-color: #18181b;
    border: 1px solid var(--brand-border);
    border-radius: 0.85rem;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.keypad-btn:hover {
    background-color: #27272a;
    border-color: var(--brand-orange);
}

.keypad-btn:active {
    transform: scale(0.92);
    background-color: var(--brand-orange) !important;
    color: #000000 !important;
    box-shadow: 0 0 16px var(--brand-orange-glow);
}

.keypad-btn-action {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-muted);
}

.keypad-btn-action:hover {
    color: #ffffff;
}

.pin-card-footer {
    border-top: 1px solid var(--brand-border);
    padding-top: 1rem;
    width: 100%;
}

.btn-link-cancel {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-family: inherit;
    transition: color 0.2s;
}

.btn-link-cancel:hover {
    color: var(--brand-orange);
}

/* Animación de vibración para PIN erróneo */
@keyframes shakeAnimation {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shakeAnimation 0.4s ease-in-out;
}

.supervisor-readonly-notice {
    background: rgba(39, 39, 42, 0.6);
    border: 1px solid var(--brand-border);
    border-left: 4px solid var(--brand-orange);
    color: #d4d4d8;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}


