:root {
  --navy: #16233F;
  --navy-light: #2C4A7C;
  --gold: #B8873A;
  --gold-bg: #F3E4C8;
  --bg: #F2F3F6;
  --card: #FFFFFF;
  --border: #DCE1E8;
  --text: #1F2733;
  --muted: #66707C;
  --danger: #A6433D;
  --danger-bg: #F6E2E0;
  --font-display: 'Fraunces', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--navy);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 13px;
}

.user-box button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-body);
}
.user-box button:hover { background: rgba(255,255,255,0.18); }

.brand-logo-box {
  background: white;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: white;
  margin: 0;
}

.brand p { color: #B9C3D6; font-size: 13px; margin: 2px 0 0; }

.layout { display: flex; flex-direction: column; }
@media (min-width: 800px) {
  .layout { flex-direction: row; }
}

.sidebar {
  width: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
@media (min-width: 800px) {
  .sidebar { width: 280px; border-right: 1px solid var(--border); border-bottom: none; }
}

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
}

.room-list {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 0 16px 16px;
}
@media (min-width: 800px) {
  .room-list { flex-direction: column; overflow-x: visible; }
}

.room-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  min-width: 190px;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
}
@media (min-width: 800px) { .room-card { min-width: 0; } }

.room-card.active {
  border-color: var(--gold);
  border-left-width: 3px;
  background: var(--gold-bg);
}

.room-card .room-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.room-card .room-meta { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.room-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.room-tag {
  background: #EEF1F6; color: var(--navy-light);
  font-size: 10px; font-family: var(--font-mono);
  padding: 2px 6px; border-radius: 4px;
}

.empty-hint { padding: 0 16px 20px; color: var(--muted); font-size: 13px; }

.main { flex: 1; padding: 20px; min-width: 0; }

.room-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}

.room-header h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; }

.link-danger {
  color: var(--danger); font-size: 12px; background: none; border: none;
  cursor: pointer; padding: 0; margin-top: 6px;
}

.date-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:hover { background: #FAFBFC; }
.btn-dark { background: var(--navy); color: white; border-color: var(--navy); }
.btn-dark:hover { opacity: 0.92; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.date-pill {
  font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  text-transform: capitalize;
}

input[type="date"] {
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12.5px; padding: 7px 8px;
}

.hint { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }

.timeline-wrap {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.hours-col { width: 56px; border-right: 1px solid var(--border); flex-shrink: 0; }
.hour-mark {
  height: 64px; font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  display: flex; align-items: flex-start; justify-content: flex-end; padding-right: 8px;
}
.hour-mark span { transform: translateY(-6px); }

.timeline {
  position: relative; flex: 1; cursor: pointer;
}
.timeline:hover { background: #FAFBFC; }
.hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }

.reservation-block {
  position: absolute; left: 8px; right: 8px;
  background: #FBF6EC; border: 1.5px solid var(--gold); border-radius: 6px;
  padding: 5px 8px; transform: rotate(-0.6deg); overflow: hidden; cursor: pointer;
}
.reservation-stamp {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--gold); font-weight: 600;
}
.reservation-name { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reservation-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.confirm-inline {
  background: white; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px; margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.confirm-inline span { font-size: 11px; }

.no-res { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.loading, .empty-state { text-align: center; padding: 60px 0; color: var(--muted); }

.overlay {
  position: fixed; inset: 0; background: rgba(22,35,63,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}

.modal {
  background: white; border-radius: 12px; padding: 22px; width: 100%; max-width: 360px;
  max-height: 85vh; overflow-y: auto;
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--muted); }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }

.field { display: block; margin-bottom: 12px; }
.field span { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 8px; font-size: 13px; font-family: var(--font-body);
}
.field select, .field input.mono { font-family: var(--font-mono); }
.row-2 { display: flex; gap: 8px; }
.row-2 .field { flex: 1; }

.form-error {
  background: var(--danger-bg); color: var(--danger); font-size: 12.5px;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
