/* ── Variables ──────────────────────────────────────────── */
:root {
    --brand:       #059669;
    --brand-mid:   #10B981;
    --brand-light: #D1FAE5;
    --brand-dark:  #047857;
    --bg:          #EFF2F7;
    --surface:     #FFFFFF;
    --surface2:    #F8FAFC;
    --sidebar-bg:  #111827;
    --border:      #E2E8F0;
    --border-soft: #EEF2F8;
    --tx:          #111827;
    --tx2:         #6B7280;
    --tx3:         #9CA3AF;
    --ok:          #059669;
    --warn:        #D97706;
    --err:         #DC2626;
    --purple:      #7C3AED;
    --blue:        #2563EB;
    --sidebar-w:   240px;
    --bar-h:       52px;
    --r:           10px;
    --sh:          0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
    --sh-lg:       0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);

    --font-display: 'Fraunces', ui-serif, Georgia, serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg); color: var(--tx);
    font-size: 13.5px; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
code {
    font-size: .82em; color: var(--brand-dark);
    background: var(--brand-light);
    padding: .15em .45em; border-radius: 4px;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

/* ── Layout ─────────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
    transition: transform .22s ease;
}

.admin-content {
    margin-left: var(--sidebar-w); flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    height: var(--bar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem; gap: 1rem;
}

.admin-main { flex: 1; padding: 1.75rem 1.5rem; }

/* ── Sidebar brand ──────────────────────────────────────── */
.sidebar-brand {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
}
.brand-icon { font-size: 1.2rem; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 700; font-size: 1rem;
    color: #fff; letter-spacing: -.01em;
}
.brand-name span { color: var(--brand-mid); }

/* ── Sidebar nav ────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: .5rem 0; }

.nav-section-title {
    font-size: .58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .12em;
    color: rgba(255,255,255,.22);
    padding: 1.1rem 1rem .3rem;
    display: flex; align-items: center; gap: .6rem;
}
.nav-section-title::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,.07);
}

.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .55rem;
    padding: .42rem 1rem;
    color: rgba(255,255,255,.5);
    border-radius: 7px; margin: 1px .5rem;
    font-size: .82rem; font-weight: 500;
    transition: color .12s, background .12s;
    position: relative; text-decoration: none;
}
.sidebar-nav .nav-link:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.sidebar-nav .nav-link.active {
    color: #fff; background: var(--brand); font-weight: 600;
}
.sidebar-nav .nav-link.active .nav-icon { color: #fff; }
.sidebar-nav .nav-link.active::before {
    content: ''; position: absolute; left: -.5rem; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-icon { width: 14px; text-align: center; flex-shrink: 0; font-size: .65rem; }

/* ── Bootstrap tabs ─────────────────────────────────────── */
.nav-tabs { border-bottom: 2px solid var(--border); gap: .1rem; }
.nav-tabs .nav-link {
    color: var(--tx2); background: transparent;
    border: none; border-bottom: 2px solid transparent;
    border-radius: 0; padding: .45rem 1rem;
    font-size: .84rem; font-weight: 500; margin-bottom: -2px;
    transition: color .12s, border-color .12s;
}
.nav-tabs .nav-link:hover { color: var(--tx); border-bottom-color: var(--tx3); background: transparent; }
.nav-tabs .nav-link.active {
    color: var(--brand-dark); font-weight: 600;
    border-bottom: 2px solid var(--brand); background: transparent;
}

/* ── Sidebar footer ─────────────────────────────────────── */
.sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: .75rem; font-weight: 600;
    color: rgba(255,255,255,.65); margin-bottom: .35rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Header elements ────────────────────────────────────── */
.header-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.header-user {
    font-size: .75rem; color: var(--tx2); font-weight: 500;
    padding: .22rem .8rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 20px;
}
.btn-toggle-sidebar {
    background: none; border: none; color: var(--tx2);
    font-size: 1.15rem; cursor: pointer;
    padding: .25rem .45rem; border-radius: var(--r); display: none;
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .5rem;
}
.page-title {
    font-family: var(--font-display);
    font-weight: 600; font-size: 1.3rem;
    color: var(--tx); letter-spacing: -.01em;
}

/* ── Banda de encabezado del Dashboard ───────────────────── */
.dash-hero {
    background: linear-gradient(127deg, var(--sidebar-bg) 0%, #0B4A3B 52%, var(--brand) 145%);
    margin: -1.75rem -1.5rem 1.75rem; padding: 1.85rem 1.5rem 2rem;
    border-radius: 0 0 16px 16px; position: relative; overflow: hidden;
}
.dash-hero::before {
    content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,.16) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(115deg, rgba(0,0,0,.9), transparent 55%);
    mask-image: linear-gradient(115deg, rgba(0,0,0,.9), transparent 55%);
}
.dash-hero .page-title, .dash-hero .page-header .page-title { color: #fff; }
.dash-hero .row { position: relative; z-index: 1; margin-bottom: 0 !important; }

/* ── Stat cards — diseño de bloque de color ─────────────── */
.stat-card {
    background: var(--surface);
    border-radius: var(--r);
    padding: 0; overflow: hidden;
    box-shadow: var(--sh);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.stat-blue, .stat-green, .stat-teal, .stat-red, .stat-purple, .stat-gray, .stat-amber, .stat-lime {
    box-shadow: none;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,.06)) drop-shadow(0 4px 16px rgba(0,0,0,.05));
    clip-path: path("M0,8C50,-12,150,28,200,8C250,-12,350,28,400,8C450,-12,550,28,600,8C650,-12,750,28,800,8C850,-12,950,28,1000,8C1050,-12,1150,28,1200,8C1250,-12,1350,28,1400,8C1450,-12,1550,28,1600,8L1600,10000L0,10000Z");
}
.stat-card::before {
    content: '';
    display: block; height: 20px; width: 100%;
    background-color: transparent;
    background-size: 200px 100%;
    background-repeat: repeat-x;
}
.stat-blue::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%232563EB' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-green::before, .stat-teal::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%23059669' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-red::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%23DC2626' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-purple::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%237C3AED' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-gray::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%239CA3AF' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-amber::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%23f59e0b' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-lime::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,8C50,-12,150,28,200,8' stroke='%2322c55e' stroke-width='3' fill='none'/%3E%3C/svg%3E");
}
.stat-value {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    font-size: 1.9rem; font-weight: 600;
    line-height: 1; letter-spacing: -.02em;
    color: var(--c, var(--tx)); padding: .9rem 1.25rem .1rem;
}
.stat-label {
    font-size: .68rem; color: var(--tx2);
    padding: .3rem 1.25rem 0; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
}
.stat-sub { font-size: .66rem; color: var(--tx3); padding: .2rem 1.25rem .9rem; }

