:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-right: env(safe-area-inset-right, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
}

body.teacher {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: calc(92px + var(--safe-bottom));
  box-shadow: 0 0 0 1px var(--border);
  transition: background 0.2s ease;
}

@media (max-width: 480px) {
  body { max-width: none; box-shadow: none; }
  .bottom-nav { left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); transform: none; width: auto; max-width: none; }
}

h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  padding: calc(16px + var(--safe-top)) 16px 16px;
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  border-bottom: 1px solid var(--border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.header-subtitle {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.role-switch {
  display: flex;
  background: #eef2ff;
  padding: 4px;
  border-radius: 999px;
  width: fit-content;
}

body.teacher .role-switch {
  background: #ede9fe;
}

.role-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-btn:hover {
  color: var(--text-main);
}

.role-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.role-btn:active {
  transform: scale(0.98);
}

.registration-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 56%, #ffffff 100%);
}

.registration-card {
  width: 100%;
  max-width: 420px;
}

.registration-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.registration-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.6px;
}

.registration-text {
  margin: 10px 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.registration-form label,
.modal-body label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-main);
}

.registration-form input,
.modal-body input[type="text"],
.modal-body input[type="email"] {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.registration-form input:focus,
.modal-body input[type="text"]:focus,
.modal-body input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.registration-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.form-error {
  margin: 0 0 14px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.4;
}

.registration-submit {
  width: 100%;
}

.main {
  padding: 16px;
  max-width: 100%;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
}

.calendar-section {
  margin-bottom: 24px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
  background: #e0e7ff;
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.month-label {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-main);
}

.days-strip {
  display: flex;
  gap: 8px;
}

.day {
  flex: 1;
  min-width: 0;
  height: 60px;
  border: none;
  border-radius: 12px;
  background: #f3f4f6;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.day span { display: block; }

.day.has-available::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.day.active.has-available::after {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.day:hover {
  background: #e0e7ff;
  transform: translateY(-2px);
}

.day:active {
  transform: translateY(0) scale(0.98);
}

.day.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

body.teacher .day.active {
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.content-section {
  margin-bottom: 24px;
}

.slot-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.period-block { margin-top: 24px; }
.period-block:first-child { margin-top: 0; }

.hidden { display: none !important; }
.view.hidden { display: none; }

.slots-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.add-slot {
  width: 120px;
  min-width: 120px;
  height: 48px;
  min-height: 44px;
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.add-slot:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

body.teacher .add-slot:hover {
  background: #f5f3ff;
}

.add-slot:active {
  transform: scale(0.98);
}

.slots-list {
  flex: 1;
  min-width: 0;
}

#teacherSlotsList {
  min-width: 180px;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

#teacherSlotsList .time-slots {
  grid-template-columns: repeat(auto-fill, minmax(180px, 180px));
}

.slot {
  padding: 12px 18px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.slot:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.slot.slot--reserved {
  position: relative;
  background: #eef2f7;
  border-color: #d8dee8;
  color: #4b5563;
  padding-right: 34px;
  white-space: nowrap;
}

.slot.slot--reserved::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.slot.slot--reserved:hover {
  border-color: #2563eb;
}

.slot:active {
  transform: scale(0.98);
}

.slot.booked,
.slot:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: transparent;
  cursor: not-allowed;
  box-shadow: none;
}

.slot.booked:hover,
.slot:disabled:hover {
  transform: none;
}

.pages .page.hidden { display: none; }

.bookings-list {
  margin: 0;
  padding: 0;
}

.booking-group {
  margin-bottom: 24px;
}

.booking-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 12px 0;
}

.appointment-card {
  display: flex;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  margin-bottom: 16px;
  animation: fadeInUp 0.25s ease forwards;
}

.appointment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.appointment-card--past {
  opacity: 0.75;
}

.appointment-card--past:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.appointment-date {
  width: 60px;
  height: 68px;
  border-radius: 14px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-right: 16px;
  flex-shrink: 0;
}

body.teacher .appointment-date {
  background: #f5f3ff;
}

.appointment-date .day {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  width: auto;
  min-width: auto;
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  display: block;
  cursor: default;
  transform: none;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-main);
}

.appointment-date .day:hover {
  background: none;
  color: inherit;
  transform: none;
}

.appointment-date .month {
  font-size: 12px;
  color: #6b7280;
  margin-top: 0;
  line-height: 1;
}

.appointment-info {
  flex: 1;
  min-width: 0;
}

.appointment-info .badge {
  display: inline-block;
  margin-bottom: 4px;
}

.appointment-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.appointment-title-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.appointment-meta {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.appointment-time {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.appointment-actions {
  flex-shrink: 0;
}

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.badge--today {
  background: #dcfce7;
  color: #16a34a;
}

.badge--tomorrow {
  background: #eef2ff;
  color: var(--primary);
}

.badge--past {
  background: #f3f4f6;
  color: #6b7280;
}

.cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: #b91c1c;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cancel-btn:hover {
  opacity: 0.7;
}

.cancel-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.empty-state {
  text-align: center;
  margin-top: 80px;
  padding: 24px 16px;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.empty-state-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.bookings-list li {
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.muted { color: var(--text-secondary); font-size: 14px; }

.no-slots-msg {
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Teacher: reserved page */
.week-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.week-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #f3f4f6;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.week-btn:hover {
  background: #e5e7eb;
}

.week-btn:active {
  transform: scale(0.98);
}

.week-label {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.teacher-summary.card {
  padding: 16px;
  margin: 12px 0 16px;
}

.teacher-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.summary-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.teacher-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 16px;
}

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  border-color: transparent;
  background: #eef2ff;
  color: var(--primary);
}

body.teacher .filter-chip.active {
  background: #ede9fe;
}

.day-group {
  margin-bottom: 20px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 10px 0;
}

.day-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.t-appointment-card {
  padding: 16px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.t-appointment-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.t-time {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.student-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.student-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

body.teacher .student-avatar {
  background: #ede9fe;
}

.student-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.student-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.t-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-secondary {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.btn-danger:active {
  transform: scale(0.98);
}

.bottom-nav {
  position: fixed;
  bottom: calc(10px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  display: flex;
  justify-content: center;
  padding: 5px;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: 30px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 3px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.nav-inner.hidden { display: none; }

.nav-item {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 6px 6px 7px;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-label {
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.05;
  color: inherit;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.nav-item:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}

.nav-item.active {
  color: var(--primary);
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08), 0 8px 18px rgba(37, 99, 235, 0.12);
  transform: none;
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.nav-item:active {
  transform: scale(0.98);
}

.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 20px;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.notice-overlay {
  z-index: 500;
  background: rgba(15, 23, 42, 0.28);
}

.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 20px;
  padding: 28px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-notice {
  max-width: 360px;
  padding: 22px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  position: relative;
  min-height: 32px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.modal-header:has(#modalTitle:empty) {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-close:active {
  transform: scale(0.98);
}

.modal-close svg {
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  padding-right: 32px;
}

#modalConfirmBooking .modal-title {
  text-align: left;
  padding-right: 0;
}

.modal-date {
  font-size: 16px;
  font-weight: 500;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-date::before {
  content: '';
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat center;
}

body.teacher .modal-date::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.modal-subtext {
  font-size: 14px;
  color: #6b7280;
  margin-top: 6px;
}

.modal-body {
  padding: 0;
}

.modal-body label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-main);
}

.modal-body input[type="time"] {
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  margin-top: 6px;
  transition: border-color 0.2s ease;
}

.modal-body select {
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  margin-top: 6px;
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.modal-body input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-body select:focus {
  outline: none;
  border-color: var(--primary);
}

.booking-preview {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.booking-preview div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.booking-preview span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.booking-preview strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: stretch;
}

.modal-actions .btn-primary,
.modal-actions .btn-ghost {
  flex: 1;
  min-width: 0;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--text-secondary);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-primary.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-ghost {
  height: 44px;
  padding: 0 16px;
  background: transparent;
  color: #6b7280;
  border: none;
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--text-main);
  background: transparent;
  border: none;
}

.toast {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--text-main);
  color: var(--card);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  animation: toastIn 0.3s ease forwards;
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
