:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card2: #273449;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --border: #334155;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.center-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}
.wrap { width: 100%; max-width: 900px; }
.wrap.narrow { max-width: 520px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.home-card { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 200px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px; /* hindari zoom di iOS */
  color: var(--fg);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; min-height: 90px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  font-size: 1rem; font-weight: 600;
  color: #fff; background: var(--accent);
  border: none; border-radius: 10px;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, transform .05s;
  min-height: 46px;
}
.btn:hover { background: var(--accent2); }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.alt { background: var(--accent2); }
.btn.green { background: var(--ok); }
.btn.green:hover { background: #15803d; }
.btn.warn { background: var(--warn); }
.btn.warn:hover { background: #b45309; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--card2); }
.btn.big { padding: 16px; font-size: 1.1rem; border-radius: 12px; }
.btn.sm { padding: 7px 12px; font-size: .82rem; min-height: 34px; border-radius: 8px; }
.foot { text-align: center; font-size: .8rem; margin-top: 16px; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-weight: 700; font-size: 1rem; }
.topbar a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.topbar .who { color: var(--muted); font-size: .85rem; }

.page { padding: 16px; max-width: 980px; margin: 0 auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar .grow { min-width: 160px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.tablewrap { overflow-x: auto; }
.sn { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge.available { background: rgba(59,130,246,.18); color: #93c5fd; }
.badge.assigned { background: rgba(245,158,11,.18); color: #fcd34d; }
.badge.sold { background: rgba(34,197,94,.18); color: #86efac; }

.empty { text-align: center; color: var(--muted); padding: 24px; }
.checkbox { width: 20px; height: 20px; accent-color: var(--accent); }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .9rem; }
.alert.ok { background: rgba(22,163,74,.16); color: #86efac; border: 1px solid rgba(22,163,74,.4); }
.alert.err { background: rgba(220,38,38,.16); color: #fca5a5; border: 1px solid rgba(220,38,38,.4); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .8rem; }

@media (min-width: 720px) {
  .page { padding: 24px; }
  h1 { font-size: 1.7rem; }
}
