/* ============================================================
   AL-SALAM GOVERNMENT PORTAL — COMPLETE RESPONSIVE ENGINE v2
   Mobile-first, tablet-optimized, professional layout system
   ============================================================ */

/* ─────────────────────────────────────────────
   🔢 RESPONSIVE BREAKPOINTS
   xs  : ≤ 480px   (small phones)
   sm  : ≤ 640px   (phones)
   md  : ≤ 768px   (large phones / small tablets)
   lg  : ≤ 1024px  (tablets)
   xl  : ≤ 1280px  (small desktops)
───────────────────────────────────────────── */

/* ──────────────────────────────────────────────────
   🖥️ DESKTOP GUARD — Force-hide all mobile-only elements
   on screens wider than 1024px regardless of cascade order.
   This is the single source of truth for desktop visibility.
──────────────────────────────────────────────────── */
@media (min-width: 1025px) {
    /* Mobile nav elements — never visible on desktop */
    .mobile-controls { display: none !important; }
    .mobile-nav      { display: none !important; }
    .mobile-logo     { display: none !important; }
    .nav-toggle      { display: none !important; }
    .dropdown-menu-mobile { display: none !important; }
    .mobile-lang-section  { display: none !important; }

    /* Desktop nav — always visible on desktop */
    .nav-list-search { display: flex !important; }

    /* Remove mobile body offset */
    body { padding-top: 0 !important; }

    /* Desktop nav stays sticky, not fixed */
    .nav { position: sticky !important; }
}

