/**
 * Solution Stark - Enterprise Design System
 * Integrated Module Palette: Dark Slate, Oxford Blue, Electric Turquoise, Indigo
 * Integrity Level: 100% (Full adaptation & synchronization)
 */

:root {
    --stark-turquesa: #00f2ea;
    --stark-dark: #0f172a;
    --stark-oxford: #1e293b;
    --stark-gray: #64748b;
    --white: #ffffff;
    --error-red: #ef4444;
    --success-green: #2ecc71; 
    /* Stark Command Variables */
    --stark-glass: rgba(15, 23, 42, 0.85); 
    --stark-glow: rgba(0, 242, 234, 0.4);
    --color-talento: #6366f1;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--white);
    color: var(--stark-dark);
    height: 100vh;
    overflow: hidden;
}

.main-wrapper { 
    display: flex; 
    height: 100vh; 
}

/* ==========================================================================
   LOGIN & BRANDING SECTION
   ========================================================================== */

.brand-side {
    width: 55%;
    background: var(--stark-dark);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--white);
    background-image: url('../../img/fondo_xrzstark.png'); 
    background-size: cover;
    background-position: center;
}

.brand-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(0, 242, 234, 0.2) 100%);
    z-index: 1;
}

.brand-content { position: relative; z-index: 2; max-width: 500px; }

.brand-badge {
    background: rgba(0, 242, 234, 0.1);
    color: var(--stark-turquesa);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
    border: 1px solid rgba(0, 242, 234, 0.3);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.main-brand-logo {
    width: 110px;
    filter: brightness(0) invert(1);
    margin-bottom: 30px;
}

.brand-content h1 { 
    font-size: 3.2rem; 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.brand-content h1 span { color: var(--stark-turquesa); }

.brand-content p { 
    color: rgba(255, 255, 255, 0.9); 
    font-size: 1.15rem; 
    line-height: 1.6; 
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6); 
    max-width: 450px;
}

.brand-footer { display: flex; gap: 35px; margin-top: 50px; }

.footer-item { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--white); }

.footer-item i { color: var(--stark-turquesa); font-size: 1.3rem; }

.login-side {
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: var(--white);
}

.login-box { width: 100%; max-width: 400px; }

.login-header h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -1px; }

.login-header p { color: var(--stark-gray); margin-bottom: 45px; }

.input-container { margin-bottom: 24px; }

.input-container label { 
    display: block; 
    font-size: 0.85rem; 
    font-weight: 700; 
    margin-bottom: 10px; 
    color: var(--stark-oxford);
}

.input-field {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.input-field:focus-within {
    border-color: var(--stark-turquesa);
    background: white;
    box-shadow: 0 10px 25px rgba(0, 242, 234, 0.08);
}

.input-field i { color: var(--stark-gray); margin-right: 14px; font-size: 1.1rem; transition: color 0.3s ease; }

.input-field:focus-within i { color: var(--stark-turquesa); }

.input-field input { border: none; background: none; outline: none; width: 100%; font-size: 1rem; font-weight: 500; color: var(--stark-dark); }

.form-options { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 35px; }

.form-options a { color: var(--stark-turquesa); text-decoration: none; font-weight: 700; }

.btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--stark-dark);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.btn-primary:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(0, 242, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--stark-turquesa);
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.login-footer { margin-top: 40px; text-align: center; border-top: 1px solid #f1f5f9; padding-top: 25px; }

.login-footer p { font-size: 0.85rem; color: var(--stark-gray); margin-bottom: 15px; }

.social-icons { display: flex; justify-content: center; gap: 20px; }

.social-icons a { color: var(--stark-gray); font-size: 1.4rem; transition: all 0.3s ease; }

.social-icons a:hover { color: var(--stark-turquesa); transform: translateY(-3px); }

.alert-error { background: #fff1f2; color: var(--error-red); padding: 16px; border-radius: 12px; margin-bottom: 25px; font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 12px; }

/* ==========================================================================
   STARK COMMAND CENTER (DASHBOARD CORE)
   ========================================================================== */

.stark-dashboard {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--white);
    height: 100vh;
    display: flex;
    padding: 20px;
    gap: 20px;
}

.stark-sidebar {
    width: 280px;
    background: var(--stark-glass);
    backdrop-filter: blur(25px);
    border-radius: 24px; 
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    z-index: 10;
}

.nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--stark-turquesa);
    margin: 25px 0 10px 15px;
    font-weight: 800;
}

.stark-nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    font-weight: 500;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.stark-nav-item i { font-size: 1.1rem; width: 24px; text-align: center; }

.stark-nav-item:hover, .stark-nav-item.active {
    background: rgba(0, 242, 234, 0.12);
    color: var(--white);
    box-shadow: inset 0 0 15px rgba(0, 242, 234, 0.05), 0 0 10px rgba(0, 242, 234, 0.2);
    border: 1px solid rgba(0, 242, 234, 0.3);
}

