:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --panel-2: #181818;
  --line: #2a2a2a;
  --text: #f2f2f2;
  --muted: #8d8d8d;
  --white: #ffffff;
  --black: #000000;
  --ok: #7ee2a8;
  --warn: #f2c66d;
  --bad: #ff7a7a;
  --radius: 10px;
  --nav-h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; letter-spacing: 0.5px; margin-right: auto; text-decoration: none; }
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.who select { max-width: 130px; }

main { padding: 16px 14px calc(var(--nav-h) + 28px); max-width: 980px; margin: 0 auto; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: var(--nav-h);
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: 13px;
  border-top: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.bottom-nav a:hover { color: var(--white); background: var(--panel); }
.bottom-nav a.active { color: var(--white); border-top-color: var(--white); }

.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }

/* ---------- Form dan tombol ---------- */
input, select, textarea {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--white); }
input[type="file"] { padding: 7px; }
input[type="checkbox"] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.btn {
  font: inherit; font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--black); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--white); }
.btn.ghost:hover { background: var(--white); color: var(--black); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: var(--black); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
a.btn { display: inline-block; text-decoration: none; }

.error { color: var(--bad); font-size: 13px; margin: 8px 0; min-height: 1em; }

/* ---------- Kartu, grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, transform 0.1s;
}
a.card:hover { border-color: var(--white); transform: translateY(-1px); }
.card .thumb { aspect-ratio: 1 / 1; background: var(--panel-2); display: flex; align-items: center; justify-content: center; }
.card .thumb.wide { aspect-ratio: 16 / 10; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px; }
.card .title { font-weight: 600; word-break: break-word; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.initial { font-size: 34px; font-weight: 600; color: var(--muted); }

.badge {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  white-space: nowrap;
}
.badge.Planned { color: var(--warn); border-color: var(--warn); }
.badge.Confirmed { color: var(--white); border-color: var(--white); }
.badge.Done { color: var(--ok); border-color: var(--ok); }
.badge.Cancelled { color: var(--bad); border-color: var(--bad); }
.badge.role { color: var(--white); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { color: var(--white); border-color: var(--white); }
.chip.active { background: var(--white); color: var(--black); border-color: var(--white); }

.empty { color: var(--muted); padding: 28px 0; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Detail ---------- */
.profile { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.avatar {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.sm .initial { font-size: 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 10px 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; background: var(--panel-2); }
.hero img { width: 100%; max-height: 320px; object-fit: cover; }
.people { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.person { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12px; text-decoration: none; }
.person:hover { border-color: var(--white); }

.section-title { margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.section-title h2 { margin-right: auto; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 640px) { .photos { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .photos { grid-template-columns: repeat(5, 1fr); } }
.photos button { padding: 0; border: 0; background: var(--panel-2); aspect-ratio: 1 / 1; cursor: pointer; overflow: hidden; border-radius: 4px; }
.photos img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.photos button:hover img { transform: scale(1.05); }

/* ---------- Kalender ---------- */
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-nav strong { margin: 0 auto; font-size: 15px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--panel-2); padding: 6px 2px; text-align: center; font-size: 11px; color: var(--muted); }
.cal .cell { background: var(--bg); min-height: 64px; padding: 3px; font-size: 11px; overflow: hidden; }
.cal .cell.off { background: #070707; }
.cal .cell.today .num { background: var(--white); color: var(--black); border-radius: 999px; padding: 0 5px; }
.cal .num { color: var(--muted); display: inline-block; margin-bottom: 2px; }
.cal .ev {
  display: block; text-decoration: none; margin-top: 2px; padding: 1px 4px; border-radius: 4px;
  border: 1px solid var(--line); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal .ev:hover { background: var(--white); color: var(--black); }
.cal .ev.Planned { border-color: var(--warn); }
.cal .ev.Confirmed { border-color: var(--white); }
.cal .ev.Done { border-color: var(--ok); }
.cal .ev.Cancelled { border-color: var(--bad); text-decoration: line-through; }
@media (min-width: 640px) { .cal .cell { min-height: 90px; font-size: 12px; } .cal .ev { font-size: 11px; } }

.list-group { margin-bottom: 18px; }
.list-group h3 { color: var(--muted); margin-bottom: 6px; }
.row-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-decoration: none;
  transition: border-color 0.15s;
}
.row-item:hover { border-color: var(--white); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 600; word-break: break-word; }
.row-item .s { color: var(--muted); font-size: 12px; }

/* ---------- Modal dan lightbox ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.8);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 18px 12px;
}
.modal {
  width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: auto 0;
}
.modal h2 { margin-bottom: 14px; }
.checks { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); }
.checks label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; padding: 4px 0; margin: 0; cursor: pointer; }

.lightbox { align-items: center; flex-direction: column; justify-content: center; gap: 10px; }
.lightbox img { max-height: 76vh; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox .info { color: var(--muted); font-size: 12px; text-align: center; }
.lightbox .nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 340px; }
.login h1 { margin-bottom: 4px; }
.login p { margin: 0 0 18px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px); z-index: 60;
  background: var(--white); color: var(--black); padding: 8px 14px; border-radius: 8px; font-size: 13px;
}
