/* =========================================================================
   DISEÑO DE INTERFAZ PREMIUM - SISTEMA DE CONTROL DE EQUIPOS
   TEMA: CYBERPUNK CORPORATIVO / OSCURO ELEGANTE (HARMONIOUS DARK V3)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Paleta Soft Dark (Descansada para la vista) */
    --bg-app: #080c14;                 /* Fondo principal pizarra suave */
    --bg-sidebar: #05070c;             /* Barra lateral más profunda */
    --bg-card: rgba(13, 20, 35, 0.6);  /* Tarjetas translúcidas oscuras */
    --bg-card-hover: rgba(18, 28, 48, 0.7);
    
    /* Colores Acento - Tonos Corporativos Soft */
    --color-primary: #0ea5e9;          /* Azul Cian Mate */
    --color-primary-hover: #38bdf8;
    --color-primary-glow: rgba(14, 165, 233, 0.2);
    
    --color-secondary: #ec4899;        /* Rosa Mate / Magenta Suave */
    --color-secondary-hover: #f472b6;
    
    --color-purple: #6366f1;           /* Indigo Técnico */
    
    --color-success: #10b981;          /* Verde Esmeralda */
    --color-success-glow: rgba(16, 185, 129, 0.15);
    
    --color-warning: #f59e0b;          /* Ámbar Cálido */
    --color-warning-glow: rgba(245, 158, 11, 0.15);
    
    --color-danger: #ef4444;           /* Rojo Suave */
    --color-danger-glow: rgba(239, 68, 68, 0.15);

    /* Bordes Finos / Sin estridencias */
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-hover: rgba(14, 165, 233, 0.25);
    --border-focus: #0ea5e9;
    
    /* Tipografía y Textos de Alta Lectura */
    --color-text-primary: #f4f4f5;      /* Blanco roto, reduce la fatiga visual */
    --color-text-secondary: #a1a1aa;    /* Gris medio para descripciones */
    --color-text-muted: #52525b;        /* Gris oscuro */
    
    --font-primary: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --transition-smooth: all 0.2s ease-in-out;
    --shadow-premium: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.03);
    --radius-lg: 12px;
    --radius-md: 8px;
}

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

body {
    background-color: var(--bg-app);
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(14, 165, 233, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 10% 90%, rgba(236, 72, 153, 0.02) 0%, transparent 50%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    overflow-x: hidden;
    height: 100vh;
}

/* Global Form Fields Reset (Evita cajas blancas del navegador) */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-md) !important;
    padding: 11px 15px !important;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary) !important;
    outline: none !important;
    transition: var(--transition-smooth) !important;
    font-size: 0.9rem !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary) !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
    box-shadow: 0 0 10px var(--color-primary-glow) !important;
}

/* Layout shell wrapper */
.app-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar panel */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.brand-logo {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.72rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Active role details card */
.role-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.role-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.role-info .name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.role-info .role-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.nav-section-label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Nav Menu Buttons */
.nav-btn {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-primary);
    text-align: left;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
    margin-bottom: 6px;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--color-text-primary);
}

.nav-btn.active {
    background: rgba(14, 165, 233, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-left: 3px solid var(--color-primary);
}

/* Lucide Vector Icons inside Sidebar */
.nav-icon {
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.nav-btn:hover .nav-icon {
    color: var(--color-primary) !important;
}

.nav-btn.active .nav-icon {
    color: var(--color-primary) !important;
}

.sidebar-spacer {
    flex-grow: 1;
}

.sidebar-footer {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-glass);
}

/* Main scrollable view panel */
.main {
    padding: 35px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 18px;
    margin-bottom: 5px;
    flex-shrink: 0;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
}

.header-title h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.header-title p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 3px;
}

