@keyframes adminSpin {
    to { transform: rotate(360deg); }
}

@keyframes adminFadeUp {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: none; }
}

@keyframes adminFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes adminKpiPop {
    0%   { opacity: 0; transform: translateY(4px) scale(0.985); }
    100% { opacity: 1; transform: none; }
}

.administrador-page {
    padding: 24px 32px 40px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    color: var(--admin-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.admin-shell {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow-sm);
    overflow: hidden;
    margin-bottom: 18px;
    animation: adminFadeUp 320ms cubic-bezier(.2, .8, .2, 1) backwards;
}

.admin-kpi { animation: adminKpiPop 280ms cubic-bezier(.2, .8, .2, 1) backwards; }
.admin-kpi:nth-child(1) { animation-delay: 60ms; }
.admin-kpi:nth-child(2) { animation-delay: 110ms; }
.admin-kpi:nth-child(3) { animation-delay: 160ms; }
.admin-kpi:nth-child(4) { animation-delay: 210ms; }

.admin-shell-head {
    padding: 18px 24px 18px;
    background: var(--admin-card);
    position: relative;
}

.admin-shell-back {
    appearance: none;
    background: transparent;
    border: none;
    padding: 4px 0;
    margin: 0 0 10px;
    color: var(--admin-text-muted);
    font-family: inherit;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: color 150ms ease;
    min-height: 28px;
}

.admin-shell-back svg {
    width: 14px;
    height: 14px;
    transition: transform 160ms ease;
}
@media (hover: hover) {
    .admin-shell-back:hover { color: var(--admin-navy); }
    .admin-shell-back:hover svg { transform: translateX(-2px); }
}
.admin-shell-back:active svg { transform: translateX(-1px); }
.admin-shell-back:focus-visible {
    outline: 2px solid var(--admin-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

.admin-shell-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--admin-gold-deep);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    line-height: 1;
}

.admin-shell-eyebrow::before { content: none; }

.admin-shell-rule {
    display: inline-block;
    width: 32px;
    height: 1px;
    background: var(--admin-gold);
    border: 0;
}

.admin-shell-rule--soft {
    width: 8px;
    background: var(--admin-gold);
    opacity: .42;
}

.admin-shell-eyebrow-text {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.admin-shell-title {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
}

.admin-shell-titletext { min-width: 0; }

.admin-shell-title h1 {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.018em;
}

.admin-shell-title p {
    font-size: 12.5px;
    color: var(--admin-text-muted);
    margin: 3px 0 0;
    line-height: 1.45;
    letter-spacing: 0.005em;
}

.admin-shell-icon {
    width: 42px;
    height: 42px;
    background: var(--admin-navy);
    color: var(--admin-gold);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .14);
}

.admin-shell-icon::after { content: none; display: none; }
.admin-shell-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }

@keyframes adminPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
    50%      { box-shadow: 0 0 0 5px rgba(22, 163, 74, .05); }
}

.admin-empty-card {
    max-width: 520px;
    margin: 56px auto 32px;
    padding: 36px 32px 32px;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow-md);
    text-align: center;
}

.admin-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: var(--admin-gold-soft);
    color: var(--admin-gold-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-empty-icon svg { width: 28px; height: 28px; }

.admin-empty-eyebrow {
    margin: 0 0 8px;
    font-size: var(--fs-eyebrow, 9.5px);
    font-weight: 700;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: var(--admin-gold-deep);
}

.admin-empty-title {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.012em;
}

.admin-empty-sub {
    font-size: 13px;
    color: var(--admin-text-muted);
    line-height: 1.55;
    margin: 0 auto 18px;
    max-width: 380px;
}

.admin-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--admin-navy);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
    box-shadow: inset 0 -1px 0 0 rgba(184, 134, 11, .35);
}

.admin-empty-cta svg { width: 14px; height: 14px; }

@media (hover: hover) {
    .admin-empty-cta:hover {
        background: var(--admin-navy-700);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(15, 23, 42, .15), inset 0 -1px 0 0 rgba(184, 134, 11, .35);
    }
}
.admin-empty-cta:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.admin-empty-cta:focus-visible {
    outline: none;
    box-shadow: var(--admin-ring);
}

.admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    border-top: 1px solid var(--admin-border);
    background:
        linear-gradient(180deg, var(--admin-bg-soft) 0%, var(--admin-card) 100%);
    position: relative;
}

.admin-kpis::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 11, .35), transparent);
}

.admin-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-right: 1px solid var(--admin-border);
    transition: background-color 160ms ease;
}

.admin-kpi:last-child { border-right: none; }
.admin-kpi:hover { background: var(--admin-card); }

.admin-kpi-value {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--admin-text);
    flex-shrink: 0;
    min-width: 44px;
}

.admin-kpi-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.admin-kpi-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--admin-text-muted);
    line-height: 1.1;
}

.admin-kpi-sub {
    font-size: 11px;
    color: var(--admin-text-subtle);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-kpi--amber .admin-kpi-value { color: #92400e; }
.admin-kpi--red .admin-kpi-value { color: #991b1b; }
.admin-kpi--navy .admin-kpi-value { color: var(--admin-navy); }
.admin-kpi--emerald .admin-kpi-value { color: #065f46; }

.admin-kpi-unit {
    font-size: 16px;
    font-weight: 500;
    margin-left: 1px;
    opacity: .8;
    letter-spacing: 0;
}

@keyframes adminShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skel-bar { animation: none; }
}

.admin-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 4px;
    padding: 3px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #f1f5f9;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .06);
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 7px 12px;
    text-align: left;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color var(--admin-transition), color var(--admin-transition);
    color: var(--admin-text-soft);
    position: relative;
    font-family: inherit;
    flex: 0 0 auto;
    min-width: 0;
    border-radius: var(--admin-radius);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    isolation: isolate;
}

@media (hover: hover) {
    .admin-tab:hover:not(.activo) {
        background: rgba(255, 255, 255, .6);
        color: var(--admin-text);
    }
}

.admin-tab:focus-visible {
    background: rgba(184, 134, 11, .06);
    box-shadow: inset 0 0 0 2px var(--admin-gold);
}

.admin-tab.activo {
    background: #fff;
    color: var(--admin-danger);
    border-color: var(--admin-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.admin-tab-icon {
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: none;
    color: currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    position: relative;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-tab.activo .admin-tab-icon {
    background: none;
    color: currentColor;
    border-color: transparent;
    box-shadow: none;
}

@media (hover: hover) {
    .admin-tab:hover .admin-tab-icon { transform: translateY(-1px); }
}

.admin-kpi--clickable {
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .admin-kpi--clickable:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
        z-index: 1;
    }
}

.admin-kpi--clickable:active {
    transform: translateY(0);
    box-shadow: none;
    background: #d3dae4;
}

.admin-kpi--clickable:focus-visible {
    box-shadow: inset 0 0 0 2px var(--admin-navy);
}

.admin-kpi--activo {
    background: #dbe1e9;
    box-shadow: inset 0 -3px 0 0 var(--admin-navy);
}

.admin-kpi--activo:hover {
    background: #d3dae4;
    box-shadow: inset 0 -3px 0 0 var(--admin-navy), 0 6px 16px rgba(15, 23, 42, .12);
}
