/* =========================================================
   ADMIN.CSS — Event Master
   Estilos del login, dashboard y pantallas administrativas
========================================================= */


/* =========================================================
   BLOQUE 1 — Login
========================================================= */

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

:root {
    --bg: #f4f1ec;
    --panel: #ffffff;
    --text: #2f2f35;
    --muted: #7b7470;
    --border: #e4ddd5;

    --primary: #0d6efd;
    --primary-dark: #0057d8;
    --gold: #2f80ed;

    --radius-lg: 24px;
    --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
}

body {
    font-family: 'Lato', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}


.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(47, 128, 237, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(242, 165, 65, 0.12), transparent 32%),
        var(--bg);
}

.auth-shell {
    width: 100%;
    max-width: 520px;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 36px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.auth-logo,
.admin-logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-logo img,
.admin-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.admin-brand .admin-logo {
    width: 60px;
    height: 60px;
}

.auth-brand h1 {
    margin-bottom: 4px;
    font-size: 1.65rem;
    letter-spacing: -0.035em;
    color: #1f2937;
    font-weight: 900;
}

.auth-brand p {
    margin-bottom: 0;
    color: #667085;
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label {
    display: grid;
    gap: 10px;
    font-weight: 700;
    color: #344054;
}

.auth-form label span {
    font-size: 0.96rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid #d6e1ef;
    border-radius: 18px;
    padding: 16px 18px;
    font: inherit;
    background: #eef5ff;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.auth-form input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.auth-form .btn,
.auth-form button,
.auth-form input[type="submit"] {
    width: 100%;
    min-height: 52px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2f80ed, #0057d8);
    color: #fff;
    border: none;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(0, 87, 216, 0.22);
    cursor: pointer;
        transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-form .btn:hover,
.auth-form button:hover,
.auth-form input[type="submit"]:hover {
    background: linear-gradient(135deg, #4b91ff, #004fc4);
    box-shadow: 0 18px 38px rgba(0, 87, 216, 0.28);
    transform: translateY(-1px);
}


/* =========================================================
   BLOQUE 2 — Layout administrativo
========================================================= */

.admin-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
}

.admin-sidebar {
    min-height: 100vh;
    padding: 20px 16px;
    background: linear-gradient(180deg, #0b5ed7 0%, #084298 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 4px 8px;
}

.admin-brand strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.admin-brand span {
    color: rgba(255,255,255,.72);
    font-size: .84rem;
    font-weight: 600;
}

.admin-nav {
    display: grid;
    gap: 7px;
}

.admin-nav a,
.admin-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255,255,255,.82);
    font-weight: 700;
}

.admin-nav a svg,
.admin-logout svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.admin-nav a span,
.admin-logout span {
    line-height: 1.2;
}

.admin-nav a.active,
.admin-nav a:hover,
.admin-logout:hover {
    background: rgba(255,255,255,.16);
    color: #fff;
    box-shadow: inset 3px 0 0 rgba(255,255,255,.9);
}

.admin-nav a,
.admin-logout {
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.admin-logout {
    margin-top: auto;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
}

.admin-logout:hover {
    background: rgba(255,255,255,.18);
}

.admin-main {
    padding: 34px;
    display: grid;
    gap: 28px;
    background: var(--bg);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 8px;
}

.admin-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.05em;
    color: #1f2937;
    font-weight: 900;
}

.admin-header p {
    color: #667085;
    font-size: 1rem;
    line-height: 1.55;
    max-width: 720px;
}


/* =========================================================
   BLOQUE 3 — Cards y métricas
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-grid-smart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    position: relative;
    min-height: 96px;
    padding: 14px 16px 14px 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(216, 222, 232, 0.9);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #eef5ff;
    color: var(--primary-dark);
}

.stat-icon svg {
    width: 21px;
    height: 21px;
    stroke-width: 2.2;
}

.admin-card {
    background: #ffffff;
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2f80ed, #d94675);
}

.stat-card span {
    display: block;
    color: #667085;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 900;
}

.stat-card strong {
    display: block;
    color: #1f2937;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.stat-card small {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 0.82rem;
    line-height: 1.3;
}

.stat-blue .stat-icon { background: #eef5ff; color: #0d6efd; }
.stat-green .stat-icon { background: #e8f8ef; color: #16a34a; }
.stat-purple .stat-icon { background: #f1ecff; color: #7c3aed; }
.stat-orange .stat-icon { background: #fff4df; color: #d97706; }
.stat-pink .stat-icon { background: #fff0f5; color: #d94675; }
.stat-gray .stat-icon { background: #f3f4f6; color: #4b5563; }

.stat-card,
.admin-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}


/* =========================================================
   BLOQUE 4 — Estado vacío
========================================================= */

.empty-state {
    display: grid;
    gap: 12px;
    justify-items: start;
    padding: 28px 0;
}

.empty-state h2 {
    margin-bottom: 0;
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}


/* =========================================================
   BLOQUE 5 — Tablas administrativas
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 24px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15,23,42,.04);
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th,
.admin-table td {
    padding: 16px 16px;
    border-bottom: 1px solid rgba(216, 222, 232, 0.8);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #344054;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #f8fafc;
    padding-top: 18px;
    padding-bottom: 18px;
}

.admin-table tbody tr:nth-child(even) {
    background: #f9fbff;
}

.admin-table tbody tr:hover {
    background: #eef5ff;
}

.admin-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.76rem;
    font-weight: 900;
}

.status-published {
    background: #dcf7eb;
    color: #177651;
}

.status-draft {
    background: #fff2d6;
    color: #9a6400;
}

.status-paused {
    background: #e8edf8;
    color: #2c4b87;
}

.status-finished {
    background: #ece7f8;
    color: #5838a1;
}

.status-archived {
    background: #f1ebe8;
    color: #786a65;
}

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

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 900;
    background: #ffffff;
    color: #344054;
    border: 1px solid rgba(216, 222, 232, 0.9);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-small:hover {
    background: #eef5ff;
    color: var(--primary-dark);
    border-color: rgba(13, 110, 253, 0.25);
}

.table-toolbar {
    margin-bottom: 18px;
}

.table-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.table-search-form input[type="search"] {
    min-width: 280px;
    flex: 1;
    border: 1px solid #d6e1ef;
    border-radius: 999px;
    padding: 13px 16px;
    font: inherit;
    background: #ffffff;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.table-search-form input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.10);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.table-pagination span {
    color: #667085;
    font-size: 0.9rem;
    font-weight: 800;
}


/* =========================================================
   BLOQUE 6 — Formularios administrativos
========================================================= */

.admin-form {
    display: grid;
    gap: 28px;
}

.form-section {
    display: grid;
    gap: 18px;
}

.form-section h2 {
    margin-bottom: 0;
    font-size: 1.4rem;
    letter-spacing: -0.04em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: #344054;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid #d6e1ef;
    border-radius: 16px;
    padding: 13px 14px;
    font: inherit;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.10);
}

.form-grid small {
    color: var(--muted);
    font-weight: 500;
}


/* =========================================================
   BLOQUE 7 — Responsive
========================================================= */

@media (max-width: 1000px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-page {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
    min-height: auto;
    border-radius: 0 0 24px 24px;
}

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-header {
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .admin-main {
    padding: 20px 16px;
    gap: 20px;
}

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .auth-shell {
        max-width: 100%;
    }

    .auth-logo,
    .admin-logo {
        width: 64px;
        height: 64px;
    }
}

/* =========================================================
   BLOQUE 8 — Información fija del evento
========================================================= */

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.info-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fffaf7;
}

.info-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.info-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.form-note {
    margin: 18px 0 0;
    font-size: 0.92rem;
}

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

.alert-success {
    color: #176b4c;
    background: #dcf7eb;
    border: 1px solid #afe8ce;
}

@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   BLOQUE 9 — Ubicaciones del evento
========================================================= */

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.location-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    background: #fffaf7;
}

.location-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.location-card h3 {
    margin-bottom: 4px;
    font-size: 1.15rem;
    letter-spacing: -0.04em;
}

.location-card p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-weight: 900;
    white-space: nowrap;
}

