@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --dark: #1E3A2B;
    --dark-alt: #16291E;
    --paper: #F4EFE1;
    --card: #FFFDF8;
    --gold: #C8932B;
    --gold-dark: #A6741E;
    --red: #B23A2E;
    --red-dark: #8E2E24;
    --green: #3E7A4E;
    --ink: #26261F;
    --border: #DED3B4;
    --muted: #6B6653;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Bitter', serif;
    color: var(--dark);
    margin: 0 0 .5em;
    line-height: 1.25;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--dark);
    border-bottom: 3px solid var(--gold);
}
.navbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 19px;
    color: #FBF6E9;
    padding: 12px 0;
}
.brand-tagline {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 11px;
    color: #C9BE9A;
    letter-spacing: .03em;
}
.brand-badge {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--dark-alt);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-badge-img {
    width: 64px; height: 64px;
    background: transparent;
    border-radius: 0;
}
@media (max-width: 480px) {
    .brand-badge-img { width: 46px; height: 46px; }
    .brand-badge { width: 42px; height: 42px; font-size: 15px; }
    .brand { font-size: 16px; gap: 8px; }
    .brand-tagline { font-size: 10px; }
}
.brand-badge-img img {
    width: 100%; height: 100%;
    object-fit: contain;
}
.nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.nav-links a {
    color: #E7E1CE;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background .15s;
}
.nav-links a:hover { background: rgba(255,255,255,.08); }
.nav-links a.active { background: var(--gold); color: var(--dark-alt); font-weight: 600; }

/* ===== ANNOUNCEMENT MARQUEE ===== */
.marquee-wrap {
    background: var(--gold);
    overflow: hidden;
    white-space: nowrap;
    padding: 9px 0;
}
.marquee-track {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 22s linear infinite;
    color: var(--dark-alt);
    font-weight: 600;
    font-size: 14px;
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===== LAYOUT / SECTIONS ===== */
.section { padding: 34px 0; }
@media (max-width: 560px) {
    .section { padding: 22px 0; }
}
.section-title {
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title .more { font-size: 13px; color: var(--gold-dark); font-weight: 600; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 800px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== SLIDESHOW ===== */
.slideshow {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--dark-alt);
    aspect-ratio: 16/6.5;
    min-height: 200px;
}
.slide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity .7s ease;
    background-size: cover;
    background-position: center;
}
.slide.active { opacity: 1; }
.slide-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 30px 26px 18px;
    background: linear-gradient(to top, rgba(15,25,18,.85), transparent);
    color: #FBF6E9;
    font-weight: 600;
    font-size: 15px;
}
.slide-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #B7C3B7; font-size: 14px; text-align: center; padding: 20px;
}
@media (max-width: 700px) {
    .slideshow {
        aspect-ratio: 4/3.4;
        min-height: 0;
        border-radius: 10px;
    }
    .slide-caption {
        padding: 20px 14px 12px;
        font-size: 13.5px;
    }
    .slide-empty {
        font-size: 13px;
        padding: 16px;
    }
}
@media (max-width: 420px) {
    .slideshow { aspect-ratio: 1/1.05; }
}

