:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;          /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;       /* centers the card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* When the app is shown, stop centering and allow full-width layout */
body.app {
  display: block;
  place-items: initial;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);       /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover { color: var(--primary); }

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.logout-icon i {
  font-size: 14px;   /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover { background: var(--primary-dark); }
.logout-icon:active { transform: translateY(1px); }

/* ---------- FAB (bottom-left) ---------- */
.fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.16), 0 6px 12px rgba(16, 24, 40, 0.12);
  transition: transform var(--transition), background var(--transition);
  z-index: 1050;
}
.fab:hover { background: var(--primary-dark); transform: translateY(-1px); }
.fab:active { transform: translateY(1px); }
.fab i { font-size: 20px; line-height: 1; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; display: none; z-index: 1100; }
.modal.show { display: block; }

.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  margin: 10vh auto 0;
  width: min(92vw, 520px);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(16, 24, 40, 0.24);
  overflow: hidden;
  animation: pop-in 0.22s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header,
.modal-footer { display: flex; align-items: center; padding: 14px 18px; }

.modal-header { justify-content: space-between; border-bottom: 1px solid #eef2f7; }
.modal-header h3 { margin: 0; font-size: 1.1rem; }

.icon-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 8px; border-radius: 10px; color: #6b7280;
}
.icon-btn:hover { color: var(--primary); background: #f3f4f6; }

.modal-body { padding: 18px; color: #374151; }
.modal-footer { justify-content: flex-end; gap: 10px; border-top: 1px solid #eef2f7; }

/* Modal buttons (don’t conflict with existing .btn styles) */
.btn-primary, .btn-ghost {
  padding: 10px 14px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: #374151; border-color: #e5e7eb; }
.btn-ghost:hover { background: #f9fafb; }


/* --- Popup form + suggestions --- */
.form-group { margin-bottom: 14px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.hint { font-size: 12px; color: #6b7280; margin-top: 6px; }

.suggestions {
  display: none; margin-top: 6px; max-height: 220px; overflow: auto;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  box-shadow: 0 8px 20px rgba(16,24,40,.12);
}
.suggestion-item { padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.suggestion-item:hover { background: #f9fafb; }

.form-subgroup {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid #eef2f7;
}

.sub-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}


.meeting-list {
  width: min(1600px, 98vw);   /* much wider */
  margin: 12px auto 24px;     /* tighter vertical spacing */
}


.meeting-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16,24,40,.08);
  margin-bottom: 12px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.meeting-row:hover {
  transform: translateY(-1px);
  border-color: #dbe2ea;
  box-shadow: 0 12px 28px rgba(16,24,40,.10);
}


.meeting-row .who {
  font-weight: 600;
}
.meeting-row .email {
  font-weight: 400;
  color: #6b7280;
  margin-left: 8px;
}

.meeting-row .links a {
  margin-right: 10px;
  text-decoration: none;
}
.meeting-row .links a:hover {
  text-decoration: underline;
}

.meeting-row .date {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
  align-self: center;
}

.empty-state {
  color: #6b7280;
  text-align: center;
  padding: 18px 8px;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

/* Loading spinner (student meeting) */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #6b7280;
}

.loading__spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e5e7eb;           /* track */
  border-top-color: var(--primary);     /* accent */
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading__text {
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


.meeting-row .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  /* Pretty gradient bubble */
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,.15);
}

.meta .name { font-weight: 700; }
.meta .email { font-size: 12px; color: #6b7280; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  color: #111827;
}
.chip:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.date {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .meeting-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }
  .date { order: 3; }
}


/* --- Saving overlay inside popup --- */
.saving-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  place-items: center;
  z-index: 50;
}
.saving-overlay[hidden] { display: none; }

.saving-box {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(16,24,40,.12);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.saving-label {
  font-weight: 700;
  color: #374151;
}

/* disabled state for Save button */
.btn-primary[disabled] {
  opacity: .6;
  cursor: not-allowed;
}


/* Right-side floating action button */
.fab.fab--right { right: 16px; left: auto; bottom: 16px; }

/* Student Meeting FAB: sits above the existing right FAB */
.fab.fab--student {
  right: 16px;
  left: auto;
  bottom: 84px; /* 56px button + ~12px gap above the "Add work meeting" button */
}


.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .form-row-3 { grid-template-columns: 1fr; }
}


/* --- Tiny confirm popup --- */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 11000; /* above .modal */
}

.confirm-dialog {
  background: #fff;
  border-radius: 14px;
  width: min(92vw, 380px);
  padding: 16px 18px;
  box-shadow: 0 24px 48px rgba(16, 24, 40, 0.24);
}
.confirm-title { margin: 0 0 8px; font-weight: 700; font-size: 1rem; }
.confirm-message { color: #374151; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }


/* --- Section title + switch row --- */
.section-title { font-weight: 700; font-size: .95rem; display: block; margin-bottom: 6px; }
.switch-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb;
}

/* --- iOS-like switch --- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer; background: #e5e7eb;
  border-radius: 9999px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }


/* ---------- Roster view ---------- */
.roster {
  width: 100%;                                /* take all space from .meeting-list */
  display: grid;
  grid-template-columns: 84px repeat(3, minmax(0, 1fr));  /* slimmer day col + 3 flexible cols */
  gap: 8px;                                   /* tighter gaps */
   align-items: stretch;   /* NEW: make all items in each row share the same height */

}


.roster__head {
  font-weight: 700;
  font-size: 13px;   /* slightly smaller header */
  padding: 6px 8px;  /* tighter padding */
  color: #111827;
  text-align: center;
}


.roster__day {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;

  /* NEW: fill row height + center label vertically */
  align-self: stretch;     /* take full height of the row */
  display: flex;           /* enable vertical centering */
  align-items: center;     /* vertical middle */
  height: 100%;            /* ensure stretching actually fills */
}



.roster__cell {
  min-height: 44px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;      /* keep vertical centering */
  align-items: flex-start;      /* <-- stop stretching to full width */
}



/* --- Day color palette (Mon=day-1 … Sun=day-7) --- */
/* Light, readable pastels; tweak hex codes anytime */
.roster__day.day-1, .roster__cell.day-1 { background: #eff6ff; /* blue-50 */ }
.roster__day.day-2, .roster__cell.day-2 { background: #ecfdf5; /* emerald-50 */ }
.roster__day.day-3, .roster__cell.day-3 { background: #fefce8; /* amber-50 */ }
.roster__day.day-4, .roster__cell.day-4 { background: #fff7ed; /* orange-50 */ }
.roster__day.day-5, .roster__cell.day-5 { background: #f5f3ff; /* violet-50 */ }
.roster__day.day-6, .roster__cell.day-6 { background: #f0fdfa; /* teal-50 */ }
.roster__day.day-7, .roster__cell.day-7 { background: #fff1f2; /* rose-50 */ }

/* Optional: a subtle border so the tint feels “card-like” */
.roster__day[class*="day-"], .roster__cell[class*="day-"] {
  border: 1px solid rgba(0,0,0,.04);
}

/* Keep pills readable on light tints (no change needed usually).
   If you ever want more contrast, uncomment:
.pill { background: rgba(255,255,255,.7); backdrop-filter: saturate(1.2); }
*/



.pill {
  display: grid;
  grid-template-columns: 24px 1fr auto; /* smaller avatar column */
  gap: 6px;                              /* tighter spacing */
  align-items: center;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 999px;
  padding: 4px 8px;                      /* tighter padding */
  font-size: 13px;                       /* slightly smaller text */
}


/* --- Pill meta and department badge --- */
.pill__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end; /* puts meta (dept + time) at the right column */
}

.pill__dept {
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

/* Hide department badge when chip is hovered or when an action inside is focused */
.pill:hover .pill__dept,
.pill:focus-within .pill__dept {
  display: none;
}


/* color variants */
.dept--ttkb      { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
.dept--breakout  { background:#ecfdf5; border-color:#a7f3d0; color:#047857; }
.dept--bm        { background:#f5f3ff; border-color:#ddd6fe; color:#6d28d9; }
.dept--supporter { background:#f0fdfa; border-color:#99f6e4; color:#0f766e; }
.dept--mix       { background:#fff7ed; border-color:#fed7aa; color:#c2410c; }
.dept--default   { background:#f3f4f6; border-color:#e5e7eb; color:#374151; }


/* --- pill hover actions (edit / delete) --- */
.pill { position: relative; }

.pill__actions {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  display: flex;
  gap: 6px;
  padding: 2px;
  border-radius: 9999px;
  background: rgba(248, 250, 252, 0.85); /* matches pill bg */
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 1;
  pointer-events: none; /* becomes clickable on hover via parent */
}

.pill:hover .pill__actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* tiny round icon buttons */
.pill__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .05s ease;
}


/* anchors that live inside .pill__actions, styled like the small buttons */
.pill__link {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  color: #6b7280;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .05s ease;
}
.pill__link:hover { background: #f3f4f6; }
.pill__link i { font-size: 12px; line-height: 1; }

/* brighter defaults for each link type */
.pill__link--meet {
  color: #2563eb;       /* blue-600 icon */
  background: #eff6ff;  /* blue-50 */
  border-color: #bfdbfe;/* blue-200 */
}
.pill__link--meet:hover {
  background: #dbeafe;  /* blue-100 */
  border-color: #93c5fd;/* blue-300 */
}

.pill__link--work {
  color: #16a34a;       /* green-600 icon */
  background: #ecfdf5;  /* emerald-50 */
  border-color: #bbf7d0;/* green-200 */
}
.pill__link--work:hover {
  background: #d1fae5;  /* green-100 */
  border-color: #86efac;/* green-300 */
}



.pill__icon:active { transform: translateY(1px); }

.pill__edit:hover  { color: var(--primary);    border-color: #c7d2fe; background: #eef2ff; }
.pill__offday:hover { color: #0ea5e9; border-color: #bae6fd; background: #e0f2fe; }

.pill__delete:hover{ color: #dc2626;           border-color: #fecaca; background: #fee2e2; }
.pill__offday:hover{ color: #0ea5e9;           border-color: #bae6fd; background: #e0f2fe; }

/* NEW: Assign button hover */
.pill__assign:hover{
  color: #7c3aed;        /* violet-ish */
  border-color: #ddd6fe; /* light violet */
  background: #f5f3ff;   /* soft violet */
}


/* NEW: Assign button hover */
.pill__assign:hover{
  color: #7c3aed;           /* violet-ish */
  border-color: #ddd6fe;    /* light violet border */
  background: #f5f3ff;      /* soft violet background */
}



/* Optional: dim the time a bit when actions are visible */
.pill:hover .pill__time { opacity: .35; transition: opacity var(--transition); }


.pill__avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;  /* keep initials readable at smaller size */
  background: linear-gradient(135deg, #6366f1, #3b82f6);
}


.pill__name { font-weight: 600; }
.pill__time { font-size: 12px; color: #6b7280; }
.empty-cell { color: #9ca3af; font-size: 13px; text-align: center; }

@media (max-width: 720px) {
  .roster { grid-template-columns: 72px repeat(3, minmax(0, 1fr)); gap: 6px; }
}



/* ---------- Week nav (top-right) ---------- */
/* Collapsed: show ONLY the calendar icon */
.week-nav {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1020;

  display: flex;
  align-items: center;
  gap: 8px;

  /* collapsed sizing */
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border-radius: 9999px;

  /* collapsed look = just the round calendar button */
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Hide everything except the calendar button when collapsed */
.week-nav .week-nav__btn,
.week-nav .week-nav__label { display: none; }

/* Collapsed calendar button = colorful */
.week-nav .week-nav__today {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 0;
  /* pretty gradient */
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff; /* FA icon inherits this */
  box-shadow: 0 10px 22px rgba(17, 24, 39, .18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .25s ease;
}
.week-nav .week-nav__today i { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.week-nav .week-nav__today:active { transform: translateY(1px); }

/* When nav expands on hover/tap, switch back to your small white button style */
.week-nav:hover .week-nav__today,
.week-nav.open .week-nav__today {
  width: 32px;
  height: 32px;
  border: 1px solid #dbeafe;
  background: #fff;
  color: #0d6efd;
  box-shadow: none;
}


/* Expanded on hover (or when .open is added for touch) */
.week-nav:hover,
.week-nav.open {
  width: auto;
  height: auto;
  padding: 6px 8px;
  background: var(--card-bg);
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(16,24,40,.10);
}

/* Show all controls when expanded */
.week-nav:hover .week-nav__btn,
.week-nav.open .week-nav__btn { display: grid; }

.week-nav:hover .week-nav__label,
.week-nav.open .week-nav__label { display: block; }

/* Make the calendar button match the other small buttons when expanded */
.week-nav:hover .week-nav__today,
.week-nav.open .week-nav__today {
  width: 32px;
  height: 32px;
  border-color: #dbeafe;
  background: #fff;
  color: #0d6efd;
}

/* Reuse your existing small button style */
.week-nav__btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}
.week-nav__btn:hover { background: #f3f4f6; }

.week-nav__label {
  min-width: 150px;
  padding: 0 6px;
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  text-align: center;
}




/* screen-reader text helper, add if you don't already have one */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0;
}


/* Right side of the chip: department badge + time */
.pill__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Department badge */
.pill__dept {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

/* Pretty colors per department */
.pill__dept.dept--ttkb {
  background: #eff6ff;   /* blue-50 */
  border-color: #bfdbfe; /* blue-200 */
  color: #1d4ed8;        /* blue-700 */
}
.pill__dept.dept--breakout {
  background: #ecfdf5;   /* emerald-50 */
  border-color: #a7f3d0; /* emerald-200 */
  color: #047857;        /* emerald-700 */
}
.pill__dept.dept--bm {
  background: #fef3c7;   /* amber-100 */
  border-color: #fde68a; /* amber-200 */
  color: #b45309;        /* amber-700 */
}
.pill__dept.dept--supporter {
  background: #f5f3ff;   /* violet-50 */
  border-color: #ddd6fe; /* violet-200 */
  color: #6d28d9;        /* violet-700 */
}
.pill__dept.dept--mix {
  background: #fff1f2;   /* rose-50 */
  border-color: #fecdd3; /* rose-200 */
  color: #be123c;        /* rose-700 */
}
.pill__dept.dept--default {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}


/* === Modal mobile fixes (paste at end of file) === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000; /* below confirm, above page */
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.modal.show {                    /* when .show is added in JS */
  display: flex;
}

.modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.38);
}

.modal .modal-content {
  position: relative;
  background: #fff;
  width: min(720px, calc(100vw - 24px));     /* fit on narrow screens */
  max-height: min(calc(100dvh - 24px), calc(100vh - 24px)); /* never taller than screen */
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;              /* header/footer stick; body scrolls */
  display: flex;
  flex-direction: column;
}

/* keep header/footer visible; make the middle scroll */
.modal .modal-header,
.modal .modal-footer {
  flex: 0 0 auto;
}
.modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;                 /* allows child to actually scroll */
  overflow: auto;                /* <-- scroll inside dialog */
}

/* saving overlay stays above the form */
.saving-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.7);
  z-index: 1;
}

/* Small phones: let the dialog use full width/height with softer corners */
@media (max-width: 600px) {
  .modal .modal-content {
    width: 100vw;
    max-height: calc(100dvh - 8px);
    border-radius: 12px;
  }
}


.meeting-link { margin-left: 0; }

.meeting-link i { font-size: 0.95em; }

.meeting-link--disabled {
  opacity: .45;
  pointer-events: none;  /* not clickable */
}




.teacher-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  background: #f3f4f6;
  color: #374151;
}

/* TTKB = blue tone */
.teacher-badge--ttkb {
  background: #eff6ff;      /* blue-50 */
  border-color: #bfdbfe;    /* blue-200 */
  color: #1d4ed8;           /* blue-700 */
}

/* BM/Breakout = emerald tone */
.teacher-badge--bm {
  background: #ecfdf5;      /* emerald-50 */
  border-color: #a7f3d0;    /* emerald-200 */
  color: #047857;           /* emerald-700 */
}


/* Small guide badge after the video icon for Supporter */
.supporter-hint {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #fde68a; /* amber-200 */
  background: #fffbeb;       /* amber-50 */
  color: #92400e;            /* amber-800 */
}

/* Mix = violet tone */
.teacher-badge--mix {
  background: #f5f3ff;   /* violet-50 */
  border-color: #ddd6fe; /* violet-200 */
  color: #6d28d9;        /* violet-700 */
}

/* Supporter = amber tone */
.teacher-badge--supporter {
  background: #fffbeb;   /* amber-50 */
  border-color: #fde68a; /* amber-200 */
  color: #b45309;        /* amber-700 */
}


.teacher-email-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  line-height: 1;
  white-space: nowrap;
}

/* badges (already added earlier) remain the same */


.teacher-name--muted {
  opacity: .7;
  font-weight: 600;
  font-style: italic;
}


/* === Student Meeting: teacher row layout + icon alignment === */
.teacher-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;   /* 8–12px is ideal; adjust if you want tighter/looser */
  line-height: 1.2;
  flex-wrap: wrap; /* keeps things graceful on narrow screens */
}


/* Small red note shown when the teacher is not on shift */
.teacher-off {
  margin-top: 4px;
  font-size: 12px;
  color: #dc2626;
}

/* Small note under the teacher name when they're not on shift */
.teacher-off {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  color: #b91c1c; /* red-700 */
  margin: 2px 0 0 2px;
}

.meeting-link,
.meeting-link--disabled {
  display: inline-flex;      /* center the video icon properly */
  align-items: center;
}

/* remove underline on the anchor, in all states (strong reset) */
a.meeting-link,
a.meeting-link:hover,
a.meeting-link:visited,
a.meeting-link:active,
a.meeting-link:focus {
  text-decoration: none !important;
  border-bottom: 0 !important;
}
.meeting-link i { text-decoration: none; } /* some resets target child elements */


.meeting-link:focus-visible {
  outline: 2px solid #93c5fd;   /* accessible focus */
  outline-offset: 2px;
  text-decoration: none;
}

.meeting-link i,
.meeting-link--disabled i {
  line-height: 1;            /* removes baseline bumps */
}


.meeting-link i,
.meeting-link--disabled i {
  line-height: 1;            /* removes baseline bumps */
}
/* Eye-catching teacher name */
/* Teacher name chip — subtle, elegant, no vertical bar */
.teacher-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;                   /* space before badge */
  padding: 4px 10px;          /* pill padding */
  background: #fff;           /* light pill */
  border: 1px solid #e5e7eb;  /* soft border */
  border-radius: 9999px;      /* full pill */
  box-shadow: 0 1px 0 rgba(16,24,40,.02);
  color: #0f172a;
  font-weight: 700;           /* not too heavy */
  font-size: 16px;            /* comfortable size */
  line-height: 1.2;
  letter-spacing: .1px;
}

/* tiny accent dot (NOT a line) */
.teacher-name::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #60a5fa, #34d399); /* blue→green */
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
}


/* Optional: if name is missing, keep it gentle */
.teacher-name--muted {
  opacity: .75;
  font-weight: 700;
  font-style: italic;
}


/* === Pretty session badges + time pills === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(0,0,0,.04) inset, 0 1px 2px rgba(0,0,0,.06);
  white-space: nowrap;
}
.badge i { font-size: 12px; opacity: .9; }

/* Buổi chính */
.badge--main {
  background: linear-gradient(180deg, #eaf2ff 0%, #dfeaff 100%);
  border-color: #c9dafd;
  color: #0b5fff;
}

/* Buổi phụ (BM/Breakout) */
.badge--aux {
  background: linear-gradient(180deg, #eafff4 0%, #dcfcec 100%);
  border-color: #bff2d6;
  color: #0e9f6e;
}

/* Time pill */
.time-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid #e8ecf3;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.roster__cell .time-pill + .time-pill { margin-top: 6px; }


/* Keep pills tight inside roster cells */
.roster__cell .badge,
.roster__cell .time-pill {
  align-self: flex-start;
}


/* --- Make meeting pills fill the whole cell again --- */
.roster__cell { 
  align-items: stretch;        /* children stretch across the cell */
}

/* ensure the pills themselves take the full width */
.roster__cell .pill {
  width: 100%;
  align-self: stretch;         /* explicit stretch in case container changes */
}
