/* =====================================================================
   GOLDEN WAKAF — style.css
   Theme: luxury gold-on-charcoal, derived from the brand mark.
   Mobile-first, responsive. No external dependencies (CSP-safe).
   ===================================================================== */

:root {
    --bg:          #0d0d0f;
    --bg-2:        #15151a;
    --panel:       #1b1b22;
    --panel-2:     #20202a;
    --line:        #2c2c38;
    --line-gold:   rgba(200,169,81,.32);
    --gold:        #c8a951;
    --gold-bright: #e7cd86;
    --gold-deep:   #9c7e32;
    --text:        #ece6d7;
    --text-dim:    #9d978a;
    --text-faint:  #6c6860;
    --danger:      #d9534f;
    --ok:          #5fae74;
    --warn:        #d9a441;
    --radius:      12px;
    --radius-sm:   8px;
    --shadow:      0 10px 40px rgba(0,0,0,.45);
    --grad-gold:   linear-gradient(135deg,#e7cd86 0%,#c8a951 45%,#9c7e32 100%);
    --sans:        system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    --serif:       "Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--gold); }

h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; margin: 0 0 .4em; }

/* ---- Brand wordmark ------------------------------------------------ */
.brand-mark {
    background: var(--grad-gold);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    font-family: var(--serif);
    letter-spacing: 2px;
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(200,169,81,.10), transparent 60%),
        var(--bg);
}
.login-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(180deg,var(--panel) 0%,var(--bg-2) 100%);
    border: 1px solid var(--line-gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 38px 34px 30px;
    text-align: center;
}
.login-card .logo { width: 110px; height: auto; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 1.45rem; margin-bottom: 2px; }
.login-card .sub { color: var(--text-dim); font-size: .9rem; margin-bottom: 26px; }

/* =====================================================================
   FORMS
   ===================================================================== */
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .3px; }
.input, select.input, textarea.input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 13px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, select.input:focus, textarea.input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200,169,81,.15);
}
.input::placeholder { color: var(--text-faint); }

/* ---- Buttons ------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 500; cursor: pointer;
    font-family: inherit;
    transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--line-gold); }
.btn:active { transform: translateY(1px); }
.btn-gold {
    background: var(--grad-gold);
    color: #1a1407; border: none; font-weight: 600;
    letter-spacing: .3px;
}
.btn-gold:hover { filter: brightness(1.07); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-danger { color: #f3b6b4; border-color: rgba(217,83,79,.4); }
.btn-danger:hover { background: rgba(217,83,79,.12); }

/* =====================================================================
   APP SHELL
   ===================================================================== */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
    background: linear-gradient(180deg,#121217 0%,#0c0c0f 100%);
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo-row { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.sidebar .logo-row img { width: 40px; height: 40px; }
.sidebar .logo-row .name { font-family: var(--serif); font-size: 1.05rem; line-height: 1.1; }
.sidebar .logo-row .name small { display: block; font-size: .62rem; color: var(--text-faint); letter-spacing: 1.5px; font-family: var(--sans); }

.nav-group { margin-top: 14px; }
.nav-group .label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-faint); padding: 0 10px 6px; }
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: .9rem; margin-bottom: 2px;
    border: 1px solid transparent;
    transition: background .12s, color .12s;
}
.nav a .ic { width: 18px; text-align: center; opacity: .85; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active {
    color: var(--gold-bright);
    background: linear-gradient(90deg, rgba(200,169,81,.14), transparent);
    border-color: var(--line-gold);
}

/* ---- Topbar -------------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 22px;
    background: rgba(20,20,26,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar .hamburger { display: none; background: none; border: none; color: var(--gold); font-size: 1.4rem; cursor: pointer; }
.topbar .page-title { font-family: var(--serif); font-size: 1.15rem; flex: 1; }
.topbar .tz { font-size: .76rem; color: var(--text-faint); padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; }

.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
    font-size: .78rem; padding: 4px 9px; border-radius: 6px;
    color: var(--text-dim); border: 1px solid var(--line);
}
.lang-switch a.active { color: #1a1407; background: var(--grad-gold); border-color: transparent; font-weight: 600; }

.user-chip { display: flex; align-items: center; gap: 9px; position: relative; }
.user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--grad-gold); color: #1a1407;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.user-chip .who { font-size: .82rem; line-height: 1.1; }
.user-chip .who small { color: var(--text-faint); display: block; font-size: .7rem; }

/* ---- Content ------------------------------------------------------- */
.content { padding: 24px 22px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .desc { color: var(--text-dim); font-size: .88rem; }

/* ---- Cards & stats ------------------------------------------------- */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4,1fr); }
.grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.grid.cols-2 { grid-template-columns: repeat(2,1fr); }

