/* ============================================================
   TEMA ELEGAN MADRASAH — Formal, nyaman dipandang, rapi
   ============================================================ */

:root {
    --color-bg:        #f7f5f0;
    --color-surface:   #ffffff;
    --color-green:     #1b4332;
    --color-green-mid: #2d6a4f;
    --color-green-soft:#52796f;
    --color-gold:      #b8860b;
    --color-gold-light:#d4a843;
    --color-text:      #2c2c2c;
    --color-text-muted:#5c5c5c;
    --color-border:    #e5e0d5;
    --color-shadow:    rgba(27, 67, 50, 0.08);
    --font-heading:    'Cormorant Garamond', Georgia, serif;
    --font-body:       'Source Sans 3', 'Segoe UI', sans-serif;
    --sidebar-width:   250px;
    --page-gutter:     clamp(20px, 4vw, 48px);
    --header-height:   72px;
    --radius:          8px;
    --radius-lg:       12px;
    --transition:      0.25s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}

a { color: var(--color-green-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-gold); }

img { max-width: 100%; height: auto; display: block; }

/* ---- TOP BAR ---- */
.top-bar {
    background: var(--color-green);
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    padding: 8px 0;
}
.top-bar .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(10px, 3vw, 24px);
}
.top-bar .container span {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}
.top-bar .container span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-bar a { color: rgba(255,255,255,0.9); }
.top-bar a:hover { color: var(--color-gold-light); }
.top-bar i { margin-right: 6px; color: var(--color-gold-light); }

/* ---- HEADER ---- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 12px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 200;
}
.site-header .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border: none;
    border-radius: 0;
    background: none;
}
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-green);
    line-height: 1.1;
    letter-spacing: 0.2px;
    margin: 0;
}
.brand-text span {
    font-size: 0.76rem;
    color: var(--color-text-muted);
    letter-spacing: 0.3px;
    line-height: 1.15;
    margin: 0;
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
    background: var(--color-green);
    color: #fff;
}
.main-nav a.nav-cta {
    background: var(--color-gold);
    color: #fff;
    margin-left: 8px;
}
.main-nav a.nav-cta:hover { background: var(--color-green); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 1.2rem;
    color: var(--color-green);
    cursor: pointer;
}

/* ---- ANNOUNCEMENT BAR ---- */
.announcement-bar {
    background: linear-gradient(90deg, var(--color-green) 0%, var(--color-green-mid) 100%);
    color: #fff;
    padding: 10px var(--page-gutter);
    overflow: hidden;
}
.announcement-bar .marquee {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 40s linear infinite;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}
.announcement-bar i { color: var(--color-gold-light); margin-right: 8px; }

@keyframes marquee {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ---- PAGE LAYOUT (3 kolom full layar) ---- */
.page-layout,
.page-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 28px var(--page-gutter) 40px;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--sidebar-width);
    gap: clamp(16px, 2vw, 28px);
    align-items: start;
}

.main-area {
    min-width: 0;
    width: 100%;
}

/* ---- SIDEBAR ---- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-left,
.sidebar-right {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    max-height: calc(100vh - var(--header-height) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.sidebar-brand img {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    object-fit: contain;
    flex-shrink: 0;
}
.sidebar-brand strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--color-green);
    line-height: 1.25;
}
.sidebar-brand span {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}
.sidebar-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 8px var(--color-shadow);
}
.sidebar-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--color-green);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-gold);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-card h3 i { color: var(--color-gold); font-size: 0.95rem; }

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 4px; }
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), padding-left var(--transition);
}
.sidebar-menu a:hover {
    background: var(--color-bg);
    padding-left: 18px;
    color: var(--color-green);
}
.sidebar-menu a i {
    width: 18px;
    text-align: center;
    color: var(--color-green-soft);
}

.sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-box {
    text-align: center;
    padding: 12px 8px;
    background: var(--color-bg);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.stat-box .num {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-green);
    display: block;
    line-height: 1;
}
.stat-box .lbl {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.sidebar-contact p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sidebar-contact i { color: var(--color-green-soft); margin-top: 3px; flex-shrink: 0; }

.agenda-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.agenda-item:last-child { border-bottom: none; padding-bottom: 0; }
.agenda-item strong {
    display: block;
    font-size: 0.88rem;
    color: var(--color-text);
    margin-bottom: 4px;
}
.agenda-item small { color: var(--color-text-muted); font-size: 0.78rem; }
.agenda-item small i { margin-right: 4px; color: var(--color-gold); }

/* ---- MOBILE SIDEBAR BAR ---- */
.mobile-sidebar-bar { display: none; }

/* ---- MAIN CONTENT ---- */
/* (main-area defined above) */

/* ---- HERO SLIDER ---- */
.hero-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 380px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px var(--color-shadow);
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slide .hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 28px;
    background: linear-gradient(to top, rgba(27,67,50,0.92), transparent);
    color: #fff;
}
.hero-caption h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.hero-caption span {
    font-size: 0.85rem;
    opacity: 0.85;
}
.hero-dots {
    position: absolute;
    bottom: 16px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 2;
}
.hero-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition);
}
.hero-dots button.active { background: var(--color-gold-light); border-color: var(--color-gold-light); }

