:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-strong: #edf4fb;
  --text: #102033;
  --muted: #62748a;
  --line: #d5e0eb;
  --accent: #0b4f8a;
  --accent-strong: #073762;
  --accent-soft: #dbeaf7;
  --coral: #c85843;
  --amber: #d3a935;
  --blue: #1b5f9f;
  --shadow: 0 20px 50px rgba(8, 29, 55, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(11, 79, 138, 0.12), transparent 34%),
    linear-gradient(45deg, rgba(211, 169, 53, 0.12), transparent 42%),
    var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #071936;
  color: #f7fbf7;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

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

.brand-mark {
  display: block;
  flex: 0 0 auto;
  height: 62px;
  object-fit: contain;
  width: 56px;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.calendar-toolbar h3,
.calendar-toolbar p,
.booking-copy h3,
.booking-copy p,
.panel-heading h3,
.panel-heading p,
.mini-panel h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1rem;
}

.brand p,
.mini-panel,
.nav-item {
  color: rgba(247, 251, 247, 0.72);
}

.primary-action,
.ghost-button,
.danger-button,
.segment,
.nav-item {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.sidebar .primary-action {
  background: #d3a935;
  color: #071936;
}

.sidebar-login {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 100%;
}

.wide {
  width: 100%;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  background: transparent;
  justify-content: flex-start;
  width: 100%;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mini-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: auto;
  padding: 16px;
}

.mini-panel h2 {
  color: #fff;
  font-size: 0.95rem;
}

.today-date {
  color: rgba(247, 251, 247, 0.66);
  margin: 6px 0 16px;
}

.metric-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.metric-row strong {
  color: #fff;
}

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  line-height: 1.05;
}

.topbar-actions,
.segmented-control {
  align-items: center;
  display: flex;
  gap: 8px;
}

.segmented-control {
  background: #e5ebe6;
  border-radius: 8px;
  padding: 4px;
}

.segment {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
}

.segment.active {
  background: #fff;
  box-shadow: 0 5px 20px rgba(27, 40, 34, 0.1);
  color: var(--text);
}