.stark-viewport {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.stark-header {
    background: var(--stark-glass);
    backdrop-filter: blur(20px);
    height: 80px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.pulse-node {
    width: 12px; height: 12px;
    background: var(--stark-turquesa);
    border-radius: 50%;
    animation: shadow-pulse 2s infinite;
}

@keyframes shadow-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 234, 0.8); }
    70% { box-shadow: 0 0 0 15px rgba(0, 242, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 234, 0); }
}

.stark-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px; 
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stark-card h3 { font-size: 0.7rem; color: var(--stark-gray); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; font-weight: 800; }

.stark-card .data { font-size: 2.2rem; font-weight: 800; color: var(--white); letter-spacing: -1.5px; }

.stark-card .sub-text { font-size: 0.8rem; color: var(--stark-turquesa); margin-top: 10px; font-weight: 700; }

/* ==========================================================================
   ADMINISTRATION & TABLES (STARK CANVAS)
   ========================================================================== */

.stark-canvas {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden; 
    padding: 30px;
    transition: 0.3s;
    position: relative;
}

table thead th {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--stark-turquesa);
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-align: left;
}

.btn-action {
    padding: 8px;
    border-radius: 8px;
    transition: 0.3s;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--white);
    cursor: pointer;
}

.btn-action:hover {
    transform: translateY(-2px);
    background: rgba(0, 242, 234, 0.1);
    border-color: var(--stark-turquesa);
}

/* ==========================================================================
   STARK MODALS (GLASSMORPHISM)
   ========================================================================== */

