/* Panel administrativo (layouts/app.blade.php) */
:root {
    --brand: #4f7a64;
    --brand-2: #8b6a5e;
    --brand-soft: #e7efe8;
    --ink: #1f2a24;
    --muted: #6b7280;
    --line: #e9e4da;
    --surface: #ffffff;
    --bg: #f5f2ec;
    --sidebar: #17231e;
    --sidebar-text: #a9bab0;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(31, 42, 36, .04), 0 8px 24px rgba(31, 42, 36, .06);
    --bs-primary: #4f7a64;
    --bs-primary-rgb: 79, 122, 100;
    --bs-body-font-family: 'Outfit', system-ui, sans-serif;
    --bs-link-color: #4f7a64;
    --bs-link-hover-color: #34483e;
    --bs-link-color-rgb: 79, 122, 100;
    --bs-link-hover-color-rgb: 52, 72, 62;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14.5px;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #43695a;
    --bs-btn-hover-border-color: #43695a;
    --bs-btn-active-bg: #34483e;
    --bs-btn-active-border-color: #34483e;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
}
.btn { border-radius: 10px; font-weight: 500; }
.btn-gradient {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border: 0;
    box-shadow: 0 6px 18px rgba(79, 122, 100, .28);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.06); }
.btn-whatsapp { background: #25d366; color: #fff; border: 0; }
.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control, .form-select { border-radius: 10px; border-color: #ddd6c8; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #8fb29f;
    box-shadow: 0 0 0 .2rem rgba(79, 122, 100, .15);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .88rem; color: #3b4a42; margin-bottom: .3rem; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); }

/* ===================== Sidebar ===================== */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background:
        radial-gradient(600px 300px at 0% 0%, rgba(79, 122, 100, .28), transparent 60%),
        radial-gradient(500px 300px at 100% 100%, rgba(139, 106, 94, .18), transparent 60%),
        var(--sidebar);
    color: #fff;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
    overflow-y: auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 22px;
    color: #fff;
    text-decoration: none;
}
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #34483e);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(52, 72, 62, .3), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-mark .logo-mark { display: block; }
.brand-name { font-weight: 700; font-size: 1.15rem; line-height: 1; }
.brand-name small { display: block; font-weight: 400; font-size: .72rem; color: var(--sidebar-text); margin-top: 3px; letter-spacing: .04em; }
.nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7f9186;
    padding: 16px 12px 6px;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 20px;
    margin: 2px 0;
    border-radius: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.side-link i { font-size: 1.15rem; width: 40px; flex-shrink: 0; text-align: center; margin-left: -8px; margin-right: -4px; }
/* Eje común: el centro de los íconos coincide con el centro del logo (sidebar 14px + 12px + 20px) */
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active {
    background: linear-gradient(135deg, rgba(79, 122, 100, .9), rgba(139, 106, 94, .75));
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 122, 100, .3);
}
.side-link .badge { margin-left: auto; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.plan-card {
    background: rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--sidebar-text);
}
.plan-card strong { color: #fff; }
.plan-card { padding-left: 0; }
.plan-card strong i { display: inline-block; width: 40px; margin: 0 0 0 12px !important; text-align: center; }
.plan-card > div { padding-left: 52px; }

/* ===================== Contenido ===================== */
.main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: rgba(245, 242, 236, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar .page-title { font-weight: 600; font-size: 1.05rem; margin: 0; }
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    flex-shrink: 0;
}
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.content { padding: 26px 28px 40px; flex: 1; min-width: 0; }
.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; }
.sidebar-close { display: none; color: #fff; padding: 6px 10px; }
.sidebar-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.bottom-nav { display: none; }
.topbar-bell { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; }

/* ---------- Escritorio: menú lateral contraíble ---------- */
@media (min-width: 992px) {
    .sidebar, .main { transition: width .25s ease, margin-left .25s ease; }
    html.sidebar-collapsed .sidebar { width: 84px; padding-inline: 12px; overflow: visible; }
    html.sidebar-collapsed .main { margin-left: 84px; }
    html.sidebar-collapsed .sidebar-top { justify-content: center; }
    html.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
    html.sidebar-collapsed .brand-name,
    html.sidebar-collapsed .link-label,
    html.sidebar-collapsed .side-link .badge { display: none; }
    html.sidebar-collapsed .nav-section { font-size: 0; padding: 10px 0 4px; border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 8px; }
    html.sidebar-collapsed .side-link { justify-content: center; padding: 12px 0; position: relative; }
    html.sidebar-collapsed .side-link i { margin: 0; }
    html.sidebar-collapsed .side-link::after {
        content: attr(data-tip);
        position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
        background: #1f2a24; color: #fff; font-size: .8rem; white-space: nowrap;
        padding: 6px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
    }
    html.sidebar-collapsed .side-link:hover::after, html.sidebar-collapsed .side-link:focus-visible::after { opacity: 1; }
    html.sidebar-collapsed .plan-card { padding: 10px 0; text-align: center; }
    html.sidebar-collapsed .plan-card i { margin: 0 !important; }
    html.sidebar-collapsed .plan-card strong { display: block; }
    html.sidebar-collapsed .collapse-toggle i { transform: scaleX(-1); }
}

/* ---------- Tableta y celular: menú hamburguesa ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: min(300px, 86vw); box-shadow: none; visibility: hidden; transition: transform .25s ease, visibility .25s; }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: none; visibility: visible; box-shadow: 20px 0 40px rgba(0, 0, 0, .25); }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(15, 25, 20, .5); z-index: 1030;
        backdrop-filter: blur(2px);
    }
    .sidebar-close { display: inline-flex; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .collapse-toggle { display: none; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
    .page-head h1 { font-size: 1.35rem; }
}

/* ---------- Celular ---------- */
@media (max-width: 767.98px) {
    body { font-size: 14px; }
    .content { padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); }
    .topbar .page-title { font-size: .98rem; }
    .page-head { margin-bottom: 14px; }
    .page-head > div:last-child:not(:first-child) { width: 100%; }
    .page-head > .d-flex > .btn, .page-head > .d-flex > .dropdown { flex: 1 1 auto; }
    .page-head > .d-flex > .dropdown > .btn { width: 100%; }
    .card-body { padding: 14px; }
    .stat-card { padding: 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
    .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; margin: 0; grid-row: span 2; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-label { margin: 0; font-size: .78rem; }
    .stat-card .stat-foot { grid-column: 1 / -1; margin-top: 6px; font-size: .72rem; }
    .filter-bar .form-control, .filter-bar .form-select { min-width: 0; width: 100%; flex: 1 1 100%; }
    .filter-bar .btn { flex: 1 1 auto; }
    .chip-filter { font-size: .78rem; padding: 4px 10px; }
    .modal-dialog { margin: .5rem; }
    .toast-stack { left: 12px; right: 12px; top: 12px; max-width: none; }
    .chart-box { height: 210px; }

    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025;
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
        border-top: 1px solid var(--line);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px rgba(31, 42, 36, .08);
    }
    .bottom-nav a, .bottom-nav button {
        position: relative;
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        color: #7f9186; text-decoration: none; font-size: .68rem; font-weight: 500;
        background: none; border: 0; padding: 4px 0;
    }
    .bottom-nav i { font-size: 1.25rem; }
    .bottom-nav .active { color: var(--brand); }
    .bottom-nav em {
        position: absolute; top: 0; left: 55%;
        background: #dc2626; color: #fff; font-style: normal; font-size: .6rem;
        min-width: 16px; height: 16px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px;
    }
    .bottom-nav .bottom-nav-main {
        width: 52px; height: 52px; margin: -22px auto 0; border-radius: 18px;
        background: linear-gradient(135deg, var(--brand), #34483e); color: #fff;
        justify-content: center; box-shadow: 0 8px 20px rgba(52, 72, 62, .35);
    }
    .bottom-nav .bottom-nav-main i { font-size: 1.5rem; }

    /* Tablas → tarjetas */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { border-bottom: 1px solid var(--line); padding: 12px 14px; position: relative; }
    .table-cards.table > :not(caption) > tr > td, .table-cards.table > tbody > tr > td { padding: 0; border: 0; box-shadow: none; }
    .table-cards td { text-align: left !important; }
    .table-cards td + td { margin-top: 8px; }
    .table-cards td[data-label]:not(.cell-main) { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
    .table-cards td[data-label]:not(.cell-main)::before {
        content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
        color: var(--muted); font-weight: 600; flex-shrink: 0; padding-top: 2px;
    }
    .table-cards td[data-label] > * { text-align: right; }
    .table-cards td.cell-main { padding-right: 48px; }
    .table-cards td.cell-menu { position: absolute; top: 10px; right: 10px; width: auto; margin: 0; }
    .table-cards td.cell-actions { display: flex !important; gap: 6px; }
    .table-cards td.cell-actions > * { flex: 1; text-align: center; }
    .table-cards td.cell-actions .btn { width: 100%; }
    .table-cards td.cell-actions::before { display: none; }
    .table-cards .d-none.d-lg-table-cell:not(.cell-empty) { display: flex !important; }
    .table-cards td:empty, .table-cards td.cell-empty { display: none !important; }
    .table-cards td.cell-actions { justify-content: flex-start; }
    .table-cards .cell-detail { text-align: left; flex: 1; }
    .table-cards .cell-detail .extra-alert { text-align: left; }
}

/* ===================== Tarjetas ===================== */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 18px; font-weight: 600; }
.card-body { padding: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.55rem; font-weight: 700; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    height: 100%;
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stat-card .stat-foot { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.tone-violet { background: #e3ede6; color: #43695a; }
.tone-green { background: #dcfce7; color: #15803d; }
.tone-red { background: #fee2e2; color: #b91c1c; }
.tone-amber { background: #fef3c7; color: #b45309; }
.tone-sky { background: #e0f2fe; color: #0369a1; }
.tone-pink { background: #f6e7e2; color: #8b5a4e; }

.progress-stack { height: 10px; border-radius: 99px; overflow: hidden; display: flex; background: #eee; }
.progress-stack span { display: block; height: 100%; }

.event-card { transition: transform .2s, box-shadow .2s; height: 100%; overflow: hidden; }
.event-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31, 42, 36, .1); }
.event-cover {
    height: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px 16px;
    color: #fff;
    background-size: cover;
    background-position: center;
}
.event-cover .emoji { font-size: 2.2rem; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.date-chip {
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    border-radius: 12px;
    padding: 4px 10px;
    text-align: center;
    line-height: 1.1;
}
.date-chip b { display: block; font-size: 1.2rem; }
.date-chip small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }

.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .7rem .8rem; border-color: var(--line); }
.table thead th {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 600;
    background: #faf8f3;
    white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f3ec; }
.badge { font-weight: 500; border-radius: 8px; padding: .38em .6em; }
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-secondary { background: #eef0f3; color: #475569; }
.badge-soft-info { background: #e0f2fe; color: #075985; }
.badge-soft-primary { background: #e3ede6; color: #34483e; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.extra-alert {
    border-left: 4px solid #0ea5e9;
    background: #f0f9ff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .82rem;
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 150px; }
.chip-filter {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 99px;
    padding: 5px 12px;
    font-size: .82rem;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.chip-filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-filter .count { opacity: .65; margin-left: 4px; }

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #faf8f3;
    border: 1px dashed #d9d0c0;
    border-radius: 12px;
    padding: 8px 10px;
}
.link-box code { color: var(--ink); font-size: .82rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.template-option input { position: absolute; opacity: 0; }
.template-option label {
    display: block;
    cursor: pointer;
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    height: 100%;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.template-option input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 122, 100, .12); }
.template-option input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.template-swatch { display: flex; gap: 4px; margin-top: 8px; }
.template-swatch span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .08); }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state .icon { font-size: 2.6rem; margin-bottom: 8px; }

.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.flash {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(31, 42, 36, .15);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-left: 4px solid var(--brand);
    animation: slideIn .3s ease;
}
.flash.success { border-color: #16a34a; }
.flash.error { border-color: #dc2626; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.chart-box { position: relative; height: 240px; }
.modal-content { border-radius: 18px; border: 0; }
.modal-header { border-bottom-color: var(--line); }
.modal-footer { border-top-color: var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }

/* Miniaturas de plantillas */
.template-thumb { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; display: block; }
.template-cover { position: relative; height: 220px; overflow: hidden; background: linear-gradient(180deg, var(--c2), #fff); border-bottom: 3px solid var(--c1); display: grid; place-items: center; }
.template-cover img { width: 78%; margin-top: 18px; align-self: start; border-radius: 6px; box-shadow: 0 10px 24px rgba(31, 42, 36, .15); transition: transform .3s; }
.event-card:hover .template-cover img { transform: translateY(-6px); }
.template-cover .emoji { font-size: 3rem; }
.template-cover .badge { position: absolute; top: 10px; right: 10px; }

.companions small { display: inline-block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* Motivo de la plantilla (🦕, 🌸…): fondo claro para que el ícono resalte */
.motif-badge {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 52px; height: 52px; border-radius: 16px;
    background: radial-gradient(circle at 35% 30%, #fff 0%, #fbf8f2 55%, var(--brand-soft) 100%);
    border: 2px solid var(--brand);
    box-shadow: 0 0 0 4px rgba(79, 122, 100, .14), 0 6px 14px rgba(31, 42, 36, .15);
    font-size: 1.8rem; line-height: 1;
}
.motif-badge.motif-lg { width: 60px; height: 60px; font-size: 2.1rem; }
.event-cover .motif-badge { width: 48px; height: 48px; font-size: 1.7rem; border-color: rgba(255, 255, 255, .9); }

/* Utilidad: permite que un hijo flex/grid se encoja y recorte su texto */
.min-w-0 { min-width: 0; }

/* Compartir tarjeta (PDF) */
.share-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f6; }
.share-file > i { flex: none; font-size: 1.8rem; color: #c2410c; }
.share-file > div { flex: 1; min-width: 0; }
.share-file strong { display: block; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }

/* Indicadores con detalle */
button.stat-card { width: 100%; height: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
button.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 42, 36, .1); }
button.stat-card:focus-visible { outline: 3px solid rgba(79, 122, 100, .45); outline-offset: 2px; }
.stat-more { font-size: .7rem; opacity: .5; transition: transform .15s, opacity .15s; }
button.stat-card:hover .stat-more { opacity: 1; transform: translateX(2px); }
.breakdown-list { list-style: none; margin: 0; padding: 0; }
.breakdown-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.breakdown-item:hover { background: #faf9f6; color: inherit; }
.breakdown-people { color: #4f7a64; margin-top: 2px; }
.breakdown-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 600; }

/* Campana de notificaciones */
.topbar-bell .notif-badge {
    position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 99px; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 700;
    display: grid; place-items: center; box-shadow: 0 0 0 2px #fff;
}
.topbar-bell .notif-dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px #fff; }
.topbar-bell [hidden] { display: none !important; }
.notif-menu { width: min(400px, calc(100vw - 24px)); padding: 0; overflow: hidden; border-radius: 14px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-pending { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #e0f2fe; color: #075985; text-decoration: none; font-size: .88rem; }
.notif-pending:hover { background: #cfeafc; color: #075985; }
.notif-pending[hidden] { display: none; }
.notif-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.notif-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 99px; padding: 4px 10px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.notif-tabs button.active { background: var(--sidebar); color: #fff; }
.notif-list { max-height: min(420px, 60vh); overflow-y: auto; }
.notif-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.notif-item:hover { background: #faf9f6; color: inherit; }
.notif-item.unread { background: #f3f8f5; }
.notif-item.unread::before { content: ""; position: absolute; left: 6px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.notif-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; }
.notif-body { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: .86rem; line-height: 1.3; }
.notif-body strong { font-weight: 600; }
.notif-detail { color: var(--ink); opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-body small { color: var(--muted); margin-top: 2px; }
.notif-tag { flex: none; align-self: center; font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: #fef3c7; color: #92400e; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .88rem; }

/* Tarjeta de evento (Mis eventos) */
.ev-card {
    position: relative; height: 100%;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(31, 42, 36, .04), 0 10px 30px -18px rgba(31, 42, 36, .25);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ev-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--ev-1) 35%, var(--line)); box-shadow: 0 22px 44px -20px rgba(31, 42, 36, .35); }
.ev-cover {
    position: relative; display: block; height: 104px; overflow: hidden; isolation: isolate;
    background: linear-gradient(135deg, var(--ev-1), var(--ev-2));
}
.ev-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transform: scale(1.02); transition: transform .6s ease; z-index: -1; }
.ev-card:hover .ev-cover img { transform: scale(1.08); }
.ev-cover::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(10, 18, 14, .35) 0%, rgba(10, 18, 14, 0) 38%, rgba(10, 18, 14, 0) 55%, rgba(10, 18, 14, .6) 100%);
}
.ev-pills { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; }
.ev-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap;
    background: rgba(255, 255, 255, .88); color: var(--ink);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.ev-pill > i:not([class]) { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ev-status-success { color: #15803d; }
.ev-status-secondary, .ev-status-dark { color: #475569; }
.ev-status-warning { color: #b45309; }
.ev-when-today { background: #16a34a; color: #fff; }
.ev-when-soon { background: #fef3c7; color: #92400e; }
.ev-when-past { background: rgba(30, 41, 59, .75); color: #fff; }
.ev-template {
    position: absolute; right: 12px; bottom: 8px;
    font-size: .72rem; font-weight: 500; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.ev-body { position: relative; flex: 1; display: flex; flex-direction: column; padding: 0 16px 12px; }
.ev-top { display: flex; align-items: flex-end; gap: 12px; }
.ev-date {
    flex: none; position: relative; margin-top: -26px; width: 54px;
    display: flex; flex-direction: column; align-items: center; line-height: 1;
    background: var(--surface); border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 20px -6px rgba(31, 42, 36, .35), 0 0 0 1px var(--line);
}
.ev-date small:first-child {
    align-self: stretch; text-align: center; padding: 3px 0;
    background: linear-gradient(135deg, var(--ev-1), var(--ev-2)); color: #fff;
    font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.ev-date b { font-size: 1.35rem; font-weight: 700; padding: 4px 0 1px; letter-spacing: -.02em; }
.ev-date small:last-child { font-size: .6rem; color: var(--muted); padding-bottom: 5px; }
.ev-head { min-width: 0; padding-top: 8px; }
.ev-type { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ev-1); }
.ev-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: .98rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); text-decoration: none;
}
.ev-title:hover { color: var(--brand); }
.ev-meta { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: .78rem; color: var(--muted); }
.ev-meta li { display: flex; gap: 5px; align-items: center; min-width: 0; max-width: 100%; }
.ev-meta i { flex: none; opacity: .8; }
.ev-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-meta li:first-child span::first-letter { text-transform: uppercase; }
.ev-stats { margin-top: auto; padding: 10px 12px 8px; background: var(--bg); border-radius: 14px; }
.ev-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.ev-kpis div { text-align: center; }
.ev-kpis div + div { border-left: 1px solid var(--line); }
.ev-kpis b { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.ev-kpis span { font-size: .68rem; color: var(--muted); }
.ev-kpis .ok b { color: #15803d; }
.ev-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: #e2ddd2; }
.ev-bar span { height: 100%; transition: width .6s ease; }
.ev-bar .ok { background: #22c55e; }
.ev-bar .no { background: #f87171; }
.ev-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 5px; font-size: .7rem; color: var(--muted); }
.ev-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: #d6d1c6; vertical-align: 1px; }
.ev-legend i.ok { background: #22c55e; }
.ev-legend i.no { background: #f87171; }
.ev-legend strong { margin-left: auto; font-weight: 600; color: var(--ink); }
.ev-alert {
    display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px;
    border-radius: 12px; background: #e0f2fe; color: #075985; font-size: .82rem; text-decoration: none;
    transition: background .2s;
}
.ev-alert:hover { background: #cdeafc; color: #075985; }
.ev-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fcfbf8; }
.ev-actions .btn { border-radius: 12px; }
.ev-icon { width: 38px; padding-left: 0; padding-right: 0; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.ev-icon:hover { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
    .ev-card, .ev-cover img { transition: none; }
    .ev-card:hover, .ev-card:hover .ev-cover img { transform: none; }
}


/* Dashboard: próximo evento destacado, siguientes y últimas respuestas */
a.stat-card { display: block; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 42, 36, .1); }
a.stat-card:hover .stat-more { opacity: 1; transform: translateX(2px); }
.stat-card.stat-alert { border-color: #f5c2d0; background: linear-gradient(180deg, #fff, #fff6f8); }

.spot { display: grid; grid-template-columns: minmax(190px, min(34%, 300px)) 1fr; gap: 22px; align-items: stretch; }
.spot-art {
    position: relative; display: block; overflow: hidden; border-radius: 18px; min-height: 260px;
    background: linear-gradient(135deg, var(--ev-1), var(--ev-2));
    box-shadow: 0 18px 40px -22px rgba(31, 42, 36, .55);
}
.spot-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s ease; }
.spot-art:hover img { transform: scale(1.04); }
.spot-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(10, 18, 14, .5)); pointer-events: none; }
.spot-frame {
    position: absolute; top: 0; left: 0; width: 420px; border: 0; transform-origin: 0 0;
    pointer-events: none; opacity: 0; transition: opacity .4s ease; background: transparent;
}
.spot-art.is-live .spot-frame { opacity: 1; }
.spot-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.spot-link:focus-visible { outline: 3px solid rgba(79, 122, 100, .6); outline-offset: 2px; }
.spot-art.is-live img { opacity: 0; }
.spot-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4rem; }
.spot-badge {
    position: absolute; z-index: 1; left: 12px; bottom: 12px;
    padding: 5px 12px; border-radius: 99px; font-size: .72rem; font-weight: 600;
    background: rgba(255, 255, 255, .9); color: var(--ink); backdrop-filter: blur(6px);
}
.spot-main { min-width: 0; display: flex; flex-direction: column; }
.spot-title { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 6px 0 8px; }
.spot-title a { color: var(--ink); text-decoration: none; }
.spot-title a:hover { color: var(--brand); }
.spot-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .86rem; }
.spot-meta i { margin-right: 4px; }
.spot-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.spot-count div {
    text-align: center; padding: 8px 4px; border-radius: 12px;
    background: color-mix(in srgb, var(--ev-1) 9%, #fff); border: 1px solid color-mix(in srgb, var(--ev-1) 18%, transparent);
}
.spot-count b { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.1; color: color-mix(in srgb, var(--ev-1) 80%, #111); font-variant-numeric: tabular-nums; }
.spot-count span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.spot-count.is-now div { background: #dcfce7; }
.spot-stats { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.spot-ring { position: relative; flex: none; width: 108px; height: 108px; }
.spot-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.spot-ring circle { fill: none; stroke-width: 10; stroke-linecap: butt; }
.spot-ring .track { stroke: #ece8df; }
.spot-ring .ok { stroke: #22c55e; }
.spot-ring .no { stroke: #f87171; }
.spot-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.spot-ring b { font-size: 1.3rem; font-weight: 700; }
.spot-ring span { font-size: .66rem; color: var(--muted); }
.spot-kpis { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; margin: 0; }
.spot-kpis div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.spot-kpis .wide { grid-column: 1 / -1; border-bottom: 0; }
.spot-kpis dt { font-weight: 400; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.spot-kpis dd { margin: 0; font-weight: 700; font-size: 1rem; }
.spot-kpis .wide dd { color: var(--brand); font-size: 1.15rem; }
.spot-kpis .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #d6d1c6; }
.spot-kpis .dot.ok { background: #22c55e; }
.spot-kpis .dot.no { background: #f87171; }
.spot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.spot-actions .btn { border-radius: 12px; }

.up-heading { margin: 24px 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.up-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.up-list > li { min-width: 0; }
.up-item {
    display: flex; align-items: center; gap: 14px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}
.up-item:hover { border-color: color-mix(in srgb, var(--ev-1) 40%, var(--line)); background: #fcfbf8; color: inherit; transform: translateX(2px); }
.up-date { flex: none; width: 46px; border-radius: 10px; overflow: hidden; text-align: center; line-height: 1; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.up-date small { display: block; padding: 3px 0; font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--ev-1), var(--ev-2)); }
.up-date b { display: block; padding: 4px 0 5px; font-size: 1.15rem; }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up-body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-body small { color: var(--muted); }
.up-progress { flex: none; width: 130px; display: flex; flex-direction: column; gap: 4px; text-align: right; font-size: .78rem; color: var(--muted); }
.up-numbers b { color: #15803d; font-size: .95rem; }
.up-bar { height: 5px; border-radius: 99px; background: #ece8df; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: #22c55e; border-radius: inherit; }
.up-arrow { color: var(--muted); }

.resp-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; transition: background .15s; }
.resp-item:hover { background: #faf9f6; color: inherit; }
.resp-item:last-child { border-bottom: 0; }
.resp-avatar { position: relative; flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; }
.resp-avatar i { position: absolute; right: -5px; bottom: -5px; font-size: .85rem; background: #fff; border-radius: 50%; line-height: 1; padding: 1px; }
.resp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.resp-status { font-size: .82rem; font-weight: 600; }

@media (max-width: 767.98px) { a.stat-card { display: grid; } }
@media (max-width: 767.98px) {
    .spot { grid-template-columns: 1fr; }
    .spot-art { min-height: 230px; }
    .spot-art img { object-position: 50% 20%; }
    .spot-stats { flex-direction: column; align-items: stretch; }
    .spot-ring { align-self: center; }
    .up-progress { width: 70px; }
    .up-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .spot-art img, .up-item, a.stat-card { transition: none; } }

/* Usuarios: eventos asignados al rol Cliente */
.assign-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fcfbf8; }
.assign-list { max-height: 280px; overflow-y: auto; display: grid; gap: 6px; }
.assign-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; margin: 0; }
.assign-item:hover { border-color: #c9d6cf; }
.assign-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.assign-item input { flex: none; margin: 0; }
.assign-item[hidden] { display: none; }


/* Roles y permisos */
.role-card { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.role-card.is-super { background: linear-gradient(160deg, #17231e, #22332b); color: #fff; border-color: transparent; }
.role-card.is-super .text-muted { color: #a9bab0 !important; }
.role-card header { display: flex; gap: 12px; align-items: center; }
.role-card h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.role-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--brand-soft); color: var(--brand); }
.role-card.is-super .role-icon { background: rgba(143, 207, 174, .16); color: #8fcfae; }
.role-modules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.role-modules li { display: flex; align-items: center; gap: 8px; font-size: .86rem; padding: 6px 10px; border-radius: 10px; background: #f6f8f7; }
.role-modules li i { color: var(--brand); }
.role-modules li b { margin-left: auto; font-size: .78rem; color: var(--brand); }
.role-modules li.off { opacity: .45; }
.role-modules li.off b { color: var(--muted); }
.role-card footer { margin-top: auto; display: flex; gap: 6px; justify-content: flex-end; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 16px; margin: 0; cursor: pointer; }
.perm-item:hover { background: #fcfbf8; }
.perm-item input { flex: none; margin-top: 3px; }
.perm-item strong { display: block; font-weight: 600; font-size: .88rem; }
.perm-item small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }

/* Modal de rol: un módulo por pestaña, sin desplazamiento largo */
.role-name-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.role-bulk { display: flex; align-items: center; gap: 6px; }
.perm-tabs { display: grid; grid-template-columns: 210px 1fr; min-height: 330px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.perm-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #f6f8f7; border-right: 1px solid var(--line); flex-wrap: nowrap; }
.perm-tab {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
    background: transparent; color: var(--ink); font-size: .9rem; font-weight: 500; text-align: left; white-space: nowrap;
}
.perm-tab i { color: var(--brand); }
.perm-tab:hover { background: #eaf0ec; }
.perm-tab.active { background: #fff; box-shadow: 0 1px 3px rgba(31, 42, 36, .12); font-weight: 600; }
.perm-tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.perm-tab-count { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: #e4e9e6; color: var(--muted); }
.perm-tab-count.is-on { background: var(--brand); color: #fff; }
.perm-panes { padding: 14px 16px; min-width: 0; }
.perm-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.perm-grid .perm-item { padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.perm-grid .perm-item:has(input:checked) { background: var(--brand-soft); border-color: #cfe0d6; }
@media (max-width: 767.98px) {
    .perm-tabs { grid-template-columns: 1fr; min-height: 0; }
    .perm-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .perm-tab { width: auto; flex: none; }
    .perm-grid { grid-template-columns: 1fr; }
    .role-bulk { width: 100%; }
}

.role-modal .form-check-input:checked,
.role-modal .form-check-input:indeterminate { background-color: var(--brand); border-color: var(--brand); }
.role-modal .form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(79, 122, 100, .2); }