.switch-field input {
    width: auto;
}

@media (max-width: 1000px) {
    .location-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   BLOQUE 10 — Centro de mando de eventos
========================================================= */

.command-table td {
    vertical-align: top;
}

.metric-mini-grid {
    display: grid;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 800;
}

.event-url-cell {
    display: grid;
    gap: 8px;
    min-width: 160px;
}

.event-url-cell a {
    color: var(--primary-dark);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 280px;
}

.command-actions .btn-small,
.event-url-cell .btn-small {
    cursor: pointer;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.dashboard-action-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(216, 222, 232, 0.9);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
}

.dashboard-action-card svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
    stroke-width: 2.1;
}

.dashboard-action-card strong {
    font-size: 1rem;
    font-weight: 900;
}

.dashboard-action-card small {
    color: #667085;
    line-height: 1.4;
}

.dashboard-action-muted {
    opacity: 0.7;
}

/* =========================================================
   BLOQUE 11 — Acciones WhatsApp invitados
========================================================= */

.btn-whatsapp {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================================
   BLOQUE 12 — Mesa de regalos admin
========================================================= */

.gift-grid,
.gift-store-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.gift-store-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subsection-title {
    margin: 8px 0 0;
    font-size: 1.2rem;
    letter-spacing: -0.04em;
}

@media (max-width: 1200px) {
    .gift-store-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .gift-grid {
        grid-template-columns: 1fr;
    }

.stats-grid-smart,
.dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

}

/* =========================================================
   BLOQUE 13 — Campo autollenado
========================================================= */

.readonly-field {
    background: #f5f1ee;
    color: var(--muted);
}

/* =========================================================
   BLOQUE — Evento activo en listado
========================================================= */

.active-event-row {
    background: #fff7f4;
    box-shadow: inset 4px 0 0 var(--primary);
}

.btn-primary-soft {
    background: #ffe2e7;
    color: var(--primary-dark);
    border-color: #f5b8c2;
}

/* =========================================================
   BLOQUE — Acceso cliente
========================================================= */

.form-copy-area {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.form-copy-area span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-copy-area textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fffaf7;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    resize: vertical;
}

/* =========================================================
   BLOQUE — Evento activo en sidebar
========================================================= */

.active-event-box {
    margin: 2px 0 8px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
}

.active-event-box span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255,255,255,.68);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.active-event-box strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    line-height: 1.25;
    font-size: 0.95rem;
    font-weight: 900;
}

