:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e3e5e9;
  --text: #1c2126;
  --muted: #6b7280;
  --primary: #0c4da2;
  --primary-dark: #093b7d;
  --accent-red: #ed1c24;
  --danger: #d64545;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --lt5: #2f9e5c;
  --lt5-bg: #e2f5ea;
  --lt6: #0c4da2;
  --lt6-bg: #e4ecfb;
}

* { box-sizing: border-box; }

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

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-logo { height: 38px; display: block; }
.brand { font-weight: 700; font-size: 17px; }
.brand span { color: var(--primary); }
.page-sub-inline { color: var(--muted); font-size: 13px; }
.topbar-divider { width: 1px; height: 28px; background: var(--border); }
.topbar-title { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.recap-card { border-left: 4px solid var(--primary); }

.section-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }

.empty { color: var(--muted); font-size: 14px; padding: 16px 0; text-align: center; }

.recap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.recap-table th, .recap-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.recap-table th { color: var(--muted); font-size: 12px; font-weight: 700; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-lt5 { background: var(--lt5-bg); color: var(--lt5); }
.badge-lt6 { background: var(--lt6-bg); color: var(--lt6); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fbe2df; color: #c0392b; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; background: var(--primary); color: #fff; text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }

.field { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
input[type=text], input[type=date], input[type=time], select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.modal-static-text { font-size: 14px; padding: 9px 0; color: var(--text); }

/* ===== Layout 2 kolom: kalender bulan di kiri, grid jam di kanan ===== */
.layout-2col { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) {
  .layout-2col { grid-template-columns: 1fr; }
}

/* ===== Kalender bulan (kotak, bisa diklik per tanggal) ===== */
.month-cal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}
.month-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-cal-title { font-weight: 700; font-size: 15px; }
.month-cal-nav {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none;
  font-size: 16px; line-height: 1;
}
.month-cal-nav:hover { background: var(--bg); }

.month-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.month-cal-day {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px;
  border: 1px solid transparent;
}
.month-cal-day:hover { background: var(--bg); border-color: var(--border); }
.month-cal-day.luar-bulan { color: #c7cbd1; }
.month-cal-day.is-today .month-cal-daynum {
  background: var(--primary); color: #fff; border-radius: 999px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.month-cal-day.is-selected { border-color: var(--primary); background: var(--lt6-bg); }
.month-cal-dot { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 999px; }
.month-cal-dot.dot-sebagian { background: #d9a521; }
.month-cal-dot.dot-penuh { background: var(--danger); }
.month-cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--muted); align-items: center; }
.month-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.month-cal-legend .month-cal-dot { position: static; }

/* ===== Grid jam tetap per ruangan ===== */
.jam-grid-card { padding: 16px 20px; }
.jam-grid-header { margin-bottom: 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.jam-grid-hint { font-size: 12px; color: var(--muted); }

/* ===== Grid kalender harian: rentang jam bebas, blok booking diposisikan
   bebas (bukan terkunci per baris jam) biar bisa gambarkan durasi berapa
   pun, termasuk yang tidak pas di batas jam bulat. ===== */
.cal-grid { display: grid; grid-template-columns: 56px repeat(2, 1fr); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-col-header { height: 36px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); background: var(--bg); }
.cal-hours-col { border-right: 1px solid var(--border); }
.cal-hour-label { height: 60px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; box-sizing: border-box; border-top: 1px solid var(--border); padding-top: 2px; }
.cal-hours-col .cal-hour-label:first-child { border-top: none; }
.cal-room-col { border-right: 1px solid var(--border); }
.cal-room-col:last-child { border-right: none; }
.cal-room-body { position: relative; }
.cal-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }

.cal-empty-zone {
  position: absolute; left: 0; right: 0; width: 100%; border: none; background: transparent;
  cursor: pointer; z-index: 1; display: flex; align-items: center; justify-content: center;
}
.cal-empty-zone:hover { background: #fafbfe; }
.cal-tersedia-label { color: #d5d8dd; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; pointer-events: none; }
.cal-empty-zone:hover .cal-tersedia-label { color: #b9c6e8; }

.cal-istirahat-band {
  position: absolute; left: 0; right: 0; z-index: 2;
  background: repeating-linear-gradient(45deg, #f0f0f2, #f0f0f2 8px, #e8e8ea 8px, #e8e8ea 16px);
  color: var(--muted); font-size: 11px; font-style: italic;
  display: flex; align-items: center; justify-content: center;
}

/* Booking = diblokir/tidak tersedia, sengaja dibuat merah tegas (bukan
   pastel per-ruangan lagi) supaya kontras jelas dengan "Tersedia" di
   belakangnya. Border putih tebal di sekeliling tiap blok memastikan dua
   booking yang jamnya bersambungan tetap kelihatan sebagai 2 kotak
   terpisah, tidak menyatu jadi satu blok besar. */
.booking-block {
  position: absolute; left: 2px; right: 2px; z-index: 3; border-radius: 6px;
  padding: 5px 22px 5px 10px; font-size: 12px; overflow: hidden;
  background: var(--danger); color: #fff;
  border: 2px solid var(--bg);
  box-sizing: border-box;
}
.sel-nama { font-weight: 700; }
.sel-keperluan { color: rgba(255,255,255,0.85); font-size: 11px; }
.sel-delete-form { position: absolute; top: 2px; right: 4px; }
.sel-delete-btn { border: none; background: transparent; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 16px; line-height: 1; }
.sel-delete-btn:hover { color: #fff; }

.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.modal-hint { font-size: 12px; color: var(--muted); margin: -8px 0 14px; }

/* ===== Pemilih jam klik+geser di dalam modal booking - horizontal ===== */
.time-block-picker {
  display: flex; flex-direction: row;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.time-block {
  flex: 1; padding: 10px 2px; font-size: 12px; font-weight: 600; color: var(--text);
  border-left: 1px solid var(--border); cursor: pointer; background: #fff;
  text-align: center; white-space: nowrap;
}
.time-block:first-child { border-left: none; }
.time-block:hover { background: var(--lt6-bg); }
.time-block.time-block-selected { background: var(--primary); color: #fff; }
.time-block.time-block-disabled {
  background: repeating-linear-gradient(45deg, #f0f0f2, #f0f0f2 5px, #e8e8ea 5px, #e8e8ea 10px);
  color: var(--muted); font-weight: 400;
  cursor: not-allowed;
}
.time-block-summary { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ===== Modal booking ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
@media (max-width: 560px) {
  .time-block { font-size: 10px; padding: 10px 1px; }
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===== Halaman login/daftar/OTP - kartu simpel di tengah layar ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #eef2f9 0%, #f3f5f9 45%, #eef2f9 100%);
}
.auth-card {
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-md);
  border-radius: 16px;
  padding: 32px 28px;
}
.auth-logo { display: block; max-width: 220px; height: auto; margin: 0 auto 14px; }
.auth-kicker {
  text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--primary); text-transform: uppercase; margin-bottom: 18px;
}
.auth-card .section-title { text-align: center; font-size: 20px; margin-bottom: 20px; }

/* Jam yang sudah lewat di hari ini - beda tampilan dari "Tersedia" normal,
   dibuat jelas tidak bisa diklik (bukan cuma warnanya saja yang beda). */
.cal-empty-lewat {
  cursor: not-allowed;
  background: repeating-linear-gradient(45deg, #f3f3f4, #f3f3f4 6px, #ececee 6px, #ececee 12px);
}
.cal-empty-lewat .cal-tersedia-label { color: #c2c5cb; }

/* Booking yang masih menunggu approval admin dibedakan warnanya (oranye)
   dari yang sudah disetujui (merah), supaya status-nya kelihatan sekilas
   tanpa perlu baca teks. */
.booking-block-pending { background: #d9a521; }