/* ──────────────── TABLET & LARGE (≤1024px) ──────────────── */
@media (max-width: 1024px) {
    :root { --container-max: 100%; }

    /* ── Header & Banner ── */
    .top-bar { display: none; }
    .main-banner { display: none !important; }
    .nav-list-search { display: none !important; }

/* ── Fixed Mobile Nav Bar (Dribbble Premium Redesign - Fixed Layout) ── */
    .nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 99999 !important; /* ضمان بقاء الهيدر فوق كل محتويات الصفحة */
        box-shadow: 0 4px 30px rgba(15, 23, 42, 0.15) !important;
        background: #1a3c6e !important;
    }

    .mobile-controls {
        display: flex !important;
        flex-direction: row !important; /* توزيع العناصر أفقياً بشكل إجباري */
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 16px !important;
        background: #1a3c6e !important;
        height: 70px !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 1. زر فتح القائمة الجانبية (يمين) */
    .nav-toggle {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        color: #fff !important;
        font-size: 1.15rem !important;
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        order: 1 !important;
    }
    .nav-toggle:hover { 
        background: rgba(255, 255, 255, 0.2) !important; 
    }

    /* 2. اللوجو المؤسسي المدمج (بجانب زر المنيو) */
    .mobile-logo {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        color: #FFFFFF !important;
        flex-shrink: 0 !important;
        order: 2 !important;
    }
    .mobile-logo img {
        height: 36px !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }
    .mobile-logo span {
        display: none !important; /* إخفاء النص الطويل لعدم التكديس */
    }

    /* 3. شريط البحث المدمج البيضاوي التفاعلي (يأخذ المساحة الوسطى بالكامل) */
    .mobile-search-wrapper {
        display: flex !important;
        align-items: center !important;
        position: relative !important;
        flex: 1 !important; /* يتمدد ليملأ الفراغ */
        min-width: 0 !important;
        order: 3 !important;
        margin: 0 4px !important;
    }
    .mobile-search-wrapper form {
        width: 100% !important;
        margin: 0 !important;
        position: relative !important;
    }
    .mobile-search-wrapper input {
        width: 100% !important;
        padding: 9px 12px 9px 38px !important; /* الحشو البريوم الداخلي */
        border-radius: 20px !important; /* زوايا بيضاوية دائرية متناسقة */
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        background: rgba(255, 255, 255, 0.08) !important;
        color: #ffffff !important;
        font-family: 'Cairo', sans-serif !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        outline: none !important;
        transition: all 0.2s ease !important;
        box-sizing: border-box !important;
    }
    .mobile-search-wrapper input:focus {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }
    .mobile-search-wrapper input::placeholder {
        color: rgba(255, 255, 255, 0.4) !important;
    }
    .mobile-search-wrapper i {
        position: absolute !important;
        left: 14px !important;
        top: 50 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        color: rgba(255, 255, 255, 0.5) !important;
        font-size: 0.85rem !important;
        pointer-events: none !important;
    }

    

    /* ── إصلاح تموضع قائمة التنقل المنسدلة (Mobile Dropdown) لكي لا تظهر شفافة بالخلف ── */
    .mobile-nav {
        display: none !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #1a3c6e !important; /* تعتيم الخلفية بالكامل لمنع التداخل */
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 99998 !important;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
    }
    .mobile-nav.active {
        display: block !important;
        animation: slideDownMobile 0.25s ease-out forwards !important;
    }

    body { padding-top: 70px !important; }
    /* ── Mobile Dropdown Nav ── */
    .mobile-nav {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0;
        background: var(--color-primary);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 2500;
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        border-top: 1px solid rgba(255,255,255,0.08);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .mobile-nav.active {
        display: block;
        animation: slideDownMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes slideDownMobile {
        from { opacity: 0; transform: translateY(-12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .mobile-nav li { border-bottom: 1px solid rgba(255,255,255,0.05); }

    .mobile-nav li a {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 15px 24px;
        color: rgba(255,255,255,0.92);
        text-decoration: none;
        font-weight: 700;
        font-size: 0.98rem;
        transition: background 0.2s, padding-right 0.2s;
    }

    .mobile-nav li a:hover {
        background: rgba(255,255,255,0.06);
        padding-right: 30px;
    }

    .mobile-nav li a i:first-child {
        color: var(--color-accent);
        width: 20px;
        text-align: center;
        font-size: 1rem;
    }

    /* Mobile sub-dropdown */
    .dropdown-menu-mobile {
        display: none;
        background: rgba(0,0,0,0.25);
        list-style: none;
        padding: 0;
    }
    .dropdown-menu-mobile.active { display: block; }

    .dropdown-menu-mobile li a {
        padding: 12px 24px 12px 50px;
        font-size: 0.9rem;
        font-weight: 500;
        color: rgba(255,255,255,0.75);
    }

    /* ── Top Hero Split ── */
    .top-hero-split { flex-direction: column; height: auto; min-height: auto; }
    .top-hero-split .splide-main { height: 50vh; min-height: 350px; }
    .split-separator { width: 100%; height: 40px; flex-direction: row; }
    .split-separator .sep-line { width: auto; height: 2px; flex: 1; background: linear-gradient(to right, transparent, var(--color-accent), transparent); }
    .top-hero-split .splide-sidebar { height: 35vh; min-height: 250px; }
    .alsalam-slider .slider-slide .slide-caption h3 { font-size: 0.85rem; }

    /* ── YouTube-Style Hero (Tablet) ── */
    .yt-hero-container { flex-direction: column; min-height: auto; }
    .yt-slider { flex: none; min-height: 350px; }
    .yt-sidebar { max-height: 400px; }
    .yt-sidebar-thumb { width: 100px; height: 56px; }

    /* ── Hero Section ── */
    .hero-video-section {
        height: 75vh;
        min-height: 480px;
    }

    .hero-content h1 { font-size: 2.4rem; }
    .hero-subtitle   { font-size: 1rem; }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-btn-primary, .hero-btn-outline {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    /* ── News Ticker ── */
    .news-ticker-container { min-height: 42px; height: auto; }
    .ticker-label { padding: 0 16px; font-size: 0.8rem; }
    .news-ticker a { font-size: 0.88rem; margin: 0 20px; }

    /* ── Stats Strip ── */
    .stats-strip { padding: 30px 0; }
    .stats-container {
        flex-wrap: wrap;
        gap: 25px 15px;
        padding: 0 20px;
    }
    .stat-item    { flex: 1 1 42%; padding: 0; max-width: none; }
    .stat-number  { font-size: 2.4rem; }
    .stat-divider { display: none; }

    /* ── Quick Links ── */
    .quick-links-container { padding: 50px 20px; }
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-top: 30px;
    }
    .quick-link-card { padding: 28px 20px 24px; }

    /* ── News Cards Section ── */
    .news-cards-section { padding: 35px 20px; }
    .news-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-top: 25px;
    }
    /* ── News Grid ── */
    .main-content-area { padding: 0 20px; margin-bottom: 50px; }
    .news-list-rows {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-top: 30px;
    }
    .news-image img { height: 190px; }

    /* ── Posts Filter Bar ── */
    .posts-filter-bar {
        flex-direction: column;
        gap: 12px;
        padding: 15px 20px;
    }

    /* ── CTA Section ── */
    .cta-section { padding: 70px 20px; }
    .cta-content h2 { font-size: 1.9rem; }
    .cta-content p  { font-size: 0.95rem; }
    .cta-buttons { flex-direction: column; align-items: center; gap: 12px; }
    .cta-btn-primary, .cta-btn-outline {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    /* ── Section Headers ── */
    .section-header { margin-bottom: 30px; }
    .section-header h2 { font-size: 1.7rem; }

    /* ── Footer ── */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
        text-align: center;
    }
    .footer-col h3::after {
        right: 50%;
        transform: translateX(50%);
    }
    .footer-contact li { justify-content: center; }
    .social-links      { justify-content: center; }
    .footer-content    { padding: 50px 20px 30px; }

    /* ── Info / About Sections ── */
    .info-section { padding: 40px 20px !important; }
    .info-card    { padding: 30px 20px !important; }

    .services-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    /* ── Gallery Grid ── */
    .masonry-gallery {
        columns: 2 !important;
        column-gap: 12px !important;
    }

    /* ── Post Hero ── */
    .post-hero         { height: 45vh !important; min-height: 280px !important; }
    .post-hero-title   { font-size: 1.6rem !important; }
    .post-body-container { padding: 30px 20px !important; }

    /* ── Project Details Grid ── */
    .post-article-content > div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* ── Search Page ── */
    .search-result-item { flex-direction: column !important; }
}

/* ──────────────── PHONE (≤768px) ──────────────── */
@media (max-width: 768px) {

    /* ── Top Hero Split ── */
    .top-hero-split .splide-main { height: 42vh; min-height: 300px; }
    .top-hero-split .splide-sidebar { height: 28vh; min-height: 200px; }
    .alsalam-slider .slider-slide .slide-caption h3 { font-size: 0.8rem; }
    .alsalam-slider .slider-slide .slide-caption { bottom: 15px; }

    /* ── YouTube-Style Hero (Small Phone) ── */
    .yt-hero-container { padding: 0 12px; }
    .yt-slider { min-height: 280px; border-radius: 8px; }
    .yt-slide-content { padding: 20px; }
    .yt-slide-title { font-size: 1.1rem; }
    .yt-slide-desc { font-size: 0.8rem; }
    .yt-slide-btn { padding: 8px 18px; font-size: 0.78rem; }
    .yt-sidebar { border-radius: 8px; }
    .yt-sidebar-thumb { width: 80px; height: 45px; }
    .yt-sidebar-info h4 { font-size: 0.75rem; }
    .yt-sidebar-item { padding: 10px 12px; gap: 10px; }
    .yt-slider-dots { right: 20px; bottom: 12px; }
    .yt-slider-arrow { width: 36px; height: 36px; }
    .section-header-custom { padding: 0 12px; margin-bottom: 16px; }

    /* ── Hero ── */
    .hero-video-section { height: 65vh; min-height: 420px; }
    .hero-content { padding: 0 20px; }
    .hero-content h1 { font-size: 1.9rem; letter-spacing: -0.5px; }
    .hero-subtitle   { font-size: 0.9rem; }
    .hero-badge      { font-size: 0.78rem; padding: 6px 14px; }

    .hero-search-container { margin: 0 10px; }
    .hero-search-button { padding: 10px 20px; font-size: 0.88rem; }

    /* ── Stats ── */
    .stat-item  { flex: 1 1 45%; }
    .stat-number { font-size: 2.1rem; }

    /* ── Quick Links — single column on small phones ── */
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .qlc-icon { width: 60px; height: 60px; font-size: 1.5rem; }
    .quick-link-card h3 { font-size: 1rem; }
    .quick-link-card p  { font-size: 0.82rem; }

    /* ── News Grid → 1 col ── */
    .news-list-rows {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* ── Ads layout ── */
    .news-item[style*="flex-direction: row"] {
        flex-direction: column !important;
    }
    .news-item [style*="flex: 0 0 180px"] {
        flex: none !important;
        width: 100% !important;
        height: 200px !important;
    }

    /* ── Post Hero ── */
    .post-hero       { height: 38vh !important; min-height: 240px !important; }
    .post-hero-title { font-size: 1.3rem !important; }

    /* ── Services Grid → 1 col ── */
    .services-grid,
    .features-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Gallery → 1 col ── */
    .masonry-gallery {
        columns: 1 !important;
    }

    /* ── Video grid → 1 col ── */
    .video-grid { grid-template-columns: 1fr !important; padding: 20px !important; }

    /* ── Org Tree ── */
    .vertical-tree  { overflow-x: auto; }
    .tree-branch    { flex-direction: column; align-items: center; }
    .tree-card      { min-width: 200px; max-width: 260px; }

    /* ── CTA ── */
    .cta-section    { padding: 55px 16px; }
    .cta-content h2 { font-size: 1.6rem; }
    .cta-icon       { width: 65px; height: 65px; font-size: 1.6rem; }

    /* ── Footer bottom ── */
    .footer-bottom-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* ── Admin tables ── */
    .admin-main    { padding: 15px !important; }
    .premium-table { display: block; overflow-x: auto; white-space: nowrap; }
    .form-row      { flex-direction: column !important; }
}

/* ──────────────── SMALL PHONES (≤640px) ──────────────── */
@media (max-width: 640px) {
    body { font-size: 15px; }

    /* ── Mobile nav font ── */
    .mobile-logo span { font-size: 0.9rem; }

    /* ── Hero ── */
    .hero-content h1 { font-size: 1.65rem; }
    .hero-actions    { gap: 10px; }
    .hero-btn-primary, .hero-btn-outline {
        padding: 13px 24px;
        font-size: 0.92rem;
        max-width: 280px;
    }

    /* ── Stats ── */
    .stats-container { gap: 20px 10px; }
    .stat-item       { flex: 1 1 48%; }
    .stat-number     { font-size: 1.9rem; }
    .stat-label      { font-size: 0.82rem; }

    /* ── Quick Links → 2 col compact ── */
    .quick-links-grid { gap: 10px; }
    .quick-link-card  { padding: 20px 14px; }
    .qlc-icon { width: 50px; height: 50px; font-size: 1.3rem; margin-bottom: 14px; }

    /* ── Section headers ── */
    .section-header h2 { font-size: 1.45rem; }

    /* ── News Cards Section ── */
    .news-cards-section { padding: 25px 16px; }
    .news-cards-grid { grid-template-columns: 1fr; gap: 14px; }
    .news-card-title { font-size: 0.9rem; }
    .news-card-body { padding: 12px 14px 14px; }

    /* ── News ── */
    .news-content  { padding: 18px; }
    .news-heading  { font-size: 1rem; }
    .news-excerpt  { font-size: 0.85rem; }

    /* ── Filter bar pills → wrap ── */
    .filter-group { flex-wrap: wrap !important; }
    .pagination-item[style*="padding: 0 25px"] {
        padding: 0 14px !important;
        font-size: 0.85rem;
    }

    /* ── Post page ── */
    .post-hero-content  { padding: 20px; }
    .post-hero-title    { font-size: 1.15rem !important; }
    .post-hero-meta     { flex-direction: column; gap: 6px; font-size: 0.8rem; }
    .post-body-container { padding: 20px 16px !important; }
    .post-article-content { font-size: 0.95rem !important; line-height: 1.9; }

    /* ── Gallery ── */
    .gallery-controls {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
        padding: 16px 20px !important;
    }
    .gallery-filters { flex-wrap: wrap; }

    /* ── Modern gallery grid ── */
    .modern-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* ── Complaints form ── */
    .complaints-form-card { padding: 24px 16px !important; }

    /* ── Pagination ── */
    .pagination-container {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    .pagination-item {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem;
    }
}

/* ──────────────── EXTRA SMALL (≤480px) ──────────────── */
@media (max-width: 480px) {
    /* Nav */
    .mobile-controls { padding: 0 14px; height: 60px; }
    body              { padding-top: 60px; }

    /* Top Hero Split */
    .top-hero-split .splide-main { height: 35vh; min-height: 240px; }
    .split-separator { display: none; }
    .top-hero-split .splide-sidebar { display: none; }

    /* YouTube-Style Hero (Extra Small) */
    .yt-slider { min-height: 220px; }
    .yt-slide-content { padding: 16px; }
    .yt-slide-title { font-size: 0.95rem; margin-bottom: 6px; }
    .yt-slide-desc { display: none; }
    .yt-slide-btn { padding: 7px 14px; font-size: 0.72rem; }
    .yt-sidebar-thumb { width: 68px; height: 38px; }
    .yt-sidebar-info h4 { font-size: 0.7rem; -webkit-line-clamp: 1; }
    .yt-sidebar-date { font-size: 0.65rem; }
    .yt-sidebar-item { padding: 8px 10px; gap: 8px; }

    /* Hero */
    .hero-video-section { height: 58vh; min-height: 360px; }
    .hero-content h1    { font-size: 1.45rem; }
    .hero-subtitle      { display: none; }  /* clean on very small screens */
    .hero-search-container { display: none; } /* hide big search on tiny screens */
    .hero-scroll-indicator { display: none; }

    /* Stats → 2x2 */
    .stat-item   { flex: 1 1 45%; }
    .stat-number { font-size: 1.7rem; }

    /* Quick links → 1 col */
    .quick-links-grid { grid-template-columns: 1fr; }

    /* News Cards Section */
    .news-cards-section { padding: 20px 12px; }
    .news-card-body { padding: 10px 12px 12px; }

    /* News */
    .news-image img { height: 165px; }

    /* CTA */
    .cta-section    { padding: 44px 14px; }
    .cta-content h2 { font-size: 1.35rem; }
    .cta-content p  { font-size: 0.88rem; }

    /* Footer */
    .footer-content { padding: 40px 16px 24px; }

    /* General padding resets */
    .main-content-area,
    .quick-links-container { padding: 0 12px; }

    /* Modern gallery → 1 col */
    .modern-gallery-grid { grid-template-columns: 1fr !important; }

    /* Admin dashboard cards */
    .stat-cards-grid { grid-template-columns: 1fr !important; }
}

/* ──────────────────────────────────────────
   🧩 UTILITY & CROSS-BREAKPOINT FIXES
─────────────────────────────────────────── */

/* Ensure images never overflow their containers */
img { max-width: 100%; height: auto; }

/* Prevent horizontal scroll on all viewports */
html, body { overflow-x: hidden; }

/* Fix news items that use inline flex-direction:row for ads */
@media (max-width: 768px) {
    article.news-item { flex-direction: column !important; }
    .news-image {
        width: 100% !important;
        height: 200px !important;
        flex: none !important;
        border-radius: 16px 16px 0 0 !important;
    }
    .news-image img { height: 100% !important; width: 100% !important; object-fit: cover; }
}

/* Post Hero consistent height */
.post-hero { height: 42vh !important; min-height: 280px !important; }
@media (max-width: 768px) {
    .post-hero { height: 36vh !important; min-height: 220px !important; }
}

/* Smooth touch scrolling everywhere */
* { -webkit-overflow-scrolling: touch; }

/* Table overflow for admin */
@media (max-width: 1024px) {
    .premium-table-wrapper,
    table { display: block; width: 100%; overflow-x: auto; }
}

/* Masonry columns at each breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .masonry-gallery { columns: 2; column-gap: 16px; }
}
@media (max-width: 768px) {
    .masonry-gallery { columns: 1; }
    .masonry-item    { margin-bottom: 14px; }
}

/* Org tree horizontal scroll on small screens */
@media (max-width: 768px) {
    .tree-branch {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .tree-node { width: 100%; max-width: 280px; }
}

/* Search page result layout */
@media (max-width: 768px) {
    .search-results-group { padding: 15px !important; }
    .search-result-item {
        flex-direction: column !important;
        gap: 10px;
    }
    .search-result-item img {
        width: 100% !important;
        height: 160px !important;
        object-fit: cover;
        border-radius: 10px;
    }
}

/* ── Video library responsive ── */
@media (max-width: 768px) {
    .video-grid { padding: 20px !important; gap: 20px !important; }
    .plyr { border-radius: 12px 12px 0 0; }
}

/* ── General Manager page ── */
@media (max-width: 768px) {
    .gm-layout {
        flex-direction: column !important;
        gap: 24px;
    }
    .gm-image-col { max-width: 100% !important; text-align: center; }
    .gm-image-col img { max-width: 240px; margin: 0 auto; }
}

/* ── About company page ── */
@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr !important; }
    .service-feature-card { padding: 20px 16px !important; }
}

/* ── Footer map embed ── */
@media (max-width: 768px) {
    .footer-map iframe {
        height: 200px !important;
        width: 100% !important;
        border-radius: 10px;
    }
}

/* ── Complaints page ── */
@media (max-width: 768px) {
    .complaints-tabs { flex-direction: column !important; gap: 8px; }
    .tab-btn { width: 100% !important; text-align: center; }
    .complaint-form input,
    .complaint-form textarea { font-size: 16px !important; } /* prevent iOS zoom */
}

/* ── Prevent iOS input zoom ── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="search"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ── Admin responsive ── */
@media (max-width: 1024px) {
    .admin-sidebar { width: 220px !important; }
}
@media (max-width: 768px) {
    .admin-layout { flex-direction: column !important; }
    .admin-sidebar { width: 100% !important; min-height: auto !important; }
    .admin-main    { padding: 16px !important; }
    .form-row      { flex-direction: column !important; gap: 12px !important; }
    .modal-content { width: 95% !important; max-width: 95% !important; margin: 10px auto; }
}

/* ── Safe area for notched iPhones ── */
@supports (padding: max(0px)) {
    .nav .mobile-controls {
        padding-left:  max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    body { padding-bottom: env(safe-area-inset-bottom); }
}