/* ============ Reset básico ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --nf-red: #E50914;
    --bg-dark: #0b0b0b;
    --bg-panel: #ffffff;
    --text-dark: #121212;
    --text-muted: #6b7280;
    --glass: rgba(255, 255, 255, .06);
    --border: rgba(255, 255, 255, .12);
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

/* ============ Layout principal (2 columnas) ============ */
body.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 18px;
    background: #fafafa;
    color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Helvetica Neue", sans-serif;
    padding: 12px;
}

/* Panel izq: tarjeta blanca */
.left-panel {
    background: #fafafa;
    color: var(--text-dark);
    padding: 40px 28px;
    overflow-y: auto;
    border-radius: 20px;
    border: 1px solid #eee;
    box-shadow: var(--shadow);
}

.left-panel .brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.nf-logo {
    width: 110px;
    height: auto;
}

.title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ Panel derecho con IMAGEN REDONDEADA real ============ */
.right-panel {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.image-mask {
    position: relative;
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    /* 🔑 recorta la imagen */
    box-shadow: var(--shadow);
    min-height: 540px;
    border: 1px solid #e9e9e9;
}

.image-bg {
    position: absolute;
    inset: 0;
    background: url('fondonet.jpg') no-repeat center center / cover fixed;
    filter: saturate(1) contrast(1.05);
    transform: scale(1.02);
}

.overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgb(0 0 0 / 0%), rgb(0 0 0 / 18%));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

/* Instrucciones dentro de la imagen */
.instructions {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
    color: var(--text-dark);
    width: min(520px, 92%);
    backdrop-filter: blur(2px);
}

/* Contenedores tipo tarjeta dentro del panel izquierdo */
.card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

