:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-strong: #f8faf7;
  --ink: #19201d;
  --muted: #66716a;
  --line: #d9dfd8;
  --accent: #1f7a5a;
  --accent-dark: #15563f;
  --accent-soft: #dff1e8;
  --info: #1f5d80;
  --info-soft: #e6f4ff;
  --warning: #b66a1a;
  --warning-soft: #fff4e3;
  --danger: #b23b3b;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(29, 43, 35, 0.12);
  --shadow-soft: 0 10px 26px rgba(29, 43, 35, 0.08);
  --focus: 0 0 0 3px rgba(31, 122, 90, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body[data-page="admin"] #roleView {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.08), rgba(244, 246, 242, 0) 36%),
    radial-gradient(circle at 88% 12%, rgba(31, 93, 128, 0.08), rgba(244, 246, 242, 0) 34%),
    var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  margin: 0 0 12px auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(29, 43, 35, 0.08);
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.sync-status__dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--muted);
}

.sync-status[data-status="checking"],
.sync-status[data-status="syncing"] {
  border-color: rgba(182, 106, 26, 0.28);
  color: var(--warning);
  background: #fffaf0;
}

.sync-status[data-status="checking"] .sync-status__dot,
.sync-status[data-status="syncing"] .sync-status__dot {
  background: var(--warning);
  animation: syncPulse 1.2s ease-in-out infinite;
}

.sync-status[data-status="online"],
.sync-status[data-status="saved"] {
  border-color: rgba(31, 122, 90, 0.24);
  color: var(--accent-dark);
  background: #f1fbf6;
}

.sync-status[data-status="online"] .sync-status__dot,
.sync-status[data-status="saved"] .sync-status__dot {
  background: var(--accent);
}

.sync-status[data-status="local"] {
  background: var(--surface-strong);
}

.sync-status[data-status="error"] {
  border-color: rgba(178, 59, 59, 0.28);
  color: var(--danger);
  background: #fff5f5;
  transform: translateY(-1px);
}

.sync-status[data-status="error"] .sync-status__dot {
  background: var(--danger);
}

@keyframes syncPulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.86);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.inline-bar {
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar strong {
  display: block;
  font-size: 1.05rem;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 250px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.view-switch button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.wide-switch {
  grid-template-columns: repeat(4, 1fr);
  min-width: min(520px, 100%);
}

.view-switch button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 90, 0.18);
}

.view-switch button:not(.active):hover {
  background: #fff;
  color: var(--accent-dark);
}

.booking-board,
.admin-panel,
.role-view,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.booking-board,
.role-view,
.login-panel {
  animation: soft-enter 280ms ease both;
}

.role-view {
  display: grid;
}

.role-hero {
  min-height: 390px;
}

.role-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 28px;
  background: linear-gradient(180deg, #fff, var(--surface-strong));
}

.public-role-view .role-actions {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.role-card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 247, 0.88));
  color: var(--ink);
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.role-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(29, 43, 35, 0.12);
  transform: translateY(-2px);
}

.role-card span,
.role-card strong,
.role-card small {
  display: block;
}

.role-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.role-card strong {
  margin-top: 10px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.role-card small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.visual-panel {
  position: relative;
  min-height: 280px;
  background: #1e2c27;
  overflow: hidden;
}

.visual-panel img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
  object-fit: cover;
}

.visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 23, 20, 0.88), rgba(12, 23, 20, 0.44) 50%, rgba(12, 23, 20, 0.12)),
    linear-gradient(180deg, rgba(12, 23, 20, 0.08), rgba(12, 23, 20, 0.42));
}

.visual-overlay {
  position: absolute;
  z-index: 1;
  inset: auto auto 34px 34px;
  width: min(560px, calc(100% - 48px));
  color: #fff;
}

.kicker,
.eyebrow {
  margin: 0 0 8px;
  color: #cfe6dc;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.visual-overlay h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.visual-overlay p:last-child {
  margin: 16px 0 0;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 0;
}

.student-schedule-layout {
  display: block;
}

.scheduler,
.form-panel,
.admin-panel {
  padding: 28px;
}

.form-panel {
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
}

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

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-heading h3 {
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent);
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

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

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.dot.available {
  background: var(--accent);
}