.stat { position: relative; overflow: hidden; }
.stat .ic { font-size: 1.3rem; opacity: .5; position: absolute; top: 16px; right: 18px; }
.stat .num { font-family: var(--serif); font-size: 1.9rem; color: var(--gold-bright); line-height: 1; margin: 8px 0 4px; }
.stat .lbl { color: var(--text-dim); font-size: .82rem; }

/* ---- Tables -------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
    text-align: left; background: var(--bg-2);
    color: var(--text-dim); font-weight: 600;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
    white-space: nowrap; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Badges -------------------------------------------------------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .72rem; font-weight: 600; letter-spacing: .3px;
    border: 1px solid var(--line);
}
.badge.ok    { color: var(--ok);    border-color: rgba(95,174,116,.4);  background: rgba(95,174,116,.08); }
.badge.warn  { color: var(--warn);  border-color: rgba(217,164,65,.4);  background: rgba(217,164,65,.08); }
.badge.dim   { color: var(--text-dim); }
.badge.gold  { color: var(--gold-bright); border-color: var(--line-gold); background: rgba(200,169,81,.08); }
.badge.action-CREATE { color: var(--ok); border-color: rgba(95,174,116,.4); }
.badge.action-UPDATE { color: var(--warn); border-color: rgba(217,164,65,.4); }
.badge.action-DELETE { color: #f3b6b4; border-color: rgba(217,83,79,.4); }
.badge.action-LOGIN  { color: var(--gold-bright); border-color: var(--line-gold); }
.badge.action-LOGOUT { color: var(--text-dim); }
.badge.action-LOGIN_FAIL { color: #f3b6b4; border-color: rgba(217,83,79,.4); }
.badge.action-APPROVE { color: var(--gold-bright); border-color: var(--line-gold); }

/* ---- Alerts -------------------------------------------------------- */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 16px; border: 1px solid; }
.alert.err { color: #f3b6b4; border-color: rgba(217,83,79,.4); background: rgba(217,83,79,.08); }
.alert.ok  { color: var(--ok); border-color: rgba(95,174,116,.4); background: rgba(95,174,116,.08); }
.hidden { display: none !important; }

/* ---- Modal --------------------------------------------------------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: none; place-items: center; z-index: 100; padding: 20px;
    backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: grid; }
.modal {
    width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--line-gold);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 24px;
}
.modal h3 { font-size: 1.2rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---- Misc helpers -------------------------------------------------- */
.muted { color: var(--text-dim); }
.right { text-align: right; }
.mono { font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace; font-size: .82rem; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.divider-gold { height: 1px; background: var(--grad-gold); opacity: .5; border: none; margin: 14px 0; }
.json-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; font-size: .76rem; white-space: pre-wrap; word-break: break-word; max-width: 360px; max-height: 160px; overflow: auto; }

/* ---- Mobile drawer ------------------------------------------------- */
.drawer-overlay { display: none; }
@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
        width: 250px; transform: translateX(-105%);
        transition: transform .22s ease; height: 100vh;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .topbar .hamburger { display: block; }
    .drawer-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
    .grid.cols-4 { grid-template-columns: repeat(2,1fr); }
    .grid.cols-3 { grid-template-columns: 1fr; }
    .grid.cols-2 { grid-template-columns: 1fr; }
    .topbar .tz { display: none; }
    .user-chip .who { display: none; }
    .content { padding: 18px 14px 60px; }
}
@media (max-width: 480px) {
    .grid.cols-4 { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 1.25rem; }
}

