/* ============================================================================
DECLARACIÓN DE PROPIEDAD INTELECTUAL Y DERECHOS DE AUTOR REGISTRADOS
============================================================================

PROPIETARIO ÚNICO, DESARROLLADOR, DISEÑADOR Y PROGRAMADOR EXCLUSIVO:
----------------------------------------------------------------------------
Ing. Roel Arturo Copetillo Portela
COPR810501rm1

HISTORIAL DE REGISTRO DE DESARROLLO (FECHA DE INICIO):
----------------------------------------------------------------------------
- Inicio oficial de diseño y desarrollo: 14 de Mayo de 2026

DECLARACIÓN DE DERECHOS LEGALES:
----------------------------------------------------------------------------
Tanto esta versión de prueba (trial/beta) como cualquier versión posterior,
estable, modificada, compilada, autoejecutable o derivada del código de esta 
aplicación, pertenecen al 100% en exclusiva y de manera vitalicia a su único
dueño y desarrollador Roel Arturo Copetillo Portela. Queda prohibida la copia, 
distribución, alteración o venta no autorizada sin el consentimiento expreso
por escrito del autor.

Todos los Derechos Reservados © 2026.
============================================================================ */

/* ═══════════════════════════════════════════════════════════════════════════
   Xerberoz® — Estilos del Panel de Administración de Usuarios (Fase 4)
   Glassmorphism Futurista con Gestión de Suscripciones y Roles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay principal del Panel Admin */
