:root {
  --bg: #f2f5f2;
  --ink: #172c2b;
  --muted: #6f7f7d;
  --line: #d9e1dd;
  --surface: #ffffff;
  --soft: #f6f9f7;
  --accent: #19766b;
  --accent-2: #b8d8cf;
  --warning: #b4533f;
  --booked: #eaf1ff;
  --shadow: 0 18px 45px rgba(23, 44, 43, 0.08);
  --shadow-soft: 0 8px 20px rgba(23, 44, 43, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(25, 118, 107, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f8faf8 0%, var(--bg) 100%);
  background-size: 32px 32px, auto;
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(25, 118, 107, 0.18);
  border-color: var(--accent);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-main,
.topbar-actions,
.hero-head,
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #173f3a;
  color: #fff;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1;
}

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

.topbar-actions {
  align-items: end;
}

.date-picker {
  min-width: 184px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

.date-picker input {
  height: 36px;
}

.ghost-btn,
.toolbar-form button,
.primary-btn,
.danger-btn,
.icon-btn {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 750;
}

.ghost-btn {
  background: #eef5f2;
  color: var(--accent);
  border: 1px solid #d5e7e2;
}

.primary-btn,
.toolbar-form button {
  background: var(--accent);
  color: #fff;
}

.danger-btn {
  background: #fff0ec;
  color: var(--warning);
}

.icon-btn {
  width: 38px;
  padding: 0;
  background: var(--soft);
  color: var(--ink);
}

.main-content {
  padding: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.command-panel,
.hero-panel,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.command-panel {
  position: sticky;
  top: 78px;
  min-height: calc(100vh - 104px);
  padding: 16px;
  border-radius: 16px;
}

.panel-title {
  margin-bottom: 14px;
}

.panel-title h2,
.hero-copy h1,
.modal-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.panel-title h2 {
  font-size: 22px;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.stats-grid {
  display: grid;
  gap: 10px;
}

.stat-card {
  min-height: 70px;
  padding: 12px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid #e2e9e6;
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.hero-panel {
  min-height: calc(100vh - 104px);
  padding: 18px;
  border-radius: 16px;
}

.hero-head {
  align-items: end;
  margin-bottom: 16px;
}

.hero-copy {
  display: grid;
  gap: 7px;
}

.hero-copy h1 {
  font-size: 34px;
  line-height: 1.05;
}

.hero-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 82px minmax(220px, 1fr) 82px minmax(220px, 1fr);
  gap: 6px;
}

.schedule-head,
.time-cell,
.schedule-cell {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.schedule-head,
.time-cell {
  background: #f0f5f3;
}

.schedule-head strong,
.time-cell strong,
.slot-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.1;
}

.schedule-cell {
  background: #f8fbfa;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.schedule-cell:hover {
  background: #eef8f5;
  border-color: var(--accent-2);
}

.schedule-cell.booked {
  background: var(--booked);
  text-align: left;
}

.schedule-cell small,
.slot-card small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.slot-card {
  display: grid;
  gap: 1px;
}

.empty-cell {
  opacity: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 44, 43, 0.32);
  backdrop-filter: blur(8px);
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  width: min(760px, 100%);
  padding: 18px;
  border-radius: 14px;
}

.compact-modal {
  width: min(540px, 100%);
}

.modal-head {
  margin-bottom: 14px;
}

.modal-head h2 {
  font-size: 24px;
}

.toolbar-form,
.booking-form,
.grid-2 {
  display: grid;
  gap: 10px;
}

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

.toolbar-form {
  grid-template-columns: 1fr auto;
}

.toolbar-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.chip strong {
  font-size: 13px;
}

.chip button {
  padding: 0;
  background: transparent;
  color: var(--warning);
  font-weight: 800;
}

.stacked-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.modal-actions {
  margin-top: 12px;
}

.exam-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.exam-group legend {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.exam-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 8px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.exam-option input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

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

  .command-panel {
    position: static;
    min-height: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .schedule-grid {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .empty-cell {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar,
  .main-content,
  .modal {
    padding: 12px;
  }

  .topbar-main,
  .topbar-actions,
  .hero-head,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .toolbar-form,
  .grid-2,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 28px;
  }
}
