:root {
  --bg: #eef2f7;
  --bg-deep: #e7ecf3;
  --card: rgba(255, 255, 255, 0.76);
  --card-strong: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --primary: #0f172a;
  --primary-soft: #1e293b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.85), transparent 32%),
    radial-gradient(circle at top right, rgba(191,219,254,0.45), transparent 30%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 48%, #e9eef5 100%);
  min-height: 100vh;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(59, 130, 246, 0.12);
  top: -120px;
  left: -100px;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: rgba(15, 23, 42, 0.06);
  right: -120px;
  top: 180px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page {
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-card,
.page-header,
.card,
.auth-card {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: 36px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 28px;
  min-height: 560px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 6px 10px 6px;
}

.hero-copy h1 {
  margin: 14px 0 14px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin: 0;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.stat-chip {
  min-width: 160px;
  padding: 18px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft);
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel {
  display: grid;
  gap: 18px;
  align-content: center;
}

.auth-card {
  background: rgba(255,255,255,0.72);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.auth-card-secondary {
  background: rgba(255,255,255,0.58);
}

.auth-header {
  margin-bottom: 10px;
}

.auth-header h2 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.page-header {
  border-radius: 30px;
  padding: 28px 30px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.page-header h1 {
  margin: 8px 0 8px;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.glass-card {
  background: rgba(255,255,255,0.72);
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-panel {
  margin-top: -2px;
}

.feature-card {
  min-height: 240px;
}

.compact-card {
  min-height: 220px;
}

.wide-highlight {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.68)),
    linear-gradient(135deg, rgba(191,219,254,0.25), rgba(255,255,255,0.05));
}

.booking-hero-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.74)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 32%);
}

.card-header,
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-header h2,
.top-bar h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h1, h2, h3 {
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.88);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

input::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

button {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: white;
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.98;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

button:active {
  transform: translateY(0);
}

.small-btn {
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 12px;
  margin-top: 10px;
  margin-right: 8px;
}

.ghost-btn {
  background: rgba(255,255,255,0.7);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.approve-btn {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.reject-btn {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.logout-btn,
.notify-btn {
  width: auto;
  padding: 10px 16px;
  border-radius: 14px;
}

.notify-btn {
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.28);
}

.booking-form-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.05);
  padding: 14px 15px;
  border-radius: 18px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

li strong {
  font-size: 15px;
}

.record-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty-text {
  color: #94a3b8;
  padding: 14px 16px;
}

.warning-item {
  background: linear-gradient(180deg, rgba(254,226,226,0.9), rgba(254,242,242,0.92));
  border-left: 4px solid var(--danger);
}

.slot-btn {
  width: auto !important;
  padding: 10px 14px !important;
  margin-bottom: 0 !important;
  border-radius: 14px;
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.slot-selected {
  outline: 3px solid rgba(59, 130, 246, 0.4);
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

#availableSlotsBox {
  margin: 10px 0 14px;
  padding: 2px 0;
}

#selectedTimeText {
  margin-top: 12px;
  font-weight: 700;
  color: var(--accent);
}

#upcomingBoard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#upcomingBoard div {
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 20px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.7;
}

#teacherBlockSlotsBox {
  margin-bottom: 10px;
}

#editStudentCard {
  transition: all 0.2s ease;
}

.student-dashboard .booking-hero-card {
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  #upcomingBoard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .container {
    padding: 16px 12px 40px;
  }

  .page-header,
  .hero-card,
  .card {
    border-radius: 24px;
  }

  .page-header {
    padding: 22px 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
  }

  .stats-grid,
  .content-grid,
  .student-summary-grid,
  .booking-form-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 22px 16px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .card {
    padding: 18px;
  }

  .card-header h2,
  .top-bar h2 {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .stat-chip {
    width: 100%;
  }

  .auth-card {
    padding: 18px;
  }

  button {
    font-size: 13px;
  }

  .small-btn {
    margin-right: 6px;
  }
}