/* ==========================================================================
   admin.css — Painel Administrativo SaaS Moderno
   Depende de tokens.css
   ========================================================================== */

:root {
    --admin-bg: #F8FAFC;
    --admin-card: #FFFFFF;
    --admin-border: #E2E8F0;
    --admin-border-subtle: #F1F5F9;
    --admin-text: #0F172A;
    --admin-muted: #64748B;
    --admin-sidebar: #0F172A;
    --admin-sidebar-surface: #1E293B;
    --admin-sidebar-text: #94A3B8;
    --admin-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --admin-shadow-md: 0 10px 24px -6px rgba(15, 23, 42, 0.08);
    --sidebar-width: 264px;
}

body.admin {
    background: var(--admin-bg);
    color: var(--admin-text);
}

/* ---------- Animação de entrada sutil ---------- */
@keyframes admin-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Shell & Sidebar Moderna (#0F172A)
   ========================================================================== */
.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.25rem 0.875rem;
    background: var(--admin-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--admin-sidebar-text);
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
}
.sidebar__logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sidebar__logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}
.sidebar__brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #FFFFFF;
    font-weight: 800;
}
.sidebar__brand-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.sidebar__brand-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #F8FAFC;
    letter-spacing: -0.01em;
}
.sidebar__brand-sub {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748B;
}

.sidebar__section {
    margin: 1rem 0.75rem 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-sidebar-text);
    border-radius: 9px;
    transition: background 0.18s ease, color 0.18s ease;
}
.sidebar__link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.18s ease, color 0.18s ease;
}
.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #F1F5F9;
}
.sidebar__link:hover svg { opacity: 1; }

.sidebar__link.is-active {
    background: rgba(217, 56, 30, 0.14);
    color: #FFFFFF;
    font-weight: 600;
}
.sidebar__link.is-active svg {
    color: #FB7185;
    opacity: 1;
}
.sidebar__link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--color-primary);
}

.sidebar__count {
    margin-left: auto;
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: var(--radius-pill);
    background: rgba(245, 158, 11, 0.18);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- Topbar & Área Principal ---------- */
.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 64px;
    padding: 0 var(--space-6);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--admin-border);
}
.admin-topbar__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: -0.015em;
}
.admin-topbar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    font-size: var(--fs-sm);
}
.admin-topbar__avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #B91C1C;
    font-size: 0.85rem;
    font-weight: 800;
    border: 1px solid rgba(220, 38, 38, 0.15);
}
.admin-topbar__name { font-weight: 600; color: var(--admin-text); line-height: 1.2; }
.admin-topbar__mail { font-size: var(--fs-xs); color: var(--admin-muted); }

.admin-content {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin-inline: auto;
    padding: 1.75rem 2rem 3rem;
}

/* Menu mobile */
.sidebar-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar-burger { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 8px; color: var(--admin-text); cursor: pointer; }
.sidebar-burger:hover { background: #F1F5F9; }
.sidebar-backdrop { display: none; }

/* ==========================================================================
   Botões & Ações Compactas com Tooltips
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #F1F5F9;
    color: #1E293B;
    white-space: nowrap;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { background: #E2E8F0; }
.btn:active { transform: scale(0.98); }

.btn--primary {
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(217, 56, 30, 0.25);
}
.btn--primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(217, 56, 30, 0.28);
}

.btn--success {
    background: #16A34A;
    color: #FFFFFF;
}
.btn--success:hover { background: #15803D; }

.btn--danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #DC2626;
}
.btn--danger:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
}

.btn--danger-solid {
    background: #DC2626;
    color: #FFFFFF;
}
.btn--danger-solid:hover { background: #B91C1C; }

.btn--warning-solid {
    background: #D97706;
    color: #FFFFFF;
}
.btn--warning-solid:hover { background: #B45309; }

.btn--outline {
    background: #FFFFFF;
    border-color: var(--admin-border);
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.btn--outline:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
}

.btn--sm { padding: 0.36rem 0.7rem; font-size: 0.78rem; border-radius: 7px; }
.btn--block { display: flex; width: 100%; }

/* Botão de ícone compacto para linhas de tabela (alinhamento em linha única) */
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #FFFFFF;
    color: #475569;
    transition: all 0.16s ease;
}
.icon-btn:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
    transform: translateY(-1px);
}
.icon-btn:active { transform: scale(0.96); }

.icon-btn--star.is-on {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #D97706;
}
.icon-btn--star.is-on svg { fill: currentColor; }

