@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --brand: #0f766e;
    --brand-600: #0d665f;
    --brand-700: #0b544e;
    --accent: #2563eb;
    --ink: #0f172a;
    --muted: #64748b;
    --bg: #f5f7fb;
    --card: #ffffff;
    --ring: rgba(37, 99, 235, .18);
    --radius: 16px;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    --shadow-2: 0 12px 34px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
    color: var(--ink);
    background: radial-gradient(1200px 800px at 100% -10%, #eaf7f1 0%, transparent 60%),
                radial-gradient(900px 900px at -10% 20%, #dbeafe 0%, transparent 55%),
                var(--bg);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px 32px;
}

.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

.header-bar {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-700) 100%);
    color: #fff;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow);
}

.header-brand { display: flex; align-items: center; gap: 14px; }
.header-brand img { max-width: 170px; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.header-title { margin: 0; font-size: clamp(18px, 2vw, 26px); font-weight: 800; }
.header-subtitle { margin: 2px 0 0; color: rgba(255,255,255,.85); font-weight: 500; }

.nav-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid rgba(2, 6, 23, 0.06);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 18px;
}

.card h3 { margin: 0 0 8px; color: var(--brand-700); }
.card .muted { color: var(--muted); margin: 4px 0 12px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ecfeff;
    color: #0e7490;
    font-weight: 700;
    border: 1px solid #cffafe;
}

.btn,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: transform .06s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    box-shadow: 0 2px 0 rgba(0,0,0,.05);
}

.btn:hover,
.btn-ghost:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active,
.btn-ghost:active { transform: translateY(0); }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 10px 18px rgba(15, 118, 110, .2); }
.btn-primary:hover { background: var(--brand-600); }

.btn-secondary { background: #0f172a; color: #fff; border-color: #0f172a; box-shadow: 0 10px 18px rgba(15, 23, 42, .18); }
.btn-secondary:hover { background: #0b1325; }

.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); box-shadow: none; }
.btn-ghost:hover { background: #ecfdf5; }

.btn-text { background: transparent; color: var(--brand); border: none; box-shadow: none; padding: 8px 0; }

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.logout-container { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table thead th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    padding: 10px 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid rgba(2, 6, 23, .08);
}
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(2, 6, 23, .06);
    vertical-align: middle;
}
.table tbody tr:hover { background: #f9fbfc; }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(2, 6, 23, .08);
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: #fff;
}

@media (max-width: 768px) {
    .header-bar { align-items: flex-start; flex-direction: column; }
    .nav-actions { width: 100%; }
    .container, .shell { padding: 0 14px 24px; }
    .btn { width: 100%; justify-content: center; }
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--ink); }
.form-control, input[type="email"], input[type="password"], input[type="text"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(2, 6, 23, .12);
    border-radius: 12px;
    background: #fff;
    outline: none;
    font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--ring);
}

.login-form { max-width: 460px; margin: 0 auto; padding: 22px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.login-form .btn { width: 100%; margin-top: 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-weight: 700; }
.badge.success { background: #ecfdf3; color: #15803d; border: 1px solid #bbf7d0; }
.badge.warning { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.section-title { margin: 0 0 6px; color: var(--ink); font-size: 18px; font-weight: 800; }
.muted { color: var(--muted); }

.table-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }

/* Utilidades para vistas de autenticación */
.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.auth-card {
    padding: 22px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid rgba(2, 6, 23, .06);
}

.auth-hero {
    border-radius: var(--radius);
    padding: 24px;
    background: linear-gradient(150deg, rgba(15, 118, 110, 0.95) 0%, rgba(11, 84, 78, 0.92) 55%, rgba(37, 99, 235, 0.9) 100%);
    color: #fff;
    box-shadow: var(--shadow-2);
    display: grid;
    gap: 10px;
}
.auth-hero h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); font-weight: 800; }
.auth-hero p { margin: 0; color: rgba(255,255,255,.9); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #bbf7d0;
    font-weight: 700;
}

.table-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.floating-section { position: sticky; top: 12px; }

.stack { display: grid; gap: 12px; }

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.alert.error { background: #fef2f2; color: #b91c1c; border-color: #fecdd3; }
.alert.success { background: #ecfdf3; color: #15803d; border-color: #bbf7d0; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.55);
    padding: 16px;
}
.modal-content {
    background: #fff;
    margin: 4% auto;
    padding: 20px;
    border: 1px solid rgba(2, 6, 23, 0.08);
    width: 96%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-2);
}
.close {
    color: #94a3b8;
    float: right;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
}
.close:hover, .close:focus {
    color: #0f172a;
    text-decoration: none;
}

/* --- ESTILOS MODERNOS HEADER & VIDEO INTRO --- */

/* Header Moderno Glassmorphism */
.header-bar.modern-header {
    background: rgba(15, 118, 110, 0.85); /* Brand color con transparencia */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0; /* Sticky para que viaje con el scroll */
    z-index: 100;
    transition: all 0.3s ease;
}

.header-bar.modern-header:hover {
    background: rgba(15, 118, 110, 0.95);
    box-shadow: 0 4px 20px rgba(15, 118, 110, 0.25);
}

.header-title {
    font-family: 'Outfit', 'Manrope', sans-serif; /* Sugerencia de fuente moderna si se importara */
    letter-spacing: -0.02em;
}

/* Nav Actions - Better alignment */
.nav-actions {
    align-items: center;
}

.nav-actions .btn-ghost {
    color: #0f766e;
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Video Overlay Styles */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999; /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.intro-overlay video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Llenar pantalla */
    opacity: 0.8; /* Un poco oscuro para que el texto resalte si hubiera */
}

/* Botón Saltar */
.skip-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 10000;
    color: white;
    border-color: white;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Animación Fade Out */
.intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}