/* ---- Native date/time picker styling (uses browser pop-up) -------- */
input[type="date"], input[type="time"], input[type="datetime-local"] {
    color-scheme: dark;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.7) sepia(1) saturate(3) hue-rotate(5deg); cursor: pointer; }

/* ---- Custom date/time pop-ups (datepicker.js) --------------------- */
.gw-cal, .gw-time-pop {
    background: var(--panel); border: 1px solid var(--line-gold);
    border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px;
}
.gw-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gw-cal-head span { font-family: var(--serif); font-size: .92rem; color: var(--gold-bright); }
.gw-cal-head button { background: none; border: 1px solid var(--line); color: var(--gold); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.gw-cal-head button:hover { border-color: var(--line-gold); }
.gw-cal-grid { display: grid; grid-template-columns: repeat(7,32px); gap: 2px; }
.gw-dow { text-align: center; font-size: .68rem; color: var(--text-faint); padding: 2px 0; }
.gw-day { width: 32px; height: 30px; background: none; border: 1px solid transparent; color: var(--text); border-radius: 6px; cursor: pointer; font-size: .82rem; }
.gw-day:hover { background: var(--panel-2); border-color: var(--line); }
.gw-day.today { border-color: var(--line-gold); }
.gw-day.sel { background: var(--grad-gold); color: #1a1407; font-weight: 700; }
.gw-time-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.gw-time-row select { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 1rem; }
.gw-time-ok { width: 100%; background: var(--grad-gold); color: #1a1407; border: none; padding: 7px; border-radius: 6px; font-weight: 600; cursor: pointer; }

/* ---- Toasts -------------------------------------------------------- */
.gw-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--panel); border: 1px solid var(--line-gold);
    color: var(--text); padding: 12px 20px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); font-size: .88rem; z-index: 300; opacity: 0;
    transition: opacity .25s, transform .25s; max-width: 90vw;
}
.gw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gw-toast.err { border-color: rgba(217,83,79,.5); color: #f3b6b4; }

/* ===================================================================
   Phase 1 — additional component styles (sites, config, nazhir, audit)
   =================================================================== */

/* Badge: error/danger variant */
.badge.err { color: #f3b6b4; border-color: rgba(217,83,79,.4); background: rgba(217,83,79,.08); }

/* Two-column form grid (collapses on mobile) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Section separator inside modals */
.section-sep {
    margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line);
    color: var(--gold-bright); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
}

/* Inline text helpers */
.gold-text { color: var(--gold-bright); }
.warn-text { color: var(--warn); }

/* Larger modal (audit detail) */
.modal.modal-lg { max-width: 720px; width: 92vw; }

/* Filter bar (audit) */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; }

/* Diff grid (audit detail old/new) */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .diff-grid { grid-template-columns: 1fr; } }
.diff-label { font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
              color: var(--text-dim); margin-bottom: 6px; }
.json-box {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px; font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
    font-size: .78rem; color: var(--text); white-space: pre-wrap; word-break: break-word;
    max-height: 320px; overflow: auto; margin: 0;
}

/* Nazhir cards */
.nazhir-card {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
    margin-bottom: 14px; background: var(--panel-2);
}
.nazhir-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.nazhir-toggle { margin-top: 10px; }

/* Toggle switch (checkbox label) */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-dim); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--gold); }

/* ===================================================================
   PHASE 2 — Campaigns: cards, public portal, detail, charts, editor
   =================================================================== */

