/* Panel Admin - Undangan Digital */
:root {
  --g: #0e4a38; --g2: #136149; --gold: #c9a24b; --bg: #f1f3ef; --card: #fff; --ink: #1b2622; --mut: #6b7873;
  --line: #e1e6e2; --danger: #c0392b; --ok: #1d7a46; --warn: #b9770e; --r: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--g2); }
h1, h2, h3 { margin: 0; }
.shell { display: flex; min-height: 100vh; }
.side { width: 250px; background: var(--g); color: #e9f2ee; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50; transition: transform .25s; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: rgba(201,162,75,.18); color: var(--gold); display: grid; place-items: center; font-size: 20px; }
.brand b { display: block; line-height: 1.2; }
.brand small { opacity: .65; font-size: .75rem; }
.side nav { padding: 14px 12px; display: grid; gap: 4px; flex: 1; align-content: start; }
.side nav a { display: flex; gap: 12px; align-items: center; padding: .7rem .9rem; border-radius: 10px; color: #cfe0d8; text-decoration: none; font-weight: 500; }
.side nav a i { font-style: normal; width: 1.3em; text-align: center; color: var(--gold); }
.side nav a:hover { background: rgba(255,255,255,.08); }
.side nav a.on { background: rgba(255,255,255,.14); color: #fff; font-weight: 700; }
.side-foot { padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; font-size: .88rem; }
.logout { color: #f3d98f; text-decoration: none; font-weight: 700; }
.content { flex: 1; margin-left: 250px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 1.25rem; }
.burger { display: none; border: 0; background: var(--g); color: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }
.page { padding: 26px 28px 80px; max-width: 1180px; }
.scrim { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 20px; }
.card > h2 { font-size: 1.05rem; margin-bottom: 4px; }
.card > .hint { color: var(--mut); font-size: .85rem; margin: 0 0 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; color: var(--g); }
.stat span { color: var(--mut); font-size: .85rem; }

label.f { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 14px; }
label.f > span { display: block; margin-bottom: 5px; }
label.f small { display: block; font-weight: 400; color: var(--mut); margin-top: 4px; font-size: .78rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cdd5d0; border-radius: 10px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(19,97,73,.3); border-color: var(--g2); }
input[type=file] { font: inherit; width: 100%; }
.cb { display: flex; gap: 10px; align-items: center; font-weight: 500; margin-bottom: 8px; }
.cb input { width: 18px; height: 18px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--g); color: #fff; padding: .6rem 1.1rem; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--g2); }
.btn.sec { background: #fff; color: var(--g); border-color: #bfcac4; }
.btn.sec:hover { background: #f3f6f4; }
.btn.gold { background: var(--gold); color: #2b2106; }
.btn.danger { background: #fff; color: var(--danger); border-color: #e7b9b3; }
.btn.danger:hover { background: #fdf0ee; }
.btn.sm { padding: .35rem .75rem; font-size: .82rem; border-radius: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: #e3f4ea; color: #145c35; }
.flash-err { background: #fdecea; color: #8a1f12; }
.flash-warn { background: #fdf3d9; color: #7a5200; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .acts { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #e8eeeb; color: #3a4a43; }
.badge.on { background: #dff3e6; color: #17653a; }
.badge.off { background: #f1e4e2; color: #8e2a20; }
.b-hadir { background: #dff3e6; color: #17653a; } .b-tidak { background: #f9e0dd; color: #8e2a20; } .b-ragu { background: #fbf0cf; color: #7a5a06; }
.muted { color: var(--mut); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; word-break: break-all; }
.empty { text-align: center; padding: 40px 10px; color: var(--mut); }

.picker { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.picker select { width: auto; min-width: 240px; }

/* Pemilih tema */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.theme-opt { position: relative; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt .tc { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; transition: all .2s; display: block; }
.theme-opt .sw { height: 70px; display: block; }
.theme-opt .tn { display: block; padding: .6rem .7rem .2rem; font-weight: 700; }
.theme-opt .td { display: block; padding: 0 .7rem .7rem; font-size: .75rem; color: var(--mut); line-height: 1.35; }
.theme-opt input:checked + .tc { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(19,97,73,.2); }
.theme-opt input:focus-visible + .tc { outline: 2px solid var(--gold); }

/* Baris berulang */
.rep { display: grid; gap: 12px; }
.rep-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fafbfa; position: relative; }
.rep-item .rm { position: absolute; top: 8px; right: 8px; }
.rep-item h4 { margin: 0 0 10px; font-size: .85rem; color: var(--mut); }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.photo-box { border: 1px dashed #b9c5be; border-radius: 12px; padding: 12px; background: #fafbfa; }
.photo-box .pv { aspect-ratio: 4/3; border-radius: 8px; background: #e8eeeb center/cover no-repeat; margin-bottom: 8px; display: grid; place-items: center; color: var(--mut); font-size: .8rem; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gal .gi { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #e8eeeb; }
.gal .gi img { width: 100%; height: 100%; object-fit: cover; }
.gal .gi label { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; padding: .25rem .4rem; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.savebar { position: sticky; bottom: 0; z-index: 15; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; gap: 10px; justify-content: space-between; align-items: center; box-shadow: 0 -6px 24px rgba(0,0,0,.06); flex-wrap: wrap; }

.linkbox { display: flex; gap: 8px; align-items: center; background: #f3f6f4; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .7rem; }
.linkbox .mono { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; background: #1b1b1b; color: #fff; padding: .6rem 1.2rem; border-radius: 999px; font-size: .88rem; transition: all .3s; pointer-events: none; z-index: 99; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #1b6b52 0, var(--g) 55%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.login-card .logo { width: 54px; height: 54px; border-radius: 16px; background: var(--g); color: var(--gold); display: grid; place-items: center; font-size: 26px; margin: 0 auto 10px; }
.login-card h1 { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.login-card p.sub { text-align: center; color: var(--mut); margin: 0 0 22px; font-size: .9rem; }
.login-card .btn { width: 100%; justify-content: center; padding: .8rem; }

@media (max-width: 1000px) { .themes { grid-template-columns: repeat(2, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
  .content { margin-left: 0; }
  .burger { display: block; }
  .top { padding: 12px 16px; }
  .page { padding: 18px 14px 80px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .photos { grid-template-columns: 1fr; }
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .tbl.stack td { display: block; border: 0; padding: .15rem 0; }
}
@media (max-width: 520px) { .themes { grid-template-columns: 1fr 1fr; } .g4 { grid-template-columns: 1fr 1fr; } .stat b { font-size: 1.6rem; } }