/* ===== PLACEHOLDER FOTO ===== */
.photo-placeholder {
    background: #EAE4D2;
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    text-align: center;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* ===== NEWS CARD ===== */
.news-card { display: flex; flex-direction: column; }
.news-thumb {
    width: 100%; aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; margin-bottom: 12px;
    background: #EAE4D2;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.news-title { font-size: 16px; font-weight: 600; font-family: 'Bitter', serif; color: var(--dark); margin: 0 0 6px; }
.news-excerpt { font-size: 13.5px; color: var(--muted); }

/* ===== GALLERY ===== */
.folder-card { display: block; }
.folder-cover {
    width: 100%; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: #EAE4D2;
    position: relative;
}
.folder-cover img { width: 100%; height: 100%; object-fit: cover; }
.folder-count {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(30,58,43,.85); color: #FBF6E9; font-size: 12px; padding: 3px 9px; border-radius: 20px;
}
.folder-name { font-weight: 600; font-family: 'Bitter', serif; color: var(--dark); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
.photo-item { position: relative; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; background: #EAE4D2; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.tag-flag {
    position: absolute; top: 6px; right: 6px;
    background: var(--gold); color: var(--dark-alt);
    font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
}

/* ===== STAT CARDS (Sosial Dana) ===== */
.stat-card { text-align: left; }
.stat-label { font-size: 12.5px; color: var(--muted); text-transform: none; margin-bottom: 6px; }
.stat-value { font-size: 21px; font-weight: 700; font-family: 'Bitter', serif; color: var(--dark); }
.stat-card.sosial { border-top: 3px solid #8A6B2E; }
.stat-card.ronda { border-top: 3px solid var(--green); }
.stat-card.perabot { border-top: 3px solid var(--gold); }
.stat-card.qurban { border-top: 3px solid var(--red); }
.stat-card.pinjaman { border-top: 3px solid var(--dark); }

/* ===== FINANCE SUMMARY CARDS (Dasbor) ===== */
.finance-card {
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-height: 90px;
    justify-content: center;
}
.finance-card-label { font-size: 12.5px; font-weight: 700; opacity: .9; }
.finance-card-value { font-size: 19px; font-weight: 700; font-family: 'Bitter', serif; line-height: 1.2; }
@media (max-width: 560px) {
    .finance-card { padding: 14px; min-height: 74px; }
    .finance-card-value { font-size: 16.5px; }
}

/* ===== FORMS ===== */
.field-note { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; margin-top: -10px; }
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
input[type=text], input[type=password], input[type=number], input[type=file],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
}
textarea { min-height: 110px; resize: vertical; }
input:disabled {
    background: #EFEADA;
    color: var(--dark);
    font-weight: 600;
    opacity: 1;
}
.btn {
    display: inline-block;
    border: none;
    border-radius: 7px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary { background: var(--dark); color: #FBF6E9; }
.btn-primary:hover { background: var(--dark-alt); }
.btn-gold { background: var(--gold); color: var(--dark-alt); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--dark); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-pending { background: #F3E3C3; color: var(--gold-dark); }
.badge-approved { background: #DCEBDF; color: var(--green); }
.badge-rejected { background: #F3D9D6; color: var(--red-dark); }

/* ===== TABLES ===== */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td {
    text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border);
}
table.data-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
table.data-table th:first-child, table.data-table td:first-child {
    white-space: nowrap;
    min-width: 95px;
}

@media (max-width: 700px) {
    .card:has(table.data-table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.data-table { min-width: 480px; }
}

/* ===== LOGIN ===== */
.login-wrap {
    max-width: 400px; margin: 60px auto; padding: 0 20px;
}
.login-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 30px; }
.demo-hint { font-size: 12.5px; color: var(--muted); margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* ===== ALERT / FLASH ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.alert-success { background: #DCEBDF; color: var(--green); }
.alert-error { background: #F3D9D6; color: var(--red-dark); }

/* ===== PROFILE ===== */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-photo {
    width: 90px; height: 90px; border-radius: 50%; overflow: hidden; background: #EAE4D2;
    display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; flex-shrink: 0;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ===== ADMIN LAYOUT ===== */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
@media (max-width: 760px) { .admin-wrap { grid-template-columns: 1fr; } }
.admin-sidebar a {
    display: block; padding: 10px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--dark);
    margin-bottom: 4px;
}
.admin-sidebar a:hover { background: #EAE4D2; }
.admin-sidebar a.active { background: var(--dark); color: #FBF6E9; }

.footer {
    background: var(--dark-alt);
    color: #B7C3B7;
    text-align: center;
    padding: 22px 0;
    font-size: 13px;
    margin-top: 40px;
}