.dot.booked {
  background: var(--warning);
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.day-tab {
  min-height: 66px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.day-tab strong,
.day-tab span {
  display: block;
}

.day-tab strong {
  font-size: 0.96rem;
  line-height: 1.1;
}

.day-tab span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.day-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(31, 122, 90, 0.1);
}

.day-tab:not(.active):hover {
  border-color: rgba(31, 122, 90, 0.34);
  background: #fbfefd;
  transform: translateY(-1px);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 10px;
}

.slot-grid .empty-state {
  grid-column: 1 / -1;
}

.slot-button {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.slot-button strong,
.slot-button span {
  display: block;
}

.slot-button strong {
  font-size: 1.05rem;
}

.slot-button span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.slot-button.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.slot-button:not(:disabled):hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.slot-button.selected span {
  color: rgba(255, 255, 255, 0.8);
}

.slot-button:disabled {
  cursor: not-allowed;
  background: #f0ece5;
  color: #7f6a55;
}

.slot-grid.week-schedule {
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.student-week-day {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.student-week-day:has(.week-slot-button.available) {
  background: #fff;
}

.student-week-day-head {
  min-height: 74px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7faf7);
}

.student-week-day-head strong,
.student-week-day-head span {
  display: block;
}

.student-week-day-head strong {
  line-height: 1.15;
}

.student-week-day-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.student-week-slots {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.week-slot-button {
  min-height: 68px;
  padding: 10px;
}

.week-slot-button.available {
  border-color: rgba(31, 122, 90, 0.22);
  background: #fff;
}

.week-slot-button.available:hover {
  border-color: rgba(31, 122, 90, 0.42);
  background: #f6fcf9;
}

.week-slot-button.closed {
  background: #f6f3ec;
}

.week-slot-button.booked {
  border-color: #e5d7c7;
  background: #f0ece5;
}

form {
  display: grid;
  gap: 14px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c3cdc5;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.16);
}

.selected-slot {
  min-height: 56px;
  border: 1px dashed #9fb3a9;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
}

.selected-slot.ready {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.profile-summary {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(31, 122, 90, 0.2);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #f1fbf6, #e9f7f0);
  color: var(--accent-dark);
  font-weight: 800;
}

.profile-summary span {
  color: var(--muted);
  font-weight: 700;
}

.booking-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.booking-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.booking-steps i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.booking-steps span.complete {
  border-color: rgba(31, 122, 90, 0.22);
  background: linear-gradient(180deg, var(--accent-soft), #edf8f3);
  color: var(--accent-dark);
}

.booking-steps span.complete i {
  background: var(--accent);
  color: #fff;
}

.student-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.student-choice-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.student-choice-summary div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.student-choice-summary span,
.student-choice-summary strong {
  display: block;
}

.student-choice-summary span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.student-choice-summary strong {
  margin-top: 6px;
  line-height: 1.25;
}

.student-bookings-panel {
  margin-bottom: 18px;
}

.segmented-filter {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(100%, 430px);
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.segmented-filter button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.segmented-filter button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 90, 0.18);
}

.segmented-filter button:not(.active):hover {
  background: #fff;
  color: var(--accent-dark);
}

.student-booking-list,
.compact-booking-list {
  display: grid;
  gap: 8px;
}

.student-booking-card,
.compact-booking-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.student-booking-card:hover,
.compact-booking-card:hover {
  border-color: rgba(31, 122, 90, 0.28);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.student-booking-card strong,
.student-booking-card span,
.compact-booking-card strong,
.compact-booking-card span {
  display: block;
}

.student-booking-card span,
.compact-booking-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.student-booking-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.student-booking-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.student-booking-actions button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.success-banner {
  margin: 0 28px 28px;
  border: 1px solid #b9decf;
  border-radius: 8px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #eaf8f1, var(--accent-soft));
  color: var(--accent-dark);
  box-shadow: var(--shadow-soft);
  animation: soft-enter 260ms ease both;
}

.success-banner strong,
.success-banner span,
.success-banner small {
  display: block;
}

.success-banner span {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.success-banner small {
  margin-top: 8px;
  color: var(--accent-dark);
  font-weight: 800;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.check-row:hover {
  color: var(--ink);
}

.primary-action,
.admin-actions button,
.booking-card button,
.settings-actions button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 9px 18px rgba(31, 122, 90, 0.14);
}

.primary-action:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(31, 122, 90, 0.18);
}

.form-note {
  min-height: 22px;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.4;
}

.form-note.error {
  color: var(--danger);
}

.form-note:not(:empty) {
  animation: soft-enter 220ms ease both;
}

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

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-actions button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.admin-actions button:hover,
.secondary-action:hover,
.settings-actions button[type="button"]:hover,
.compact-actions button:hover,
.blocked-date-item button:hover,
.smart-settings > button:hover {
  border-color: rgba(31, 122, 90, 0.3);
  color: var(--accent-dark);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.secondary-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.login-panel {
  padding: 0;
}

.login-form {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 44px 28px 52px;
}

.login-form:has(.two-column) {
  width: min(720px, 100%);
}

.login-form h1 {
  margin: 0 0 20px;
  font-size: 2rem;
  line-height: 1.08;
}

.muted-note {
  color: var(--muted);
}

.current-instructor,
.current-student {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.instructor-filter {
  max-width: 420px;
  margin-bottom: 18px;
}

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

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

.school-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 12px;
}

.school-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.school-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.school-card:hover,
.moderation-card:hover,
.notification-item:hover,
.blocked-date-item:hover,
.analytics-card:hover {
  border-color: rgba(31, 122, 90, 0.24);
  box-shadow: var(--shadow-soft);
}

.school-card.inactive {
  border-left-color: var(--muted);
  background: var(--surface-strong);
}

.school-card h3 {
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

.school-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.school-card code {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(31, 122, 90, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.school-card code:hover {
  border-color: rgba(31, 122, 90, 0.32);
  background: #eef9f3;
}

.school-card .card-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.school-card .card-actions .primary-action {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.school-card .card-actions .primary-action:hover {
  border-color: transparent;
  background: var(--accent-dark);
  color: #fff;
}

.school-card .card-actions .danger-action {
  border-color: #f0caca;
  background: var(--danger-soft);
  color: var(--danger);
}

.moderation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warning);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.moderation-card.approved {
  border-left-color: var(--accent);
}

.moderation-card.blocked {
  border-left-color: var(--danger);
}

.moderation-card h3 {
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

.moderation-card p,
.moderation-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.mini-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, var(--surface-strong), #fff);
}

.mini-panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 247, 0.92));
  line-height: 1.45;
}

.compact-empty {
  padding: 12px;
  background: #fff;
}

.notification-list,
.blocked-date-list {
  display: grid;
  gap: 8px;
}

.notification-item,
.blocked-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.notification-item {
  display: grid;
  justify-content: stretch;
}

.notification-item strong,
.notification-item span,
.blocked-date-item span {
  min-width: 0;
}

.notification-item span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.blocked-date-item button,
.smart-settings > button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.booking-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr) minmax(200px, 0.85fr) minmax(170px, auto);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.booking-card:hover {
  border-color: rgba(31, 122, 90, 0.25);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.journal-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(220px, 1fr) minmax(150px, auto);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, var(--surface-strong), #fff);
}

.journal-filters h3 {
  margin: 0;
  font-size: 1.05rem;
}

.journal-filter-summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.booking-card.editing {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 14px 28px rgba(31, 122, 90, 0.12);
}

.booking-card h3,
.booking-card p {
  margin: 0;
}

.booking-card h3 {
  font-size: 1rem;
}

.booking-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.booking-time {
  color: var(--accent-dark);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.pending,
.status-pill.new {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.confirmed {
  background: var(--info-soft);
  color: var(--info);
}

.status-pill.completed {
  background: #eef1f3;
  color: #59636b;
}

.status-pill.cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.muted-pill {
  margin-left: 6px;
  background: var(--surface-strong);
  color: var(--muted);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-card button,
.booking-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.booking-card .danger-action {
  border-color: #f0caca;
  background: var(--danger-soft);
  color: var(--danger);
}

.booking-card button:hover,
.booking-card a:hover,
.school-card .card-actions button:hover {
  border-color: rgba(31, 122, 90, 0.32);
  color: var(--accent-dark);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.danger-action:hover,
.booking-card .danger-action:hover,
.school-card .card-actions .danger-action:hover {
  border-color: rgba(178, 59, 59, 0.34);
  color: #8f2e2e;
  background: #fff8f8;
}

.booking-card.cancelled,
.calendar-booking.cancelled,
.compact-booking-card.cancelled {
  opacity: 0.72;
}

.instructor-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.compact-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.compact-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.danger-action {
  border: 1px solid #f0caca;
  background: var(--danger-soft);
  color: var(--danger);
}

.settings-form {
  max-width: 860px;
}

.smart-settings {
  display: grid;
  gap: 12px;
}

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

.calendar-week-label {
  margin: -8px 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-day {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.calendar-day-head {
  min-height: 74px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7faf7);
}

.calendar-day-head strong,
.calendar-day-head span {
  display: block;
}

.calendar-day-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.calendar-bookings {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.calendar-booking {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.calendar-booking:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.calendar-booking strong,
.calendar-booking span {
  display: block;
}

.calendar-booking span,
.calendar-empty {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.calendar-empty {
  margin: 0;
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.analytics-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, var(--surface-strong));
  box-shadow: 0 1px 0 rgba(29, 43, 35, 0.04);
}

.analytics-card span,
.analytics-card strong {
  display: block;
}

.analytics-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.analytics-card strong {
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 1.55rem;
  line-height: 1;
}

.analytics-bars {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: 80px minmax(140px, 1fr) 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.analytics-track {
  height: 12px;
  border-radius: 999px;
  background: #e7ece8;
  overflow: hidden;
}

.analytics-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(16, 25, 22, 0.38);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.edit-drawer {
  width: min(620px, 100%);
  height: 100%;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 48px rgba(29, 43, 35, 0.18);
  transform: translateX(32px);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-backdrop.is-open .edit-drawer {
  transform: translateX(0);
}

.edit-form {
  min-height: 100%;
  padding: 28px;
  background: var(--surface);
}

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

.drawer-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: rgba(31, 122, 90, 0.28);
  color: var(--accent-dark);
  box-shadow: var(--shadow-soft);
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 8px;
}

.check-tile {
  display: block;
  position: relative;
}

.check-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-tile span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.check-tile:hover span {
  border-color: rgba(31, 122, 90, 0.28);
  color: var(--accent-dark);
}

.check-tile input:focus-visible + span {
  box-shadow: var(--focus);
}

.check-tile input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.settings-grid.two-column {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.settings-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, var(--surface-strong), #fff);
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-actions button[type="button"] {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

@keyframes soft-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 940px) {
  .content-grid,
  .booking-card,
  .school-form,
  .school-card,
  .instructor-dashboard-grid,
  .student-choice-summary,
  .journal-filters,
  .moderation-card {
    grid-template-columns: 1fr;
  }

  .journal-filter-summary {
    justify-content: flex-start;
    text-align: left;
  }

  .role-actions {
    grid-template-columns: 1fr;
  }

  .card-actions {
    justify-content: flex-start;
  }

  .analytics-cards {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .form-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .day-tabs {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
  }

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

  .weekday-grid,
  .settings-grid,
  .settings-grid.two-column {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .edit-drawer {
    width: min(560px, 100%);
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    margin-top: 9px;
  }

  .sync-status {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }

  .visual-panel,
  .visual-panel img {
    min-height: 240px;
  }

  .role-hero {
    min-height: 320px;
  }

  .visual-overlay {
    inset: auto 16px 20px 16px;
    width: auto;
  }

  .visual-overlay h1 {
    font-size: 2rem;
    line-height: 1.04;
  }

  .scheduler,
  .form-panel,
  .admin-panel,
  .success-banner {
    padding: 18px;
  }

  .login-form {
    padding: 28px 18px 34px;
  }

  .success-banner {
    margin: 0 18px 18px;
  }

  .section-heading,
  .legend,
  .admin-actions,
  .top-bar,
  .header-actions {
    flex-wrap: wrap;
  }

  .view-switch {
    width: 100%;
  }

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

  .role-actions {
    grid-template-columns: 1fr;
    padding: 18px;
  }

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

  .card-actions button,
  .card-actions a,
  .admin-actions button,
  .header-actions button,
  .settings-actions button {
    width: 100%;
  }

  .school-card .card-actions {
    grid-template-columns: 1fr;
  }

  .day-tabs,
  .slot-grid,
  .booking-steps,
  .student-filter-grid,
  .weekday-grid,
  .settings-grid,
  .settings-grid.two-column,
  .notification-settings,
  .analytics-cards {
    grid-template-columns: 1fr 1fr;
  }

  .student-choice-summary,
  .student-booking-card,
  .student-booking-actions,
  .compact-booking-card {
    grid-template-columns: 1fr;
  }

  .student-booking-actions {
    justify-items: start;
  }

  .student-booking-actions button,
  .compact-actions button {
    width: 100%;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
  }

  .drawer-backdrop {
    align-items: stretch;
  }

  .edit-form {
    padding: 20px;
  }
}