.xrz-admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 15, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Tarjeta del Panel Admin — aprovecha pantallas grandes; scroll solo si no cabe */
.xrz-admin-card {
    position: relative;
    width: min(96vw, 1500px);
    max-width: 1500px;
    max-height: 92vh;
    background: #090d16;
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 229, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: adminPanelIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adminPanelIn {
    from { opacity: 0; transform: scale(0.96) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Cabecera del Panel */
.xrz-admin-header {
    padding: 22px 28px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xrz-admin-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.xrz-admin-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #00e5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.xrz-admin-badge {
    padding: 4px 12px;
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid rgba(255, 0, 85, 0.5);
    border-radius: 20px;
    color: #ff0055;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.xrz-admin-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.xrz-admin-close:hover {
    color: #ff0055;
}

/* Pestañas Usuarios / Bitácora */
.xrz-admin-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 28px 0;
    background: rgba(15, 23, 42, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.xrz-admin-tab {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: #94a3b8;
    padding: 10px 16px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.xrz-admin-tab:hover { color: #e2e8f0; }
.xrz-admin-tab.active {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.35);
}
.xrz-access-log-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.xrz-access-month-select {
    width: auto !important;
    min-width: 130px;
    padding: 8px 10px !important;
    margin: 0 !important;
}
.xrz-access-log-table td {
    font-size: 12px;
    vertical-align: top;
}
.xrz-event-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.xrz-event-badge.ok { color: #39ff14; background: rgba(57,255,20,0.12); }
.xrz-event-badge.fail { color: #ff3333; background: rgba(255,51,51,0.12); }
.xrz-event-badge.block { color: #ff9900; background: rgba(255,153,0,0.12); }
.xrz-event-badge.out { color: #94a3b8; background: rgba(148,163,184,0.12); }

/* Barra de herramientas / Botón Nuevo Usuario */
.xrz-admin-toolbar {
    padding: 16px 28px;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xrz-btn-new-user {
    padding: 10px 18px;
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    border: 1px solid #00e5ff;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
    transition: all 0.2s ease;
}

.xrz-btn-new-user:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #0096c7 100%);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.45);
}

/* Tabla de Usuarios — el alto lo marca el panel (92vh); scroll solo si hace falta */
.xrz-admin-body {
    flex: 1 1 auto;
    padding: 16px 24px 24px;
    overflow: auto;
    min-height: 0;
    max-height: none;
}

.xrz-users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    table-layout: auto;
}

.xrz-users-table th {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.xrz-users-table td {
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.xrz-users-table .xrz-table-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Password: texto normal, clic para copiar (sin caja de botón) */
.xrz-users-table th.xrz-col-password,
.xrz-users-table td.xrz-col-password {
    min-width: 15ch;
    white-space: nowrap;
}

.xrz-users-table th.xrz-col-email,
.xrz-users-table td.xrz-col-email {
    width: 4.5rem;
    max-width: 5rem;
    text-align: center;
    white-space: nowrap;
}

.xrz-email-view-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #00e5ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
}

.xrz-email-view-link:hover {
    color: #7af0ff;
}

.xrz-email-card {
    max-width: 440px;
}

.xrz-email-hint {
    color: #64748b;
    font-size: 12px;
    margin: 0 0 12px;
    line-height: 1.45;
}

.xrz-email-value {
    word-break: break-all;
    color: #00e5ff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
}

.xrz-email-mailto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

/* Copiar: amarillo neutro (rojo solo para salir/borrar) */
.xrz-btn-copy {
    background: rgba(255, 183, 0, 0.12) !important;
    border: 1px solid rgba(255, 183, 0, 0.55) !important;
    color: #ffb700 !important;
    box-shadow: 0 0 10px rgba(255, 183, 0, 0.18) !important;
}

.xrz-btn-copy:hover {
    background: rgba(255, 183, 0, 0.28) !important;
    border-color: #ffb700 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(255, 183, 0, 0.45) !important;
}

.xrz-password-text {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #f1f5f9;
    font-size: 13px;
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: pointer;
    line-height: inherit;
}

.xrz-password-text:hover {
    color: #00e5ff;
    text-decoration: underline;
    background: transparent;
    border: none;
}

/* Usuario: naranja solo para admin del sistema */
.xrz-user-name {
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.xrz-user-name.xrz-user-admin {
    color: #ff6a00;
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.45);
}

/* Rol: texto normal (sin caja); admin en naranja */
.xrz-role-text {
    display: inline;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.xrz-role-admin {
    color: #ff8a1a;
}

.xrz-role-user {
    color: #cbd5e1;
}

@media (max-width: 1280px) {
    .xrz-admin-card {
        width: 96vw;
        max-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .xrz-admin-card {
        width: 96vw;
        max-width: 1040px;
    }
    .xrz-users-table th,
    .xrz-users-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

.xrz-users-table tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.xrz-users-table tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* Badges de Estado de Suscripción */
.xrz-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.xrz-status-badge.active { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.xrz-status-badge.expired { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.xrz-status-badge.suspended { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

/* Acciones en Tabla */
.xrz-table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xrz-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.xrz-btn-icon:hover {
    color: #00e5ff;
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.1);
}

/* Acciones semánticas: relleno claro + borde del color + ícono vectorial blanco */
.xrz-btn-icon .xrz-ico {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.xrz-btn-icon.xrz-btn-icon--play {
    color: #ffffff;
    border-color: #16a34a;
    background: rgba(34, 197, 94, 0.38);
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.25);
}
.xrz-btn-icon.xrz-btn-icon--play:hover {
    color: #ffffff;
    border-color: #4ade80;
    background: rgba(34, 197, 94, 0.58);
}

.xrz-btn-icon.xrz-btn-icon--pause {
    color: #ffffff;
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.38);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.25);
}
.xrz-btn-icon.xrz-btn-icon--pause:hover {
    color: #ffffff;
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.58);
}

.xrz-btn-icon.xrz-btn-icon--danger {
    color: #ffffff;
    border-color: #dc2626;
    background: rgba(239, 68, 68, 0.38);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.25);
}
.xrz-btn-icon.xrz-btn-icon--danger:hover {
    color: #ffffff;
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.58);
}

.xrz-btn-icon.xrz-btn-icon--info {
    color: #ffffff;
    border-color: #0284c7;
    background: rgba(14, 165, 233, 0.42);
    box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.25);
}
.xrz-btn-icon.xrz-btn-icon--info:hover {
    color: #ffffff;
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.62);
}

.xrz-btn-icon.xrz-btn-icon--violet {
    color: #ffffff;
    border-color: #7c3aed;
    background: rgba(139, 92, 246, 0.42);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.25);
}
.xrz-btn-icon.xrz-btn-icon--violet:hover {
    color: #ffffff;
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.62);
}

.xrz-btn-icon.xrz-btn-icon--muted {
    color: #ffffff;
    border-color: #64748b;
    background: rgba(100, 116, 139, 0.45);
    box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.3);
}
.xrz-btn-icon.xrz-btn-icon--muted:hover {
    color: #ffffff;
    border-color: #94a3b8;
    background: rgba(148, 163, 184, 0.55);
}

/* Select nativo oculto — UI custom estilo Xerberoz */
.xrz-admin-select-native {
    display: none !important;
}

.xrz-admin-dd {
    position: relative;
    min-width: 220px;
    z-index: 5;
    user-select: none;
}

.xrz-admin-dd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.xrz-admin-dd-trigger:hover,
.xrz-admin-dd.open .xrz-admin-dd-trigger {
    border-color: rgba(0, 229, 255, 0.75);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
    background: rgba(15, 23, 42, 1);
}

.xrz-admin-dd-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    color: #f8fafc;
}

.xrz-admin-dd-caret {
    flex-shrink: 0;
    color: #00e5ff;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.xrz-admin-dd.open .xrz-admin-dd-caret {
    transform: rotate(180deg);
}

.xrz-admin-dd-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: rgba(9, 13, 22, 0.98);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 229, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 6;
}

.xrz-admin-dd.open .xrz-admin-dd-list {
    display: block;
    animation: xrzAdminDdIn 0.16s ease;
}

@keyframes xrzAdminDdIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.xrz-admin-dd-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.xrz-admin-dd-item:hover {
    background: rgba(0, 229, 255, 0.08);
    color: #ffffff;
    border-left-color: rgba(0, 229, 255, 0.45);
}

.xrz-admin-dd-item.is-active {
    background: rgba(0, 229, 255, 0.14);
    color: #00e5ff;
    border-left-color: #00e5ff;
}

/* Formulario Modal Interno de Alta / Edición — siempre por encima de filtros/dropdowns */
#adminFormModalContainer {
    position: absolute;
    inset: 0;
    z-index: 300;
    pointer-events: none;
}

#adminFormModalContainer:not(:empty) {
    pointer-events: auto;
}

