/* ========== Reset y variables ========== */
:root {
    --bg: #0b1220;
    /* fondo header */
    --bg-2: #0f172a;
    /* fondo body suave */
    --card: #ffffff;
    /* tarjetas */
    --text: #0f172a;
    /* texto primario */
    --muted: #64748b;
    /* texto secundario */
    --brand: #2563eb;
    /* primario */
    --brand-2: #1d4ed8;
    --ok: #16a34a;
    --warn: #eab308;
    --err: #dc2626;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 10px 25px rgba(2, 6, 23, .08);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: var(--text);
    background: #f6f7fb;
}

/* ========== helpers ========== */
.container {
    width: min(1200px, 92%);
    margin-inline: auto;
}

.content {
    padding: 24px 0 48px;
}

/* ========== Topbar / Banner ========== */
.topbar {
    background: linear-gradient(90deg, var(--bg) 0%, #0e1a33 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 18px rgba(2, 6, 23, .25);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.brand__logo {
    width: 90px;
    height: 90px;
    display: block;
}


/* Logo del login: crecer en ALTO y mantener proporción */
.login-logo {
    height: 660px;
    /* ajusta a gusto (p.ej. 140–200px) */
    width: auto;
    display: block;
    margin: 0 auto 1.5rem;
    image-rendering: auto;
    max-width: 100%;
    /* por si la imagen es muy ancha */
}

.logo-box {
    width: 100%;
    max-width: 320px;
    height: 180px;
    /* alto que quieres */
    margin: 0 auto 1.5rem;
}

.logo-box .login-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* mantiene proporción dentro del alto */
}





.brand__name {
    font-weight: 700;
    letter-spacing: .2px;
}

.nav {
    display: flex;
    gap: 6px;
}

.nav__link {
    color: #e2e8f0;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background .2s ease, color .2s ease, transform .05s ease;
}

.nav__link:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.nav__link--cta {
    background: #fff;
    color: var(--bg);
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 14px;
}

.nav__link--cta:hover {
    transform: translateY(-1px);
}

/* ========== Flash messages ========== */
.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef2ff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.flash--success {
    background: #ecfdf5;
    border-color: #d1fae5;
    color: #065f46;
}

.flash--warning {
    background: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.flash--danger {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

/* ========== Cards ========== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card+.card {
    margin-top: 16px;
}

/* ========== Auth (login) ========== */
.auth-wrapper {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(420px, 92%);
    text-align: center;
    padding: 28px 24px;
}

.auth-card__logo img {
    height: 160px;
    /* o 180px, 200px */
    width: auto;
    display: block;
    margin: 0 auto 8px;
    filter: drop-shadow(0 2px 6px rgba(2, 6, 23, .15));
}


.auth-card__title {
    margin: 6px 0 16px;
    font-size: 20px;
}

/* ========== Formularios ========== */
.form {
    display: grid;
    gap: 12px;
}

.form__row {
    text-align: left;
}

.form__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.form__input,
.form select,
.form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.form__input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.form__error {
    color: var(--err);
    font-size: 13px;
    margin-top: 4px;
}

.form__actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: transform .05s ease, box-shadow .2s ease, background .2s;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--brand);
    color: #fff;
}

.btn--primary:hover {
    background: var(--brand-2);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .25);
}

.btn--ghost {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    background: #f8fafc;
}

/* ========== Tablas (listas) ========== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

thead th {
    background: #f8fafc;
    text-align: left;
    font-weight: 700;
}

tbody tr:hover {
    background: #f9fafb;
}

/* ========== Imágenes / charts ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== Footer ========== */
.footer {
    border-top: 1px solid var(--border);
    background: #fff;
    color: #64748b;
}

.footer .container {
    padding: 14px 0;
    font-size: 14px;
}

/* ========== Responsivo ========== */
@media (max-width: 720px) {
    .nav {
        gap: 2px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav__link {
        padding: 8px 10px;
    }
}


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

.icon-link,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: transform .05s ease, box-shadow .2s ease, background .2s;
}

.icon-link:hover,
.icon-btn:hover {
    background: #f8fafc;
    box-shadow: 0 6px 14px rgba(2, 6, 23, .10);
    transform: translateY(-1px);
}

.icon--edit svg {
    width: 18px;
    height: 18px;
    stroke: #0f172a;
}

.icon--delete svg {
    width: 18px;
    height: 18px;
    stroke: #b91c1c;
}

.icon-btn {
    border: 1px solid #fecaca;
    /* rojo claro */
    background: #fff;
}

.icon-btn:hover {
    background: #fff1f2;
    /* rosado claro */
}

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}


/* Collapsable */
.collapsible {
    padding: 0;
}

.collapsible__summary {
    list-style: none;
    /* oculta el triángulo nativo en algunos navegadores */
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Iconito ▸ / ▾ */
.collapsible__summary::after {
    content: "▾";
    font-weight: 700;
    opacity: .6;
    transition: transform .2s ease;
}

details:not([open]) .collapsible__summary::after {
    transform: rotate(-90deg);
}

.collapsible__content {
    padding: 16px 18px 18px;
}

/* Opcional: en pantallas chicas empezar cerrado */
@media (max-width: 720px) {
    #alta-rapida[open] {
        /* nada, lo dejamos al JS para recordar estado */
    }
}