/* ═══════════════════════════════════════════════════════════════
   ADMIN LAYOUT — dos modos:
   A) Dashboard: <div class="admin-layout">  (full-viewport flex)
   B) Otras vistas: <main class="page"><section class="pro-dash">
      → convertidas automáticamente a full-viewport con :has()
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar fijo del área de contenido ──────────────────────── */
#yvTopbar {
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 190;
    display: flex;
    align-items: center;
    padding: 0 20px 0 24px;
    gap: 8px;
}

/* ── A) Modo dashboard (div.admin-layout) ────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── B) Modo legacy — resetear .page cuando contiene .pro-dash ─ */
.page:has(.pro-dash) {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ── .pro-dash → flex layout igual que admin-layout ─────────── */
.pro-dash {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.pro-side {
    width: 220px;
    flex-shrink: 0;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
    box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

.pro-side-header {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.pro-logo {
    font-size: .7rem;
    letter-spacing: .16em;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
}

.pro-store {
    margin-top: 8px;
    font-size: .97rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}

.pro-meta {
    margin-top: 3px;
    font-size: .74rem;
    color: #475569;
}

/* ── Store-info desplegable ───────────────────────────────────── */
.pro-store-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
.pro-store-toggle {
    background: none;
    border: none;
    color: #475569;
    font-size: .7rem;
    padding: 0 2px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .2s;
}
.pro-store-details {
    margin-top: 2px;
}
.pro-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.pro-info-badge {
    font-size: .68rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: #94a3b8;
    white-space: nowrap;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.pro-nav {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
}

.pro-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    text-decoration: none;
    color: #94a3b8;
    font-weight: 600;
    font-size: .83rem;
    border-left: 3px solid transparent;
    transition: color .12s, background .12s;
    white-space: nowrap;
}

.pro-link:hover {
    color: #cbd5e1;
    background: rgba(255,255,255,.05);
}

.pro-link-active {
    color: #e2e8f0;
    background: rgba(59,130,246,.16);
    border-left-color: #3b82f6;
}

.pro-nav-divider {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: 6px 0;
}

/* ── Accesos rápidos de ventas ───────────────────────────────── */
.pro-quick {
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 2px;
}
/* Botón POS — CTA principal */
.pro-qbtn-sell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 11px;
    font: inherit;
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(29,78,216,.45);
    transition: filter .13s, transform .1s, box-shadow .13s;
    letter-spacing: .01em;
}
.pro-qbtn-sell:hover {
    filter: brightness(1.08);
    box-shadow: 0 5px 18px rgba(29,78,216,.55);
    color: #fff;
}
.pro-qbtn-sell:active { transform: scale(.97); }

/* Grid 2×2 para los accesos secundarios */
.pro-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}
/* Cada botón secundario: icono izquierda + texto derecha */
.pro-qbtn-tile {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 9px;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1.2;
    background: rgba(255,255,255,.07);
    color: #94a3b8;
    transition: background .12s, color .12s, transform .1s;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}
.pro-qbtn-tile:hover { background: rgba(255,255,255,.12); color: #e2e8f0; }
.pro-qbtn-tile:active { transform: scale(.96); }
.pro-qbtn-tile svg { flex-shrink: 0; opacity: .8; }
.pro-qbtn-tile-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: #fff;
    font-size: .58rem;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}
/* Fila única para Caja (span completo) */
.pro-qbtn-tile-wide {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: .76rem;
}

/* ── Badges ──────────────────────────────────────────────────── */
.pro-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 5px;
    background: #ef4444;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Logout ──────────────────────────────────────────────────── */
.pro-side-footer {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.pro-logout {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid rgba(239,68,68,.35);
    background: rgba(239,68,68,.08);
    color: #fca5a5;
    font-weight: 700;
    font-size: .83rem;
    cursor: pointer;
    text-align: left;
    border-radius: 7px;
    transition: color .12s, background .12s, border-color .12s;
}

.pro-logout:hover {
    background: rgba(239,68,68,.2);
    color: #fecaca;
    border-color: rgba(239,68,68,.55);
}

/* ═══════════════════════════════════════════════════════════════
   WRAP + CONTENT  (compartido por admin-layout y pro-dash)
   ═══════════════════════════════════════════════════════════════ */

/* admin-layout context */
.admin-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    padding-top: 52px;
}

/* pro-dash context: dash-main hace el mismo rol que admin-wrap */
.dash-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    padding-top: 52px;
}

/* ── .card.pro-card en modo pro-dash: se convierte en wrapper sin estilos propios ── */
.pro-dash .dash-main > .card.pro-card {
    flex: 1;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    animation: none;
    display: flex;
    flex-direction: column;
}

/* ── .hero dentro de pro-card → topbar sticky ───────────────── */
.pro-dash .dash-main > .card.pro-card > .hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    min-height: 52px;
    margin: 0;
    position: sticky;
    top: 52px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(16,43,80,.07);
}

