/* ============================================================
   DESAIN: Lazpersis KLP Kawalu — Distribusi Zakat
   Palet diambil langsung dari warna logo (hijau & emas).
   Fraunces (judul) dipadu Plus Jakarta Sans (isi) — keduanya
   dipilih agar terasa hangat & terpercaya, bukan default generik.
   Motif garis-gigi (dogtooth) emas dipakai SEKALI sebagai aksen
   khas di bawah header, terinspirasi ornamen geometris.
   ============================================================ */

:root {
  --forest: #0b4f30;
  --leaf: #009348;
  --leaf-dark: #007038;
  --gold: #e7a400;
  --gold-soft: #fbead0;
  --paper: #f6f5ee;
  --card: #ffffff;
  --ink: #1b241d;
  --muted: #67766c;
  --border: #dee3d8;
  --error: #b3261e;
  --error-bg: #fbeae8;
  --success: #106b3f;
  --success-bg: #e7f5ec;

  /* alias lama supaya kompatibel */
  --green: var(--leaf);
  --green-dark: var(--forest);
  --bg: var(--paper);
  --text: var(--ink);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 2.5px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--forest);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Motif garis-gigi emas — satu-satunya elemen dekoratif khas di seluruh app */
.pattern-strip {
  height: 7px;
  background-image:
    linear-gradient(45deg, var(--gold) 25%, transparent 25.5%),
    linear-gradient(-45deg, var(--gold) 25%, transparent 25.5%);
  background-size: 14px 14px;
  opacity: 0.9;
}

.brand { display: inline-flex; align-items: center; }
.brand-logo {
  height: 36px;
  background: #fff;
  padding: 4px 10px;
  border-radius: 7px;
  display: block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.login-logo {
  display: block;
  max-height: 64px;
  margin: 0 auto 16px;
}
.nav { display: flex; align-items: center; gap: 16px; font-size: 0.88rem; flex-wrap: wrap; }
.nav a { color: #fff; text-decoration: none; opacity: 0.88; font-weight: 500; transition: opacity 0.15s; }
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.who { opacity: 0.8; font-size: 0.82rem; }

/* ---------- Layout ---------- */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(11, 79, 48, 0.06), 0 8px 24px rgba(11, 79, 48, 0.04);
}

.login-card { max-width: 380px; margin: 48px auto; text-align: center; }
.login-card form { text-align: left; }

h1 { font-size: 1.55rem; font-weight: 600; margin: 0 0 6px; color: var(--forest); }
.muted { color: var(--muted); font-size: 0.92rem; }

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin: 16px 0 6px;
  color: var(--ink);
}

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=file], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
textarea { resize: vertical; }

.row-2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--leaf); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset; }
.btn-primary:hover { background: var(--leaf-dark); }
.btn-secondary { background: #fff; border: 1.5px solid var(--leaf); color: var(--leaf); }
.btn-secondary:hover { background: var(--success-bg); }
.btn-small { padding: 6px 12px; font-size: 0.8rem; background: var(--paper); color: var(--ink); border: 1px solid var(--border); }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-link { background: none; color: var(--muted); padding: 10px; }
.btn-block { width: 100%; margin-top: 20px; }

/* ---------- Alerts & hints ---------- */
.alert { padding: 13px 15px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-error { background: var(--error-bg); color: var(--error); border-color: #f3cfcb; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #c9e8d5; }

.hint { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.stat-row { display: flex; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.stat {
  background: linear-gradient(155deg, var(--success-bg), #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 160px;
}
.stat-num { display: block; font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 600; color: var(--forest); }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.filter-form > div { flex: 1; min-width: 140px; }
.filter-form label { margin-top: 0; }
.filter-actions { display: flex; gap: 8px; }

.table-wrap { overflow-x: auto; }
.bulk-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger:disabled:hover { background: var(--error-bg); color: var(--error); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-mustahik { table-layout: fixed; width: 100%; }
.table-mustahik th, .table-mustahik td { white-space: normal; word-break: break-word; vertical-align: top; }
.table-dashboard { table-layout: fixed; width: 100%; }
.table-dashboard th, .table-dashboard td { white-space: normal; word-break: break-word; vertical-align: middle; }
.table-dashboard td:first-child, .table-dashboard th:first-child,
.table-dashboard td:nth-child(2) { text-align: center; }
.table-dashboard .thumb { width: 42px; height: 42px; }
.aksi-cell { display: flex; flex-direction: column; gap: 6px; }
.aksi-cell .btn { width: 100%; text-align: center; }
.table td form { margin-left: 6px; }
.table th {
  color: var(--forest);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gold);
}
.table tbody tr:hover { background: var(--paper); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.back-link { color: var(--leaf); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

.detail-photo { width: 100%; max-width: 500px; border-radius: 12px; margin: 14px 0; display: block; box-shadow: 0 4px 16px rgba(11,79,48,0.12); }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th { text-align: left; padding: 9px 10px 9px 0; width: 160px; color: var(--muted); font-size: 0.85rem; vertical-align: top; font-weight: 600; }
.detail-table td { padding: 9px 0; }

.badge-ok { color: var(--success); background: var(--success-bg); padding: 3px 9px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-off { color: var(--error); background: var(--error-bg); padding: 3px 9px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }

.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px; }

/* ---------- Landing Page ---------- */
.landing-hero { text-align: center; padding: 44px 32px; max-width: 640px; margin: 24px auto 0; }
.landing-logo { max-height: 76px; margin: 0 auto 22px; display: block; }
.landing-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.25;
  margin: 0 0 16px;
}
.landing-sub { color: var(--muted); font-size: 0.98rem; line-height: 1.6; max-width: 480px; margin: 0 auto 28px; }
.landing-cta { padding: 13px 34px; font-size: 0.98rem; }

.landing-features {
  display: flex;
  gap: 16px;
  max-width: 700px;
  margin: 20px auto 0;
  flex-wrap: wrap;
  justify-content: center;
}
.landing-feature { flex: 1; min-width: 180px; text-align: center; padding: 22px 16px; }
.landing-feature-icon { font-size: 1.8rem; margin-bottom: 8px; }
.landing-feature .stat-label { display: block; margin-top: 4px; }

.landing-footnote { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 28px 0 0; }

@media (max-width: 560px) {
  .landing-hero { padding: 32px 20px; }
  .landing-title { font-size: 1.5rem; }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 32px 26px 26px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(11,20,15,0.28);
}
@media (prefers-reduced-motion: no-preference) {
  .modal-box { animation: modalPop 0.18s ease-out; }
}
@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 2.8rem; line-height: 1; margin-bottom: 12px; }
.modal-text { font-size: 1rem; margin: 0 0 20px; color: var(--ink); }
.modal-success .modal-text { color: var(--success); font-weight: 600; }
.modal-error .modal-text { color: var(--error); font-weight: 600; }