.stat-blue   { --c: var(--blue);   }
.stat-green  { --c: var(--ok);     }
.stat-red    { --c: var(--err);    }
.stat-purple { --c: var(--purple); }
.stat-teal   { --c: var(--brand);  }
.stat-gray   { --c: var(--tx3);    }
.stat-amber  { --c: #d97706; background: #fffbeb; box-shadow: none; filter: drop-shadow(0 1px 4px rgba(0,0,0,.06)) drop-shadow(0 4px 16px rgba(0,0,0,.05)); clip-path: path("M0,8C50,-12,150,28,200,8C250,-12,350,28,400,8C450,-12,550,28,600,8C650,-12,750,28,800,8C850,-12,950,28,1000,8C1050,-12,1150,28,1200,8C1250,-12,1350,28,1400,8C1450,-12,1550,28,1600,8L1600,10000L0,10000Z"); }
.stat-lime   { --c: #15803d; background: #f0fdf4; box-shadow: none; filter: drop-shadow(0 1px 4px rgba(0,0,0,.06)) drop-shadow(0 4px 16px rgba(0,0,0,.05)); clip-path: path("M0,8C50,-12,150,28,200,8C250,-12,350,28,400,8C450,-12,550,28,600,8C650,-12,750,28,800,8C850,-12,950,28,1000,8C1050,-12,1150,28,1200,8C1250,-12,1350,28,1400,8C1450,-12,1550,28,1600,8L1600,10000L0,10000Z"); }

/* ── Admin card ─────────────────────────────────────────── */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh);
}
.card-header-admin {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: .9rem 1.15rem .7rem;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap; gap: .5rem;
}
.card-title-admin {
    font-size: .78rem; font-weight: 700;
    color: var(--tx); letter-spacing: -.01em;
}
.card-body { padding: 1.1rem; }

