/* ============ TagihanNet — tema "buku kas" ============ */
:root {
  --paper: #f5f1e6;
  --card: #fffdf6;
  --ink: #22322c;
  --ink-soft: #5b6a63;
  --line: #ddd3bb;
  --line-soft: #eae2cf;
  --pine: #11614f;
  --pine-dark: #0b463a;
  --pine-ghost: #e3efe9;
  --amber: #b45309;
  --amber-bg: #fdf0d7;
  --green: #187a44;
  --green-bg: #ddf3e4;
  --red: #b3261e;
  --red-bg: #fbe4e2;
  --radius: 10px;
  --font-d: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --font-b: "Atkinson Hyperlegible", Verdana, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-b);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(17, 97, 79, .045) 31px 32px),
    radial-gradient(1200px 500px at 15% -10%, #fbf8ef 0%, var(--paper) 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
main.wrap { flex: 1; padding: 26px 0 44px; }

h1, h2, h3 { font-family: var(--font-d); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
.sub { color: var(--ink-soft); margin: 0 0 22px; }
a { color: var(--pine); }

/* ---------- topbar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--pine-dark), #093a30);
  color: #f2ede0;
  border-bottom: 3px solid #d9a441;
}
.topbar-in { display: flex; align-items: center; gap: 20px; padding: 12px 0; }
.menu { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 0; }
.menu-head { display: none; }
.burger { display: none; }
.menu-close { display: none; }
.brand {
  font-family: var(--font-d); font-weight: 800; font-size: 21px;
  color: #fdfaf1; text-decoration: none; display: flex; align-items: center; gap: 9px;
  letter-spacing: -.01em;
}
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: #d9a441; box-shadow: 0 0 0 4px rgba(217,164,65,.25); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #cfdcd4; text-decoration: none; padding: 8px 13px; border-radius: 8px;
  font-weight: 700; font-size: 14.5px;
}
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav a.on { background: rgba(217,164,65,.18); color: #f5d9a0; }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.me a { color: #e8e2d1; text-decoration: none; }
.me small { color: #a8bcb2; }
.btn-out {
  border: 1px solid rgba(255,255,255,.35); padding: 6px 13px; border-radius: 8px; font-weight: 700;
}
.btn-out:hover { background: rgba(255,255,255,.12); }

/* ---------- kartu & panel ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: 0 1px 0 rgba(34,50,44,.05);
}
.grid-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { position: relative; overflow: hidden; }
.stat .lbl { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.stat .num { font-family: var(--font-d); font-size: 30px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .den { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.stat.tone-green { border-left: 5px solid var(--green); }
.stat.tone-amber { border-left: 5px solid var(--amber); }
.stat.tone-pine  { border-left: 5px solid var(--pine); }

.progress { height: 9px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--pine), var(--green)); border-radius: 99px; }

/* ---------- tabel ---------- */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
th {
  font-family: var(--font-d); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); background: #f8f4e9; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
tbody tr:hover { background: #fbf7ec; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-soft); font-size: 13px; }

/* ---------- badge status ---------- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12.5px;
  font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.b-lunas { background: var(--green-bg); color: var(--green); border: 1px solid #b3dfc2; }
.b-belum { background: var(--amber-bg); color: var(--amber); border: 1px solid #ecd39e; }
.b-off { background: #eceae2; color: var(--ink-soft); border: 1px solid var(--line); }

/* ---------- form & tombol ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=month], input[type=tel], select, textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(17,97,79,.35); border-color: var(--pine); }
.field { margin-bottom: 15px; }
.btn {
  display: inline-block; background: var(--pine); color: #fdfaf1; border: 0; cursor: pointer;
  font: 700 14.5px var(--font-b); padding: 10px 18px; border-radius: 8px; text-decoration: none;
}
.btn:hover { background: var(--pine-dark); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--pine); }
.btn-ghost:hover { background: var(--pine-ghost); }
.btn-warn { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn-warn:hover { background: var(--red-bg); }
.btn-pay { background: var(--green); }
.btn-pay:hover { background: #10603a; }

/* filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filters .field { margin: 0; }
.filters .field.grow { flex: 1; min-width: 180px; }
.filters select, .filters input { width: auto; min-width: 130px; }
.filters .field.grow input { width: 100%; }

/* ---------- popup detail tagihan ---------- */
table[data-rowmodal] tbody tr[data-search] { cursor: pointer; }
.modal-scrim {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 30, 25, .55); padding: 18px;
  align-items: center; justify-content: center;
}
.modal-scrim.show { display: flex; }
.modal {
  position: relative; width: min(400px, 100%);
  background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--pine);
  border-radius: 14px; padding: 24px 22px 22px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 8px; right: 12px; background: none; border: 0;
  font-size: 30px; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 4px;
}
.modal-name { font-family: var(--font-d); font-weight: 800; font-size: 22px; letter-spacing: -.015em; padding-right: 28px; }
.modal-sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.modal-nominal { font-family: var(--font-d); font-weight: 800; font-size: 30px; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.modal-status { margin-bottom: 18px; font-size: 14px; }
.modal-aksi { width: 100%; padding: 13px; font-size: 16px; }

/* ---------- pagination ---------- */
.pg-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 14px; font-size: 14px;
}
#pager { display: flex; gap: 5px; }
.pg-btn {
  min-width: 38px; height: 38px; padding: 0 10px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 8px;
  font: 700 14px var(--font-b); color: var(--ink); font-variant-numeric: tabular-nums;
}
.pg-btn:hover:not(:disabled):not(.on) { border-color: var(--pine); color: var(--pine); }
.pg-btn.on { background: var(--pine); border-color: var(--pine); color: #fdfaf1; cursor: default; }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-weight: 700; }
.flash-ok { background: var(--green-bg); color: var(--green); border: 1px solid #b3dfc2; }
.flash-err { background: var(--red-bg); color: var(--red); border: 1px solid #eebbb7; }

/* ---------- halaman login ---------- */
.login-body { justify-content: center; align-items: center; display: flex; }
.login-card {
  width: min(400px, calc(100% - 36px)); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 32px 30px; box-shadow: 0 18px 50px -18px rgba(11,70,58,.35);
  border-top: 5px solid var(--pine);
}
.login-brand { font-family: var(--font-d); font-weight: 800; font-size: 32px; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; }
.login-brand .brand-dot { width: 14px; height: 14px; }
.login-sub { color: var(--ink-soft); margin: 4px 0 24px; }

/* header halaman + aksi kanan */
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.pagehead .sub { margin: 0; }

.foot { border-top: 1px solid var(--line); padding: 14px 0; color: var(--ink-soft); font-size: 13px; }

.inline-form { display: inline; }
.actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ---------- sidebar HP (hamburger) ---------- */
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(15, 30, 25, .55);
  z-index: 40; opacity: 0; transition: opacity .2s;
}
.scrim.show { display: block; opacity: 1; }

@media (max-width: 760px) {
  .topbar-in { justify-content: space-between; gap: 10px; }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 44px; padding: 10px 11px; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.25); border-radius: 9px; cursor: pointer;
  }
  .burger span { display: block; height: 2.5px; border-radius: 2px; background: #f2ede0; }
  .menu {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: min(290px, 84vw);
    flex-direction: column; align-items: stretch; gap: 0;
    background: linear-gradient(180deg, var(--pine-dark), #082e26);
    border-right: 3px solid #d9a441;
    padding: 0 0 18px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 40px -18px rgba(0,0,0,.6);
    overflow-y: auto;
  }
  .menu.open { transform: translateX(0); }
  .menu-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.14); margin-bottom: 8px;
  }
  .menu-close {
    display: block; background: none; border: 0; color: #cfdcd4; font-size: 30px;
    line-height: 1; cursor: pointer; padding: 2px 8px;
  }
  .nav { flex-direction: column; gap: 2px; padding: 0 10px; }
  .nav a { padding: 13px 14px; font-size: 16px; border-radius: 9px; }
  .me {
    margin: auto 10px 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14);
    flex-direction: column; align-items: stretch; gap: 10px; text-align: left;
  }
  .me a { padding: 6px 14px; }
  .btn-out { text-align: center; padding: 11px; }
}

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .stat .num { font-size: 24px; }
  .btn, .btn-sm { min-height: 40px; }
}
