@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast System */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  padding: 16px;
  min-width: 250px;
  max-width: 350px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  border: 1px solid #f1f5f9;
}
.toast.show {
  transform: translateX(0);
}
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #f43f5e; }
.toast-info { border-left: 4px solid #6366f1; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== Premium Card ===== */
.premium-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
}
.premium-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ===== Premium Table ===== */
.premium-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.premium-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
.premium-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.premium-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.premium-table tbody tr:last-child td {
  border-bottom: none;
}
.premium-table tbody tr:hover {
  background: #f8fafc;
}

/* ===== Buttons ===== */
/* ===== Timetable grid ===== */
.tt-grid-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.tt-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}
.tt-grid th,
.tt-grid td {
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  vertical-align: top;
  padding: 0;
}
.tt-grid th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 8px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.tt-grid th.tt-time-col,
.tt-grid td.tt-time-col {
  width: 96px;
  min-width: 96px;
  background: #f8fafc;
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  padding: 8px 4px;
}
.tt-grid th.tt-time-col { z-index: 3; }
.tt-slot {
  min-height: 64px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.tt-slot:hover { background: #f8fafc; }
.tt-slot.tt-break {
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 6px,
    #f1f5f9 6px,
    #f1f5f9 12px
  );
  cursor: default;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}
.tt-slot-empty {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 1.1rem;
}
.tt-slot-empty:hover { color: #6366f1; background: #eef2ff; }
.tt-block {
  border-radius: 10px;
  padding: 8px;
  font-size: 0.75rem;
  line-height: 1.25;
  border: 1px solid transparent;
  height: 100%;
  min-height: 52px;
}
.tt-block-0 { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.tt-block-1 { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.tt-block-2 { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.tt-block-3 { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }
.tt-block-4 { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.tt-block-5 { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.tt-block-title { font-weight: 700; margin-bottom: 2px; }
.tt-block-meta { opacity: 0.85; font-size: 0.68rem; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #4f46e5;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: white;
  color: #475569;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Input Fields ===== */
.input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.input-field {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input-field:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.input-field::placeholder {
  color: #94a3b8;
}

/* ===== Modal System ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 50;
  transition: opacity 0.3s;
}
.modal-content {
  max-width: 540px;
  width: 90%;
  margin: 60px auto;
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  z-index: 51;
  position: relative;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-content.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.modal-content.hidden {
  display: none;
}

/* Transfer dialog is fixed to the viewport so the admin shell's flex row
   does not push it off a narrow screen. */
#modal-transfer-students.modal-content {
  position: fixed;
  top: 48px;
  left: 50%;
  margin: 0;
  z-index: 60;
  max-height: calc(100vh - 72px);
  overflow: auto;
}
#modal-transfer-students.modal-content.show {
  transform: translateX(-50%);
}

#modal-grading-scale.modal-content,
#modal-grading-preset.modal-content {
  position: fixed;
  top: 24px;
  left: 50%;
  margin: 0;
  z-index: 60;
  width: min(920px, calc(100vw - 24px));
  max-width: 920px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
}
#modal-grading-preset.modal-content {
  width: min(640px, calc(100vw - 24px));
  max-width: 640px;
}
#modal-grading-scale.modal-content.show,
#modal-grading-preset.modal-content.show {
  transform: translateX(-50%);
}

/* ===== Sidebar Navigation ===== */
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-item:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.nav-item.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}
.nav-item.active i {
  color: #4f46e5;
}

/* ===== Top Header Search ===== */
header input[type="text"]::placeholder {
  color: #94a3b8;
}

/* ===== Sidebar Responsive ===== */
@media (max-width: 768px) {
  aside {
    width: 56px;
  }
  aside .nav-item span,
  aside .nav-item i.ph:not(.ph-sign-out) {
    display: none;
  }
  aside .p-4 {
    padding: 8px;
  }
}

/* ===== Notification Tabs ===== */
.notif-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: transparent;
}
.notif-tab:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.6);
}
.notif-tab.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ===== Notification Badge ===== */
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  background: #6366f1;
  border-radius: 10px;
  margin-left: 6px;
  line-height: 1;
}