.icon-btn--success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #16A34A;
}
.icon-btn--success:hover {
    background: #16A34A;
    border-color: #16A34A;
    color: #FFFFFF;
}

.icon-btn--warning:hover {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}

.icon-btn--danger:hover {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #DC2626;
}

/* Tooltips elegantes em CSS puro */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: #0F172A;
    color: #F8FAFC;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 80;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   KPI Cards SaaS & Seletor de Período
   ========================================================================== */
.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.period-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: #E2E8F0;
    border-radius: 9px;
    gap: 2px;
}
.period-switch__btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    border-radius: 7px;
    transition: all 0.16s ease;
}
.period-switch__btn:hover { color: #0F172A; }
.period-switch__btn.is-active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.2rem 1.35rem;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
    animation: admin-fade-up 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card:nth-child(2) { animation-delay: 40ms; }
.stat-card:nth-child(3) { animation-delay: 80ms; }
.stat-card:nth-child(4) { animation-delay: 120ms; }
.stat-card:nth-child(5) { animation-delay: 160ms; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--admin-shadow-md);
    border-color: #CBD5E1;
}

.stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.stat-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--admin-muted);
}
.stat-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}
.stat-icon--blue   { background: #EFF6FF; color: #2563EB; }
.stat-icon--green  { background: #ECFDF5; color: #16A34A; }
.stat-icon--amber  { background: #FFFBEB; color: #D97706; }
.stat-icon--purple { background: #F5F3FF; color: #7C3AED; }
.stat-icon--coral  { background: #FEF2F2; color: #DC2626; }

.stat-card__value {
    margin-top: 0.65rem;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    color: var(--admin-text);
}
.stat-card__hint {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    color: var(--admin-muted);
    font-variant-numeric: tabular-nums;
}
.stat-card--alert {
    border-color: #FDE68A;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF5 100%);
}

/* ==========================================================================
   Painéis, Tabelas Alinhadas & Barra de CTR
   ========================================================================== */
.panel {
    margin-bottom: 1.5rem;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
    animation: admin-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--admin-border);
}
.panel__title {
    margin: 0;
    font-size: 0.975rem;
    font-weight: 700;
    color: var(--admin-text);
}
.panel__body { padding: 1.35rem; }
.panel__body--flush { padding: 0; }

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.page-actions__spacer { margin-left: auto; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--admin-border);
}
.tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    margin-bottom: -1px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--admin-muted);
    border-bottom: 2px solid transparent;
    transition: color 0.16s ease, border-color 0.16s ease;
}
.tabs__item:hover { color: var(--admin-text); }
.tabs__item.is-active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.tabs__count {
    padding: 0.1rem 0.48rem;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: var(--radius-pill);
    background: #F1F5F9;
    color: #475569;
}
.tabs__item.is-active .tabs__count {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}
.tabs__item--highlight .tabs__count {
    background: #FEF3C7;
    color: #B45309;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.search-bar .input { min-width: 250px; }
.search-bar .select { width: auto; min-width: 170px; }

/* ---------- Tabelas SaaS ---------- */
.table-wrap { overflow-x: auto; }
.table { font-size: 0.85rem; }
.table th {
    padding: 0.75rem 1.1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-muted);
    background: #F8FAFC;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}
.table td {
    padding: 0.85rem 1.1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--admin-border-subtle);
}
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: #F8FAFC; }
.table tbody tr:last-child td { border-bottom: 0; }

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table__thumb {
    width: 68px;
    height: 44px;
    object-fit: cover;
    border-radius: 7px;
    background: #F1F5F9;
    border: 1px solid var(--admin-border);
}
.table__thumb-placeholder {
    display: grid;
    place-items: center;
    width: 68px;
    height: 44px;
    border-radius: 7px;
    background: #F1F5F9;
    border: 1px solid var(--admin-border);
    font-weight: 700;
    color: var(--admin-muted);
}

.table__primary {
    font-weight: 600;
    color: var(--admin-text);
    line-height: 1.35;
}
.table__primary a:hover { color: var(--color-primary); }
.table__secondary {
    margin-top: 2px;
    font-size: 0.76rem;
    color: var(--admin-muted);
}

/* Ações estritamente em uma única linha horizontal compacta */
.table__actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}
.table__actions form {
    margin: 0;
    display: inline-flex;
}

/* Barra visual de desempenho CTR */
.ctr-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 78px;
    font-variant-numeric: tabular-nums;
}
.ctr-cell__val {
    font-weight: 700;
    color: var(--admin-text);
}
.ctr-bar {
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}
.ctr-bar__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366F1, #D9381E);
    transition: width 0.35s ease;
}

