:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --gray-bg: #f3f4f6;
  --gray-border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
}

header.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

header.topbar h1 {
  font-size: 20px;
  margin: 0;
}

header.topbar nav a {
  margin-left: 16px;
  color: var(--blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 60px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}

button.primary { background: var(--blue); color: white; }
button.primary:hover { background: var(--blue-dark); }
button.success { background: var(--green); color: white; }
button.danger { background: var(--red); color: white; }
button.ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--gray-border); }

.btn-row { display: flex; gap: 8px; margin-top: 16px; }

.date-nav {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.date-nav button { background: white; border: 1px solid var(--gray-border); }
.date-nav strong { font-size: 15px; }

.room-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.room-tab {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--gray-border);
  background: white; cursor: pointer; font-size: 13px; font-weight: 600;
}
.room-tab.active { background: var(--blue); color: white; border-color: var(--blue); }

.slot-list { display: flex; flex-direction: column; gap: 10px; }

.slot {
  border-radius: 8px; padding: 12px 14px; border-left: 5px solid var(--gray-border);
  background: #fafafa; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.slot .time { font-weight: 700; font-size: 14px; min-width: 110px; }
.slot .meta { font-size: 13px; color: var(--text-muted); }
.slot .title { font-weight: 600; }

.slot.approved { border-left-color: var(--green); }
.slot.pending { border-left-color: var(--amber); }
.slot.rejected { border-left-color: var(--red); opacity: .6; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge.approved { background: #dcfce7; color: #15803d; }
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.rejected { background: #fee2e2; color: #b91c1c; }
.badge.cancelled { background: #e5e7eb; color: #6b7280; }

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

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert.error { background: #fee2e2; color: #b91c1c; }
.alert.ok { background: #dcfce7; color: #15803d; }

/* Tablet display page */
body.tablet-body { background: #05070a; color: #fff; height: 100vh; overflow: hidden; margin: 0; }

.tablet-screen { height: 100vh; padding: 20px; display: flex; box-sizing: border-box; }
.tablet-card {
  flex: 1; display: flex; background: #0f151b; border: 2px solid #2dd4bf; border-radius: 28px;
  overflow: hidden; box-shadow: 0 0 40px rgba(45,212,191,0.15);
}

.tablet-left {
  width: 38%; padding: 36px 32px; display: flex; flex-direction: column;
  border-right: 1px solid #1f2937; box-sizing: border-box;
}
.tablet-clock { font-size: 56px; font-weight: 800; line-height: 1; }
.tablet-date { color: #8a94a6; font-size: 14px; margin-top: 6px; text-transform: capitalize; }
.tablet-capacity { margin-top: 28px; color: #8a94a6; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.tablet-roomname { font-size: 26px; font-weight: 700; margin-top: 6px; }
.tablet-status-box {
  margin-top: 28px; border: 2px solid #2dd4bf; border-radius: 24px; padding: 22px 24px;
  background: rgba(45,212,191,0.06);
}
.tablet-status-box.busy { border-color: #f87171; background: rgba(248,113,113,0.08); }
.status-main { font-size: 30px; font-weight: 800; color: #2dd4bf; }
.tablet-status-box.busy .status-main { color: #f87171; }
.status-sub { color: #8a94a6; font-size: 15px; margin-top: 6px; }
.tablet-book-btn {
  margin-top: 24px; background: #2dd4bf; color: #04231f; text-decoration: none; text-align: center;
  font-weight: 700; padding: 14px; border-radius: 14px; font-size: 16px; display: block;
}
.tablet-book-btn:hover { background: #14b8a6; }
.tablet-icons { margin-top: auto; display: flex; gap: 10px; padding-top: 24px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; background: #1a222b; display: flex;
  align-items: center; justify-content: center; color: #8a94a6; text-decoration: none; font-size: 18px;
}
.icon-btn:hover { background: #232d38; color: #fff; }

.tablet-right { flex: 1; padding: 32px 28px; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.tablet-right h2 { margin: 0 0 16px; font-size: 16px; color: #8a94a6; font-weight: 600; }
.tablet-timeline { flex: 1; overflow-y: auto; position: relative; display: flex; }
.timeline-hours { width: 56px; flex-shrink: 0; position: relative; }
.timeline-hour { position: absolute; left: 0; right: 0; color: #5b6472; font-size: 12px; transform: translateY(-50%); }
.timeline-track { flex: 1; position: relative; border-left: 1px solid #1f2937; margin-left: 8px; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed #2dd4bf; z-index: 2; }
.now-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #2dd4bf; }
.now-time { position: absolute; left: 12px; top: -10px; color: #2dd4bf; font-size: 12px; font-weight: 700; }
.timeline-event {
  position: absolute; left: 12px; right: 8px; background: #1a222b; border-radius: 12px; padding: 8px 12px;
  overflow: hidden; border: 1px solid #232d38; box-sizing: border-box;
}
.timeline-event .time { font-size: 11px; color: #8a94a6; font-weight: 700; }
.timeline-event .title { font-size: 13px; font-weight: 700; margin-top: 2px; }
.timeline-event .name { font-size: 12px; color: #8a94a6; }
.timeline-event.now { background: #0b2b28; border-color: #2dd4bf; }