.pro-dash .dash-main > .card.pro-card > .hero h1 {
    font-size: .97rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
}

.pro-dash .dash-main > .card.pro-card > .hero p {
    font-size: .78rem;
    color: var(--muted);
    margin: 0 0 0 8px;
    display: inline;
}

/* ── Contenido después del hero: padding ────────────────────── */
.pro-dash .dash-main > .card.pro-card > *:not(.hero) {
    padding-left: 28px;
    padding-right: 28px;
}

/* Primer elemento no-hero: espacio top */
.pro-dash .dash-main > .card.pro-card > .hero + * {
    padding-top: 24px;
}

/* Último elemento no-hero: espacio bottom */
.pro-dash .dash-main > .card.pro-card > *:last-child:not(.hero) {
    padding-bottom: 28px;
}

/* ─ Topbar explícito (usado en dashboard) ────────────────────── */
.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 52px;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(16,43,80,.07);
}

.admin-topbar-left { display: flex; align-items: baseline; gap: 8px; }
.admin-topbar-title { font-size: .97rem; font-weight: 800; color: var(--ink); }
.admin-topbar-crumb { font-size: .78rem; color: var(--muted); }

/* ─ Content area (dashboard) ────────────────────────────────── */
.admin-content {
    padding: 24px 28px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════
   INFO BOXES  (dashboard)
   ═══════════════════════════════════════════════════════════════ */
.info-boxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16,43,80,.10), 0 6px 24px rgba(16,43,80,.07);
}

.info-box {
    padding: 18px 20px 0;
    color: #fff;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(0,0,0,.1);
}

.info-box:last-child { border-right: none; }