.active-event-box small {
    display: block;
    color: rgba(255,255,255,.76);
    line-height: 1.35;
    font-size: 0.78rem;
    font-weight: 600;
}

/* =========================================================
   BLOQUE — Página de error admin
========================================================= */

.admin-error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(200, 50, 69, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(217, 166, 90, 0.16), transparent 30%),
        var(--bg);
}

.admin-error-card {
    width: min(100%, 620px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.admin-error-badge {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff2d6;
    color: #9a6400;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-error-card h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -0.06em;
}

.admin-error-card p {
    max-width: 460px;
    margin: 0 auto 24px;
    color: var(--muted);
}

/* =========================================================
   BLOQUE — Acciones página de error admin
========================================================= */

.admin-error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.admin-error-actions .btn {
    min-width: 180px;
}

@media (max-width: 560px) {
    .admin-error-card {
        padding: 28px 22px;
    }

    .admin-error-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-error-actions .btn {
        width: 100%;
        min-width: 0;
    }
.stats-grid-smart,
.dashboard-action-grid {
    grid-template-columns: 1fr;
}

.stat-card {
    min-height: auto;
}

}

/* =========================================================
   TEMPLATE PICKER — Crear/editar evento
========================================================= */

.template-picker-field {
    display: grid;
    gap: 10px;
}

.template-picker-field > span {
    font-weight: 800;
    color: var(--text);
}

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

.template-picker-card {
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    text-align: center;
}

.template-picker-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 16px 34px rgba(200, 50, 69, 0.18);
}

.template-picker-preview {
    width: 100%;
    aspect-ratio: 9 / 14;
    overflow: hidden;
    border-radius: 14px;
    background: #f6f3ef;
    margin-bottom: 10px;
}

.template-picker-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ajuste del selector visual dentro del grid del formulario */
.template-picker-field {
    grid-column: 1 / -1;
}

.template-picker-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    align-items: start;
}