/* ---- SECTIONS ---- */
.section { margin-bottom: 48px; }
.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.section-title h2 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    color: var(--color-green);
    white-space: nowrap;
    font-weight: 700;
}
.section-title .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--color-border), transparent);
}
.section-title i { color: var(--color-gold); }

/* ---- CARDS ---- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: 0 6px 20px var(--color-shadow);
    transform: translateY(-2px);
}
.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.card h3, .card h4 { font-family: var(--font-heading); color: var(--color-green); }
.card p { color: var(--color-text-muted); font-size: 0.92rem; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}
.badge-date { background: var(--color-green); color: #fff; }
.badge-cat  { background: var(--color-gold-light); color: #fff; margin-left: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.span-2 { grid-column: span 2; }

/* ---- STATS ROW ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--color-shadow);
}
.stat-item { text-align: center; }
.stat-item .stat-num {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-green);
    display: block;
    line-height: 1;
}
.stat-item .stat-label {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.detail-stat-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--color-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-gold);
}
.detail-stat-num {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-green);
    display: block;
}
.detail-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- TEAM / EKSKUL ---- */
.team-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: box-shadow var(--transition);
}
.team-card:hover { box-shadow: 0 4px 16px var(--color-shadow); }
.team-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    border: 3px solid var(--color-border);
}
.ekskul-badge {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    transition: border-color var(--transition);
}
.ekskul-badge:hover { border-color: var(--color-green-soft); }
.ekskul-icon { font-size: 1.8rem; color: var(--color-gold); margin-bottom: 8px; }

/* ---- GALERI ---- */
.galeri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.galeri-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    height: 160px;
    cursor: pointer;
}
.galeri-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.galeri-item:hover img { transform: scale(1.06); }
.galeri-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27,67,50,0.85), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    color: #fff;
    opacity: 0;
    transition: opacity var(--transition);
}
.galeri-item:hover .galeri-overlay { opacity: 1; }
.galeri-overlay p { font-size: 0.85rem; font-weight: 600; }

/* ---- INFO TICKER ---- */
.info-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-gold);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: box-shadow var(--transition);
}
.info-item:hover { box-shadow: 0 2px 10px var(--color-shadow); }

/* ---- SAMBUTAN ---- */
.sambutan-wrap {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.sambutan-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
    flex-shrink: 0;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--color-green); color: #fff; }
.btn-primary:hover { background: var(--color-green-mid); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--color-green);
    border: 1.5px solid var(--color-green);
}
.btn-outline:hover { background: var(--color-green); color: #fff; }
.btn-gold { background: var(--color-gold); color: #fff; }
.btn-gold:hover { background: var(--color-green); color: #fff; }

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-40 { margin-bottom: 40px; }

/* ---- AD SLOTS ---- */
.ad-slot {
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-slot--sidebar { min-height: 250px; }
.ad-slot--banner  { min-height: 90px; margin-bottom: 24px; }
.ad-slot--footer  { min-height: 90px; margin: 24px 0; text-align: center; overflow-x: auto; }
.ad-slot--footer .adsbygoogle { margin: 0 auto; max-width: 100%; }
.ad-placeholder {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    letter-spacing: 0.3px;
}
.ad-placeholder i { display: block; font-size: 1.4rem; margin-bottom: 6px; color: var(--color-border); }

/* ---- MAP ---- */
.map-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    height: 320px;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

.map-lazy {
    cursor: pointer;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.map-lazy:hover { background: #efece4; }
.map-lazy-placeholder {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
}
.map-lazy-placeholder i {
    font-size: 2rem;
    color: var(--color-green-soft);
    margin-bottom: 10px;
    display: block;
}
.map-lazy-placeholder span {
    display: block;
    font-weight: 600;
    color: var(--color-green);
    margin-bottom: 6px;
}
.map-lazy-placeholder small { font-size: 0.78rem; }
.map-lazy.is-loaded { cursor: default; }
.map-lazy.is-loaded .map-lazy-placeholder { display: none; }

/* ---- PPDB HOME SECTION ---- */
.ppdb-home {
    background: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-mid) 70%, #3d6b54 100%);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    color: #fff;
    box-shadow: 0 8px 28px rgba(27, 67, 50, 0.2);
}
.ppdb-home-inner {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    align-items: start;
}
.ppdb-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}
.ppdb-home h2 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    margin-bottom: 14px;
}
.ppdb-lead {
    font-size: 0.95rem;
    line-height: 1.75;
    opacity: 0.95;
    margin-bottom: 18px;
}
.ppdb-points {
    list-style: none;
    margin-bottom: 24px;
}
.ppdb-points li {
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-left: 26px;
    position: relative;
    line-height: 1.5;
    opacity: 0.92;
}
.ppdb-points li i {
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--color-gold-light);
}
.ppdb-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.ppdb-note {
    font-size: 0.82rem;
    opacity: 0.8;
    line-height: 1.5;
}
.ppdb-home-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ppdb-step-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 4px 12px;
    align-items: start;
}
.ppdb-step-num {
    grid-row: span 2;
    width: 36px;
    height: 36px;
    background: var(--color-gold);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.ppdb-step-card strong {
    font-size: 0.88rem;
    display: block;
}
.ppdb-step-card p {
    font-size: 0.78rem;
    opacity: 0.85;
    grid-column: 2;
}

@media (max-width: 900px) {
    .ppdb-home-inner { grid-template-columns: 1fr; }
    .ppdb-home-aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .ppdb-home { padding: 24px 18px; }
    .ppdb-home-aside { grid-template-columns: 1fr; }
    .ppdb-home-actions { flex-direction: column; }
    .ppdb-home-actions .btn { width: 100%; justify-content: center; }
}

/* ---- FOOTER ---- */
.site-footer {
    background: var(--color-green);
    color: rgba(255,255,255,0.85);
    padding: 48px var(--page-gutter) 24px;
    margin-top: 48px;
}
.site-footer .container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}
.site-footer img {
    width: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}
.site-footer h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 8px;
}
.site-footer p { font-size: 0.88rem; opacity: 0.8; margin-bottom: 6px; }
.social-links { margin: 24px 0; }
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    margin: 0 6px;
    font-size: 1rem;
    transition: background var(--transition), border-color var(--transition);
}
.social-links a:hover {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: #fff;
}
.footer-copy {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 20px;
    margin-top: 24px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1200px) {
    :root { --sidebar-width: 220px; }
}