/* ── Tables ─────────────────────────────────────────────── */
.table { color: var(--tx); border-color: transparent; margin: 0; }
.table > :not(caption) > * > * {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    padding: .65rem 1rem !important;
}
.table tbody tr:last-child > td { border-bottom: none; }
.table-hover tbody tr:hover > * { background: var(--surface2); }
.table-light {
    --bs-table-bg: var(--surface2);
    --bs-table-color: var(--tx2);
}
th {
    font-size: .63rem; text-transform: uppercase;
    letter-spacing: .09em; font-weight: 700;
    white-space: nowrap; color: var(--tx3);
    border-bottom: 1px solid var(--border) !important;
    padding: .65rem 1rem !important;
}
td { vertical-align: middle; font-size: .845rem; color: var(--tx); }
.table-danger > td, tr.table-danger > td   { background: #FEF2F2 !important; }
.table-warning > td, tr.table-warning > td { background: #FFFBEB !important; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(17,24,39,.45);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; animation: fIn .14s;
}
@keyframes fIn { from { opacity: 0 } to { opacity: 1 } }

.modal-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; flex-direction: column;
    max-height: 90vh;
    box-shadow: var(--sh-lg);
    animation: mUp .18s cubic-bezier(.16,1,.3,1);
}
@keyframes mUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal-sm-panel { width: min(480px, 95vw); }
.modal-lg-panel { width: min(880px, 95vw); }
.modal-panel-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
}
.modal-panel-header h5 { margin: 0; font-weight: 700; font-size: .9rem; color: var(--tx); }
.modal-panel-body  { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-panel-footer {
    display: flex; justify-content: flex-end; gap: .5rem;
    padding: .875rem 1.25rem;
    border-top: 1px solid var(--border-soft);
    background: var(--surface2);
    border-radius: 0 0 14px 14px;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--tx); border-radius: 7px;
    font-size: .845rem;
    transition: border-color .12s, box-shadow .12s;
}
.form-control:focus, .form-select:focus {
    background: var(--surface); color: var(--tx);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(5,150,105,.1);
    outline: none;
}
.form-control::placeholder { color: var(--tx3); }
.form-control[readonly] {
    opacity: 1; color: var(--tx2);
    background: var(--surface2);
    border-color: var(--border-soft); cursor: default;
}
.form-control-sm, .form-select-sm { font-size: .8rem; padding: .3rem .65rem; }
.form-label-sm {
    font-size: .65rem; font-weight: 700; color: var(--tx3);
    text-transform: uppercase; letter-spacing: .08em;
    display: block; margin-bottom: .3rem;
}
.form-check-input {
    background-color: var(--surface);
    border-color: var(--border);
    width: 2.3em; height: 1.15em;
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(5,150,105,.12); border-color: var(--brand); }
textarea.form-control { resize: vertical; min-height: 80px; }
.invalid-feedback { display: block; color: var(--err); font-size: .72rem; margin-top: .2rem; }
.is-invalid { border-color: var(--err) !important; box-shadow: none !important; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: 7px; transition: all .12s; font-size: .845rem; }
.btn-xs { padding: .18rem .55rem; font-size: .7rem; border-radius: 5px; line-height: 1.5; }

.btn-primary {
    background: var(--brand); border-color: var(--brand);
    color: #fff; font-weight: 600;
}
.btn-primary:hover {
    background: var(--brand-dark); border-color: var(--brand-dark);
    color: #fff; box-shadow: 0 4px 12px rgba(5,150,105,.3);
}
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-sm.btn-primary { padding: .28rem .8rem; font-size: .78rem; }

.btn-outline-secondary {
    border-color: var(--border); color: var(--tx2); background: var(--surface);
}
.btn-outline-secondary:hover {
    background: var(--surface2); color: var(--tx); border-color: var(--tx3);
}
.btn-outline-primary {
    border-color: var(--brand); color: var(--brand-dark); background: transparent;
}
.btn-outline-primary:hover {
    background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand);
}
.btn-close { opacity: .35; }
.btn-close:hover { opacity: .7; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: .65rem; border-radius: 5px; padding: .25em .6em; }

