/* =========================================================
   Alhadi Smart Budget — Tema Pondok Pesantren
   Hijau (warna keislaman) + emas + krem.
   ========================================================= */
:root {
    --pondok-green-900: #0f3d2e;
    --pondok-green-800: #14532d;
    --pondok-green-700: #1b6e3c;
    --pondok-green-600: #21824a;
    --pondok-green-100: #e3f1e8;
    --pondok-gold: #c9a227;
    --pondok-gold-light: #e8d27a;
    --pondok-cream: #f7f4ec;
    --pondok-ink: #243029;
    --sidebar-width: 268px;
}

* { font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif; }

body {
    background-color: var(--pondok-cream);
    color: var(--pondok-ink);
}

/* Pola geometris halus di latar */
body.app-body {
    background-image:
        radial-gradient(circle at 1px 1px, rgba(20, 83, 45, 0.05) 1px, transparent 0);
    background-size: 22px 22px;
}

.text-gold { color: var(--pondok-gold) !important; }
.bg-pondok { background-color: var(--pondok-green-800) !important; }

/* ===== Sidebar ===== */
.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--pondok-green-900), var(--pondok-green-800));
    color: #d7e6dd;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 14px rgba(0,0,0,.12);
}
.app-sidebar .brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: .7rem;
}
.app-sidebar .brand .brand-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--pondok-gold), var(--pondok-gold-light));
    color: var(--pondok-green-900);
    display: grid; place-items: center; font-size: 1.4rem;
    flex: 0 0 auto;
}
.app-sidebar .brand .brand-title { font-weight: 700; color: #fff; line-height: 1.1; }
.app-sidebar .brand .brand-sub { font-size: .72rem; color: var(--pondok-gold-light); }

.app-sidebar .nav-section {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: rgba(215,230,221,.5); padding: 1rem 1.4rem .35rem;
}
.app-sidebar .nav-link {
    color: #cfe0d6; padding: .6rem 1.4rem; display: flex; align-items: center; gap: .75rem;
    border-left: 3px solid transparent; font-size: .92rem;
}
.app-sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active {
    background: rgba(201,162,39,.16); color: #fff; border-left-color: var(--pondok-gold);
    font-weight: 600;
}
.app-sidebar .sidebar-scroll { overflow-y: auto; flex: 1; }
.app-sidebar .sidebar-scroll::-webkit-scrollbar { width: 6px; }
.app-sidebar .sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* ===== Konten utama ===== */
.app-main { margin-left: var(--sidebar-width); min-height: 100vh; }
.app-topbar {
    background: #fff; border-bottom: 1px solid #e7e2d4;
    padding: .65rem 1.4rem; position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 1rem;
}
.app-content { padding: 1.5rem 1.6rem 3rem; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .app-sidebar.show { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; display: none;
}
.sidebar-backdrop.show { display: block; }

/* ===== Komponen ===== */
.btn-pondok {
    background: var(--pondok-green-800); border-color: var(--pondok-green-800); color: #fff;
}
.btn-pondok:hover { background: var(--pondok-green-900); border-color: var(--pondok-green-900); color: #fff; }
.btn-gold { background: var(--pondok-gold); border-color: var(--pondok-gold); color: #3a2f06; font-weight: 600; }
.btn-gold:hover { background: #b8941f; border-color: #b8941f; color: #3a2f06; }
.btn-outline-pondok { color: var(--pondok-green-800); border-color: var(--pondok-green-700); }
.btn-outline-pondok:hover { background: var(--pondok-green-800); color: #fff; }

.card { border: 1px solid #ece6d6; border-radius: 14px; box-shadow: 0 2px 8px rgba(20,83,45,.04); }
.card-header { background: transparent; border-bottom: 1px solid #ece6d6; font-weight: 600; }
.page-title { font-weight: 700; color: var(--pondok-green-900); }
.page-subtitle { color: #7a8a80; font-size: .9rem; }

a { color: var(--pondok-green-700); }
a:hover { color: var(--pondok-green-900); }

.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { background: var(--pondok-green-100); color: var(--pondok-green-900); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--pondok-green-600); }

/* Statistik kartu */
.stat-card { border-radius: 14px; overflow: hidden; position: relative; }
.stat-card .stat-icon {
    position: absolute; right: -8px; bottom: -10px; font-size: 4.2rem; opacity: .12;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }

/* Badge warna khusus */
.badge.bg-teal { background-color: #0d9488 !important; color: #fff; }
.text-bg-teal { background-color: #0d9488 !important; color: #fff; }

.badge { font-weight: 600; }

/* Timeline alur */
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 2rem; border-left: 2px solid #e1dac8; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li .tl-dot {
    position: absolute; left: -9px; top: 0; width: 16px; height: 16px; border-radius: 50%;
    background: var(--pondok-green-600); border: 3px solid #fff; box-shadow: 0 0 0 1px #cdd8d0;
}
.timeline li.done .tl-dot { background: var(--pondok-gold); }
.timeline li.pending .tl-dot { background: #c5ccc7; }

/* Auth */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--pondok-green-900), var(--pondok-green-700));
    background-attachment: fixed;
    padding: 1.5rem;
}
.auth-card { width: 100%; max-width: 430px; border-radius: 18px; }
.auth-brand-icon {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto;
    background: linear-gradient(135deg, var(--pondok-gold), var(--pondok-gold-light));
    color: var(--pondok-green-900); display: grid; place-items: center; font-size: 2rem;
}

.form-label { font-weight: 500; font-size: .9rem; }
.required:after { content: " *"; color: #dc3545; }

.arabic { font-family: 'Traditional Arabic', 'Scheherazade New', serif; }