/* Badges for connection state */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-connected {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-disconnected {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Cards & Glass panels */
.card, .table-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.card:hover, .table-card:hover {
    border-color: rgba(14, 165, 233, 0.15);
}

/* Table Card Header Alignment */
.table-card-header, .card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.table-card-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-card-header-left h3, .card-head h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.table-card-header-left p, .card-head p {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.table-card-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Count Pills */
.asesor-count-pill, .selection-pill {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* Control Row and Search Wrap */
.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    min-width: 260px;
}

.search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
    pointer-events: none;
}

.search-input-clean {
    width: 100% !important;
}

/* Grow utility */
.grow {
    flex-grow: 1;
}

.flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

/* Section general spacing gap */
.section-gap {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Stats panel */
.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.stat-green, .stat-blue, .stat-amber, .stat-red, .stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    min-width: 130px;
    flex: 1;
    text-align: center;
    transition: var(--transition-smooth);
}

.stat-green { border-left: 3px solid var(--color-success); }
.stat-blue { border-left: 3px solid var(--color-primary); }
.stat-amber { border-left: 3px solid var(--color-warning); }
.stat-red { border-left: 3px solid var(--color-danger); }

.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.stat-green .stat-num { color: var(--color-success); }
.stat-blue .stat-num { color: var(--color-primary); }
.stat-amber .stat-num { color: var(--color-warning); }
.stat-red .stat-num { color: var(--color-danger); }

.stat-lbl {
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Grid layout for cards */
.advisor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 15px;
    margin-top: 5px;
}

/* Advisor Card - Soft styling */
.advisor-card {
    background-color: rgba(13, 20, 35, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-md) !important;
    padding: 16px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    transition: var(--transition-smooth) !important;
}

.advisor-card:hover {
    border-color: rgba(14, 165, 233, 0.2) !important;
}

/* Estilo destacado para asesores seleccionados */
.selected-card {
    background-color: rgba(14, 165, 233, 0.05) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 10px rgba(14, 165, 233, 0.05) !important;
}

.adv-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.adv-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.adv-cedula {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
}

.status-indicator {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pendiente {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-teletrabajo {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-devuelto {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Badges de selección en el formulario */
.badge-seleccionado {
    background-color: rgba(14, 165, 233, 0.08) !important;
    color: var(--color-primary) !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

.badge-en-oficina {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: var(--color-text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Card inside details */
.adv-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-row span:first-child {
    color: var(--color-text-secondary);
}

.detail-row span:last-child {
    font-weight: 600;
    font-family: var(--font-mono);
}

.adv-actions {
    display: flex;
    gap: 8px;
}

/* Tables and inner wrappers */
.table-inner {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.15);
    margin-top: 10px;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

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

.table th, .table td {
    padding: 12px 18px;
}

.table th {
    background-color: rgba(255, 255, 255, 0.01);
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 1px solid var(--border-glass) !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.01) !important;
    color: var(--color-text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.01) !important;
}

/* Table statuses and details badges */
.badge-devuelto {
    background-color: rgba(16, 185, 129, 0.05);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.12);
}

.badge-incidencia {
    background-color: rgba(239, 68, 68, 0.05);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.12);
}

/* Modals overlays and cards */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 6, 10, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-glass-hover);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-premium), 0 0 20px rgba(14, 165, 233, 0.05);
    animation: scaleUp 0.25s ease-out;
}

.modal h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--color-primary);
    text-transform: uppercase;
}

.modal p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Buttons style stack - Tonos planos/soft profesionales */
.btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.btn-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--color-text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

/* Forms layout and accordion panel */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Collapsable panel form styling */
.form-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transition: var(--transition-smooth);
    margin-bottom: 20px;
}

.form-panel-header {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.form-panel-header:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.form-panel-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-panel-icon {
    font-size: 1.15rem;
    color: var(--color-primary);
}

.form-panel-title {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
}

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

.form-panel-toggle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: var(--transition-smooth);
}

.form-panel-body {
    padding: 0 22px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all 0.25s ease-out;
}

.form-panel.open .form-panel-body {
    padding: 5px 22px 22px 22px;
    max-height: 480px;
    opacity: 1;
    visibility: visible;
}

.form-panel.open .form-panel-toggle {
    transform: rotate(45deg);
    color: var(--color-primary);
}

.form-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.span-2 {
    grid-column: span 2;
}

/* Toast alert notification box styling */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-glass-hover);
    border-left: 5px solid var(--color-primary);
    border-radius: 6px;
    padding: 12px 22px;
    color: var(--color-text-primary);
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    z-index: 12000;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 0.3s ease;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.hidden {
    display: none !important;
}

/* Empty state style for sections with no data */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

/* Animations block */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   PANTALLA DE INICIO DE SESIÓN (LOGIN) — CYBERPUNK SOFT
   ========================================================================= */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at center, #0b111e 0%, #03060a 100%);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.03) 0%, transparent 50%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    padding: 20px;
}

.login-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.login-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-purple));
}

.login-logo {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.login-box h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.login-box p {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    margin-bottom: 25px;
}

.role-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.role-option:hover {
    background: rgba(255, 255, 255, 0.01);
    transform: translateX(2px);
}

.role-option.selected {
    background: rgba(14, 165, 233, 0.06);
    border-color: var(--color-primary);
}

.role-option .icon {
    font-size: 1.4rem;
}

.role-option .ro-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.role-option .ro-desc {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 1px;
}

/* Webkit scrollbar override */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* =========================================================================
   ESTILOS DE SWEETALERT2 CYBERPUNK
   ========================================================================= */
.swal-cyber-popup {
    border: 1px solid var(--border-glass-hover) !important;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.1) !important;
    border-radius: var(--radius-lg) !important;
    font-family: var(--font-primary) !important;
}

.swal-cyber-btn {
    font-family: var(--font-primary) !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
}

/* =========================================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================================= */
@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.9);
        border-right: 1px solid rgba(14, 165, 233, 0.15);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-spacer {
        display: none;
    }
    
    .sidebar-footer {
        display: block;
        margin-top: auto;
    }
    
    .main {
        height: 100vh;
        padding: 16px;
    }

    .page-header {
        padding-bottom: 12px;
        margin-bottom: 8px;
    }
    
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th, .table td {
        padding: 10px 8px;
        font-size: 11px;
    }

    .advisor-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }

    .modal {
        padding: 20px;
        width: 100%;
        max-width: 92vw;
    }

    .signature-pad-canvas {
        width: 100%;
        height: 180px;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 12px;
    }

    .page-header h2 {
        font-size: 16px;
    }

    .page-header p {
        font-size: 10px;
    }

    .form-inline-grid {
        grid-template-columns: 1fr !important;
    }

    .card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .card-head button, .card-head div {
        width: 100%;
    }

    .adv-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .adv-actions button {
        width: 100%;
    }
}

