/* ============================================================
   ADMIN PANEL — RESPONSIVE STYLES
   Breakpoints: mobile < 768px | tablet 768-1024px | desktop > 1024px
   ============================================================ */

/* ── HAMBURGER BUTTON (creado por JS) ─────────────────────── */
.admin-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: none; border-radius: 10px;
    background: #f1f5f9; cursor: pointer;
    flex-direction: column; gap: 5px;
    flex-shrink: 0;
    margin-right: 14px;
}
.admin-hamburger span {
    display: block; width: 20px; height: 2px;
    background: #0b1f40; border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.admin-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-hamburger.open span:nth-child(2) { opacity: 0; }
.admin-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── OVERLAY (creado por JS) ──────────────────────────────── */
.admin-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.admin-overlay.open { display: block; }

/* ── TABLET (≤ 1100px) ────────────────────────────────────── */
@media (max-width: 1100px) {
    .stats-grid   { grid-template-columns: repeat(2, 1fr) !important; }
    .quick-grid   { grid-template-columns: repeat(2, 1fr) !important; }
    .form-layout  { grid-template-columns: 1fr !important; }
    .page-grid    { grid-template-columns: 1fr !important; }
}

/* ── MOBILE/TABLET SIDEBAR (≤ 900px) ─────────────────────── */
@media (max-width: 900px) {
    /* Sidebar: oculto por defecto, desliza desde la izquierda */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        z-index: 200 !important;
        height: 100dvh;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 30px rgba(0,0,0,0.3);
    }

    /* Main ocupa todo el ancho */
    .main, .main-content { margin-left: 0 !important; }

    /* Topbar ocupa todo el ancho */
    .topbar { left: 0 !important; padding: 0 16px !important; }

    /* Mostrar hamburguesa */
    .admin-hamburger { display: flex; }

    /* Tablas: scroll horizontal */
    .table-wrapper, .table-card { overflow-x: auto; }
    table { min-width: 600px; }

    /* Stats y acceso rápido: 1 columna en muy pequeño */
    .stats-grid   { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    .quick-grid   { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }

    /* Content padding reducido */
    .content { padding: 16px !important; }

    /* Welcome banner compacto */
    .welcome-banner { flex-direction: column; gap: 12px; padding: 22px 20px !important; }
    .welcome-date   { align-self: flex-start; }

    /* Topbar título más pequeño */
    .topbar h1, .topbar-left h1 { font-size: 15px !important; }

    /* Formularios en 1 columna */
    .form-row { grid-template-columns: 1fr !important; }

    /* Cards de edición */
    .card { padding: 18px !important; }

    /* Mensajes tabla: ocultar columnas menos importantes */
    .col-hide-mobile { display: none; }

    /* Usuario en topbar: solo avatar */
    .topbar-user .user-name { display: none; }
}

/* ── MOBILE PEQUEÑO (≤ 480px) ────────────────────────────── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .quick-grid { grid-template-columns: 1fr !important; }
    .topbar { height: 56px !important; }
    .main, .main-content { padding-top: 56px !important; }
    .sidebar-brand img { width: 110px !important; }

    /* Botones de acción en tablas: solo ícono */
    .btn-accion span, .btn-sm span { display: none; }

    /* User list en usuarios.php */
    .user-actions { flex-direction: column; gap: 4px; }
}

/* ── SCROLLBAR SIDEBAR ────────────────────────────────────── */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ── TABLAS RESPONSIVE ────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
