:root {
  --primary: #b8860b;
  --primary-dark: #8a6408;
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #888;
  --border: #e5e0d6;
  --danger: #c0392b;
  --ok: #27ae60;
  --no: #c0392b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-brand { font-size: 1.2rem; font-weight: 700; color: var(--primary); letter-spacing: .3px; }
.topbar-nav { display: flex; align-items: center; gap: 14px; }
.topbar-user { color: var(--muted); font-size: .9rem; }
.topbar-nav a:not(.btn) { color: var(--text); }
.topbar-nav a:not(.btn):hover { color: var(--primary); text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }
.page-title { margin: 8px 0 18px; font-size: 1.5rem; }
.section-title { margin: 28px 0 14px; font-size: 1.15rem; color: #555; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: .9rem;
  text-decoration: none; transition: all .15s;
}
.btn:hover { background: #f3f0ea; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #e6b4ae; }
.btn-danger:hover { background: #fdf1f0; }
.btn-small { padding: 4px 10px; font-size: .8rem; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: .85rem; font-weight: 600; color: #555; }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary);
}
.field small { color: var(--muted); font-size: .8rem; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.font-preview {
  display: block; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px;
  background: #faf8f4; color: #333; font-size: 1.3rem; line-height: 1.4;
  font-family: 'Cormorant Garamond', serif; text-align: center; letter-spacing: .5px;
}
.thumb { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; margin-top: 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span2 { grid-column: span 2; }
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}

/* ---------- Cards & alerts ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: .92rem; }
.alert-success { background: #e9f7ef; color: #1e7e43; border: 1px solid #b9e4c8; }
.alert-error { background: #fdecea; color: #a93226; border: 1px solid #f0c0ba; }

/* ---------- Stats ---------- */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 22px; text-align: center; min-width: 96px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.6rem; color: var(--primary); }
.stat span { font-size: .8rem; color: var(--muted); }
.stat-ok b { color: var(--ok); }
.stat-no b { color: var(--no); }

.dash-actions { display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap; }

/* ---------- Invitation cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.inv-card { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.inv-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.inv-thumb { position: relative; height: 130px; background: #eee; }
.inv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inv-thumb-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 10px; text-align: center; }
.inv-info { padding: 10px 14px; }
.inv-info h3 { margin: 0; font-size: .98rem; }
.muted { color: var(--muted); font-size: .82rem; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.badge-draft { background: #f0f0f0; color: #666; }
.badge-published { background: #e3f2fd; color: #1565c0; }
.badge-archived { background: #f3e5f5; color: #7b1fa2; }
.badge-yes { background: #e9f7ef; color: #1e7e43; }
.badge-no { background: #fdecea; color: #a93226; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; }
.table th { background: #faf8f4; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: #777; }
.table tr:last-child td { border-bottom: none; }
.ta-r { text-align: right; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.inline { display: inline; }
.row-actions .btn { white-space: nowrap; }

/* ---------- Toolbar / tabs ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 7px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: .88rem; }
.tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.tabs a:hover { text-decoration: none; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------- Builder ---------- */
.builder-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.builder-grid { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.builder-nav { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 4px; }
.builder-nav a { padding: 9px 12px; border-radius: 8px; color: var(--text); background: #fff; border: 1px solid var(--border); font-size: .9rem; }
.builder-nav a.active, .builder-nav a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.builder-main { min-width: 0; }
.section-block h2 { margin: 0 0 14px; font-size: 1.1rem; }
.builder-submit { margin: 8px 0 24px; }
.builder-submit .btn-lg { width: 100%; }

.toggle-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .toggle-list { grid-template-columns: 1fr; } }
.toggle-item {
  display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; background: #fcfaf6;
}
.toggle-item:hover { border-color: var(--primary); }
.toggle-item input { margin-top: 3px; }
.toggle-item b { display: block; font-size: .9rem; }
.toggle-item small { color: var(--muted); font-size: .8rem; }

.mod-section.mod-off h2::after {
    content: ' Nonaktif';
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    background: #999;
    border-radius: 999px;
    padding: 2px 10px;
    margin-left: 8px;
    vertical-align: middle;
}
.mod-row {
  border: 1px dashed var(--border); border-radius: 10px; padding: 14px;
  margin-bottom: 12px; background: #fcfaf6; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.mod-row > .remove-row { position: static; align-self: flex-end; }
.names-fields { margin-top: 16px; }
.add-row-wrap { align-self: flex-start; }

@media (max-width: 820px) {
  .builder-grid { grid-template-columns: 1fr; }
  .builder-nav {
    position: static; flex-direction: row; overflow-x: auto; white-space: nowrap;
    padding-bottom: 4px;
  }
  .builder-nav a { flex: 0 0 auto; }
}

/* ---------- Auth ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #f6f4ef, #efe6d3); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 400px; }
.auth-brand { margin: 0; font-size: 1.6rem; color: var(--primary); text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin: 6px 0 20px; font-size: .92rem; }
.auth-link { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 16px; }

/* ---------- Landing ---------- */
.landing-body { background: #fff; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.landing-nav nav { display: flex; gap: 10px; }
.landing-hero { text-align: center; padding: 70px 20px; background: linear-gradient(160deg, #fdf8ef, #f6ead6); }
.landing-hero h1 { font-size: 2.4rem; margin: 0 0 14px; color: #4a3b12; line-height: 1.2; }
.landing-hero p { max-width: 640px; margin: 0 auto 24px; color: #6b5d3a; font-size: 1.05rem; }
.landing-features { max-width: 1080px; margin: 0 auto; padding: 50px 20px; }
.landing-features h2 { text-align: center; margin-bottom: 30px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.feat { border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: #fdfcf9; }
.feat h3 { margin: 0 0 8px; font-size: 1rem; color: var(--primary); }
.feat p { margin: 0; color: #555; font-size: .92rem; }
.feat code { background: #f3efe6; padding: 1px 5px; border-radius: 4px; }
.landing-footer { text-align: center; padding: 30px; color: var(--muted); font-size: .85rem; }