/* ---------- Shared campaign card (white card; used in admin preview + public) ---------- */
.cmp-card {
    display: block; width: 268px; min-width: 268px; background: #fff; border-radius: 14px;
    overflow: hidden; text-decoration: none; color: #1d2530;
    box-shadow: 0 6px 22px rgba(20,30,25,.10); border: 1px solid #e7ebe8;
    transition: transform .15s, box-shadow .15s;
}
.cmp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,30,25,.16); }
.cmp-thumb {
    height: 150px; background-size: cover; background-position: center; position: relative;
    background-color: #14493a;
}
.cmp-thumb-ph { display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#1c3a2e,#0e2b22); }
.cmp-ph-mark { color: var(--gold-bright); font-family: Georgia, serif; letter-spacing: 2px; font-size: 16px; opacity:.85; }
.cmp-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.45);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.cmp-body { padding: 12px 14px 14px; }
.cmp-loc { font-size: 12px; color: #6b7a72; margin-bottom: 8px; }
.cmp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cmp-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; color: #fff; }
.tag-wakaf    { background: #2f6bd8; }
.tag-abadi    { background: #2f6bd8; }
.tag-temporer { background: #1f9d57; }
.cmp-title {
    font-weight: 700; font-size: 15px; line-height: 1.3; color: #1d2530; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 39px;
}
.cmp-org { font-size: 12.5px; color: #8a97a0; margin-bottom: 10px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis; }
.cmp-verified { color: #2f6bd8; font-size: 11px; }
.cmp-bar { height: 6px; border-radius: 6px; background: #e6ece8; overflow: hidden; margin-bottom: 8px; }
.cmp-bar > span { display: block; height: 100%; border-radius: 6px;
    background: linear-gradient(90deg,#27b365,#1f9d57); }
.cmp-amount { color: #1f9d57; font-weight: 800; font-size: 17px; }
.cmp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.cmp-foot-label { font-size: 12px; color: #8a97a0; }
.cmp-pct { font-size: 12px; color: #1f9d57; font-weight: 700; }
.cmp-infinity { font-size: 20px; color: #c8a951; line-height: 1; }

/* ---------- Admin: list mini-thumb + editor ---------- */
.cmp-mini { width: 54px; height: 40px; border-radius: 6px; background-size: cover; background-position: center; background-color:#14493a; }
.cmp-mini-ph { display:flex; align-items:center; justify-content:center; color:var(--gold-bright);
    background:linear-gradient(135deg,#1c3a2e,#0e2b22); font-size:14px; }
.editor-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.preview-label { font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; color:var(--text-dim); margin-bottom:10px; }
.editor-grid textarea.input { resize: vertical; font-family: inherit; }

/* ---------- Public portal chrome (light theme) ---------- */
body.pub { background: #f4f6f5; color: #1d2530; display: block; }
.pub-top { position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg,#16493a,#0e2b22);
    border-bottom: 2px solid var(--line-gold); }
.pub-top-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; }
.pub-back { color: #fff; text-decoration: none; font-size: 20px; line-height: 1; }
.pub-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.pub-brand img { width: 34px; height: 34px; object-fit: contain; }
.pub-lang { margin-left: auto; display: flex; gap: 4px; }
.pub-lang a { color: #cfe6dd; text-decoration: none; font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.pub-lang a.active { background: var(--gold); color: #1a1a1a; font-weight: 700; }
.pub-main { max-width: 1100px; margin: 0 auto; padding: 18px; }
.pub-foot { max-width: 1100px; margin: 24px auto; padding: 18px; color: #8a97a0; font-size: 13px; text-align: center; }
.pub-hero { padding: 20px 4px 6px; }
.pub-hero h1 { margin: 0 0 6px; font-size: 24px; color: #14322a; }
.pub-hero p { margin: 0; color: #5e6e66; }
.pub-section { margin-top: 26px; }
.pub-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pub-section-head h2 { font-size: 18px; margin: 0; color: #14322a; }
.pub-section-sub { font-size: 13px; color: #7c8a82; margin-top: 2px; }
.cmp-scroller { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.cmp-scroller .cmp-card { scroll-snap-align: start; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px,1fr)); gap: 16px; }
.cmp-grid .cmp-card { width: auto; min-width: 0; }

/* Public uses white panels for .card */
body.pub .card { background: #fff; border: 1px solid #e7ebe8; color: #1d2530; box-shadow: 0 4px 16px rgba(20,30,25,.06); }
body.pub .muted { color: #8a97a0; }

.pub-cat-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.pub-cat-head h1 { font-size: 22px; margin: 0; color: #14322a; }
.pub-sort { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.pub-sort a { text-decoration: none; color: #5e6e66; padding: 5px 12px; border-radius: 20px; background: #fff; border: 1px solid #e0e6e2; }
.pub-sort a.active { background: var(--gold); color: #1a1a1a; font-weight: 700; border-color: var(--gold); }

/* ---------- Campaign detail ---------- */
.cmp-detail { max-width: 980px; margin: 0 auto; }
.cmp-detail-media { border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.cmp-detail-cover { width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; background-color:#14493a; }
.cmp-video { position: relative; width: 100%; aspect-ratio: 16/9; }
.cmp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cmp-detail-head h1 { font-size: 24px; margin: 8px 0; color: #14322a; }
.cmp-org-line { color: #5e6e66; font-weight: 600; margin-top: 4px; }
.cmp-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 18px; align-items: start; }
@media (max-width: 860px) { .cmp-detail-grid { grid-template-columns: 1fr; } }
.cmp-summary { font-size: 16px; font-weight: 600; color: #2a3b33; }
.cmp-narrative { line-height: 1.7; color: #3a4a42; margin-top: 10px; white-space: normal; }
.cmp-detail-side .card { margin-bottom: 16px; }
.cmp-stats .cmp-stat-amount { font-size: 26px; font-weight: 800; color: #1f9d57; }
.cmp-stat-label { color: #8a97a0; font-size: 13px; margin-bottom: 12px; }
.cmp-stats .cmp-bar { height: 10px; margin: 6px 0 12px; }
.cmp-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.cmp-stat-mini { display: flex; gap: 18px; margin: 16px 0; border-top: 1px solid #eef2ef; padding-top: 14px; }
.cmp-stat-mini .k { font-size: 12px; color: #8a97a0; }
.cmp-stat-mini .v { font-weight: 700; color: #2a3b33; }
.cmp-donate { width: 100%; font-size: 16px; padding: 12px; }
.cmp-infinity-lg { font-size: 26px; color: #c8a951; }
.cmp-chart-title { font-weight: 700; color: #2a3b33; margin-bottom: 12px; }
.cmp-chart { display: flex; justify-content: center; }
.chart-ring { display: block; margin: 0 auto; }

/* ===================================================================
   PHASE 3 — Donations: form, presets, methods, receipt, admin
   =================================================================== */
.donate-wrap { max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }
.donate-summary .cmp-bar { height: 8px; }
.donate-presets { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.preset-chip {
    border: 1.5px solid #d8e0db; background: #fff; color: #1f6b45; font-weight: 700;
    padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; transition: all .12s;
}
.preset-chip:hover { border-color: #1f9d57; }
.preset-chip.active { background: #1f9d57; color: #fff; border-color: #1f9d57; }
.pay-methods { display: grid; gap: 10px; margin-bottom: 16px; }
.pay-method {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid #e2e8e4;
    border-radius: 12px; cursor: pointer; background: #fff;
}
.pay-method input { margin-top: 3px; }
.pay-method:hover { border-color: var(--gold); }

.receipt { text-align: center; }
.receipt-check {
    width: 64px; height: 64px; border-radius: 50%; background: #1f9d57; color: #fff;
    font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.receipt h2 { margin: 6px 0; color: #14322a; }
.receipt-amount, .transfer-amount {
    font-size: 30px; font-weight: 800; color: #1f9d57; margin: 12px 0; text-align: center;
}
.transfer-amount { color: #14322a; }
.receipt-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.receipt-table td { padding: 9px 4px; border-bottom: 1px solid #eef2ef; font-size: 14px; text-align: left; }
.receipt-table td:first-child { color: #8a97a0; width: 42%; }

/* admin total pill */
.stat-pill { background: var(--panel-2, #1b1b21); border: 1px solid var(--line, #2a2a31);
    padding: 8px 16px; border-radius: 20px; font-size: 13px; color: var(--text-dim); }
.stat-pill strong { color: var(--gold-bright); }

/* ===================================================================
   PHASE 4 — Dashboard financial widgets, top campaigns, reports
   =================================================================== */
.grid.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid.cols-2 { grid-template-columns: 1fr; } }
.stat-money { align-items: flex-start; text-align: left; }
.stat-money .lbl { font-size: 12px; color: var(--text-dim); }
.num-money { font-size: 22px; font-weight: 800; color: #36c06f; margin: 4px 0; letter-spacing: -.5px; }
.num-money.gold { color: var(--gold-bright); }
.top-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line, #2a2a31); }
.top-row:last-child { border-bottom: 0; }
.top-label { font-size: 13px; color: var(--text, #ddd); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.top-bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg,#e7cd86,#c8a951); }
.top-amt { font-size: 13px; font-weight: 700; color: #36c06f; }
.gold-text { color: var(--gold-bright); }
td.right, th.right { text-align: right; }

/* Public header login link */
.pub-login { color: #1a1a1a !important; background: var(--gold); font-weight: 700;
    padding: 4px 12px; border-radius: 6px; margin-left: 6px; }
.pub-login:hover { filter: brightness(1.06); }

/* =====================================================================
   PHASE 5 — Member, Beneficiary, Ledger & Certificate components
   ===================================================================== */

/* badge + button additions */
.badge.info { color: #2b6cb0; border-color: rgba(43,108,176,.4); background: rgba(43,108,176,.08); }
.btn-green {
    background: #1f8a4c; color: #fff; border: 1px solid #1f8a4c; font-weight: 700;
}
.btn-green:hover { filter: brightness(1.06); }

/* tabbar — works on dark admin and light public */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.tabbar .tab {
    background: none; border: none; cursor: pointer; color: inherit; opacity: .65;
    padding: 10px 14px; font-size: .92rem; border-bottom: 2px solid transparent;
}
.tabbar .tab.active { opacity: 1; border-bottom-color: var(--gold); font-weight: 600; }
.tabbar .tab .badge { margin-left: 6px; }

/* stat grid (shared) */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .stat-grid, .acct-stats { grid-template-columns: 1fr 1fr; } }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: .78rem; opacity: .7; }
.stat-value { font-family: var(--serif); font-size: 1.5rem; margin-top: 6px; }

/* ---- Public (light) pages ---- */
.pub .auth-wrap { max-width: 460px; margin: 18px auto; }
.pub .auth-card { padding: 22px; }
.pub .auth-alt { text-align: center; margin-top: 14px; font-size: .9rem; color: #5a6b62; }
.pub .btn-block { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.pub .chk { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 10px 0 16px; color: #2c3e36; }
.pub .chk input { width: auto; }

.pub .acct-wrap { max-width: 720px; margin: 16px auto; }
.pub .acct-hello { display: flex; align-items: center; gap: 12px; padding: 16px; }
.pub .acct-avatar {
    width: 46px; height: 46px; border-radius: 50%; background: #1f8a4c; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
}
.pub .acct-name { font-weight: 700; color: #14322a; }

/* ---- Certificate ---- */
.pub .cert-wrap { max-width: 640px; margin: 18px auto; }
.pub .cert-card { padding: 0; overflow: hidden; border: 2px solid var(--gold); }
.pub .cert-head {
    display: flex; align-items: center; gap: 12px; padding: 18px 22px;
    background: linear-gradient(120deg, #14322a, #1f8a4c);
}
.pub .cert-head img { width: 40px; height: 40px; }
.pub .cert-brand { color: #fff; font-weight: 800; letter-spacing: 1px; }
.pub .cert-sub { color: #d8e8df; font-size: .76rem; }
.pub .cert-body { text-align: center; padding: 26px 22px 10px; }
.pub .cert-line { color: #5a6b62; font-size: .9rem; }
.pub .cert-waqif { font-family: var(--serif); font-size: 1.7rem; color: #14322a; margin: 8px 0; }
.pub .cert-campaign { font-weight: 600; color: #1f8a4c; margin-top: 8px; }
.pub .cert-amount { font-family: var(--serif); font-size: 1.5rem; color: #14322a; margin: 10px 0; }
.pub .cert-meta { padding: 12px 22px; border-top: 1px solid #e6ece9; }
.pub .cert-meta > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: .85rem; }
.pub .cert-meta span { color: #7a8a82; }
.pub .cert-note { padding: 14px 22px; background: #f4f8f5; font-size: .8rem; color: #5a6b62; }
.pub .cert-actions { display: flex; gap: 10px; padding: 16px 22px; flex-wrap: wrap; }

.pub .verify-ok, .pub .verify-bad {
    display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius);
}
.pub .verify-ok  { background: #eef8f1; color: #14633a; border: 1px solid #bfe3cc; }
.pub .verify-bad { background: #fdeeee; color: #9b2c2c; border: 1px solid #f0c4c4; }

@media print {
    .pub-top, .pub-foot, .cert-actions { display: none !important; }
    .pub .cert-card { border-color: #14322a; }
}
.pub-foot-links { margin-bottom: 8px; font-size: .85rem; }
.pub-foot-links a { color: #2f7d52; }

/* Wakaf Temporer akad box */
.pub .akad-box {
    background: #f4f8f5; border: 1px solid #d9e6dd; border-radius: var(--radius);
    padding: 12px 14px; margin: 6px 0 10px; font-size: .82rem; color: #3a4a42;
}
.pub .akad-box strong { color: #14322a; }
.pub .akad-box p { margin: 6px 0 0; }

/* Fundraising — leaderboard (public light) */
.pub .lead-wrap { max-width: 640px; margin: 16px auto; }
.pub .lead-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pub .lead-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid #e6ece9; border-radius: var(--radius); background: #fff;
}
.pub .lead-row:hover { border-color: var(--gold); }
.pub .lead-rank {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-weight: 800;
    background: #eef2f0; color: #5a6b62;
}
.pub .lead-rank.rank-1 { background: linear-gradient(135deg,#f5d061,#caa53a); color: #4a3a00; }
.pub .lead-rank.rank-2 { background: linear-gradient(135deg,#dfe4e8,#b4bcc4); color: #34404a; }
.pub .lead-rank.rank-3 { background: linear-gradient(135deg,#e7c19b,#c79a6a); color: #4a3320; }
.pub .lead-main { flex: 1; min-width: 0; }
.pub .lead-name { font-weight: 700; color: #14322a; }
.pub .lead-sub { font-size: .8rem; color: #7a8a82; }
.pub .lead-amt { font-family: var(--serif); color: #1f8a4c; font-weight: 700; white-space: nowrap; }

/* Daftar Wakif — real-time donor feed (public light) */
.pub .wakif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pub .wakif-live { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: #1f8a4c; font-weight: 600; }
.pub .wakif-dot { width: 8px; height: 8px; border-radius: 50%; background: #1f8a4c; box-shadow: 0 0 0 0 rgba(31,138,76,.5); animation: wkpulse 1.8s infinite; }
@keyframes wkpulse { 0% { box-shadow: 0 0 0 0 rgba(31,138,76,.5); } 70% { box-shadow: 0 0 0 7px rgba(31,138,76,0); } 100% { box-shadow: 0 0 0 0 rgba(31,138,76,0); } }
.pub .wakif-feed { display: flex; flex-direction: column; }
.pub .wakif-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef2f0; animation: wkfade .4s ease; }
.pub .wakif-row:last-child { border-bottom: none; }
@keyframes wkfade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pub .wakif-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: #e7f0ea; color: #1f8a4c; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pub .wakif-main { flex: 1; min-width: 0; }
.pub .wakif-name { font-weight: 600; color: #14322a; font-size: .9rem; }
.pub .wakif-meta { font-size: .75rem; color: #8a9a92; }
.pub .wakif-amt { font-family: var(--serif); color: #1f8a4c; font-weight: 700; white-space: nowrap; font-size: .9rem; }
.pub .wakif-tag { display: inline-block; font-size: .65rem; font-weight: 700; color: #9c7e32; background: rgba(200,169,81,.16); border: 1px solid rgba(200,169,81,.4); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
