:root {
  --bg: #050816;
  --bg-deep: #02040b;
  --panel: rgba(10, 16, 30, 0.86);
  --panel-strong: rgba(12, 21, 38, 0.94);
  --text: #eff7ff;
  --muted: #96a7b8;
  --line: rgba(120, 180, 190, 0.16);
  --roman: #ffd84d;
  --roman-soft: rgba(255, 216, 77, 0.16);
  --nubian: #36e0d0;
  --nubian-soft: rgba(54, 224, 208, 0.14);
  --custom: #ff9b3d;
  --custom-soft: rgba(255, 155, 61, 0.16);
  --shared: #31a9ff;
  --shared-soft: rgba(49, 169, 255, 0.14);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  --radius: 26px;
  --font-display: "Trebuchet MS", "Avenir Next", sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(75, 215, 200, 0.22), transparent 24%),
    radial-gradient(circle at 85% 20%, rgba(0, 186, 255, 0.14), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(75, 215, 200, 0.1), transparent 35%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg) 55%, #07111f 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1380px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(118, 198, 210, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 22px;
}

.panel-wide {
  padding: 26px;
}

.section-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: #78d9d0;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
  font-size: 1.55rem;
}

.calendar-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.calendar-header {
  margin-bottom: 18px;
}

.section-heading {
  margin-bottom: 14px;
}

.calendar-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button,
.delete-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(118, 198, 210, 0.14);
}

.primary-button {
  background: linear-gradient(135deg, #1bc3b0, #0f6f80);
  color: #031015;
  font-weight: 700;
}

.delete-button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(118, 198, 210, 0.14);
  flex-shrink: 0;
}

.ghost-button:hover,
.primary-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.swatch.roman {
  background: var(--roman);
}

.swatch.nubian {
  background: var(--nubian);
}

.swatch.shared {
  background: var(--shared);
}

.swatch.custom {
  background: var(--custom);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekday-row {
  margin-bottom: 10px;
}

.weekday {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.calendar-day {
  min-height: 134px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(10, 18, 33, 0.92);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.calendar-day.empty-day .booking-chip-list {
  display: block;
}

.calendar-day:hover {
  transform: translateY(-1px);
}

.calendar-day.outside-month {
  opacity: 0.38;
}

.calendar-day.is-today {
  border-color: rgba(75, 215, 200, 0.85);
  background:
    linear-gradient(180deg, rgba(75, 215, 200, 0.12), rgba(255, 255, 255, 0.02) 45%, transparent 100%),
    rgba(10, 18, 33, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(75, 215, 200, 0.28),
    0 0 0 1px rgba(75, 215, 200, 0.22),
    0 0 24px rgba(75, 215, 200, 0.18);
}

.calendar-day.is-selected {
  border-color: rgba(49, 169, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(49, 169, 255, 0.18);
}

.day-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.day-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.booking-chip-list,
.upcoming-list,
.day-schedule {
  display: grid;
  gap: 10px;
}

.upcoming-list {
  margin-top: 12px;
}

.booking-chip,
.schedule-card,
.mini-card {
  border-radius: 16px;
  padding: 10px 12px;
}

.booking-chip {
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 12px;
}

.booking-chip strong,
.schedule-card strong,
.mini-card strong {
  display: block;
  margin-bottom: 4px;
}

.booking-chip.roman,
.schedule-card.roman,
.mini-card.roman {
  background: var(--roman-soft);
  border: 1px solid rgba(75, 215, 200, 0.18);
}

.booking-chip.nubian,
.schedule-card.nubian,
.mini-card.nubian {
  background: var(--nubian-soft);
  border: 1px solid rgba(127, 255, 212, 0.18);
}

.booking-chip.shared,
.schedule-card.shared,
.mini-card.shared {
  background: var(--shared-soft);
  border: 1px solid rgba(49, 169, 255, 0.18);
}

.booking-chip.custom,
.schedule-card.custom,
.mini-card.custom {
  background: var(--custom-soft);
  border: 1px solid rgba(255, 155, 61, 0.18);
}

.meta-line {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.booking-form {
  display: grid;
  gap: 14px;
}

.booking-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hidden-field[hidden] {
  display: none;
}

.bot-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.booking-form input,
.booking-form select {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(118, 198, 210, 0.14);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
}

#date {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 22px;
}

.schedule-card {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.schedule-copy {
  min-width: 0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

@media (max-width: 760px) {
  .page-shell {
    width: calc(100% - 12px);
    padding-top: 12px;
  }

  .panel,
  .panel-wide {
    padding: 14px;
    border-radius: 22px;
  }

  .calendar-header,
  .section-heading {
    flex-direction: column;
    gap: 10px;
  }

  .calendar-controls {
    width: 100%;
    gap: 8px;
  }

  .calendar-controls button {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 0;
    padding: 11px 8px;
    font-size: 0.98rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  h2 {
    font-size: 1.95rem;
  }

  .legend {
    gap: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.82rem;
  }

  .weekday-row,
  .calendar-grid {
    gap: 4px;
    min-width: 0;
  }

  .weekday-row {
    margin-bottom: 4px;
  }

  .calendar-day {
    min-height: 0;
    aspect-ratio: 1 / 1.36;
    padding: 5px;
    gap: 4px;
    border-radius: 12px;
  }

  .day-number {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.75rem;
    line-height: 1;
  }

  .booking-chip-list {
    gap: 3px;
  }

  .booking-chip {
    padding: 3px 4px;
    font-size: 0.56rem;
    border-radius: 7px;
  }

  .booking-chip strong {
    margin-bottom: 1px;
    font-size: 0.56rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .booking-chip .meta-line,
  .weekday {
    font-size: 0.56rem;
  }

  .booking-chip .meta-line {
    line-height: 1;
  }

  .day-count {
    display: none;
  }

  .empty-day .booking-chip-list,
  .empty-day .compact-more {
    display: none;
  }

  .calendar-day.outside-month {
    opacity: 0.28;
  }

  .schedule-card {
    flex-direction: column;
    align-items: stretch;
  }

  .delete-button {
    width: 100%;
  }

  .booking-form input,
  .booking-form select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  #date {
    display: block;
    width: 100%;
    inline-size: 100%;
    max-inline-size: 100%;
    overflow: hidden;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: calc(100% - 8px);
    padding-top: 10px;
  }

  .panel,
  .panel-wide {
    padding: 12px;
    border-radius: 18px;
  }

  .calendar-controls button {
    padding: 10px 6px;
    font-size: 0.92rem;
  }

  .legend {
    gap: 8px 12px;
    font-size: 0.76rem;
  }

  .swatch {
    width: 9px;
    height: 9px;
  }

  .weekday {
    font-size: 0.5rem;
  }

  .calendar-day {
    padding: 4px;
    border-radius: 10px;
  }

  .day-number {
    font-size: 0.68rem;
  }

  .booking-chip {
    padding: 2px 4px;
    font-size: 0.52rem;
    border-radius: 6px;
  }

  .booking-chip strong,
  .booking-chip .meta-line {
    font-size: 0.52rem;
  }
}
