@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #faf6f1;
  --card: #ffffff;
  --ink: #2a1f22;
  --muted: #7a6a6e;
  --line: #eadfd8;
  --brand: #8e2c48;
  --brand-2: #b8506c;
  --brand-soft: #f6e7ec;
  --pria: #2f5d8a;
  --pria-soft: #e7eef6;
  --wanita: #a3365a;
  --wanita-soft: #f8e6ed;
  --ok: #2e7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 30, 40, .06), 0 4px 16px rgba(60, 30, 40, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, .brand { font-family: Fraunces, Georgia, serif; letter-spacing: -.01em; margin: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: rgba(250, 246, 241, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-size: 22px; color: var(--brand); text-decoration: none; }
.brand span { color: var(--ink); font-weight: 600; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.narrow { max-width: 640px; }
.wrap.wide { max-width: 1280px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: .15s;
}
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #7a2340; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: #b3261e; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }

label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
/* 16px supaya iPhone tidak auto-zoom saat input diketuk */
input, select, textarea { font-size: 16px !important; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 16px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* segmented choice */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  margin: 0; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 400; font-size: 13.5px;
}
.seg input:checked + label { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg input:focus-visible + label { outline: 2px solid var(--brand-2); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 20px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: calc(100vh - 140px); }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 440px; }
.points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.points li { display: flex; gap: 10px; align-items: flex-start; }
.points li::before { content: '♥'; color: var(--brand-2); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; } }

.tabs { display: flex; background: var(--bg); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13px; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--brand); }

/* ---------- profile form ---------- */
.foto-pick { display: flex; align-items: center; gap: 18px; }
.foto-pick .ph {
  width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft) center/cover;
  display: grid; place-items: center; color: var(--brand); font-size: 32px; flex: none; border: 3px solid #fff; box-shadow: var(--shadow);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 400; font-size: 13.5px; cursor: pointer; background: #fff; }
.chips input:checked + label { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); }

.krit { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.krit:last-child { border-bottom: 0; }
.krit > span { font-weight: 500; font-size: 14px; }
@media (max-width: 560px) { .krit { grid-template-columns: 1fr; gap: 6px; } }

.prio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.prio .badge { display: inline-block; background: var(--brand); color: #fff; border-radius: 6px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
@media (max-width: 560px) { .prio { grid-template-columns: 1fr; } }

.savebar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- match list ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; border-radius: 999px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: .15s; box-shadow: var(--shadow); text-align: left; padding: 0; font: inherit; color: inherit; }
.pcard:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.pcard .img { aspect-ratio: 4/5; background: var(--brand-soft) center/cover; position: relative; }
.pcard .skor { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.95); color: var(--brand); font-weight: 600; font-size: 13px; padding: 3px 9px; border-radius: 999px; }
.pcard .info { padding: 12px 14px; }
.pcard .info b { display: block; font-size: 15.5px; }
.pcard .info small { color: var(--muted); font-size: 12.5px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; color: var(--brand-2); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(30, 15, 20, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .box { background: var(--card); border-radius: 18px; max-width: 720px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.modal .close { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; }
.detail { display: grid; grid-template-columns: 260px 1fr; }
.detail .img { background: var(--brand-soft) center/cover; min-height: 340px; }
.detail .body { padding: 24px; }
@media (max-width: 640px) { .detail { grid-template-columns: 1fr; } .detail .img { min-height: 0; aspect-ratio: 1; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; margin-top: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.meter { height: 8px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; margin: 8px 0 2px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.tag.ok { background: #e8f4ec; border-color: #bfe0cb; color: var(--ok); }

/* ---------- admin ---------- */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 120px; }
.stat b { display: block; font-size: 24px; font-family: Fraunces, serif; }
.stat small { color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.col header { padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; }
.col.pria header { background: var(--pria-soft); color: var(--pria); }
.col.wanita header { background: var(--wanita-soft); color: var(--wanita); }
.col.belum header { background: #f1eeec; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; text-align: left; color: inherit; }
.row:hover { background: var(--bg); }
.row .av { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft) center/cover; flex: none; }
.row .meta { flex: 1; min-width: 0; }
.row .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta small { color: var(--muted); font-size: 12.5px; }
.row .kode { font-size: 12px; font-weight: 600; color: var(--muted); }
.row.off { opacity: .5; }

.mini { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.mini .av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft) center/cover; flex: none; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 99; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
#toast.err { background: #b3261e; }

/* ---------- HP (harus paling akhir supaya menang) ---------- */
@media (max-width: 560px) {
  .topbar { padding: 10px 16px; }
  .wrap { padding: 18px 16px 48px; }
  .card { padding: 18px 16px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 15.5px; }
  .points { margin-top: 14px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pcard .info { padding: 10px; }
  .pcard .info b { font-size: 14.5px; }
  .pcard .skor { top: 8px; right: 8px; font-size: 12px; }
  .kv { grid-template-columns: 115px 1fr; font-size: 13.5px; }
  .seg label, .chips label { padding: 8px 13px; }
  .modal { padding: 0; place-items: end center; }
  .modal .box { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .detail .img { aspect-ratio: auto; height: 42vh; min-height: 0; }
  .detail .body { padding: 20px 16px 28px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-width: 0; padding: 10px 14px; }
  .stat b { font-size: 20px; }
  .toolbar select { flex: 1; }
}

/* ---------- persetujuan admin ---------- */
.col.tunggu header { background: #fff4dc; color: #8a5a00; }
.st-tolak { color: #b3261e; font-weight: 600; }
.approval { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.approval.st-menunggu { background: #fff8e8; border-color: #f0dca8; }
.approval.st-disetujui { background: #e8f4ec; border-color: #bfe0cb; color: var(--ok); }
.approval.st-ditolak { background: #fdecea; border-color: #f3c5c0; color: #b3261e; }
.approval details { margin-top: 8px; color: var(--ink); font-size: 13.5px; }
.approval summary { cursor: pointer; font-weight: 500; }
.approval ul { margin: 6px 0 0; padding-left: 20px; }
.banner { padding: 16px 18px; border-radius: var(--radius); margin: 16px 0; border: 1px solid; }
.banner.menunggu { background: #fff8e8; border-color: #f0dca8; }
.banner.ditolak { background: #fdecea; border-color: #f3c5c0; }
.banner b { display: block; margin-bottom: 4px; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.pair .org { display: flex; gap: 10px; align-items: center; min-width: 0; cursor: pointer; }
.pair .org.kanan { flex-direction: row-reverse; text-align: right; }
.pair .org .av { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft) center/cover; flex: none; }
.pair .org b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair .org small { color: var(--muted); font-size: 12px; }
.pair .skor { text-align: center; font-weight: 600; color: var(--brand); font-size: 15px; }
.pair .skor i { display: block; font-style: normal; font-size: 18px; }
@media (max-width: 560px) {
  .pair { padding: 10px 12px; gap: 6px; }
  .pair .org .av { width: 34px; height: 34px; }
  .pair .org b { font-size: 13.5px; }
}