.ghost-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.icon-button {
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.danger-button {
  background: #fff0ed;
  color: #a93e2d;
}

.view {
  display: none;
  padding: 28px;
}

.view.active {
  display: block;
}

.calendar-toolbar {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.calendar-toolbar h3,
.booking-copy h3,
.panel-heading h3 {
  font-size: 1.35rem;
}

.calendar-toolbar p,
.booking-copy p {
  color: var(--muted);
  margin-top: 6px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
}

.legend i {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-booked {
  background: var(--accent);
}

.legend-blocked {
  background: var(--coral);
}

.legend-open {
  background: #b8c9c1;
}

.calendar-grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 74px repeat(var(--days-visible), minmax(124px, 1fr));
  overflow: auto;
}

.public-month-grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  overflow: auto;
}

.month-weekday {
  background: #fbfcfa;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 42px;
  padding: 12px;
  text-transform: uppercase;
}

.month-day {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  text-align: left;
}

.month-day strong {
  color: var(--text);
  font-size: 1rem;
}

.month-day span {
  color: var(--muted);
}

.month-day.available {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.month-day.available span {
  color: var(--accent-strong);
  font-weight: 800;
}

.month-day:disabled {
  cursor: default;
}

.month-day.muted {
  opacity: 0.42;
}

.admin-month-day {
  cursor: pointer;
}

.admin-month-day:hover,
.admin-month-day:focus-visible {
  background: #f2f8f5;
  outline: 2px solid var(--accent-soft);
}

.month-record {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
  min-height: 30px;
  overflow: hidden;
  padding: 6px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-record.blocked {
  background: var(--coral);
}

.time-cell,
.day-head,
.slot-cell {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 54px;
}

.time-cell {
  align-items: start;
  color: var(--muted);
  display: flex;
  font-size: 0.8rem;
  justify-content: center;
  padding-top: 10px;
}

.day-head {
  appearance: none;
  background: #fbfcfa;
  border-left: 0;
  border-top: 0;
  color: inherit;
  font: inherit;
  min-height: 66px;
  padding: 12px;
  position: sticky;
  text-align: left;
  top: 0;
  z-index: 1;
}

button.day-head:hover,
button.day-head:focus-visible {
  background: var(--accent-soft);
  outline: 2px solid transparent;
}

.day-head strong {
  display: block;
}

.day-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.slot-cell {
  background: #fff;
  min-width: 124px;
  padding: 5px;
}

.slot-cell[role="button"] {
  cursor: pointer;
}

.slot-cell[role="button"]:hover,
.slot-cell[role="button"]:focus-visible {
  background: var(--accent-soft);
  outline: 2px solid transparent;
}

.slot-cell.closed {
  background: repeating-linear-gradient(
    -45deg,
    #f4f1ec,
    #f4f1ec 8px,
    #ebe7df 8px,
    #ebe7df 16px
  );
}

.slot-event {
  border: 0;
  border-radius: 6px;
  color: #fff;
  display: grid;
  min-height: 42px;
  overflow: hidden;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.slot-event small {
  opacity: 0.82;
}

.slot-event.booked {
  background: var(--accent);
}

.slot-event.blocked {
  background: var(--coral);
}

.open-slot-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.54);
  border: 1px dashed #abc0b6;
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  height: 42px;
  justify-content: center;
  width: 100%;
}

.slot-cell:hover .open-slot-button {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.booking-layout,
.settings-layout {
  display: none;
  gap: 24px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
}

.booking-layout.active,
.settings-layout.active {
  display: grid;
}

.booking-copy {
  background:
    linear-gradient(rgba(7, 25, 54, 0.18), rgba(7, 25, 54, 0.72)),
    url("assets/booking-workspace.svg");
  background-size: cover;
  border-radius: 8px;
  color: #fff;
  min-height: 430px;
  padding: 28px;
}

.booking-copy .eyebrow,
.booking-copy p {
  color: rgba(255, 255, 255, 0.82);
}

.booking-panel,
.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.booking-step {
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 20px;
}

.booking-step:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.details-step.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.step-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.step-heading span {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: grid;
  flex: 0 0 auto;
  font-weight: 800;
  height: 32px;
  width: 32px;
}

.step-heading strong {
  display: block;
}

.step-heading p {
  color: var(--muted);
  margin: 4px 0 0;
}

label,
.field-label {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 8px;
  margin-bottom: 16px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  margin: 8px 0 18px;
}

.slot-choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
}

.slot-choice.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 800;
}

.empty-state {
  background: #f2f6f4;
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.settings-layout {
  grid-template-columns: minmax(360px, 1.1fr) minmax(300px, 0.9fr);
}

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

.availability-list,
.service-list {
  display: grid;
  gap: 10px;
}

.day-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px 92px 1fr 1fr;
  padding: 12px;
}

.day-row:hover,
.day-row:focus-visible {
  background: #f5faf7;
  cursor: pointer;
  outline: 2px solid transparent;
}

.day-row label {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.day-row input[type="checkbox"] {
  min-height: 18px;
  width: 18px;
}

.service-item {
  align-items: center;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.service-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.appointment-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 460px;
  width: min(92vw, 460px);
}

.dialog-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.dialog-panel h4 {
  margin: 0 0 14px;
}

.appointment-dialog::backdrop {
  background: rgba(20, 35, 31, 0.45);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  background: #f6f9f7;
  border-radius: 8px;
  padding: 10px 12px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 4px 0 0;
}

menu {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 20px 0 0;
  padding: 0;
}

.toast {
  background: #17201c;
  border-radius: 8px;
  bottom: 20px;
  color: #fff;
  left: 50%;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 14px);
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mini-panel {
    margin-top: 0;
  }

  .topbar,
  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .booking-layout.active,
  .settings-layout.active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .view,
  .topbar {
    padding: 18px;
  }

  .form-grid,
  .day-row {
    grid-template-columns: 1fr;
  }

  .booking-copy {
    min-height: 300px;
  }

  .calendar-grid {
    grid-template-columns: 66px repeat(var(--days-visible), minmax(110px, 1fr));
  }

  .public-month-grid {
    grid-template-columns: repeat(7, minmax(82px, 1fr));
  }

  .month-day {
    min-height: 96px;
    padding: 10px;
  }
}