/* ============ Formulario de búsqueda ============ */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-form label {
    font-weight: 600;
    font-size: 14px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.search-form input[type="email"] {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.search-form input[type="email"]:focus {
    border-color: var(--nf-red);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, .15);
}

.btn {
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--nf-red);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.helper {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============ Loading ============ */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 14px;
    margin-top: 10px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--nf-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.big {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ Resultados / Tabla ============ */
.results {
    margin-top: 12px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

thead th {
    background: #111827;
    color: #fff;
    text-align: left;
    padding: 12px 14px;
    font-size: 14px;
    letter-spacing: .2px;
}

tbody td {
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f9fafb;
}

td a {
    color: var(--nf-red);
    font-weight: 600;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.email-count {
    font-size: 13px;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-block;
    margin: 8px 0 6px;
}

/* ============ Timeline / Pasos (en tarjeta) ============ */
.section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #0f172a;
}

.timeline-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    align-items: flex-start;
}

.timeline-item+.timeline-item {
    margin-top: 12px;
}

.timeline-item .dot {
    width: 10px;
    height: 10px;
    margin-top: 8px;
    border-radius: 50%;
    background: var(--nf-red);
    box-shadow: 0 0 0 4px rgba(229, 9, 20, .15);
}

.timeline-content {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .05);
}

.timeline-content h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.timeline-content p {
    color: #374151;
    font-size: 14px;
    line-height: 1.45;
}

.timeline-item.note .timeline-content {
    background: #fef2f2;
    border-color: #fecaca;
}

.timeline-item.note .timeline-content h3 {
    background: var(--nf-red);
    color: #fff;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* ============ Modal ============ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    z-index: 50;
    overscroll-behavior: contain;
}

.modal-content {
    position: relative;
    width: min(940px, 92vw);
    height: min(86vh, 820px);
    margin: 5vh auto 0;
    background: #0f0f0f;
    color: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.close {
    position: absolute;
    right: 12px;
    top: 8px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid var(--border);
    font-size: 22px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

.close:hover {
    background: #2a2a2a;
}

.email-content {
    margin-top: 32px;
    flex: 1;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #111;
    padding: 0;
}

/* iframe que inserta scripts.js */
#emailFrame {
    width: 100%;
    height: 100%;
    border: 0;
    overflow: hidden;
}

/* Scroll personalizado dentro del modal */
.email-content::-webkit-scrollbar {
    width: 10px;
}

.email-content::-webkit-scrollbar-track {
    background: #111;
}

.email-content::-webkit-scrollbar-thumb {
    background-color: var(--nf-red);
    border-radius: 5px;
    border: 2px solid #111;
}

/* Botón Iniciar sesión */
.btn-login {
    position: fixed;
    top: 20px;
    right: 22px;
    background: var(--nf-red);
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    transition: background .25s ease, transform .2s ease;
    z-index: 100;
}

.btn-login:hover {
    background: #ff1d23;
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
    body.layout {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .right-panel {
        order: 2;
    }

    .left-panel {
        order: 1;
        padding: 28px 18px;
    }

    .image-mask {
        min-height: 360px;
    }

    .instructions {
        width: 100%;
    }
}

/* ========== Botón flotante (si aún no lo tienes) ========== */
.btn-login {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 100;
    background: var(--nf-red);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    transition: transform .18s ease, background .2s ease;
}

.btn-login:hover {
    background: #ff1d23;
    transform: translateY(-1px);
}

/* ========== Modal Login Shell (usa tu .modal base) ========== */
.login-shell {
    width: min(440px, 92vw);
    margin: 8vh auto 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ========== Tarjeta de Login (look Netflix) ========== */
.login-card {
    background: #141414;
    color: #fff;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    padding: 28px 24px;

}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.login-logo svg {
    width: 44px;
    height: auto;
}

.login-heading {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    margin: 4px 0 16px;
    color: #e5e7eb;
}

/* Campos */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    position: relative;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    outline: none;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
}

.field input::placeholder {
    color: #7c818a;
}

.field input:focus {
    border-color: var(--nf-red);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, .18);
}

/* Icono ojito */
.has-icon .icon-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: #222;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.has-icon .icon-btn:hover {
    background: #2a2a2a;
}

.has-icon .icon-btn svg {
    width: 18px;
    height: 18px;
    fill: #b7b7b7;
}

/* Row utilidades */
.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.row.between {
    justify-content: space-between;
}

.chk {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 13px;
}

.link-muted {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
}

.link-muted:hover {
    text-decoration: underline;
}

/* Captcha mock */
.captcha-mock {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    color: #111;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}

.captcha-mock .ok {
    color: #059669;
    font-weight: 700;
}

.captcha-mock .brand {
    text-align: right;
    font-weight: 700;
    color: #111;
}

.captcha-mock .brand small {
    font-weight: 500;
    color: #555;
}

/* Error */
.login-error {
    text-align: center;
    color: #fecaca;
    background: #7f1d1d;
    border: 1px solid #fecaca33;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

/* Botón acceder (reusa .btn .btn-primary) */
.login-submit {
    height: 48px;
    margin-top: 6px;
    width: 100%;
    border-radius: 999px;
}

/* Pie */
.login-foot {
    text-align: center;
    margin-top: 10px;
    color: #cbd5e1;
    font-size: 14px;
}

.link-accent {
    color: #ff4b55;
    text-decoration: none;
    font-weight: 700;
}

.link-accent:hover {
    text-decoration: underline;
}

/* Botón cerrar del login (igual al de tu modal) */
.login-close {
    background: #1a1a1a;
}

.login-close:hover {
    background: #2a2a2a;
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
    }
}

/* ====== Layout del panel ====== */
body {
    background: #f5f6f8;
    color: #111;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Helvetica Neue", sans-serif;
}

.panel-app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ====== Sidebar ====== */
.sidebar {
    background: #0f0f10;
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    margin-bottom: 12px;
}

.sb-brand svg {
    width: 32px;
    height: auto;
    flex: 0 0 auto;
}

.sb-brand .title {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .2px;
}

.sb-user {
    background: #151516;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 12px;
    margin: 12px 0;
}

.sb-user .name {
    font-weight: 800;
    font-size: 15px;
}

.sb-user .role {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #111827;
    color: #fff;
    text-transform: capitalize;
}

.sb-nav {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sb-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e5e7eb;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.sb-nav a:hover {
    background: #1b1c1f;
    border-color: rgba(255, 255, 255, .06);
}

.sb-nav a.active {
    background: #1f2937;
    border-color: rgba(255, 255, 255, .12);
}

.sb-footer {
    margin-top: auto;
}

.logout {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    padding: 9px 12px;
    border-radius: 12px;
}

.logout:hover {
    filter: brightness(1.05);
}

/* ====== Topbar y contenido ====== */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.tb-title {
    font-weight: 900;
    font-size: 18px;
    margin: 0;
}

.tb-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    text-transform: capitalize;
}

.content {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
}

.muted {
    color: #6b7280;
    font-size: 14px;
}

.span-12 {
    grid-column: span 12;
}

.span-6 {
    grid-column: span 6;
}

.span-4 {
    grid-column: span 4;
}

.span-3 {
    grid-column: span 3;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric {
    background: #0f0f10;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 12px;
    padding: 12px;
}

.metric .k {
    font-size: 24px;
    font-weight: 900;
}

.metric .t {
    color: #cbd5e1;
    font-size: 12px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    color: #111;
    background: #fff;
}

.btn:hover {
    background: #f9fafb;
}

.btn-primary {
    background: #E50914;
    color: #fff;
    border: 1px solid #E50914;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

/* ====== Tabla mock ====== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: #111827;
    color: #fff;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
}

.table tbody td {
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
}

/* ====== Responsive ====== */
@media (max-width: 1100px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-6 {
        grid-column: span 12;
    }

    .span-4 {
        grid-column: span 6;
    }

    .span-3 {
        grid-column: span 6;
    }
}

@media (max-width: 860px) {
    .panel-app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
}