/* =========================================================================
   HUD SCI-FI ADDITIONAL STYLES
   ========================================================================= */

.scanlines {
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    ), linear-gradient(
        90deg,
        rgba(14, 165, 233, 0.04),
        rgba(16, 185, 129, 0.01),
        rgba(99, 102, 241, 0.04)
    );
    background-size: 100% 4px, 6px 100%;
}

.bg-radial-gradient {
    background: radial-gradient(circle at center, #0a1128 0%, #03050c 100%) !important;
}

@keyframes scaleUp {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.animate-scaleUp {
    animation: scaleUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Corner Brackets on cards & containers */
.advisor-card, .table-card, .form-panel {
    position: relative;
}

.advisor-card::after, .table-card::after, .form-panel::after {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    pointer-events: none;
    background: 
        linear-gradient(to right, #0ea5e9 10px, transparent 10px) 0 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #0ea5e9 10px, transparent 10px) 0 0 / 2px 100% no-repeat,
        linear-gradient(to left, #0ea5e9 10px, transparent 10px) 100% 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #0ea5e9 10px, transparent 10px) 100% 0 / 2px 100% no-repeat,
        linear-gradient(to right, #0ea5e9 10px, transparent 10px) 0 100% / 100% 2px no-repeat,
        linear-gradient(to top, #0ea5e9 10px, transparent 10px) 0 100% / 2px 100% no-repeat,
        linear-gradient(to left, #0ea5e9 10px, transparent 10px) 100% 100% / 100% 2px no-repeat,
        linear-gradient(to top, #0ea5e9 10px, transparent 10px) 100% 100% / 2px 100% no-repeat;
    transition: all 0.3s ease;
}

.advisor-card:hover::after, .table-card:hover::after, .form-panel:hover::after {
    background: 
        linear-gradient(to right, #ec4899 12px, transparent 12px) 0 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #ec4899 12px, transparent 12px) 0 0 / 2px 100% no-repeat,
        linear-gradient(to left, #ec4899 12px, transparent 12px) 100% 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #ec4899 12px, transparent 12px) 100% 0 / 2px 100% no-repeat,
        linear-gradient(to right, #ec4899 12px, transparent 12px) 0 100% / 100% 2px no-repeat,
        linear-gradient(to top, #ec4899 12px, transparent 12px) 0 100% / 2px 100% no-repeat,
        linear-gradient(to left, #ec4899 12px, transparent 12px) 100% 100% / 100% 2px no-repeat,
        linear-gradient(to top, #ec4899 12px, transparent 12px) 100% 100% / 2px 100% no-repeat;
    filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.4));
}

/* =========================================================================
   FIRMADO DIGITAL Y ALERTAS DE RETORNO
   ========================================================================= */

/* Parpadeo de alerta neón rojo */
@keyframes alertBlink {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.2);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    50% {
        border-color: rgba(239, 68, 68, 0.85);
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
    }
}

.alert-blink {
    animation: alertBlink 1.5s infinite ease-in-out !important;
}

/* Esquinas rojas para alertas parpadeantes */
.alert-blink::after {
    background: 
        linear-gradient(to right, #ef4444 10px, transparent 10px) 0 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #ef4444 10px, transparent 10px) 0 0 / 2px 100% no-repeat,
        linear-gradient(to left, #ef4444 10px, transparent 10px) 100% 0 / 100% 2px no-repeat,
        linear-gradient(to bottom, #ef4444 10px, transparent 10px) 100% 0 / 2px 100% no-repeat,
        linear-gradient(to right, #ef4444 10px, transparent 10px) 0 100% / 100% 2px no-repeat,
        linear-gradient(to top, #ef4444 10px, transparent 10px) 0 100% / 2px 100% no-repeat,
        linear-gradient(to left, #ef4444 10px, transparent 10px) 100% 100% / 100% 2px no-repeat,
        linear-gradient(to top, #ef4444 10px, transparent 10px) 100% 100% / 2px 100% no-repeat !important;
}

/* Pad de Firma Digital (Canvas) */
.signature-container {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px dashed rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.signature-pad-canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none; /* Previene scroll táctil al firmar en tablets */
}

/* Línea de Tiempo de Historial Clínico de Equipos */
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(14, 165, 233, 0.15);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -29px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #040712;
    border: 2px solid #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-item.success .timeline-icon {
    border-color: #10b981;
}

.timeline-item.danger .timeline-icon {
    border-color: #ef4444;
}

.timeline-content {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 16px;
}

.timeline-time {
    font-size: 0.72rem;
    color: #a1a1aa;
    font-family: 'Fira Code', monospace;
}