/* Pills de Status */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: #F1F5F9;
    color: #475569;
    white-space: nowrap;
}
.pill--success { background: #DCFCE7; color: #15803D; }
.pill--warning { background: #FEF3C7; color: #B45309; }
.pill--danger  { background: #FEE2E2; color: #B91C1C; }
.pill--info    { background: #EFF6FF; color: #1D4ED8; }
.pill--star    { background: #FEF9C3; color: #A16207; }

/* ==========================================================================
   Empty States Ilustrados
   ========================================================================== */
.admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.25rem 1.5rem;
}
.admin-empty__icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid var(--admin-border);
}
.admin-empty__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--admin-text);
}
.admin-empty__text {
    max-width: 44ch;
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--admin-muted);
}

/* ==========================================================================
   Modal de Confirmação Customizado (substitui window.confirm)
   ========================================================================== */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.confirm-modal[hidden] {
    display: none;
}
.confirm-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.confirm-modal__dialog {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    background: #FFFFFF;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25);
    transform: scale(0.96) translateY(6px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-modal.is-open .confirm-modal__dialog {
    transform: scale(1) translateY(0);
}
.confirm-modal__head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}
.confirm-modal__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    background: #FEF2F2;
    color: #DC2626;
}
.confirm-modal__icon--warning {
    background: #FFFBEB;
    color: #D97706;
}
.confirm-modal__title {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--admin-text);
}
.confirm-modal__desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--admin-muted);
}
.confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--admin-border-subtle);
}

/* ==========================================================================
   Formulários & Editor Rico Quill
   ========================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.5rem; align-items: start; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.82rem; font-weight: 600; color: #334155; }
.field__hint { font-size: 0.75rem; color: var(--admin-muted); }
.field__error { font-size: 0.75rem; font-weight: 600; color: #DC2626; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.58rem 0.8rem;
    font-size: 0.875rem;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: var(--admin-text);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: #94A3B8; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(217, 56, 30, 0.12);
    outline: 0;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: #DC2626; }
.textarea { min-height: 110px; resize: vertical; }
.input[type='file'] { padding: 0.45rem; background: #F8FAFC; }

.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 500; color: #334155; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--color-primary); }

.image-preview {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    background: #F8FAFC;
    color: var(--admin-muted);
    font-size: 0.75rem;
    text-align: center;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.editor { background: #FFFFFF; border-radius: 8px; }
.editor .ql-toolbar.ql-snow { border-color: #CBD5E1; border-radius: 8px 8px 0 0; background: #F8FAFC; }
.editor .ql-container.ql-snow { min-height: 320px; border-color: #CBD5E1; border-radius: 0 0 8px 8px; font-family: var(--font-sans); font-size: 0.95rem; }
.editor .ql-editor { min-height: 320px; line-height: 1.7; }

/* ---------- Alertas ---------- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid transparent;
    animation: admin-fade-up 0.25s ease both;
}
.alert--success { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.alert--error   { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.alert--info    { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.alert--warning { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.alert__close { padding: 0 0.25rem; background: none; border: 0; font-size: 1.2rem; line-height: 1; color: inherit; opacity: 0.6; }
.alert__close:hover { opacity: 1; }

/* ---------- Login SaaS ---------- */
body.admin--login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(circle at 50% 0%, #1E293B 0%, #0F172A 70%);
}
.login-card {
    width: 100%;
    max-width: 410px;
    padding: 2.25rem;
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: admin-fade-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-card__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    text-align: center;
}
.login-card__logo {
    height: 48px;
    width: auto;
    margin-bottom: 0.25rem;
}
.login-card__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--color-primary);
    color: #FFFFFF;
    font-size: 1.25rem;
    font-weight: 800;
}
.login-card__title { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--admin-text); }
.login-card__subtitle { margin: 0; font-size: 0.82rem; color: var(--admin-muted); }
.login-card form { display: flex; flex-direction: column; gap: 1rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .form-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) {
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 200;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .sidebar-toggle:checked ~ .sidebar { transform: translateX(0); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }
    .sidebar-toggle:checked ~ .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 150; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); }
    .sidebar-burger { display: inline-flex; }
    .admin-topbar { padding: 0 1rem; }
    .admin-topbar__meta { display: none; }
    .admin-content { padding: 1.25rem 1rem 2.5rem; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .search-bar .input { min-width: 0; flex: 1; }
}