@media (max-width: 1024px) {
    body.has-mobile-sidebar-bar {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .page-layout,
    .page-wrapper {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 20px var(--page-gutter) 32px;
    }

    .main-area {
        order: 1;
        width: 100%;
    }

    .sidebar-left,
    .sidebar-right {
        order: 2;
        position: static;
        max-height: none;
        overflow: visible;
        width: 100%;
        display: none !important;
    }

    /* Default HP: hanya konten utama */
    .page-layout .sidebar-left,
    .page-layout .sidebar-right {
        display: none !important;
    }

    .page-layout[data-mobile-view="left"] .sidebar-left {
        display: flex !important;
    }

    .page-layout[data-mobile-view="right"] .sidebar-right {
        display: flex !important;
    }

    .page-layout[data-mobile-view="left"] .main-area,
    .page-layout[data-mobile-view="right"] .main-area,
    .page-layout[data-mobile-view="left"] .sidebar-right,
    .page-layout[data-mobile-view="right"] .sidebar-left {
        display: none !important;
    }

    /* Logo sidebar jangan besar di HP — header sudah ada logo */
    .sidebar-brand-card {
        display: none;
    }

    .sidebar-card {
        padding: 16px;
    }

    .mobile-sidebar-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 320;
        gap: 8px;
        padding: 8px var(--page-gutter) calc(8px + env(safe-area-inset-bottom, 0px));
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 20px var(--color-shadow);
    }

    .mobile-bar-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 52px;
        padding: 6px 8px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        background: var(--color-bg);
        color: var(--color-text-muted);
        font-family: var(--font-body);
        font-size: 0.72rem;
        font-weight: 600;
        cursor: pointer;
        transition: background var(--transition), color var(--transition), border-color var(--transition);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bar-btn i { font-size: 1.1rem; }

    .mobile-bar-btn.active {
        background: var(--color-green);
        border-color: var(--color-green);
        color: #fff;
    }

    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .span-2 { grid-column: span 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --page-gutter: 20px; }
    .nav-toggle { display: block; min-width: 44px; min-height: 44px; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 4px 12px var(--color-shadow);
        z-index: 210;
    }
    .main-nav.open { display: flex; }
    .main-nav a { width: 100%; min-height: 44px; display: flex; align-items: center; }
    .site-header .container { position: relative; flex-wrap: nowrap; padding: 8px var(--page-gutter); min-height: 60px; }
    .brand { gap: 10px; min-width: 0; flex: 1; }
    :root { --header-height: 60px; }
    .brand img { width: 46px; height: 46px; }
    .brand-text h1 { font-size: 1.15rem; font-weight: 800; line-height: 1.08; }
    .brand-text span { font-size: 0.68rem; line-height: 1.1; }
    .top-bar { font-size: 0.7rem; padding: 7px 0; }
    .top-bar .container {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 8px;
        font-size: 0.68rem;
    }
    .announcement-bar .marquee { font-size: 0.78rem; }
    .hero-slider { height: 240px; }
    .hero-caption h2 { font-size: 1.15rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .card { padding: 18px; }
    .btn, .filter-btn, .tab-btn, .profil-tab-btn { min-height: 44px; }
    .section-title h2 { font-size: 1.25rem; white-space: normal; }
}

@media (max-width: 480px) {
    :root { --page-gutter: 20px; }
    .page-layout,
    .page-wrapper { padding: 20px var(--page-gutter) 28px; }
    .stats-grid { grid-template-columns: 1fr; }
    .hero-slider { height: 210px; }
    .hero-caption h2 { font-size: 1.05rem; }
    .sidebar-stats { grid-template-columns: 1fr 1fr; }
    .sidebar-card { padding: 16px; }
}