.info-box-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.info-box-label {
    font-size: .78rem;
    font-weight: 600;
    margin-top: 5px;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.info-box-icon {
    position: absolute;
    right: 14px;
    bottom: 4px;
    font-size: 4.5rem;
    font-weight: 900;
    opacity: .13;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.info-box-footer {
    border-top: 1px solid rgba(255,255,255,.18);
    margin-top: 14px;
    padding: 7px 0 9px;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-box-footer a { color: inherit; text-decoration: none; opacity: .82; }
.info-box-footer a:hover { opacity: 1; text-decoration: underline; }

.ib-blue   { background: #1a56db; }
.ib-green  { background: #127a4c; }
.ib-orange { background: #b45309; }
.ib-slate  { background: #1e3a5f; }
.ib-teal   { background: #0e7490; }

/* ═══════════════════════════════════════════════════════════════
   KPI STRIP  (dashboard)
   ═══════════════════════════════════════════════════════════════ */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(16,43,80,.07), 0 4px 14px rgba(16,43,80,.05);
}

.kpi-cell {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
    position: relative;
}

.kpi-cell:last-child { border-right: none; }

.kpi-cell::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: transparent;
}

.kpi-cell.kc-alert::before   { background: #f59e0b; }
.kpi-cell.kc-danger::before  { background: #ef4444; }
.kpi-cell.kc-success::before { background: #22c55e; }
.kpi-cell.kc-primary::before { background: #3b82f6; }

.kpi-cell-label {
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}

.kpi-cell-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.15;
    margin-top: 5px;
}

.kpi-cell.kc-alert  .kpi-cell-value { color: #92400e; }
.kpi-cell.kc-danger .kpi-cell-value { color: #991b1b; }

.kpi-cell-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.kpi-cell-sub a { color: var(--primary); text-decoration: none; font-weight: 600; }
.kpi-cell-sub a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   PANELS (dashboard)
   ═══════════════════════════════════════════════════════════════ */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0;
    border: 1px solid var(--border);
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(16,43,80,.07), 0 4px 14px rgba(16,43,80,.05);
}

.c-panel {
    background: var(--surface);
    padding: 20px 22px;
}

.c-panel-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.c-panel-title a {
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════
   TABLAS
   ═══════════════════════════════════════════════════════════════ */
.dtbl { width: 100%; border-collapse: collapse; font-size: .83rem; }

.dtbl th {
    text-align: left;
    padding: 0 10px 10px;
    color: var(--muted);
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.dtbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtbl tbody tr:last-child td { border-bottom: none; }
.dtbl tbody tr:hover { background: var(--surface-soft); }

/* ── Badges de estado ────────────────────────────────────────── */
.badge-estado {
    display: inline-flex;
    padding: 2px 8px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge-pendiente  { background: #fef3c7; color: #92400e; }
.badge-confirmado { background: #dbeafe; color: #1e40af; }
.badge-enviado    { background: #ede9fe; color: #5b21b6; }
.badge-entregado  { background: #d1fae5; color: #065f46; }
.badge-pagado     { background: #d1fae5; color: #065f46; }
.badge-cancelado  { background: #fee2e2; color: #991b1b; }

/* ── Acciones rápidas ────────────────────────────────────────── */
.qa-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--ink);
    font-size: .845rem;
    font-weight: 600;
    transition: color .12s;
}

.qa-link:last-child { border-bottom: none; }
.qa-link:hover { color: var(--primary); }

.qa-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.qa-dot-blue   { background: #3b82f6; }
.qa-dot-green  { background: #22c55e; }
.qa-dot-yellow { background: #f59e0b; }
.qa-dot-purple { background: #a855f7; }
.qa-dot-gray   { background: #94a3b8; }

.qa-count   { margin-left: auto; background: #ef4444; color: #fff; border-radius: 5px; font-size: .7rem; padding: 1px 7px; font-weight: 800; }
.qa-count-y { margin-left: auto; background: #f59e0b; color: #fff; border-radius: 5px; font-size: .7rem; padding: 1px 7px; font-weight: 800; }

/* ── Alertas inventario ──────────────────────────────────────── */
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .83rem; }
.alert-row:last-child { border-bottom: none; }
.ald-r { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.ald-y { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; }
.no-alerts { color: var(--muted); font-size: .845rem; padding: 16px 0; text-align: center; }

/* ── Prod rows ───────────────────────────────────────────────── */
.prod-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .83rem; gap: 10px; }
.prod-row:last-child { border-bottom: none; }
.prod-row-name  { font-weight: 700; }
.prod-row-meta  { color: var(--muted); font-size: .76rem; margin-top: 1px; }
.prod-row-price { text-align: right; font-weight: 700; white-space: nowrap; }
.prod-row-stock { font-size: .76rem; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   PANEL genérico (otras vistas: pos, credits, etc.)
   ═══════════════════════════════════════════════════════════════ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

/* ── Responsive ──────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   MOBILE TOPBAR  (aparece solo en pantallas pequeñas)
   ═══════════════════════════════════════════════════════════════ */
.mob-topbar {
    display: none; /* oculto en desktop */
}

/* ── Botón salir en topbar móvil ────────────────────────────── */
.mob-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 8px;
    color: #fca5a5;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.mob-logout-btn:hover { background: rgba(239,68,68,.28); }

/* ── Botón hamburguesa ───────────────────────────────────────── */
.mob-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    margin: 0;
    flex-shrink: 0;
}

.mob-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: transform .22s ease, opacity .22s ease;
}

.mob-menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mob-menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay del sidebar ─────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .52);
    z-index: 190;
    backdrop-filter: blur(1px);
}

.sidebar-overlay.is-open { display: block; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .info-boxes { grid-template-columns: repeat(2, 1fr); }
    .info-box { border-bottom: 1px solid rgba(0,0,0,.1); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {

    /* ── Topbar móvil visible ─────────────────────────────────── */
    .mob-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 48px;
        z-index: 200;
        background: #0f172a;
        padding: 0 14px;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .mob-topbar-logo {
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .14em;
        color: #64748b;
        text-transform: uppercase;
    }

    .mob-topbar-store {
        font-size: .85rem;
        font-weight: 700;
        color: #e2e8f0;
        flex: 1;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ── Empujar todo el contenido bajo el topbar móvil ───────── */
    body { padding-top: 48px; }
    #yvTopbar { display: none; }
    .admin-wrap, .dash-main { padding-top: 0; }
    .pro-dash .dash-main > .card.pro-card > .hero { top: 0; }
    .admin-topbar { top: 0; }

    /* ── Sidebar: posición fija, fuera de pantalla ───────────── */
    .admin-layout .pro-side,
    .pro-dash .pro-side {
        position: fixed !important;
        top: 48px !important;
        left: -240px;
        width: 240px !important;
        height: calc(100vh - 48px) !important;
        z-index: 200;
        transition: left .26s cubic-bezier(.4, 0, .2, 1);
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
    }

    /* El nav scrollea internamente; header y footer quedan fijos */
    .admin-layout .pro-side .pro-nav,
    .pro-dash .pro-side .pro-nav {
        min-height: 0;
        overflow-y: auto;
        flex: 1;
    }

    .pro-side.is-open { left: 0 !important; }

    /* ── Layout: no apilar, el sidebar es overlay ────────────── */
    .admin-layout,
    .pro-dash { flex-direction: row; }

    /* El admin-wrap/dash-main toma todo el ancho */
    .admin-wrap,
    .dash-main { width: 100%; }

    /* ── Topbars internos: no sticky en mobile ───────────────── */
    .admin-topbar,
    .pro-dash .dash-main > .card.pro-card > .hero {
        position: relative;
        top: auto;
        z-index: auto;
    }

    /* ── Padding de contenido ─────────────────────────────────── */
    .admin-content {
        padding: 16px 14px 24px;
        gap: 14px;
    }

    .pro-dash .dash-main > .card.pro-card > *:not(.hero) {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pro-dash .dash-main > .card.pro-card > .hero {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pro-dash .dash-main > .card.pro-card > .hero + * {
        padding-top: 16px;
    }

    /* ── Info boxes ───────────────────────────────────────────── */
    .info-boxes { grid-template-columns: repeat(2, 1fr); }
    .info-box-num { font-size: 1.6rem; }

    /* ── KPI strip ────────────────────────────────────────────── */
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .kpi-cell { border-right: none; border-bottom: 1px solid var(--border); }
    .kpi-cell:nth-child(odd) { border-right: 1px solid var(--border); }
    .kpi-cell:last-child,
    .kpi-cell:nth-last-child(2):nth-child(odd) { border-bottom: none; }

    /* ── Tablas con scroll ────────────────────────────────────── */
    .dtbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* ── Panels ───────────────────────────────────────────────── */
    .content-grid { grid-template-columns: 1fr; }
    .c-panel { padding: 16px 14px; }

    /* ── Admin topbar compacto ────────────────────────────────── */
    .admin-topbar {
        padding: 0 14px;
        height: 46px;
    }

    .admin-topbar-title { font-size: .88rem; }
    .admin-topbar-crumb { display: none; }
}

@media (max-width: 480px) {
    .info-boxes { grid-template-columns: 1fr 1fr; }
    .info-box-num { font-size: 1.4rem; }
    .info-box-footer { flex-direction: column; align-items: flex-start; gap: 2px; }

    .kpi-strip { grid-template-columns: 1fr 1fr; }
    .kpi-cell-value { font-size: 1.25rem; }

    .admin-content { padding: 12px 12px 20px; gap: 12px; }

    .pro-dash .dash-main > .card.pro-card > *:not(.hero) {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ── Bottom nav (solo móvil ≤860px) ──────────────────────────── */
#yvBottomNav {
    display: none; /* oculto en escritorio */
}
@media (max-width: 860px) {
    .pro-quick { display: none; }

    /* Empujar contenido sobre la barra */
    .dash-main, .admin-wrap { padding-bottom: 66px; }

    #yvBottomNav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #0f172a;
        border-top: 1px solid rgba(255,255,255,.1);
        z-index: 400;
        box-shadow: 0 -2px 16px rgba(0,0,0,.3);
    }
    .yv-bnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #475569;
        text-decoration: none;
        font-size: .6rem;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 4px 4px;
        position: relative;
        transition: color .15s;
        -webkit-tap-highlight-color: transparent;
    }
    .yv-bnav-item.pro-link-active,
    .yv-bnav-item:active { color: #f1f5f9; }
    .yv-bnav-item svg { opacity: .55; transition: opacity .15s; flex-shrink: 0; }
    .yv-bnav-item.pro-link-active svg { opacity: 1; }
    .yv-bnav-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        background: #ef4444;
        color: #fff;
        font-size: .56rem;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 99px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }
}