.bg-success   { background: #D1FAE5 !important; color: #065F46 !important; }
.bg-danger    { background: #FEE2E2 !important; color: #991B1B !important; }
.bg-warning   { background: #FEF3C7 !important; color: #92400E !important; }
.bg-primary   { background: #DBEAFE !important; color: #1E40AF !important; }
.bg-secondary { background: #F1F5F9 !important; color: #475569 !important; }
.bg-info      { background: var(--brand-light) !important; color: var(--brand-dark) !important; }
.text-dark    { color: var(--tx) !important; }

/* ── Sello — para documentos/contratos ya aceptados por Hacienda ───── */
.seal {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
    letter-spacing: .02em; color: var(--brand-dark);
    padding: .14rem .55rem .14rem .4rem; border-radius: 20px;
    border: 1px dashed var(--brand);
}
.seal::before { content: '✓'; display: inline-flex; }

/* ── Datos tabulares (claves, consecutivos, montos, fechas) ─────────── */
.tabular { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; border-radius: var(--r); }
.alert-danger  { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; border-radius: var(--r); }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: var(--r); }

/* ── Progress ───────────────────────────────────────────── */
.progress { background: var(--border); border-radius: 99px; }
.progress-bar { border-radius: 99px; }
.bg-danger.progress-bar  { background: var(--err) !important; }
.bg-warning.progress-bar { background: var(--warn) !important; }
.bg-primary.progress-bar { background: var(--blue) !important; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrapper {
    position: relative; min-height: 100vh; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 78% 18%, rgba(16,185,129,.28), transparent 42%),
        radial-gradient(circle at 12% 88%, rgba(16,185,129,.14), transparent 40%),
        var(--sidebar-bg);
    padding: 2rem 1rem;
}
.login-wrapper::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,.9), transparent 72%);
    mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,.9), transparent 72%);
}
.login-hero-mark {
    position: absolute; top: 50%; left: 50%;
    width: min(900px, 150vw); height: auto; opacity: .1;
    transform: translate(-50%,-54%);
    filter: drop-shadow(0 0 60px rgba(16,185,129,.35));
    animation: heroPulse 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes heroPulse {
    0%, 100% { opacity: .08; }
    50%      { opacity: .16; }
}
@media (prefers-reduced-motion: reduce) {
    .login-hero-mark { animation: none; opacity: .12; }
}
.login-stack { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.login-eyebrow-hero {
    font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase; color: var(--brand-mid);
    margin-bottom: .9rem; text-align: center;
}
.login-headline {
    font-family: var(--font-display); font-weight: 600; text-align: center;
    font-size: clamp(1.6rem, 4vw, 2.3rem); color: #fff; letter-spacing: -.01em;
    text-wrap: balance; margin: 0 0 1.9rem; max-width: 20ch;
}
.login-headline em { font-style: normal; color: var(--brand-mid); }
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px; padding: 2.25rem;
    width: min(400px, 100%);
    box-shadow: 0 30px 70px rgba(0,0,0,.45), 0 4px 16px rgba(0,0,0,.2);
}
.login-brand      { text-align: center; margin-bottom: 1.75rem; }
.login-brand-icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.login-logo       { width: min(220px, 100%); height: auto; }
.login-brand-name {
    font-family: var(--font-display);
    font-size: 1.35rem; font-weight: 700;
    color: var(--tx); letter-spacing: -.01em;
}
.login-subtitle { color: var(--tx3); font-size: .8rem; margin-top: .2rem; }

/* ── Utility ────────────────────────────────────────────── */
.text-muted { color: var(--tx2) !important; }

/* ── Sidebar backdrop (mobile) ──────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 99; cursor: pointer;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; }
    .admin-content { margin-left: 0; }
    .btn-toggle-sidebar { display: block; }
    .admin-main { padding: 1rem; }

    .stat-value { font-size: 1.45rem; }
    .page-title { font-size: 1.05rem; }

    .modal-panel-body   { padding: 1rem; }
    .modal-panel-header { padding: .875rem 1rem; }
    .modal-panel-footer { padding: .75rem 1rem; gap: .4rem; }

    .card-header-admin { align-items: flex-start; }
}

@media (max-width: 480px) {
    .admin-main { padding: .65rem; }
    .page-title { font-size: .95rem; }
    .stat-value { font-size: 1.15rem; }
    .stat-label { font-size: .6rem; }

    .table > :not(caption) > * > * { padding: .4rem .55rem !important; }
    th  { font-size: .58rem; }
    td  { font-size: .78rem; }
    .btn-xs { padding: .13rem .38rem; font-size: .67rem; }

    .modal-sm-panel, .modal-lg-panel { width: 98vw; }
    .modal-panel-body   { padding: .85rem .75rem; }
    .modal-panel-header { padding: .7rem .85rem; }
    .modal-panel-footer { padding: .6rem .85rem; flex-wrap: wrap; }
    .modal-panel-footer .btn { flex: 1; text-align: center; }
}