/* ===== Line Clamp ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Spinner ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== Plan Cards ===== */
.plan-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.plan-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}
.plan-card.selected {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 25px rgba(79, 70, 229, 0.12);
}
.plan-card.selected::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 40px 40px 0;
  border-color: transparent #6366f1 transparent transparent;
}
.plan-card.selected .check-mark {
  display: block;
}
.plan-card .check-mark {
  display: none;
  position: absolute;
  top: 4px; right: 4px;
  color: white;
  font-size: 0.75rem;
  z-index: 1;
}
.plan-price {
  color: #4f46e5;
  font-weight: 700;
}
.plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #475569;
  padding: 3px 0;
}
.plan-feature i.ph-check-circle {
  color: #10b981;
  font-size: 1rem;
}
.plan-feature i.ph-x-circle {
  color: #cbd5e1;
  font-size: 1rem;
}

/* ===== Registration Steps ===== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: all 0.25s;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
}
.step-dot.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}
.step-dot.done {
  background: #eef2ff;
  color: #6366f1;
  border-color: #c7d2fe;
}
.step-line {
  width: 40px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
  transition: background 0.25s;
}
.step-line.done {
  background: #c7d2fe;
}

/* ===== Academic Terms ===== */
.term-list-item {
  transition: all 0.15s;
  cursor: pointer;
}
.term-list-item:hover {
  background: #f8fafc;
}
.term-list-item.selected {
  border-color: #6366f1 !important;
  background: #eef2ff;
}

/* ===== Calendar View ===== */
#calendar-wrapper .grid-cols-7 {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day-empty {
  background: #f8fafc;
  color: #cbd5e1;
}

.calendar-day-outside {
  background: #f8fafc;
  color: #cbd5e1;
  cursor: default;
}

.calendar-day-active {
  background: #ffffff;
  cursor: pointer;
}

.calendar-day-active:hover {
  background: #eef2ff;
}

.calendar-day-today {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

/* Multi-day event spans */
.calendar-day-event-start {
  border-radius: 6px 0 0 6px;
}
.calendar-day-event-middle {
  border-radius: 0;
}
.calendar-day-event-end {
  border-radius: 0 6px 6px 0;
}
.calendar-day-event-single {
  border-radius: 6px;
}

/* ===== View Toggle ===== */
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.view-toggle-btn.active {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

/* ===== Event Type Legend ===== */
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ===== Bulk Select Checkbox ===== */
.bulk-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 5;
}

/* ===== Field Error ===== */
.input-field-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1) !important;
}
.field-error-msg {
  color: #f43f5e;
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ===== Calendar Day Selected ===== */
.calendar-day-selected {
  background: #eef2ff !important;
  box-shadow: inset 0 0 0 2px #6366f1;
}

/* ===== Searchable Select UI ===== */
.select-wrapper {
  position: relative;
  width: 100%;
}
.select-wrapper .select-display {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  min-height: 42px;
}
.select-wrapper .select-display:focus-visible {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.select-dropdown.open {
  display: block;
  animation: fadeIn 0.15s ease-out;
}
.select-search {
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  width: 100%;
  font-size: 0.875rem;
  outline: none;
  border-radius: 12px 12px 0 0;
  background: #f8fafc;
}
.select-search:focus {
  background: white;
}
.select-options {
  max-height: 200px;
  overflow-y: auto;
}
.select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #334155;
  transition: background 0.15s, color 0.15s;
}
.select-option:hover,
.select-option.highlighted {
  background: #f8fafc;
}
.select-option.selected {
  background: #eff6ff;
  color: #4f46e5;
  font-weight: 600;
}
.select-empty {
  padding: 14px;
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
}

/* ===== Form Helper Text & Accessible Hints ===== */
.input-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