.stark-modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; 
    width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px); align-items: center; justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95); border: 1px solid var(--stark-turquesa);
    padding: 40px; width: 90%; max-width: 450px; border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 242, 234, 0.15); animation: modalSlide 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalSlide { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-modal { position: absolute; right: 25px; top: 20px; color: var(--stark-gray); cursor: pointer; font-size: 1.8rem; }

.detail-item { 
    display: flex; justify-content: space-between; padding: 12px 0; 
    border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; font-size: 0.85rem; 
}

.detail-item b { color: var(--stark-turquesa); }

/* ==========================================================================
   STARK PROTOCOLS: INTEGRIDAD Y EXCEPCIONES
   ========================================================================== */

.stark-integrity-panel {
    background: rgba(15, 23, 42, 0.4);
    padding: 20px;
    border-radius: 18px;
    border-left: 3px solid var(--stark-gray);
    backdrop-filter: blur(5px);
}

.check-item {
    font-size: 0.75rem;
    margin-bottom: 12px;
    color: var(--stark-gray);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.check-success { 
    color: var(--success-green) !important; 
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.check-error { 
    color: var(--error-red) !important; 
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

#panel-excepcion-ejecutiva {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin-top: 15px;
    animation: pulse-border-red 2s infinite;
}

@keyframes pulse-border-red {
    0% { border-color: rgba(239, 68, 68, 0.3); }
    50% { border-color: rgba(239, 68, 68, 0.8); }
    100% { border-color: rgba(239, 68, 68, 0.3); }
}

/* ==========================================================================
   MODULE SPECIFIC: HOTELERIA, RESTAURANT & INPUTS
   ========================================================================== */

/* Hoteleria Room Grid */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; margin-top: 20px; }
.room-card {
    background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px; padding: 20px; text-align: center; transition: 0.3s;
}
.status-disponible { border-bottom: 4px solid #10b981; }
.status-ocupada { border-bottom: 4px solid var(--error-red); }
.status-mantenimiento { border-bottom: 4px solid #f59e0b; }

/* Restaurant Table Grid */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 20px; }
.table-card {
    background: rgba(30, 41, 59, 0.4); border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%; width: 110px; height: 110px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; transition: 0.4s;
}
.status-libre { border-color: #10b981; }
.status-cuenta { border-color: var(--stark-turquesa); }

/* Integrated Inputs & Selects */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], select, textarea, .stark-input {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    transition: 0.3s;
    outline: none;
    width: 100%;
}

/* MEJORA DE LEGIBILIDAD PARA SELECTS */
select.stark-input {
    background-color: rgba(30, 41, 59, 0.7);
    color: #ffffff;
    cursor: pointer;
}

select.stark-input option {
    background-color: var(--stark-oxford); /* Fondo sólido para legibilidad */
    color: #ffffff;
    padding: 10px;
}

input:focus, select:focus, textarea:focus, .stark-input:focus {
    border-color: var(--stark-turquesa) !important;
    box-shadow: 0 0 10px rgba(0, 242, 234, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   TALENTO HUMANO - TABLAS & LISTADO
   ========================================================================== */

/* Aumentamos el padding de las celdas para dar más altura a la fila */
.stark-table tbody td {
    padding: 18px 15px; /* Mayor espacio vertical */
    vertical-align: middle;
}

.profile-avatar-container {
    width: 50px; 
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--stark-turquesa);
    box-shadow: 0 0 10px var(--stark-glow);
    background: rgba(255,255,255,0.05);
}

.profile-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Clave para que la foto no se deforme */
}

.stark-scroll { 
    overflow-y: auto; 
    flex-grow: 1; 
    position: relative;
}

.stark-scroll::-webkit-scrollbar { width: 6px; }
.stark-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.stark-scroll::-webkit-scrollbar-thumb { 
    background: var(--stark-turquesa); 
    border-radius: 10px;
    box-shadow: 0 0 10px var(--stark-turquesa);
}

.stark-table { width: 100%; border-collapse: collapse; }

/* Animación de entrada para las filas */
@keyframes starkFadeIn {
    from { opacity: 0; transform: translateY(10px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.stark-table tbody tr {
    animation: starkFadeIn 0.5s ease forwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
}

/* Efecto de Iluminación (Hover Glow) */
.stark-table tbody tr:hover {
    background: rgba(0, 242, 234, 0.05) !important;
    box-shadow: inset 4px 0 15px rgba(0, 242, 234, 0.1);
    transform: scale(1.005) translateX(5px);
    z-index: 10;
    position: relative;
}

.stark-table tbody tr:hover td {
    color: #fff !important;
    border-bottom: 1px solid rgba(0, 242, 234, 0.3);
}

.grado-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 5px currentColor;
}

.stark-status-pill {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
}

.stark-fade-bottom {
    position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
    background: linear-gradient(transparent, var(--stark-dark));
    pointer-events: none;
    z-index: 5;
}

/* ==========================================================================
   PAGINACIÓN & FOOTER
   ========================================================================== */

.stark-table-footer {
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--stark-oxford);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.counter-badge {
    background: rgba(0, 242, 234, 0.1);
    border: 1px solid rgba(0, 242, 234, 0.3);
    color: var(--stark-turquesa);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.stark-pagination {
    display: flex;
    gap: 10px;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.75rem;
    text-decoration: none;
}

.page-btn:hover:not(.disabled) {
    background: var(--stark-turquesa);
    color: var(--stark-dark);
    border-color: var(--stark-turquesa);
}

.page-btn.active {
    background: var(--stark-turquesa);
    color: var(--stark-dark);
    font-weight: 800;
}

.page-btn.disabled {
    pointer-events: none;
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================================================
   OTHERS
   ========================================================================== */

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.form-group label { display: block; font-size: 0.65rem; color: var(--stark-gray); margin-bottom: 5px; font-weight: 700; text-transform: uppercase; }

/* Responsive */
@media (max-width: 900px) { .brand-side { display: none; } .login-side { width: 100%; } .stark-sidebar { display: none; } }

/* ANIMACIONES DE PULSO PARA NODOS OPERATIVOS */
@keyframes status-glow-green {
    0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
    100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); }
}

@keyframes status-glow-red {
    0% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
    100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
}

.room-card.status-disponible:hover { animation: status-glow-green 2s infinite; }
.room-card.status-ocupada:hover { animation: status-glow-red 2s infinite; }
.table-card.status-libre { border-color: #10b981; }
.table-card.status-libre:hover { animation: status-glow-green 2s infinite; }
.table-card.status-ocupada { border-color: #ef4444; }
.table-card.status-ocupada:hover { animation: status-glow-red 2s infinite; }
.table-card.status-cuenta { border-color: var(--stark-turquesa); }
.table-card.status-cuenta:hover { box-shadow: 0 0 25px var(--stark-glow); border-color: #fff; }

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.alert-pulse {
  animation: pulse-red 1s infinite;
  border-color: #ef4444 !important;
}

/* ==========================================================================
   STARK DYNAMIC PROGRESS BARS (SISTEMA DE CARGA)
   ========================================================================== */

/* Contenedor de la barra: debe tener altura y fondo para verse */
.progress-bar-container {
    background: rgba(255, 255, 255, 0.1) !important; /* Fondo gris oscuro traslúcido */
    height: 8px !important;
    border-radius: 10px;
    margin: 15px 0 10px;
    position: relative;
    overflow: hidden;
    display: block !important;
    width: 100%;
}

/* Relleno Neón */
.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: block;
}

.fill-stark {
    background: linear-gradient(90deg, #00f2ea, #6366f1) !important;
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.5);
}

/* Gradiente de Alerta (Sobregiro > 100%) */
.fill-alert {
    background: linear-gradient(90deg, #f59e0b, var(--error-red));
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Efecto de brillo animado */
.progress-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}