/* ─── RESET & ROOT ───────────────────────────────────────── */
        *,
        *::before,
        *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg: #f5edde;
            --bg2: #ece0cc;
            --surface: #fdf6ea;
            --surface2: #f7edd8;
            --border: rgba(32, 24, 12, 0.24);
            --gold: #9a6f20;
            --gold-bright: #c49a2e;
            --gold-glow: rgba(154, 111, 32, 0.15);
            --gold-pale: #fdf0d0;
            --green: #2c5f3d;
            --green-soft: #e8f2ec;
            --text: #080604;
            --text2: #17110a;
            --text3: #2f281f;
            --shadow: 0 4px 20px rgba(18, 14, 8, 0.13);
            --shadow-lg: 0 10px 40px rgba(18, 14, 8, 0.20);
            --r: 16px;
            --r-lg: 24px;
            --r-xl: 32px;
        }

        body.dark {
            --bg: #0d0f0c;
            --bg2: #111510;
            --surface: #161b14;
            --surface2: #1c231a;
            --border: rgba(160, 130, 60, 0.12);
            --gold: #c49a2e;
            --gold-bright: #e8bf55;
            --gold-glow: rgba(196, 154, 46, 0.18);
            --gold-pale: #1e1a0a;
            --green: #3a8c55;
            --green-soft: #0e1a11;
            --text: #ede8de;
            --text2: #c8b890;
            --text3: #857a60;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
            --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.65);
        }

        body {
            font-family: 'Noto Nastaliq Urdu', 'Noto Serif Arabic', serif;
            background-color: var(--bg);
            color: var(--text);
            min-height: 100vh;
            transition: background-color .3s, color .3s;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            z-index: 0;
            pointer-events: none;
            background-image:
                repeating-linear-gradient(60deg, transparent, transparent 40px, rgba(154, 111, 32, 0.03) 40px, rgba(154, 111, 32, 0.03) 41px),
                repeating-linear-gradient(-60deg, transparent, transparent 40px, rgba(154, 111, 32, 0.03) 40px, rgba(154, 111, 32, 0.03) 41px),
                repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(154, 111, 32, 0.025) 40px, rgba(154, 111, 32, 0.025) 41px);
        }

        body.dark::after {
            content: 'بِسْمِ اللّٰہِ الرَّحْمٰنِ الرَّحِیْمِ\A اللّٰہُ اَکْبَر\A سُبْحَانَ اللّٰہ\A اَلْحَمْدُ لِلّٰہ\A لَا اِلٰہَ اِلَّا اللّٰہ\A مُحَمَّدٌ رَّسُولُ اللّٰہ ﷺ';
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-family: 'Amiri', serif;
            font-size: clamp(1.8rem, 4.6vw, 4.8rem);
            line-height: 1.75;
            text-align: center;
            color: var(--gold);
            opacity: 0.045;
            white-space: pre;
            pointer-events: none;
            z-index: 0;
            text-shadow: 0 0 60px var(--gold-glow);
        }

        .dark body::before {
            background-image:
                radial-gradient(ellipse at 20% 30%, rgba(196, 154, 46, 0.04) 0%, transparent 55%),
                radial-gradient(ellipse at 80% 70%, rgba(58, 140, 85, 0.03) 0%, transparent 55%);
        }

        .wrap {
            max-width: 1320px;
            margin: 0 auto;
            padding: 0 20px;
            position: relative;
            z-index: 1;
        }

        /* ─── NAVBAR ─────────────────────────────────────────────── */
        .nav {
            position: sticky;
            top: 12px;
            z-index: 200;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 24px;
            margin: 12px 0 28px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 50px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(16px);
        }

        .nav-logo {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-logo-icon {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: var(--surface2);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            box-shadow: 0 2px 8px var(--gold-glow);
        }

        .nav-logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .nav-logo-text {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text);
            line-height: 1.2;
        }

        .nav-logo-text small {
            display: block;
            margin-top: 10px;
            color: var(--text3);
            font-weight: 400;

        }

        .nav-links {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .nav-links a {
            text-decoration: none;
            padding: 7px 14px;
            border-radius: 30px;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text2);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: background .2s, color .2s;
        }

        .nav-links a:hover {
            background: var(--gold-pale);
            color: var(--gold);
        }

        .nav-links a i,
        .theme-btn i {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1em;
            line-height: 1;
            transform: translateY(1px);
        }

        .nav-hadith {
            background: var(--gold) !important;
            color: #fff !important;
            padding: 7px 16px !important;
            margin-right: 8px;
            box-shadow: 0 2px 10px var(--gold-glow);
        }

        .nav-quran {
            background: var(--green) !important;
            color: #fff !important;
            padding: 7px 16px !important;
            box-shadow: 0 2px 10px rgba(44, 95, 61, .18);
        }

        .theme-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: var(--bg2);
            cursor: pointer;
            font-size: 0.95rem;
            color: var(--gold);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background .2s;
        }

        .theme-btn:hover {
            background: var(--gold-pale);
        }

        /* ─── HERO ───────────────────────────────────────────────── */
        .hero {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 28px;
            align-items: center;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r-xl);
            padding: 36px 40px;
            margin-bottom: 28px;
            box-shadow: var(--shadow);
            overflow: hidden;
            position: relative;
        }

        .hero::before {
            content: 'ﷲ';
            position: absolute;
            left: -10px;
            top: -24px;
            font-family: 'Amiri', serif;
            font-size: 10rem;
            color: var(--gold);
            opacity: 0.05;
            pointer-events: none;
            line-height: 1;
        }

        body.dark .hero::before {
            content: 'ﷲ';
            font-size: 12rem;
            opacity: 0.05;
            text-shadow: 0 0 60px var(--gold-glow);
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--gold-pale);
            color: var(--gold);
            padding: 5px 14px;
            border-radius: 20px;
            font-size: 0.72rem;
            font-weight: 700;
            margin-bottom: 14px;
            border: 1px solid var(--border);
        }

        .hero h1 {
            font-family: 'Amiri', serif;
            font-size: clamp(1.6rem, 3vw, 2.4rem);
            font-weight: 700;
            line-height: 1.3;
            margin-bottom: 6px;
            color: var(--text);
        }

        .hero-titles {
            color: var(--gold);
            font-size: 0.85rem;
            margin-bottom: 18px;
        }

        .hero-ayah {
            background: var(--bg2);
            border-right: 3px solid var(--gold);
            border-radius: 0 12px 12px 0;
            padding: 14px 18px;
            font-family: 'Amiri', serif;
            font-size: 1.05rem;
            line-height: 1.9;
            color: var(--text2);
            margin: 14px 0 20px;
            display: flex;
            align-items: baseline;
            column-gap: 38px;
            row-gap: 8px;
            flex-wrap: wrap;
        }

        .hero-quote {
            display: inline;
        }

        .hero-ayah small {
            display: inline;
            font-size: 0.7rem;
            color: var(--text3);
            margin: 0 6px;
            font-family: inherit;
        }

        .btn-row {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .btn {
            padding: 10px 22px;
            border-radius: 30px;
            font-family: inherit;
            font-weight: 700;
            font-size: 0.8rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            text-decoration: none;
            border: none;
            transition: all .2s;
        }

        .btn-gold {
            background: var(--gold);
            color: #fff;
            box-shadow: 0 3px 12px var(--gold-glow);
        }

        .btn-gold:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
        }

        .btn-outline {
            border: 1.5px solid var(--gold);
            color: var(--gold);
            background: transparent;
        }

        .btn-outline:hover {
            background: var(--gold-pale);
        }

        .hero-avatar {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--bg2), var(--surface2));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 5rem;
            color: var(--gold);
            border: 3px solid var(--border);
            box-shadow: 0 0 0 8px var(--bg), 0 0 0 10px var(--border), var(--shadow);
            overflow: hidden;
        }

        .hero-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        /* ─── STATS ──────────────────────────────────────────────── */
        .stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 28px;
        }

        .stat {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r);
            padding: 20px 16px;
            text-align: center;
            box-shadow: var(--shadow);
            transition: transform .2s, box-shadow .2s;
        }

        .stat:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-lg);
        }

        .stat i {
            font-size: 1.4rem;
            color: var(--gold);
            margin-bottom: 8px;
            display: block;
        }

        .stat-num {
            font-size: 1.6rem;
            font-weight: 800;
            color: var(--text);
            display: block;
            font-family: 'Amiri', serif;
        }

        .stat-lbl {
            font-size: 0.68rem;
            color: var(--text3);
            text-transform: uppercase;
            letter-spacing: .5px;
            margin-top: 2px;
        }

        /* ─── HADITH BANNER ──────────────────────────────────────── */
        .hadith-banner {
            background: linear-gradient(110deg, var(--green) 0%, #1a3d28 100%);
            border-radius: var(--r-lg);
            padding: 20px 28px;
            margin-bottom: 36px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: #fff;
            text-decoration: none;
            box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
            transition: transform .2s;
            position: relative;
            overflow: hidden;
        }

        .hadith-banner:hover {
            transform: translateY(-2px);
        }

        .hadith-banner::after {
            content: 'ﷺ';
            position: absolute;
            left: 24px;
            bottom: -16px;
            font-family: 'Amiri', serif;
            font-size: 5rem;
            opacity: 0.12;
            pointer-events: none;
        }

        .hadith-banner-text {
            font-size: 0.9rem;
            font-weight: 600;
        }

        .hadith-banner-text small {
            display: block;
            opacity: .7;
            font-size: .72rem;
            margin-top: 3px;
        }

        /* ─── SECTION HEADING ────────────────────────────────────── */
        .sec-head {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 36px 0 18px;
        }

        .sec-head-icon {
            width: 38px;
            height: 38px;
            border-radius: 12px;
            background: var(--gold);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .sec-head h2 {
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--text);
        }

        /* ─── TOPICS ─────────────────────────────────────────────── */
        .topics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 14px;
            margin-bottom: 36px;
        }

        .topic-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r);
            padding: 20px 16px;
            cursor: pointer;
            box-shadow: var(--shadow);
            transition: all .25s;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .topic-card:hover {
            border-color: var(--gold);
            transform: translateY(-4px);
            box-shadow: var(--shadow-lg);
        }

        .topic-icon-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .topic-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            flex-shrink: 0;
            background: var(--gold-pale);
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            color: var(--gold);
        }

        .topic-meta {
            font-size: 0.68rem;
            color: var(--text3);
        }

        .topic-name {
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--text);
            line-height: 1.4;
        }

        .topic-desc {
            font-size: 0.75rem;
            color: var(--text3);
            line-height: 1.5;
        }

        .topic-tags {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .topic-tag {
            padding: 2px 10px;
            border-radius: 20px;
            background: var(--gold-pale);
            color: var(--gold);
            font-size: 0.62rem;
            font-weight: 700;
            border: 1px solid var(--border);
        }

        .topic-type-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.62rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 20px;
        }

        .type-pdf {
            background: #fff0f0;
            color: #c0392b;
            border: 1px solid rgba(192, 57, 43, .15);
        }

        .type-text {
            background: #f0f7ff;
            color: #2563eb;
            border: 1px solid rgba(37, 99, 235, .15);
        }

        body.dark .type-pdf {
            background: #2a1010;
            color: #e07070;
        }

        body.dark .type-text {
            background: #101a2a;
            color: #70a0e0;
        }

        /* ─── FILTER PANEL ───────────────────────────────────────── */
        .filter-bar {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r-xl);
            padding: 12px 18px;
            margin-bottom: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
            box-shadow: var(--shadow);
        }

        .search-box {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg2);
            border-radius: 30px;
            padding: 6px 14px;
            flex: 1;
            min-width: 180px;
        }

        .search-box:focus-within {
            outline: 2px solid var(--gold);
        }

        .search-box input {
            background: transparent;
            border: none;
            outline: none;
            font-family: inherit;
            font-size: 0.82rem;
            color: var(--text);
            width: 100%;
        }

        .search-box input::placeholder {
            color: var(--text3);
        }

        .chips {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .chip {
            padding: 5px 14px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.72rem;
            font-weight: 700;
            background: var(--bg2);
            border: 1px solid var(--border);
            color: var(--text2);
            transition: .2s;
            white-space: nowrap;
        }

        .chip.on {
            background: var(--gold);
            color: #fff;
            border-color: var(--gold);
        }

        .chip:hover:not(.on) {
            background: var(--gold-pale);
            color: var(--gold);
            border-color: var(--border);
        }

        /* ─── CATEGORY DROPDOWN MENU ─────────────────────────────── */
        .category-dropdown {
            position: relative;
        }

        .dropdown-toggle {
            padding: 6px 14px;
            border-radius: 30px;
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--bg2);
            border: 1px solid var(--border);
            color: var(--text2);
            transition: background .2s, color .2s;
            white-space: nowrap;
        }

        .dropdown-toggle:hover {
            background: var(--gold-pale);
            color: var(--gold);
        }

        .dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 16px;
            box-shadow: var(--shadow-lg);
            min-width: 180px;
            max-height: 320px;
            overflow-y: auto;
            z-index: 300;
            display: none;
            padding: 6px;
        }

        .dropdown-menu.open {
            display: block;
        }

        .dropdown-item {
            display: block;
            width: 100%;
            padding: 8px 14px;
            border-radius: 12px;
            background: none;
            border: none;
            text-align: right;
            font-family: inherit;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text2);
            cursor: pointer;
            transition: background .15s, color .15s;
        }

        .dropdown-item:hover {
            background: var(--gold-pale);
            color: var(--gold);
        }

        .dropdown-item.active {
            background: var(--gold);
            color: #fff;
        }

        .dropdown-menu::-webkit-scrollbar {
            width: 4px;
        }

        .dropdown-menu::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }

        /* ─── VIDEO PAGINATION ───────────────────────────────────── */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin: -18px 0 40px;
        }

        .page-btn {
            min-width: 36px;
            height: 36px;
            padding: 0 12px;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text2);
            font-family: inherit;
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: background .2s, color .2s, border-color .2s;
        }

        .page-btn:hover:not(:disabled):not(.active) {
            background: var(--gold-pale);
            color: var(--gold);
        }

        .page-btn.active {
            background: var(--gold);
            border-color: var(--gold);
            color: #fff;
        }

        .page-btn:disabled {
            cursor: not-allowed;
            opacity: .45;
        }

        .page-gap {
            color: var(--text3);
            font-weight: 700;
            line-height: 36px;
        }

        /* ─── VIDEO GRID ─────────────────────────────────────────── */
        .video-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 14px;
            margin-bottom: 40px;
            align-items: start;
        }

        .vcard {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r);
            overflow: hidden;
            box-shadow: var(--shadow);
            cursor: pointer;
            transition: all .25s;
            display: flex;
            flex-direction: column;
            align-self: start;
        }

        .vcard:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
            border-color: var(--gold);
        }

        .vcard.featured {
            grid-column: span 2;
        }

        .vcard-thumb {
            width: 100%;
            aspect-ratio: 16/9;
            background: var(--bg2);
            object-fit: cover;
            display: block;
        }

        .vcard-body {
            padding: 10px 13px 12px;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .vcard-title {
            font-size: 0.84rem;
            font-weight: 700;
            line-height: 1.4;
            color: var(--text);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .vcard-cat {
            display: inline-block;
            padding: 2px 9px;
            border-radius: 20px;
            background: var(--gold-pale);
            color: var(--gold);
            font-size: 0.62rem;
            font-weight: 700;
            width: fit-content;
            border: 1px solid var(--border);
        }

        .vcard-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.65rem;
            color: var(--text3);
            padding-top: 7px;
            margin-top: 2px;
            border-top: 1px solid var(--border);
        }

        @media (min-width: 700px) {
            .vcard.featured {
                flex-direction: row;
            }

            .vcard.featured .vcard-thumb {
                width: 280px;
                aspect-ratio: unset;
                height: auto;
                flex-shrink: 0;
            }

            .vcard.featured .vcard-title {
                font-size: 1rem;
            }
        }

        @media (max-width: 600px) {
            .vcard.featured {
                grid-column: span 1;
                flex-direction: column;
            }

            .stats {
                grid-template-columns: repeat(2, 1fr);
            }

            .hero {
                grid-template-columns: 1fr;
            }

            .hero-avatar {
                display: none;
            }

            .nav-links a:not(.nav-hadith):not(.nav-quran):not(.theme-btn-wrap) {
                display: none;
            }
        }

        /* ─── MODAL ──────────────────────────────────────────────── */
        .modal {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 500;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            align-items: center;
            justify-content: center;
            padding: 16px;
        }

        .modal.on {
            display: flex;
        }

        .modal-box {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r-lg);
            overflow: hidden;
            max-width: 720px;
            width: 100%;
            animation: up .3s ease;
        }

        @keyframes up {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
        }

        .modal-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 18px;
            border-bottom: 1px solid var(--border);
        }

        .modal-top span {
            font-weight: 700;
            font-size: 0.9rem;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 1.3rem;
            cursor: pointer;
            color: var(--text3);
        }

        .modal iframe {
            width: 100%;
            aspect-ratio: 16/9;
            display: block;
            border: none;
        }

        .modal-info {
            padding: 16px 20px 20px;
        }

        .modal-info h3 {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .modal-meta {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            font-size: 0.75rem;
            color: var(--text3);
            margin-bottom: 10px;
        }

        .modal-desc {
            font-size: 0.8rem;
            color: var(--text2);
            line-height: 1.7;
        }

        /* ─── EMPTY / ERROR ──────────────────────────────────────── */
        .empty {
            grid-column: 1/-1;
            text-align: center;
            padding: 40px;
            color: var(--text3);
            font-size: 0.9rem;
        }

        .err {
            background: #fff0f0;
            border: 1px solid #f5c6c6;
            border-radius: var(--r);
            padding: 16px 20px;
            color: #b00;
            font-size: 0.85rem;
        }

        body.dark .err {
            background: #2a1010;
            color: #e07070;
            border-color: #4a2020;
        }

        /* ─── HIDDEN ADMIN SYNC BUTTON ──────────────────────────── */
        .admin-sync-btn {
            position: fixed;
            bottom: 24px;
            left: 24px;
            z-index: 999;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--gold);
            color: #fff;
            border: none;
            cursor: pointer;
            font-size: 1.2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all .3s;
            opacity: 0;
            pointer-events: none;
            transform: scale(0.7);
        }

        .admin-sync-btn.visible {
            opacity: 1;
            pointer-events: auto;
            transform: scale(1);
        }

        .admin-sync-btn:hover {
            filter: brightness(1.2);
            transform: scale(1.08);
        }

        .admin-sync-btn.syncing {
            animation: spin 0.8s linear infinite;
            pointer-events: none;
            opacity: 0.7;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .sync-toast {
            position: fixed;
            bottom: 90px;
            left: 24px;
            z-index: 999;
            background: var(--surface);
            border: 1px solid var(--gold);
            border-radius: 12px;
            padding: 10px 18px;
            font-size: 0.78rem;
            color: var(--text);
            box-shadow: var(--shadow-lg);
            opacity: 0;
            transform: translateY(10px);
            transition: all .3s;
            pointer-events: none;
            max-width: 320px;
        }

        .sync-toast.show {
            opacity: 1;
            transform: translateY(0);
        }

        .sync-toast.success {
            border-color: var(--green);
            color: var(--green);
        }

        .sync-toast.error {
            border-color: #c0392b;
            color: #c0392b;
        }

        /* ─── FOOTER ─────────────────────────────────────────────── */
        .footer {
            text-align: center;
            margin-top: 56px;
            padding: 28px 0 16px;
            border-top: 1px solid var(--border);
            color: var(--text3);
            font-size: 0.75rem;
        }

        .back-top {
            background: var(--gold);
            color: #fff;
            border: none;
            padding: 7px 20px;
            border-radius: 30px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.78rem;
            margin-top: 10px;
        }

        .back-top:hover {
            filter: brightness(1.1);
        }

        /* ─── TABS ───────────────────────────────────────────────── */
        .tab-bar {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }

        .tab {
            padding: 7px 16px;
            border-radius: 30px;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 700;
            border: 1.5px solid var(--border);
            color: var(--text2);
            background: var(--surface);
            transition: .2s;
        }

        .tab.on {
            background: var(--gold);
            color: #fff;
            border-color: var(--gold);
        }

        .tab:hover:not(.on) {
            border-color: var(--gold);
            color: var(--gold);
        }

        /* ─── LOADING SPINNER ───────────────────────────────────── */
        .spinner-wrap {
            grid-column: 1/-1;
            display: flex;
            justify-content: center;
            padding: 40px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 3px solid var(--border);
            border-top-color: var(--gold);
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }

        .hidden {
            display: none;
        }

        .text-muted-icon {
            color: var(--text3);
        }

        .gold-icon {
            color: var(--gold);
        }

        .modal-watch-link {
            margin-top: 14px;
            display: inline-flex;
        }

        /* ─── LIGHT MODE POLISH ─────────────────────────────────── */
        body:not(.dark) {
            --bg: #f7f4ed;
            --bg2: #efe7d8;
            --surface: #fffdf8;
            --surface2: #f7efdf;
            --border: rgba(42, 34, 22, 0.14);
            --gold: #8a641b;
            --gold-bright: #bd8f24;
            --gold-glow: rgba(138, 100, 27, 0.18);
            --gold-pale: #fff3d2;
            --green: #245b3b;
            --green-soft: #e7f3eb;
            --shadow: 0 10px 30px rgba(55, 42, 24, 0.10);
            --shadow-lg: 0 18px 50px rgba(55, 42, 24, 0.18);
            background:
                radial-gradient(circle at 12% 8%, rgba(36, 91, 59, 0.12), transparent 28%),
                radial-gradient(circle at 88% 14%, rgba(189, 143, 36, 0.16), transparent 30%),
                linear-gradient(180deg, #fbfaf5 0%, #f4eddf 48%, #f8f5ec 100%);
        }

        body:not(.dark)::before {
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08)),
                repeating-linear-gradient(45deg, rgba(138, 100, 27, 0.045) 0 1px, transparent 1px 34px),
                repeating-linear-gradient(-45deg, rgba(36, 91, 59, 0.035) 0 1px, transparent 1px 34px);
        }

        body:not(.dark) .nav {
            background: rgba(255, 253, 248, 0.88);
            border-color: rgba(138, 100, 27, 0.18);
            box-shadow: 0 14px 36px rgba(62, 48, 26, 0.13);
        }

        body:not(.dark) .nav-logo-icon {
            border: 1px solid rgba(138, 100, 27, 0.18);
            box-shadow: 0 5px 14px rgba(138, 100, 27, 0.16);
        }

        body:not(.dark) .nav-links a:not(.nav-quran):not(.nav-hadith) {
            background: rgba(255, 255, 255, 0.38);
        }

        body:not(.dark) .nav-links a:not(.nav-quran):not(.nav-hadith):hover,
        body:not(.dark) .theme-btn:hover,
        body:not(.dark) .btn-outline:hover,
        body:not(.dark) .tab:hover:not(.on),
        body:not(.dark) .page-btn:hover:not(:disabled):not(.active),
        body:not(.dark) .dropdown-toggle:hover,
        body:not(.dark) .dropdown-item:hover {
            background: #fff1c4;
            color: #6f4b0f;
        }

        body:not(.dark) .hero {
            background:
                linear-gradient(135deg, rgba(255, 253, 248, 0.96) 0%, rgba(255, 246, 225, 0.96) 58%, rgba(231, 243, 235, 0.92) 100%);
            border-color: rgba(138, 100, 27, 0.18);
            box-shadow: 0 20px 60px rgba(73, 55, 28, 0.15);
        }

        body:not(.dark) .hero::after {
            content: '';
            position: absolute;
            inset-inline-start: 0;
            top: 0;
            width: 7px;
            height: 100%;
            background: linear-gradient(180deg, var(--green), var(--gold-bright));
            pointer-events: none;
        }

        body:not(.dark) .hero::before {
            color: rgba(138, 100, 27, 0.55);
            opacity: 0.08;
        }

        body:not(.dark) .hero-badge,
        body:not(.dark) .vcard-cat,
        body:not(.dark) .topic-tag {
            background: #fff0bd;
            border-color: rgba(138, 100, 27, 0.16);
            color: #76530f;
        }

        body:not(.dark) .hero-ayah {
            background: rgba(255, 255, 255, 0.68);
            border-right-color: var(--green);
            box-shadow: inset 0 0 0 1px rgba(138, 100, 27, 0.08);
        }

        body:not(.dark) .hero-avatar {
            background: linear-gradient(135deg, #fff8df, #e8f4ec);
            border-color: rgba(138, 100, 27, 0.24);
            box-shadow: 0 0 0 8px rgba(255, 253, 248, 0.92), 0 0 0 10px rgba(36, 91, 59, 0.12), 0 18px 42px rgba(36, 91, 59, 0.18);
        }

        body:not(.dark) .stat,
        body:not(.dark) .topic-card,
        body:not(.dark) .filter-bar,
        body:not(.dark) .vcard,
        body:not(.dark) .modal-box,
        body:not(.dark) .dropdown-menu {
            background: rgba(255, 253, 248, 0.94);
            border-color: rgba(138, 100, 27, 0.15);
            box-shadow: 0 12px 34px rgba(55, 42, 24, 0.09);
        }

        body:not(.dark) .stat,
        body:not(.dark) .topic-card,
        body:not(.dark) .vcard {
            position: relative;
        }

        body:not(.dark) .stat::before,
        body:not(.dark) .topic-card::before,
        body:not(.dark) .vcard::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border-top: 3px solid rgba(36, 91, 59, 0.18);
            pointer-events: none;
        }

        body:not(.dark) .stat:hover,
        body:not(.dark) .topic-card:hover,
        body:not(.dark) .vcard:hover {
            border-color: rgba(138, 100, 27, 0.36);
            box-shadow: 0 20px 54px rgba(55, 42, 24, 0.16);
        }

        body:not(.dark) .sec-head-icon,
        body:not(.dark) .tab.on,
        body:not(.dark) .page-btn.active,
        body:not(.dark) .btn-gold {
            background: linear-gradient(135deg, #8a641b, #b88720);
            box-shadow: 0 8px 20px rgba(138, 100, 27, 0.22);
        }

        body:not(.dark) .topic-icon,
        body:not(.dark) .search-box,
        body:not(.dark) .dropdown-toggle,
        body:not(.dark) .chip,
        body:not(.dark) .page-btn,
        body:not(.dark) .tab,
        body:not(.dark) .theme-btn {
            background: rgba(255, 255, 255, 0.72);
            border-color: rgba(138, 100, 27, 0.16);
        }

        body:not(.dark) .hadith-banner {
            background:
                linear-gradient(110deg, #245b3b 0%, #2f7450 52%, #8a641b 100%);
            box-shadow: 0 18px 44px rgba(36, 91, 59, 0.24);
        }

        body:not(.dark) .footer {
            background: linear-gradient(180deg, transparent, rgba(255, 253, 248, 0.72));
        }