.template-picker-card {
    max-width: 220px;
}

.template-picker-preview {
    aspect-ratio: 9 / 12;
}

/* ===== Modal editar invitado ===== */

.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:9999;
}

.modal-overlay[hidden]{
    display:none;
}

.modal-card{
    width:min(640px,100%);
    background:#fff;
    border-radius:20px;
    box-shadow:0 24px 60px rgba(15,23,42,.18);
    overflow:hidden;
}

.modal-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:20px 24px;
    border-bottom:1px solid #e5e7eb;
}

.modal-header h3{
    margin:0;
    font-size:1.1rem;
}

.modal-close{
    border:none;
    background:none;
    font-size:28px;
    cursor:pointer;
    color:#64748b;
}

.modal-body{
    padding:24px;
}

.modal-footer{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    padding:20px 24px;
    border-top:1px solid #e5e7eb;
}

@media (max-width:768px){
    .modal-card{
        border-radius:18px;
    }

    .modal-footer{
        flex-direction:column;
    }

    .modal-footer .btn{
        width:100%;
    }
}

/* ALERTA solicitudes nuevas */

.pulse-card {
    animation: pulseCard 2s infinite;
}

@keyframes pulseCard {
    0% {
        box-shadow: 0 0 0 rgba(236,72,153,.35);
    }
    50% {
        box-shadow: 0 0 18px rgba(236,72,153,.35);
    }
    100% {
        box-shadow: 0 0 0 rgba(236,72,153,.35);
    }
}

/* =========================================================
   BLOQUE — Filtros de plantillas
========================================================= */

.template-filter-form {
    margin: 18px 0 22px;
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}

.template-filter-form select,
.template-filter-form input[type="search"] {
    width: 100%;
    border: 1px solid #d6e1ef;
    border-radius: 999px;
    padding: 13px 16px;
    font: inherit;
    background: #ffffff;
    outline: none;
}

.template-filter-form select:focus,
.template-filter-form input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.10);
}

@media (max-width: 900px) {
    .template-filter-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .template-filter-form {
        grid-template-columns: 1fr;
    }

    .template-filter-form .btn {
        width: 100%;
    }
}

.event-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-profile-grid label:first-child,
.event-profile-grid label:last-child {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .event-profile-grid {
        grid-template-columns: 1fr;
    }

    .event-profile-grid label:first-child,
    .event-profile-grid label:last-child {
        grid-column: auto;
    }
}

/* BLOQUE — Admin Plantillas / Backgrounds */
.admin-form .form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

/* En alta: Tipo | Nombre | Imagen */
.admin-form .form-grid > div:has(.checkbox-grid) {
    grid-column: 1 / -1;
    order: 4;
}

.admin-form .form-grid > label:nth-of-type(1) {
    order: 1;
}

.admin-form .form-grid > label:nth-of-type(2) {
    order: 2;
}

.admin-form .form-grid > label:nth-of-type(3) {
    order: 3;
}

/* Categorías y layouts como chips horizontales */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.checkbox-card {
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    width: fit-content;
    min-width: max-content;
    min-height: 34px;
    padding: 7px 12px;
    white-space: nowrap;
}

.checkbox-card input {
    position: static !important;
    width: 15px;
    height: 15px;
    margin: 0;
    flex: 0 0 15px;
}

.checkbox-card span {
    display: inline-flex;
    white-space: nowrap;
}

.checkbox-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #123a8c;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* Cards de backgrounds */
.template-picker-card small {
    display: block;
    line-height: 1.35;
    margin-top: 4px;
}

.template-picker-card .admin-actions {
    margin-top: 12px;
    justify-content: center;
}

.template-picker-card .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-form .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form .form-grid > div:has(.checkbox-grid) {
        grid-column: auto;
    }
}