/* ============================================================
   JANJI KITA — Admin Panel Stylesheet v2 (indoinvite-inspired)
   ============================================================ */
:root {
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.admin-shell {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 14px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.05); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── Layout: sidebar shell ─────────────────────────────── */
.admin-shell.with-sidebar { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #e0e7ff;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.05rem; color: #fff; letter-spacing: .01em; }
.sidebar .brand .logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, .4); }
.sidebar .brand small { display: block; font-size: .62rem; font-weight: 500; color: #a5b4fc; letter-spacing: .12em; text-transform: uppercase; }

.sidebar .nav-group { display: flex; flex-direction: column; gap: .25rem; }
.sidebar .nav-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: #818cf8; padding: 0 .6rem .3rem; font-weight: 700; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .7rem; border-radius: var(--radius-sm);
  color: #c7d2fe; font-size: .875rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.sidebar a.nav-link .ico { width: 16px; text-align: center; opacity: .85; }

.sidebar .sidebar-foot { margin-top: auto; font-size: .72rem; color: #818cf8; padding: 0 .6rem; line-height: 1.5; }

.content-wrap { flex: 1; min-width: 0; padding: 2rem 2.2rem 3rem; }

/* ── Topbar ────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topbar .page-title .eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); font-weight: 700; }
.topbar .page-title h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.topbar .page-title p { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.topbar .topbar-actions { display: flex; gap: .6rem; align-items: center; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: none; border-radius: var(--radius-sm);
  padding: .6rem 1.1rem; font-size: .86rem; font-weight: 600;
  background: var(--line); color: var(--ink); transition: all .15s;
  line-height: 1.2;
}
.btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: #d1fae5; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--line); }
.btn-sm { padding: .4rem .75rem; font-size: .78rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.5rem; font-size: .95rem; }

/* ── Cards / panels ────────────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-pad { padding: 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-width: 0; }
.panel-head h2 { font-size: 1rem; font-weight: 700; }
.panel-head .sub { font-size: .78rem; color: var(--muted); }

/* ── Stats grid ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; position: relative; overflow: hidden; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .stat-label { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-sub { font-size: .78rem; color: var(--ink-soft); }
.stat-card .stat-ico { position: absolute; right: 1rem; top: 1rem; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.stat-card.tint-brand .stat-ico { background: var(--brand-soft); color: var(--brand); }
.stat-card.tint-green .stat-ico { background: var(--success-soft); color: var(--success); }
.stat-card.tint-amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.stat-card.tint-rose .stat-ico { background: var(--danger-soft); color: var(--danger); }

/* ── Invitation cards ──────────────────────────────────── */
.invite-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.invite-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.invite-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.invite-cover { height: 150px; background: linear-gradient(135deg, #4f46e5, #7c3aed); position: relative; display: flex; align-items: center; justify-content: center; color: #fff; }
.invite-cover .couple { font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; text-shadow: 0 2px 12px rgba(0,0,0,.25); text-align: center; padding: 0 1rem; font-family: Georgia, 'Times New Roman', serif; font-style: italic; }
.invite-cover .badge { position: absolute; top: .8rem; right: .8rem; font-size: .66rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.invite-cover .badge.published { background: var(--success); color: #fff; }
.invite-cover .badge.draft { background: #f1f5f9; color: var(--ink-soft); }
.invite-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.invite-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.invite-meta .chip { font-size: .7rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); padding: .25rem .6rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .3rem; }
.invite-body .desc { font-size: .82rem; color: var(--muted); line-height: 1.5; flex: 1; }
.invite-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); background: #fafbfc; }
.data-table td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .87rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafc; }

/* ── Badges / status ───────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; }
.badge.b-green { background: var(--success-soft); color: #059669; }
.badge.b-gray { background: var(--bg); color: var(--ink-soft); }
.badge.b-amber { background: var(--amber-soft); color: #b45309; }
.badge.b-red { background: var(--danger-soft); color: var(--danger); }
.badge.b-blue { background: var(--brand-soft); color: var(--brand-dark); }

/* ── Forms ─────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-grid .field { display: flex; flex-direction: column; gap: .35rem; }
.form-grid .field.wide { grid-column: 1 / -1; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: .72rem; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .6rem .8rem; font-size: .9rem; transition: border .15s, box-shadow .15s;
  background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.field textarea { resize: vertical; min-height: 90px; }

/* ── Template picker ───────────────────────────────────── */
.tpl-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.tpl-opt { position: relative; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); transition: border .15s, transform .15s; display: block; }
.tpl-opt:hover { transform: translateY(-2px); }
.tpl-opt.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.tpl-opt input { position: absolute; opacity: 0; }
.tpl-thumb { height: 105px; background: linear-gradient(135deg, #f1f5f9, #e2e8f0); display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--muted); overflow: hidden; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-name { padding: .55rem .6rem; font-size: .78rem; font-weight: 600; text-align: center; background: #fff; }
.tpl-opt.selected .tpl-name { color: var(--brand-dark); }
.tpl-check { position: absolute; top: .45rem; right: .45rem; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; display: none; align-items: center; justify-content: center; font-size: .7rem; }
.tpl-opt.selected .tpl-check { display: flex; }

/* ── Guest list ────────────────────────────────────────── */
.guest-list { display: flex; flex-direction: column; gap: .6rem; }
.guest-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfc; flex-wrap: wrap; }
.guest-item .info { min-width: 0; }
.guest-item .info strong { display: block; font-size: .88rem; }
.guest-item .info small { color: var(--muted); font-size: .74rem; word-break: break-all; }
.guest-item .actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── RSVP / wishes ─────────────────────────────────────── */
.rsvp-item { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.rsvp-item:last-child { border-bottom: none; }
.rsvp-item .who { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .86rem; }
.rsvp-item .who .badge { font-size: .64rem; }
.rsvp-item p { margin-top: .3rem; font-size: .84rem; color: var(--ink-soft); }

/* ── Notice / alert ────────────────────────────────────── */
.notice, .alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-size: .86rem; font-weight: 500; margin-bottom: 1.2rem; }
.notice { background: var(--success-soft); color: #059669; border: 1px solid #a7f3d0; }
.alert { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }

/* ── Empty state ───────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .empty-ico { font-size: 2.6rem; margin-bottom: .6rem; opacity: .5; }
.empty h3 { color: var(--ink); font-size: 1.05rem; }
.empty p { font-size: .86rem; margin-top: .2rem; }

/* ── Login page ────────────────────────────────────────── */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-brand {
  background: linear-gradient(155deg, #1e1b4b 0%, #312e81 45%, #4f46e5 100%);
  color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 75% 25%, rgba(255,255,255,.12), transparent 45%); pointer-events: none; }
.login-brand .brand { display: flex; align-items: center; gap: .8rem; font-weight: 800; font-size: 1.2rem; }
.login-brand .brand .logo-mark { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.login-brand .headline h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.login-brand .headline p { color: #c7d2fe; margin-top: .8rem; font-size: 1rem; max-width: 380px; line-height: 1.6; }
.login-brand .foot { font-size: .78rem; color: #a5b4fc; line-height: 1.5; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card-box { width: 100%; max-width: 380px; }
.login-card-box h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.login-card-box .sub { color: var(--muted); font-size: .88rem; margin: .3rem 0 1.6rem; }
.login-card-box form { display: flex; flex-direction: column; gap: 1rem; }
.login-card-box .field input { padding: .75rem .9rem; font-size: .95rem; }
.login-card-box button[type=submit] { margin-top: .3rem; }
.login-foot-note { margin-top: 1.4rem; font-size: .74rem; color: var(--muted); text-align: center; }

/* ── Tab navigation ────────────────────────────────────── */
.tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; }
.tab-btn {
  border: none; background: none; padding: .7rem 1.1rem; font-size: .86rem; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Utility ───────────────────────────────────────────── */
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.muted { color: var(--muted); } .small { font-size: .8rem; }
.grow { flex: 1; }
.text-right { text-align: right; }

code.url { background: var(--bg); border: 1px solid var(--line); padding: .15rem .45rem; border-radius: 6px; font-size: .78rem; word-break: break-all; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-shell.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: .8rem 1rem; gap: .8rem; }
  .sidebar .nav-group { flex-direction: row; flex-wrap: wrap; }
  .sidebar .sidebar-foot { display: none; }
  .content-wrap { padding: 1.4rem 1rem 2.5rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 2rem; min-height: 200px; }
  .login-brand .foot { display: none; }
  .login-brand .headline p { max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Responsive lanjutan: tablet & hp ─────────────────── */
@media (max-width: 640px) {
  .sidebar { flex-wrap: wrap; gap: .4rem; }
  .sidebar .brand { width: 100%; margin-bottom: .3rem; }
  .sidebar .nav-group { width: 100%; }
  .stat-grid, .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .tab-bar { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: .6rem .9rem; font-size: .85rem; }
  .invite-grid { grid-template-columns: 1fr !important; }
  .panel-pad { padding: 1rem; }
  .content-head { flex-direction: column; align-items: flex-start; gap: .6rem; }
  table.table, .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 400px) {
  .stat-grid, .stats-row { grid-template-columns: 1fr !important; }
  .login-brand { min-height: 160px; padding: 1.4rem; }
  .login-shell .login-card { padding: 1.6rem 1.2rem; }
}


/* ══════════════════════════════════════════════
   ADMIN v3 — Premium polish
   ══════════════════════════════════════════════ */
.admin-shell h1, .admin-shell h2, .admin-shell h3, .admin-shell .brand { font-family: 'Playfair Display', Georgia, serif; letter-spacing: -.01em; }
.btn, button.btn, a.btn { transition: transform .25s var(--ease, cubic-bezier(.16,1,.3,1)), box-shadow .25s var(--ease, cubic-bezier(.16,1,.3,1)), background .25s; }
.btn:hover, button.btn:hover, a.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,.25); }
.btn:active { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sidebar a.nav-link { transition: background .25s var(--ease, cubic-bezier(.16,1,.3,1)), color .25s, transform .25s; }
.sidebar a.nav-link:hover { transform: translateX(2px); }
.stat-card, .inv-card, .tpl-card, .panel-card { transition: transform .3s var(--ease, cubic-bezier(.16,1,.3,1)), box-shadow .3s var(--ease, cubic-bezier(.16,1,.3,1)); }
.stat-card:hover, .inv-card:hover, .tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tab-btn { transition: color .25s, border-color .25s; }
.form-grid input, .form-grid select, .form-grid textarea { transition: border-color .25s, box-shadow .25s; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
