:root {
  color-scheme: dark;
  --bg: #071120;
  --panel: rgba(255, 255, 255, .075);
  --panel-strong: rgba(255, 255, 255, .12);
  --line: rgba(132, 231, 255, .22);
  --text: #ebfbff;
  --muted: #9eb5c8;
  --cyan: #5df4ff;
  --green: #4effc7;
  --blue: #6fa8ff;
  --red: #ff5574;
  --yellow: #ffd760;
  --orange: #ffad5c;
  --gray: #8f9daf;
  --dark-gray: #4f5866;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 0%, rgba(93, 244, 255, .18), transparent 30%),
    radial-gradient(circle at 12% 14%, rgba(139, 108, 255, .15), transparent 28%),
    linear-gradient(145deg, #071120, #0b1630 54%, #141226);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: rgba(4, 12, 26, .74);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(93, 244, 255, .5);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(93, 244, 255, .25), rgba(100, 120, 255, .18));
  color: var(--cyan);
  font-weight: 900;
  box-shadow: 0 0 28px rgba(93, 244, 255, .18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.server-note small,
.muted {
  color: var(--muted);
}

.desktop-nav,
.mobile-nav {
  display: grid;
  gap: 10px;
}

.nav-btn,
.ghost-btn,
.primary-btn,
.danger-btn {
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.nav-btn.active,
.primary-btn {
  border-color: rgba(78, 255, 199, .45);
  background: linear-gradient(135deg, rgba(78, 255, 199, .22), rgba(93, 244, 255, .12));
  color: #eafff9;
}

.danger-btn {
  border-color: rgba(255, 85, 116, .42);
  color: #ffd8df;
}

.server-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}

.server-note span,
.server-note small {
  display: block;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 2px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2, h3, p {
  margin-top: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#clock,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .06);
  color: #c9f9ff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .2);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.room-card {
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
  position: relative;
  overflow: hidden;
}

.room-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .08) 42%, transparent 74%);
  transform: translateX(-100%);
  animation: scan 5s infinite;
  pointer-events: none;
}

@keyframes scan {
  0%, 55% { transform: translateX(-100%); }
  80%, 100% { transform: translateX(100%); }
}

.room-head,
.row,
.status-line,
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

.state-free { color: var(--green); border-color: rgba(78, 255, 199, .48); }
.state-booked { color: var(--blue); border-color: rgba(111, 168, 255, .46); }
.state-in-use { color: var(--red); border-color: rgba(255, 85, 116, .5); }
.state-starting-soon { color: var(--orange); border-color: rgba(255, 173, 92, .5); }
.state-pending { color: var(--yellow); border-color: rgba(255, 215, 96, .52); }
.state-ended { color: var(--gray); border-color: rgba(143, 157, 175, .38); }
.state-disabled { color: var(--dark-gray); border-color: rgba(98, 107, 122, .42); }

.status-title {
  margin: 14px 0 8px;
  font-size: 24px;
  font-weight: 900;
}

.room-card p,
.booking-item p {
  color: var(--muted);
  line-height: 1.55;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.wide {
  grid-column: span 2;
}

.recommend-grid,
.booking-list,
.admin-grid,
.board-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.recommend-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.recommend-card,
.booking-item,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .06);
}

.recommend-card.available {
  border-color: rgba(78, 255, 199, .45);
}

.recommend-card.unavailable {
  opacity: .72;
}

.recommend-card.selected {
  background: linear-gradient(135deg, rgba(78, 255, 199, .2), rgba(93, 244, 255, .11));
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  margin: 2px 5px 2px 0;
  background: rgba(93, 244, 255, .12);
  color: #d9fbff;
  font-size: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.timeline-room {
  color: #d9fbff;
  padding: 6px 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.timeline-track {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  position: relative;
  overflow: hidden;
}

.timeline-block {
  position: absolute;
  top: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 6px 10px;
  overflow: hidden;
  color: #071120;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.timeline-block strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timeline-scale {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-scale div {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.empty-track {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
}

.time-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.time-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.time-list strong {
  color: #dffbff;
  min-width: 90px;
}

.timeline-block.approved { background: var(--blue); }
.timeline-block.pending { background: var(--yellow); }
.timeline-block.in-progress { background: var(--red); color: white; }
.timeline-block.ended { background: var(--gray); }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .62);
  z-index: 20;
}

.modal.open {
  display: grid;
}

.receipt {
  width: min(420px, 100%);
  color: #101820;
  background:
    linear-gradient(45deg, transparent 8px, #fff 0) bottom left,
    linear-gradient(-45deg, transparent 8px, #fff 0) bottom right;
  background-size: 50% 100%;
  background-repeat: no-repeat;
  padding: 24px;
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, .36));
}

.receipt h2 {
  text-align: center;
  margin-bottom: 16px;
}

.receipt .row {
  border-bottom: 1px dashed #c4ced8;
  padding: 8px 0;
  color: #182533;
}

.success-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #4effc7;
  color: #062018;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(78, 255, 199, .6);
}

.mobile-nav {
  display: none;
}

@media (max-width: 1100px) {
  .rooms-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 800px) {
  .shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 16px 84px;
  }

  .topbar,
  .hero-grid {
    display: block;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .rooms-grid,
  .metric-grid,
  .form-grid,
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(4, 12, 26, .86);
    backdrop-filter: blur(18px);
    z-index: 10;
  }

  .mobile-nav .nav-btn {
    padding: 9px 4px;
    font-size: 12px;
  }

  .timeline-row,
  .timeline-scale {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-room {
    font-size: 16px;
  }
}