.xrz-admin-form-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 301;
    background: rgba(9, 13, 22, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px 24px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.xrz-admin-form-card {
    width: 100%;
    max-width: 520px;
    margin: auto 0; /* centra en vertical si cabe; si no, el overlay hace scroll */
    background: #0f172a;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 16px;
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    box-sizing: border-box;
}

.xrz-admin-form-card > h3 {
    margin: 0 0 4px 0 !important;
}

.xrz-admin-form-card > p {
    margin: 0 0 2px 0;
}

.xrz-admin-form-card .xrz-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 4px;
    flex-shrink: 0;
}

/* Dropdowns Xerberoz dentro de formularios (evita select nativo de Windows) */
.xrz-admin-form-modal .xrz-admin-dd {
    width: 100%;
    min-width: 0;
    z-index: 20;
}

.xrz-admin-form-modal .xrz-admin-dd-list {
    z-index: 30;
    max-height: 220px;
}

/* Modal elegir empresa para historial (admin dios) */
.xrz-emp-pick-card {
    width: min(92vw, 520px);
    max-height: min(88vh, 640px);
    background: #090d16;
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 28px rgba(0, 229, 255, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.xrz-emp-pick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    flex-shrink: 0;
}

.xrz-emp-pick-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #00e5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.xrz-emp-pick-body {
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
}

.xrz-emp-pick-hint {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.45;
}

.xrz-emp-pick-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.xrz-emp-pick-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(42vh, 320px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
}

.xrz-emp-pick-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.xrz-emp-pick-item:hover {
    background: rgba(0, 229, 255, 0.08);
    color: #ffffff;
    border-left-color: rgba(0, 229, 255, 0.45);
}

.xrz-emp-pick-item.is-active {
    background: rgba(0, 229, 255, 0.14);
    color: #00e5ff;
    border-color: rgba(0, 229, 255, 0.35);
    border-left-color: #00e5ff;
}

.xrz-emp-pick-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-top: 4px;
}
