/* Situs utama: web jualan, panel customer, admin. */
:root {
  --bg: #fbf8f3; --surface: #ffffff; --soft: #f4efe6; --text: #2b2620; --muted: #776d60; --line: #e7dfd2;
  --brand: #a8823f; --brand-2: #7d5f2a; --brand-soft: #f3e9d6; --ok: #2f7d55; --warn: #b26b00; --err: #b3372e;
  --radius: 14px; --shadow: 0 1px 2px rgba(40,30,15,.06), 0 6px 24px rgba(40,30,15,.06);
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-2); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font: 600 2.4rem/1.15 var(--serif); } h2 { font: 600 1.9rem/1.2 var(--serif); } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.inline { display: inline; margin: 0; }

/* header & footer */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 60px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.brand b { color: var(--brand); font-weight: 600; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .linkbtn { padding: 7px 11px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; }
.topnav a:hover, .linkbtn:hover { background: var(--soft); }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; font-size: .9rem; }
.sitefoot { margin-top: auto; padding: 28px 20px; text-align: center; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.sitefoot a { color: inherit; }
.main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 20px 48px; }
.flash { max-width: 1120px; margin: 16px auto 0; padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); width: calc(100% - 40px); }
.flash.ok { background: color-mix(in srgb, var(--ok) 12%, #fff); } .flash.err { background: color-mix(in srgb, var(--err) 10%, #fff); color: var(--err); }

/* tombol & form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: 600 .92rem var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--brand-2); } .btn-ghost:hover { background: var(--brand-soft); color: var(--brand-2); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: 1rem; }
.btn-danger { background: var(--err); border-color: var(--err); } .btn-danger:hover { background: #8f2a22; }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field > label { font-size: .85rem; font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea { width: 100%; font: 15px var(--sans); color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.err-text { color: var(--err); font-size: .9rem; } .ok-text { color: var(--ok); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--muted); }
.badge.active { background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok); }
.badge.pending_payment, .badge.pending { background: color-mix(in srgb, var(--warn) 14%, #fff); color: var(--warn); }
.badge.expired, .badge.cancelled { background: #eee; color: #777; }
.badge.paid { background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--soft); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stack > * + * { margin-top: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar h1 { margin: 0; }

/* halaman masuk/daftar */
.authbox { max-width: 420px; margin: 4vh auto; }
.authbox h1 { text-align: center; }

/* halaman error */
.errpage main { max-width: 480px; margin: 15vh auto; padding: 0 16px; text-align: center; }
.errpage { background: #fbf7ef; color: #3d3428; font-family: Georgia, serif; }
.errpage h1 { font-weight: 400; } .errpage-mark { font-size: 2.4rem; color: #b08d4a; margin: 0; }
.errpage .small { font-size: .85rem; color: #7d705e; margin-top: 28px; }
.errpage a { color: #8a6a2f; }

@media (max-width: 640px) {
  h1 { font-size: 2rem; } .row2, .row3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; } .main { padding: 20px 16px 40px; } .brand span:last-child { display: none; }
  .topnav a, .linkbtn { padding: 6px 8px; font-size: .85rem; }
}

/* panel customer */
.invrow { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.invname { font: 600 1.3rem var(--serif); }
.invact { display: flex; gap: 8px; flex-wrap: wrap; }
.tplpick .tplcard { position: relative; cursor: pointer; }
.tplpick input { position: absolute; opacity: 0; }
.tplpick .tplimg { border-color: var(--line); }
.tplpick input:checked + .tplimg { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent); }
.tplpick input:focus-visible + .tplimg { outline: 3px solid var(--brand-2); }
.tplpick h3 { margin-bottom: 0; }
.paybox { background: var(--soft); border-radius: 12px; padding: 14px 16px; }
.paybox p { margin: 0; } .paynum { font: 700 1.4rem var(--sans); letter-spacing: .04em; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks .ok { color: var(--ok); } .checks .no { color: var(--err); }
.legal { max-width: 780px; margin: 0 auto; }
.legal h2 { font: 600 1.3rem var(--sans); margin: 26px 0 8px; }
.legal li { margin-bottom: 6px; }
