/* =====================================================================
   Foothills Family Portal — parent site styles
   Loaded as a Power Pages Web File at URL /fsd-portal.css and referenced
   from the layout-parent web template.
   ===================================================================== */

:root {
  --fsd-navy:       #0b3d66;
  --fsd-navy-dark:  #082b48;
  --fsd-gold:       #f2a900;
  --fsd-bg:         #f4f7fa;
  --fsd-card:       #ffffff;
  --fsd-text:       #1f2937;
  --fsd-muted:      #6b7280;
  --fsd-border:     #e5e7eb;
  --fsd-success:    #16a34a;
  --fsd-warning:    #d97706;
  --fsd-danger:     #dc2626;
  --fsd-topbar-bg:  #0b3d66;
  --fsd-topbar-muted:#cfe1f2;
  --fsd-surface-soft:#fafbfc;
  --fsd-hover-row:  #f9fbfd;
  --fsd-pill-bg:    #eef2f7;
  --fsd-risk-bg:    #fffaf0;
  --fsd-progress-bg:#e5e7eb;
  --fsd-focus-ring: rgba(11,61,102,.12);
  --fsd-focus-border:#9ca3af;
  --fsd-focus-outline:#0b3d66;
  --fsd-touch-min: 44px;
  --fsd-touch-compact: 40px;
  --fsd-mobile-font-min: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --fsd-bg: #1f1f1f;
  --fsd-card: #2a2a2a;
  --fsd-text: #f3f2f1;
  --fsd-muted: #c8c6c4;
  --fsd-border: #777572;
  --fsd-topbar-bg: #0b3d66;
  --fsd-surface-soft: #252423;
  --fsd-hover-row: #323130;
  --fsd-pill-bg: #323130;
  --fsd-risk-bg: #252423;
  --fsd-progress-bg: #3b3a39;
  --fsd-focus-ring: rgba(255,255,255,.26);
  --fsd-focus-border: #d1d5db;
  --fsd-focus-outline:#f2a900;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .login-box,
html[data-theme="dark"] .kebab-menu,
html[data-theme="dark"] .ms-modal,
html[data-theme="dark"] .ms-filters input,
html[data-theme="dark"] .ms-filters select,
html[data-theme="dark"] .form-row input,
html[data-theme="dark"] .form-row select,
html[data-theme="dark"] .form-row textarea,
html[data-theme="dark"] .ms-btn,
html[data-theme="dark"] .ms-panel,
html[data-theme="dark"] .risk-form,
html[data-theme="dark"] .rd-btn,
html[data-theme="dark"] .sig-tab,
html[data-theme="dark"] .sig-style,
html[data-theme="dark"] .sig-input {
  background: var(--fsd-card);
  color: var(--fsd-text);
}
html[data-theme="dark"] .btn-outline { background: transparent; color: #f3f2f1; border-color: #8a8886; }
html[data-theme="dark"] .btn-outline:hover { background: var(--fsd-surface-soft); }
html[data-theme="dark"] #tripHold.btn-outline { color: #fed7aa; border-color: #c2410c; }
html[data-theme="dark"] #tripHold.btn-outline:hover { color: #ffedd5; background: #7c2d12; }
html[data-theme="dark"] .kebab-menu a.kebab-hold { color: #fed7aa; }
html[data-theme="dark"] .kebab-btn { background: transparent; color: var(--fsd-muted); border-color: transparent; }
html[data-theme="dark"] .kebab-btn:hover { background: rgba(140,199,255,.14); color: #8cc7ff; }
html[data-theme="dark"] .kebab-menu a,
html[data-theme="dark"] .kebab-menu .km-item,
html[data-theme="dark"] .trip-summary .ts-item div,
html[data-theme="dark"] .trip-notes p,
html[data-theme="dark"] .trip-info-grid .ti-item div,
html[data-theme="dark"] .ti-notes p,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .risk-form-head .rf-name,
html[data-theme="dark"] .risk-decision .rd-prompt,
html[data-theme="dark"] .ack-row label { color: var(--fsd-text); }
html[data-theme="dark"] .risk-form-head,
html[data-theme="dark"] .risk-decision { background: var(--fsd-surface-soft); border-color: var(--fsd-border); }
html[data-theme="dark"] .ti-chips .ti-chip { background: var(--fsd-surface-soft); border-color: var(--fsd-border); color: var(--fsd-text); }
html[data-theme="dark"] .ti-chips-risk .ti-chip { background: #3a2f1c; border-color: #5c4a25; }
html[data-theme="dark"] .ti-chip .ti-chip-ver { background: #1f3a5c; color: #cfe2ff; }
html[data-theme="dark"] .ti-chips-risk .ti-chip .ti-chip-ver { background: #5c4a25; color: #f5d68a; }
html[data-theme="dark"] .fsd-skel { background: #323130; }
html[data-theme="dark"] .fsd-skel::after { background: linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent); }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color: var(--fsd-border); }
html[data-theme="dark"] .stat .num { color: #f3f2f1; }
html[data-theme="dark"] .btn-gold { background: var(--fsd-gold); color: #1f2937; border-color: #c98a00; }
html[data-theme="dark"] .btn-gold:hover { background: #ffbe2e; }
html[data-theme="dark"] .badge-draft { background: #475569; color: #f3f4f6; }
html[data-theme="dark"] .badge-active { background: #1e3a8a; color: #dbeafe; }
html[data-theme="dark"] .badge-pending,
html[data-theme="dark"] .badge-inprogress { background: #78350f; color: #fde68a; }
html[data-theme="dark"] .badge-hold { background: #7c2d12; color: #fed7aa; }
html[data-theme="dark"] .badge-signed,
html[data-theme="dark"] .badge-completed { background: #14532d; color: #dcfce7; }
html[data-theme="dark"] .badge-overdue,
html[data-theme="dark"] .badge-incident { background: #7f1d1d; color: #fee2e2; }
html[data-theme="dark"] .filter-bar input,
html[data-theme="dark"] .filter-bar select,
html[data-theme="dark"] #stuSearch,
html[data-theme="dark"] #histSearch,
html[data-theme="dark"] #histDateFrom,
html[data-theme="dark"] #histDateTo,
html[data-theme="dark"] #tripPickerSearch,
html[data-theme="dark"] #tpStatus,
html[data-theme="dark"] #tpSort,
html[data-theme="dark"] #cfSearch,
html[data-theme="dark"] #cfStatus,
html[data-theme="dark"] #cfSort,
html[data-theme="dark"] #tpOtherText {
  background: var(--fsd-card) !important; color: var(--fsd-text) !important; border-color: var(--fsd-border) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #c8c6c4 !important; opacity: 1; }
html[data-theme="dark"] option { background: var(--fsd-card); color: var(--fsd-text); }
html[data-theme="dark"] .ms-opt:hover,
html[data-theme="dark"] .kebab-menu a:hover,
html[data-theme="dark"] .kebab-menu .km-item:hover { background: var(--fsd-surface-soft); }
html[data-theme="dark"] .ms-opt input:checked + span { color: #8cc7ff; }
html[data-theme="dark"] .class-mine-label { color:#8cc7ff; }
.class-mine-label { color:#0b3d66; font-weight:700; margin-left:4px; }
html[data-theme="dark"] .stu-empty { background: var(--fsd-surface-soft); border-color: var(--fsd-border); }
html[data-theme="dark"] .stu-empty-title,
html[data-theme="dark"] .stu-empty-sub,
html[data-theme="dark"] .stu-empty-sub strong { color: var(--fsd-text); }
html[data-theme="dark"] #scModal > div,
html[data-theme="dark"] #sigModal > div,
html[data-theme="dark"] #editModal > div,
html[data-theme="dark"] #schoolModal .ms-modal { background: var(--fsd-card) !important; color: var(--fsd-text); border: 1px solid var(--fsd-border); }
html[data-theme="dark"] #scModal > div > div:first-child,
html[data-theme="dark"] #sigModal > div > div:first-child,
html[data-theme="dark"] #editModal > div > div:first-child,
html[data-theme="dark"] #schoolModal .ms-modal-head { background: var(--fsd-surface-soft) !important; border-bottom-color: var(--fsd-border) !important; }
html[data-theme="dark"] #schoolModal .ms-pager { border-top-color: var(--fsd-border) !important; }
html[data-theme="dark"] #scModal h3,
html[data-theme="dark"] #sigModalTitle,
html[data-theme="dark"] #editModal strong,
html[data-theme="dark"] #schoolModal h3 { color: var(--fsd-text) !important; }
html[data-theme="dark"] #scBody,
html[data-theme="dark"] #sigModalBody { background: var(--fsd-bg) !important; }
html[data-theme="dark"] .parent-note,
html[data-theme="dark"] .parent-note-row td { background: var(--fsd-surface-soft) !important; border-color: var(--fsd-border) !important; }
html[data-theme="dark"] .parent-note .pn-text,
html[data-theme="dark"] .parent-note .pn-label,
html[data-theme="dark"] .sig-style-preview,
html[data-theme="dark"] .sig-label,
html[data-theme="dark"] .consent-head { color: var(--fsd-text) !important; }
html[data-theme="dark"] .sig-pad,
html[data-theme="dark"] .sig-style,
html[data-theme="dark"] .sig-tabs,
html[data-theme="dark"] .risk-form-body,
html[data-theme="dark"] .consent-actions { background: var(--fsd-card) !important; border-color: var(--fsd-border) !important; }
html[data-theme="dark"] .sig-tab.is-active,
html[data-theme="dark"] .sig-style.is-active { border-color: #fff !important; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
html[data-theme="dark"] .hero .login-box,
html[data-theme="dark"] .hero .login-box .card { background: var(--fsd-card) !important; color: var(--fsd-text); border-color: var(--fsd-border) !important; }
html[data-theme="dark"] .child-card > div:first-child { color: var(--fsd-text) !important; }
.page-copy .sectionBlockLayout { margin-left: 0 !important; margin-right: 0 !important; max-width: 100%; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, Roboto, Helvetica, Arial, sans-serif;  color: var(--fsd-text);
  background: var(--fsd-bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.fsd-skip-link {
  position: absolute;
  left: 12px;
  top: -44px;
  z-index: 2000;
  background: #ffffff;
  color: var(--fsd-navy-dark);
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid var(--fsd-gold);
  text-decoration: none;
  font-weight: 600;
}
.fsd-skip-link:focus { top: 10px; }

/* Roster-sync badge (teacher dashboard) - a noticeable chip showing when the Edsembli roster last synced. */
.dash-roster { display:inline-flex; align-items:center; gap:6px; margin:2px 0 20px; padding:7px 14px; background:#eef4fb; border:1px solid #d4e3f2; border-radius:999px; font-size:13px; color:#0b3d66; }
.dash-roster strong { font-weight:700; }
html[data-theme="dark"] .dash-roster { background:#22303f; border-color:#33475b; color:#cfe2ff; }

/* ---------- Top bar ---------- */
.fsd-topbar {
  background: var(--fsd-topbar-bg);
  color: #fff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  flex-wrap: wrap;
  gap: 12px;
}
.fsd-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 18px; }
.fsd-brand > a { min-height: var(--fsd-touch-min); }
.fsd-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.fsd-nav a { color: var(--fsd-topbar-muted); text-decoration: none; font-size: 14px; padding: 6px 8px; border-bottom:2px solid transparent; border-radius:4px 4px 0 0; }
.fsd-nav a.active { color:#fff; border-bottom-color:var(--fsd-gold); }
.fsd-nav a:hover:not(.active), .fsd-nav a:focus-visible:not(.active) { color:#fff; background:transparent; border-bottom-color:rgba(255,255,255,.65); outline:none; }
.fsd-nav-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  min-height: var(--fsd-touch-min);
  min-width: var(--fsd-touch-min);
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fsd-nav-toggle:focus-visible,
.fsd-theme-toggle:focus-visible { outline: 2px solid var(--fsd-gold); outline-offset: 2px; }
.fsd-user-chip {
  background: rgba(255,255,255,.12);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fsd-user-chip > a {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:2px 0;
}
.fsd-theme-toggle {
  border: 1px solid rgba(255,255,255,.52);
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 999px;
  min-height: 28px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.fsd-theme-toggle:hover,
.fsd-theme-toggle[aria-pressed="true"] { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.82); }
html[data-theme="dark"] .fsd-topbar { border-bottom: 1px solid #1f4f7a; }
html[data-theme="dark"] .fsd-nav a { color: #dbecff; }

/* ---------- Layout ---------- */
.fsd-container { max-width: 1180px; margin: 0 auto; padding: 28px 32px 60px; }
.fsd-shell { display: flex; flex-direction: column; min-height: 100vh; }
.fsd-shell .fsd-container { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.fsd-shell .fsd-footer { flex-shrink: 0; }
h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; line-height: 1.29; letter-spacing: -.01em; }
h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.4; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.375; }
.sub { color: var(--fsd-muted); margin-bottom: 24px; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--fsd-card);
  border: 1px solid var(--fsd-border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}
.stat { text-align: center; }
.stat .num { font-size: 32px; font-weight: 700; color: var(--fsd-navy); }
.stat .lbl { font-size: 13px; color: var(--fsd-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  min-height: var(--fsd-touch-compact);
  border-radius: 6px;
  border: 1px solid var(--fsd-border);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn,
.kebab-btn,
.ms-filters input,
.ms-filters select,
#cfSearch,
#histSearch,
#tripPickerSearch {
  border-width: 1px;
}
.btn:focus-visible { outline: 2px solid var(--fsd-gold); outline-offset: 2px; }
.btn-primary { background: var(--fsd-navy); color: #fff; border-color: var(--fsd-navy); }
.btn-primary:hover { background: var(--fsd-navy-dark); }
.btn-outline { background: #fff; color: var(--fsd-navy); border-color: var(--fsd-navy); }
.btn-outline:hover { background: var(--fsd-surface-soft); }
.btn-link { background: transparent; color: var(--fsd-navy); padding: 4px 0; min-height: 0; border: 0; }
.btn-link:hover { text-decoration: underline; }
html[data-theme="dark"] .btn-link { color: #8cc7ff; }
html[data-theme="dark"] .btn-link:hover,
html[data-theme="dark"] .btn-link:focus-visible { color: #cfe8ff; }
html[data-theme="dark"] .pill { background: #3b3a39; color: #f3f2f1; }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: 13px; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.list-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.list-toolbar > input[type="search"] { flex:1 1 280px; min-width:220px; }
.list-toolbar-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.filter-select,
.list-toolbar input[type="search"],
.list-toolbar input[type="date"] {
  min-height:40px; padding:8px 12px; border:1px solid var(--fsd-border); border-radius:6px;
  background:var(--fsd-card); color:var(--fsd-text); font:inherit; font-size:13px;
}
.filter-select { min-width:170px; }
.date-filter { display:flex; align-items:center; gap:7px; color:var(--fsd-muted); font-size:12px; font-weight:600; }
.date-filter input { width:145px; }
.history-toolbar { align-items:center; }
.modal-surface { background:var(--fsd-card); color:var(--fsd-text); border:1px solid var(--fsd-border); border-radius:10px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .list-toolbar input { background:var(--fsd-card) !important; color:var(--fsd-text) !important; border-color:var(--fsd-border) !important; }

/* ---------- Shared kebab menu ---------- */
.kebab-wrap { position: relative; display: inline-block; }
.kebab-btn {
  width: var(--fsd-touch-compact);
  height: var(--fsd-touch-compact);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--fsd-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.kebab-btn:hover {
  border-color: transparent;
  background: rgba(11,61,102,.08);
  color: var(--fsd-navy);
}
.kebab-btn:focus-visible {
  outline: 2px solid var(--fsd-gold);
  outline-offset: 2px;
}
.kebab-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 184px;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(11,61,102,.16);
  padding: 6px;
  overflow: hidden;
}
.kebab-menu.is-open { display: block; }
.kebab-menu.fsd-menu-floating { position:fixed; right:auto; z-index:10020; }
.kebab-menu .km-item[disabled] { opacity:.62; cursor:not-allowed; }
.kebab-menu a,
.kebab-menu .km-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.kebab-menu a:hover,
.kebab-menu .km-item:hover {
  background: #f3f6f9;
  color: var(--fsd-navy);
}
.kebab-menu .km-item.km-danger,
.kebab-menu a.kebab-cancel { color: var(--fsd-danger); }
.kebab-menu .km-item.km-danger:hover,
.kebab-menu a.kebab-cancel:hover {
  background: #fef2f2;
  color: var(--fsd-danger);
}
/* Put on Hold — same amber as .badge-hold (trip detail button + kebab) */
#tripHold.btn-outline {
  color: #9a3412;
  border-color: #fdba74;
}
#tripHold.btn-outline:hover {
  background: #ffedd5;
  color: #9a3412;
  border-color: #f59e0b;
}
.kebab-menu a.kebab-hold { color: #9a3412; }
.kebab-menu a.kebab-hold:hover {
  background: #ffedd5;
  color: #9a3412;
}
.kebab-menu .kebab-sep {
  height: 1px;
  background: #eef1f5;
  margin: 5px 2px;
}

/* ---------- School browser modal ---------- */
.school-list { margin-top: 6px; }
.sch-row {
  display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:14px;
  padding:13px 14px; border:1px solid var(--fsd-border); border-radius:8px; margin-bottom:10px;
  background:var(--fsd-surface-soft);
}
.school-avatar { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--fsd-navy); color:#fff; font-size:18px; font-weight:700; }
.school-row-body { display:grid; gap:3px; }
.sch-row .sch-name { font-weight:600; color:var(--fsd-text); }
.sch-row .sch-count { font-size:12px; color:var(--fsd-muted); }
.ms-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,61,102,.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ms-modal {
  background: #fff;
  border-radius: 14px;
  width: min(760px, 100%);
  height: min(620px, 86vh);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(11,61,102,.28);
  overflow: hidden;
}
.ms-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f5;
}
.ms-modal-head h3 { margin: 0; font-size: 18px; color: var(--fsd-navy); }
.ms-modal-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--fsd-border);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--fsd-text, #1f2937);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
}
.ms-modal-close:hover { background: rgba(128,128,128,.18); color: var(--fsd-text, #1f2937); border-color: var(--fsd-navy); }
.ms-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #eef1f5;
}
.ms-filters input,
.ms-filters select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--fsd-border);
  border-radius: 8px;
  outline: none;
  background: #fff;
}
.ms-filters input { flex: 1; min-width: 180px; }
#schoolModal .ms-body { padding: 0 20px 18px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.ms-body { padding: 6px 20px 18px; overflow: auto; flex:1 1 auto; min-height:0; }
.ms-body table { width: 100%; table-layout: fixed; }
#schoolModal #msTable { border-collapse: separate; border-spacing: 0; }
#schoolModal #msTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 10px 12px;
  background: var(--fsd-surface-soft, #f4f6f9);
  box-shadow: 0 1px 0 var(--fsd-border, #eef1f5);
}
#schoolModal #msTable td {
  text-align: left;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#schoolModal #msTable .cell-ellipsis {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
#msTable th:nth-child(1), #msTable td:nth-child(1) { width: 38%; }
#msTable th:nth-child(2), #msTable td:nth-child(2) { width: 14%; }
#msTable th:nth-child(3), #msTable td:nth-child(3) { width: 48%; }
html[data-theme="dark"] #schoolModal #msTable thead th {
  background: var(--fsd-surface-soft);
  box-shadow: 0 1px 0 var(--fsd-border);
}
/* Long text in list/table cells: keep to ONE line with an ellipsis (hover title shows full text) */
.cell-ellipsis { display: block; max-width: 260px; margin-left: auto; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { .cell-ellipsis { max-width: 160px; } }
/* Site-wide: auto-truncate long plain-text table cells to one line + ellipsis (title tooltip added by JS) */
td.fsd-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { td.fsd-clip { max-width: 180px; } }
/* Required-field asterisk on consent labels */
.req-star { color: var(--fsd-danger,#dc2626); font-weight: 800; font-size: 15px; line-height: 1; margin-left: 3px; vertical-align: middle; }
[data-theme="dark"] .req-star { color: #ff6b6b; }
/* Risk-form decision progress bar (consent form) */
.risk-progress { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.risk-progress-track { flex: 1; height: 10px; border-radius: 999px; background: var(--fsd-border, #e5e7eb); overflow: hidden; }
.risk-progress-fill { display: block; height: 100%; width: 0; background: var(--fsd-gold, #f2a900); border-radius: 999px; transition: width .25s ease; }
.risk-progress.is-complete .risk-progress-fill { background: var(--fsd-success, #16a34a); }
.risk-progress-label { font-size: 13px; font-weight: 700; color: var(--fsd-text); white-space: nowrap; }
[data-theme="dark"] .risk-progress-track { background: #3b3a39; }
/* Consent pending list: keep Review button + "Signing closed" badge the same width so the column lines up */
td.cf-action .btn, td.cf-action .badge { min-width: 110px; display: inline-block; box-sizing: border-box; text-align: center; }
/* Waiver / release text shown on the consent page (accessible HTML in a scrollable document box) */
.waiver-box { max-height: 360px; overflow-y: auto; font-size: 14px; line-height: 1.5; color: var(--fsd-text); }
.waiver-box p { margin: 8px 0; font-size: 14px; color: var(--fsd-text); }
.waiver-box ul { margin: 6px 0 12px; padding-left: 20px; }
.waiver-box li { margin: 4px 0; font-size: 14px; }
#teacherTripsTable td:nth-child(2), #tripPickerTable td:nth-child(2) { white-space: nowrap; }
.ms-count-head { margin-left: auto; font-family: inherit; font-weight: 600; font-size: 14px; color: var(--fsd-muted, #6b7785); }
.ms-modal-head .ms-count-head + .ms-modal-close { margin-left: 0; }
/* Keep dropdown option rows compact + consistent: the option checkbox must not inherit the 42px field min-height. */
#createTripForm .form-row label.ms-opt input { min-height: 0; }
#classFilter.ms-panel { min-width: 300px; }
/* Breadcrumb current page: long dynamic names stay on one line, capped ~20 characters with an ellipsis */
.breadcrumb span[aria-current="page"] { display: inline-block; max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { .breadcrumb span[aria-current="page"] { max-width: 14ch; } }
/* Trip-details header: allow the FULL name to wrap across multiple lines (break very long unbroken strings) */
.trip-detail-title { overflow-wrap: anywhere; word-break: break-word; }
.ms-shimmer { padding: 14px 4px 4px; }
.ms-shimmer .fsd-skel-line { height: 16px; margin: 0 0 16px; }
.ms-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid #eef1f5;
}
.ms-pager .btn[disabled], .ms-pager .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
/* Shared Previous/Next list pagination (site-wide standard) */
.list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.list-pager .list-pager-info { margin: 0; font-size: 13px; text-align: center; }
/* Split layout (site-wide standard): Previous pinned to the far left,
   Next pinned to the far right, page info centred. The controls wrapper is
   unwrapped with display:contents so Previous/info/Next order across the row. */
.list-pager .list-pager-controls { display: contents; }
.list-pager .list-pager-info,
.list-pager .list-pager-controls > span { order: 2; }
.list-pager .list-pager-controls > .btn:first-child { order: 1; }
.list-pager .list-pager-controls > .btn:last-child { order: 3; }
.list-pager .btn[disabled], .list-pager .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
/* Disabled controls site-wide: show a not-allowed cursor on hover, and keep a
   dimmed look. Buttons that must stay hoverable for their tooltip use
   aria-disabled instead of the native [disabled] attribute. */
button:disabled, .btn:disabled, .btn[disabled],
input:disabled, select:disabled, textarea:disabled,
[aria-disabled="true"] { cursor: not-allowed; }
.btn[aria-disabled="true"], button[aria-disabled="true"] { opacity: .5; }
/* Row action cell: primary button (e.g. View) beside the overflow (kebab) menu */
/* Action columns stay tight (width:1%) so the data columns fill the full table
   width. Content is centered and the ACTION header is centered to match. */
td:has(.row-actions-cell), td.pending-action, td.cf-action { width: 1%; white-space: nowrap; text-align: center; }
.row-actions-cell { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
table:has(td.pending-action) th:last-child,
table:has(td.cf-action) th:last-child,
table:has(td .row-actions-cell) th:last-child { text-align: center; }

/* Trip Details student grid: keep all columns in the card (no horizontal slide).
   Long text truncates with ellipsis; full value is on the title tooltip. Scoped to
   #tdTable only so other tables keep their existing layout. */
#tdTable {
  width: 100%;
  table-layout: fixed;
}
#tdTable th,
#tdTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
#tdTable th:nth-child(1), #tdTable td:nth-child(1) { width: 26%; }
#tdTable th:nth-child(2), #tdTable td:nth-child(2) { width: 16%; }
#tdTable th:nth-child(3), #tdTable td:nth-child(3) { width: 16%; }
#tdTable th:nth-child(4), #tdTable td:nth-child(4) { width: 22%; }
#tdTable th:nth-child(5),
#tdTable td:last-child {
  width: 118px;
  overflow: visible;
  white-space: nowrap;
  text-align: right;
}
#tdTable .cell-ellipsis {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
/* Student cell may also show Incident / View note under the name */
#tdTable td:first-child { white-space: normal; }
#tdTable td:first-child > .cell-ellipsis { white-space: nowrap; }
/* Expanded parent-note rows must wrap; do not ellipsis the note body.
   Single colspan td also matches td:last-child (Actions width/align) — reset those. */
#tdTable tr.parent-note-row td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  width: auto;
  text-align: left;
}

/* My Students grid: same approach as #tdTable — all columns stay in the card,
   long text truncates with ellipsis + title tooltip. Scoped to #stuTable only. */
#stuTable {
  width: 100%;
  table-layout: fixed;
}
#stuTable th,
#stuTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
#stuTable th:nth-child(1), #stuTable td:nth-child(1) { width: 20%; }
#stuTable th:nth-child(2), #stuTable td:nth-child(2) { width: 10%; }
#stuTable th:nth-child(3), #stuTable td:nth-child(3) { width: 8%; }
#stuTable th:nth-child(4), #stuTable td:nth-child(4) { width: 16%; }
#stuTable th:nth-child(5), #stuTable td:nth-child(5) { width: 18%; }
#stuTable th:nth-child(6), #stuTable td:nth-child(6) { width: 12%; }
#stuTable th:nth-child(7),
#stuTable td:last-child {
  width: 88px;
  overflow: visible;
  white-space: nowrap;
  text-align: center;
}
#stuTable .cell-ellipsis {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: center; padding: 12px 10px; border-bottom: 1px solid var(--fsd-border); font-size: 14px; }
th { color: var(--fsd-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: var(--fsd-hover-row); }
.card > div[style*="overflow-x:auto"] { position:relative; }

/* Mobile table overflow wrapper */
@media (max-width: 768px) {
  div[style*="overflow-x:auto"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  div[style*="overflow-x:auto"] table { width: 100%; }
}

/* ========== Print Styles (Good to Have #23) ========== */
@media print {
  .fsd-topbar, .fsd-nav, .footer, .btn, .badge, .kebab-wrap, .filter-bar { display: none !important; }
  body { background: white; color: black; }
  table { font-size: 11pt; page-break-inside: avoid; }
  tr { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
  .card { page-break-inside: avoid; border: 1px solid #ccc; }
  a { text-decoration: underline; }
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-signed  { background: #dcfce7; color: #166534; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-inprogress { background: #fef3c7; color: #92400e; }
.badge-hold { background: #ffedd5; color: #9a3412; }
.badge-completed { background: #dcfce7; color: #166534; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--fsd-muted); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--fsd-border); font-size: 14px;
  font-family: inherit; color: var(--fsd-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus,
.login-box input:focus, .filter-bar input:focus, .filter-bar select:focus {
  outline: none; border-color: var(--fsd-focus-border);
  box-shadow: 0 0 0 2px var(--fsd-focus-ring);
}

/* Create Trip: every field/box (text inputs, native date, custom dropdowns and the
   student search) shares one height so the whole form lines up in a consistent grid. */
#createTripForm .form-row input,
#createTripForm .form-row select,
#createTripForm .ms-btn,
#createTripForm .filter-bar input[type="search"],
#createTripForm .filter-bar input[type="text"],
#createTripForm .filter-bar input:not([type]) {
  min-height: 42px;
  box-sizing: border-box;
}
#createTripForm .form-row input,
#createTripForm .filter-bar input[type="search"],
#createTripForm .filter-bar input[type="text"],
#createTripForm .filter-bar input:not([type]) {
  padding: 9px 12px;
  font-size: 14px;
}

/* Keep Trip Name visibly outlined even while typing. */
#createTripForm input[name="fsdt_name"] {
  border: 1px solid var(--fsd-border);
}
#createTripForm input[name="fsdt_name"]:focus,
#createTripForm input[name="fsdt_name"]:not(:placeholder-shown) {
  border-color: var(--fsd-focus-border);
  box-shadow: 0 0 0 2px var(--fsd-focus-ring);
}
.checkbox-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--fsd-border);
  border-radius: 8px; margin-bottom: 10px; background: var(--fsd-surface-soft);
}
.checkbox-row input { margin-top: 3px; }
.signature-box {
  border: 2px dashed var(--fsd-border);
  border-radius: 8px; padding: 24px; text-align: center;
  color: var(--fsd-muted); margin: 12px 0;
}

/* ---------- Hero / login ---------- */
.hero {
  background: linear-gradient(135deg, var(--fsd-navy) 0%, #1a5a8a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: 32px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 12px; }
.hero p  { font-size: 16px; line-height: 1.5; opacity: .92; }
.login-box {
  background: #fff;
  color: var(--fsd-text);
  border-radius: 10px;
  padding: 28px;
}
.login-box label { display: block; font-size: 13px; margin: 10px 0 4px; color: var(--fsd-muted); }
.login-box input {
  width: 100%; padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--fsd-border); font-size: 14px;
}
.login-box .btn { width: 100%; margin-top: 16px; }

/* ---------- Teacher: filter bar / student list / progress / pill ---------- */
.filter-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; background: var(--fsd-card); border: 1px solid var(--fsd-border);
  border-radius: 8px; margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
  padding: 8px 10px; border-radius: 6px; border: 1px solid var(--fsd-border);
  font-size: 13px;
}
.student-list {
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--fsd-border); border-radius: 8px;
}
.student-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--fsd-border);
  font-size: 14px;
}
.student-row:last-child { border-bottom: none; }
.student-row:hover { background: var(--fsd-hover-row); }
.student-row .meta { color: var(--fsd-muted); font-size: 12px; margin-left: auto; }
.progress-bar {
  background: var(--fsd-progress-bg); border-radius: 999px; height: 8px; overflow: hidden;
  width: 140px; display: inline-block; vertical-align: middle;
}
.progress-bar > span { display: block; height: 100%; background: var(--fsd-success); }
.pill {
  background: var(--fsd-pill-bg); color: var(--fsd-navy); padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.btn-gold { background: var(--fsd-gold); color: var(--fsd-navy-dark); }
.btn-gold:hover { filter: brightness(.96); }
/* Consistent right-aligned action button row inside tables */
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; white-space: nowrap; }
td .row-actions .btn { min-width: 84px; }
.badge-draft  { background: #e5e7eb; color: #374151; }
.badge-active { background: #dbeafe; color: #1e40af; }

/* ---------- Risk multi-select (teacher Create Trip) ---------- */
.risk-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  border: 1px solid var(--fsd-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--fsd-surface-soft);
}
.risk-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer;
}
.risk-opt input { margin: 0; }

/* ---------- Risk box ---------- */
.risk-box {
  background: var(--fsd-risk-bg);
  border-left: 4px solid var(--fsd-gold);
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.risk-box ul { margin: 8px 0 0 18px; padding: 0; }
.risk-box li { margin-bottom: 4px; font-size: 14px; }

/* ---------- Shimmer / skeleton loaders ---------- */
@keyframes fsd-shimmer { 100% { transform: translateX(100%); } }
.fsd-skel { position: relative; overflow: hidden; background: #e9eef5; border-radius: 8px; }
.fsd-skel::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 100%);
  animation: fsd-shimmer 1.25s infinite;
}
@media (prefers-reduced-motion: reduce) { .fsd-skel::after { animation: none; } }
.fsd-skel-line { height: 12px; border-radius: 6px; margin: 0 0 12px; }
.fsd-skel-line.sk-title { height: 18px; width: 55%; margin-bottom: 18px; }
.fsd-skel-line.sk-med { width: 70%; }
.fsd-skel-line.sk-short { width: 40%; }
.fsd-skel-line:last-child { margin-bottom: 0; }
/* Inline shimmer placeholders for values fetched right after load (trip-detail count/grades). */
.fsd-skel-inline { display: inline-block; vertical-align: middle; height: 12px; width: 24px; border-radius: 4px; }
.fsd-skel-inline.sk-grade { height: 22px; width: 128px; border-radius: 999px; }
.fsd-doc-skel { background: var(--fsd-card); border: 1px solid var(--fsd-border); border-radius: 10px; padding: 26px 28px; }
.consent-view-loading { height:100%; overflow:hidden; padding:20px; box-sizing:border-box; display:grid; align-content:start; gap:14px; }
.consent-view-skeleton-card { border:1px solid var(--fsd-border); border-radius:8px; padding:18px; background:var(--fsd-card); }
.consent-view-skeleton-card.is-large { min-height:230px; }

.breadcrumb { margin: 0 0 14px; color: var(--fsd-muted); font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.breadcrumb a { color: var(--fsd-navy); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
html[data-theme="dark"] .breadcrumb a { color: #c8c6c4; }

.fsd-footer {
  text-align: center; color: var(--fsd-muted); font-size: 12px;
  padding: 24px; border-top: 1px solid var(--fsd-border); margin-top: 40px;
}

.empty-state {
  padding: 40px 20px; text-align: center; color: var(--fsd-muted);
}
.children-list { display:grid; gap:10px; width:100%; }
.child-card {
  display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:14px;
  padding:13px 14px; border:1px solid var(--fsd-border); border-radius:8px; color:inherit;
  text-decoration:none; background:var(--fsd-surface-soft); transition:background .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.child-card:hover,.child-card:focus-visible { background:var(--fsd-hover-row); border-color:var(--fsd-focus-border); box-shadow:0 2px 8px rgba(11,61,102,.1); outline:none; }
.child-avatar { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--fsd-navy); color:#fff; font-size:18px; font-weight:700; }
.child-card-body { display:grid; gap:2px; min-width:0; }
.child-card-body strong { color:var(--fsd-text); font-size:15px; }
.child-card-body span { color:var(--fsd-muted); font-size:12px; white-space:normal; }
.child-card-action { color:var(--fsd-navy); font-size:13px; font-weight:600; white-space:nowrap; }
html[data-theme="dark"] .child-card-action { color:#8cc7ff; }
.ms-panel-search { position:sticky; top:0; z-index:1; width:calc(100% - 16px); margin:8px; padding:8px 10px; border:1px solid var(--fsd-border); border-radius:6px; background:var(--fsd-card); color:var(--fsd-text); }
.empty-state h3 { margin: 0 0 8px; color: var(--fsd-text); font-size: 18px; }
.empty-state p { margin: 0 auto 16px; max-width: 520px; }

/* ---------- Shared feedback and progress ---------- */
.fsd-toast-region {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  display: grid; gap: 10px; width: min(360px, calc(100vw - 24px));
}
.fsd-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 8px; color: #fff; background: #1f2937;
  box-shadow: 0 12px 30px rgba(0,0,0,.24); font-size: 14px; line-height: 1.4;
  border-left: 3px solid rgba(255,255,255,.6);
  animation: fsd-toast-in .18s ease-out;
}
.fsd-toast .fsd-ic { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.fsd-toast-msg { flex: 1 1 auto; }
.fsd-toast-success { background: #166534; }
.fsd-toast-error { background: #b91c1c; }
.fsd-toast-warning { background: #92400e; }
@keyframes fsd-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fsd-confirm-panel {
  background: var(--fsd-card); color: var(--fsd-text); border: 1px solid var(--fsd-border);
  border-radius: 10px; max-width: 440px; width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.34);
  padding: 24px; text-align: left;
  animation: fsd-confirm-in .16s ease-out;
}
@keyframes fsd-confirm-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fsd-toast, .fsd-confirm-panel { animation: none; } }
.fsd-confirm-panel h3 { margin: 0 0 10px; color: var(--fsd-navy); font-size: 18px; }
html[data-theme="dark"] .fsd-confirm-panel h3 { color: #f3f2f1; }
.fsd-confirm-panel p { margin: 0 0 20px; color: var(--fsd-muted); line-height: 1.5; white-space: pre-line; }
.fsd-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
#fsdConfirmOk.is-danger { background: var(--fsd-danger); border-color: var(--fsd-danger); color: #fff; }
#fsdConfirmOk.is-danger:hover { filter: brightness(.94); }
.fsd-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 22px; }
.fsd-step { padding: 10px 12px; border: 1px solid var(--fsd-border); border-radius: 8px; color: var(--fsd-muted); font-size: 13px; font-weight: 600; background: var(--fsd-card); }
.fsd-step.is-current { border-color: var(--fsd-border); color: var(--fsd-navy); box-shadow: inset 0 -3px 0 var(--fsd-gold); }
html[data-theme="dark"] .fsd-step.is-current { color: #f3f2f1; border-color: var(--fsd-border); }
.field-error { border-color: var(--fsd-danger) !important; box-shadow: 0 0 0 2px rgba(220,38,38,.12) !important; }
.field-error-message { display: block; margin-top: 5px; color: var(--fsd-danger); font-size: 12px; font-weight: 600; }
.char-count { margin-top: 5px; color: var(--fsd-muted); font-size: 12px; text-align: right; }
.row-secondary td:not(:last-child) { opacity: .72; }
.inline-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 180px; }
.inline-progress .progress-bar { width: 90px; }
.inline-progress small { color: var(--fsd-muted); white-space: nowrap; }
.trip-header-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.trip-header-meta strong { color: var(--fsd-text); font-weight: 600; }
.trip-header-meta .meta-item { white-space: nowrap; }
.tc-actions-card { margin-top: 16px; }

@keyframes fsd-progress-spin { to { transform: rotate(360deg); } }
.trip-progress-overlay {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15,23,42,.64); backdrop-filter: blur(2px);
}
.trip-progress-overlay[hidden] { display: none; }
.trip-progress-panel {
  width: min(420px, 100%); padding: 30px 26px; text-align: center; border: 1px solid var(--fsd-border);
  border-radius: 10px; background: var(--fsd-card); color: var(--fsd-text); box-shadow: 0 20px 55px rgba(0,0,0,.32);
}
.trip-progress-spinner {
  width: 42px; height: 42px; margin: 0 auto 18px; border: 4px solid var(--fsd-border);
  border-top-color: var(--fsd-navy); border-radius: 50%; animation: fsd-progress-spin .8s linear infinite;
}
.trip-progress-panel.is-complete .trip-progress-spinner {
  animation: none; border: 0; background: var(--fsd-success); position: relative;
}
.trip-progress-panel.is-complete .trip-progress-spinner::after {
  content: ""; position: absolute; left: 11px; top: 8px; width: 17px; height: 10px;
  border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg);
}
.trip-progress-panel h2 { margin: 0 0 7px; }
.trip-progress-panel p { margin: 0; color: var(--fsd-muted); }
html[data-theme="dark"] .trip-progress-spinner { border-color: #605e5c; border-top-color: #8cc7ff; }

.fsd-nav:empty,
.fsd-user-chip:empty {
  display: none;
}

/* ---------- Mobile pass ---------- */
@media (max-width: 1120px) {
  body {
    font-size: var(--fsd-mobile-font-min);
  }
  .fsd-topbar {
    padding: 12px 14px;
    align-items: center;
    gap: 10px;
  }
  .fsd-brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .fsd-brand img {
    height: 34px !important;
  }
  .fsd-brand span {
    font-size: 15px !important;
    padding-left: 10px !important;
  }
  .fsd-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .fsd-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: 0;
    background: rgba(0,0,0,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    padding: 6px;
    margin-top: 2px;
  }
  .fsd-topbar.nav-open .fsd-nav {
    display: flex;
  }
  .fsd-topbar.nav-open .fsd-user-chip {
    display: flex;
  }
  .fsd-nav a {
    display: block;
    font-size: 15px;
    color: #eef6ff;
    border-bottom: 0;
    border-radius: 8px;
    padding: 12px 10px;
  }
  .fsd-nav a.active,
  .fsd-nav a:hover {
    border-bottom: 0;
    background: rgba(255,255,255,.18);
  }
  .fsd-user-chip {
    width: 100%;
    order: 4;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 2px;
    display: none;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
  }
  .fsd-theme-toggle { min-height: 30px; border-radius: 8px; padding: 4px 9px; }
  .fsd-container {
    padding: 18px 12px 40px;
  }
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 19px;
  }
  .card {
    padding: 16px 14px;
  }
  .btn {
    min-height: var(--fsd-touch-min);
  }
  .btn-sm {
    min-height: var(--fsd-touch-min);
    font-size: 14px;
  }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table thead,
  table tbody,
  table tr,
  table th,
  table td {
    white-space: nowrap;
  }
  /* My Students: keep fixed + ellipsis (see base #stuTable rules); tighten padding only.
     All columns stay visible — Class is no longer hidden. */
  #stuTable {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  #stuTable th,
  #stuTable td {
    padding: 10px 8px;
    font-size: 13px;
  }
  #stuTable th:nth-child(7),
  #stuTable td:last-child {
    width: 88px;
    overflow: visible;
    white-space: nowrap;
    text-align: center;
  }
  #stuTable .btn,
  #stuTable .btn-sm {
    min-width: 68px;
  }
  /* Teams-like mobile table alignment pass across key routes */
  #teacherTripsTable,
  #pendingTable,
  #recentSignedTable,
  #histTable,
  #cfPendingTable,
  #tdTable,
  #tripPickerTable,
  #msTable {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  #teacherTripsTable th,
  #teacherTripsTable td,
  #pendingTable th,
  #pendingTable td,
  #recentSignedTable th,
  #recentSignedTable td,
  #histTable th,
  #histTable td,
  #cfPendingTable th,
  #cfPendingTable td,
  #tripPickerTable th,
  #tripPickerTable td,
  #msTable th,
  #msTable td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    padding: 10px 8px;
    font-size: 13px;
  }
  /* #tdTable keeps fixed + ellipsis (see base #tdTable rules); only tighten padding */
  #tdTable th,
  #tdTable td {
    padding: 10px 8px;
    font-size: 13px;
  }
  /* Keep action cells compact and right-aligned like Teams mobile lists */
  #teacherTripsTable td:last-child,
  #pendingTable td:last-child,
  #recentSignedTable td:last-child,
  #histTable td:last-child,
  #cfPendingTable td:last-child,
  #tripPickerTable td:last-child {
    text-align: right;
    width: 74px;
  }
  /* Trip Details Actions = View + kebab; 74px clips View and forces horizontal slide */
  #tdTable th:last-child,
  #tdTable td:last-child {
    text-align: right;
    width: 118px;
    overflow: visible;
    white-space: nowrap;
  }
  #teacherTripsTable .row-actions-cell,
  #recentSignedTable .row-actions-cell,
  #histTable .row-actions-cell,
  #tdTable .row-actions-cell {
    gap: 6px;
  }
  #teacherTripsTable .btn-sm,
  #pendingTable .btn-sm,
  #recentSignedTable .btn-sm,
  #histTable .btn-sm,
  #cfPendingTable .btn-sm,
  #tdTable .btn-sm,
  #tripPickerTable .btn-sm {
    min-width: 56px;
    padding-left: 10px;
    padding-right: 10px;
  }
  /* Mobile column priorities: hide secondary metadata first */
  #teacherTripsTable th:nth-child(3),
  #teacherTripsTable td:nth-child(3),
  #teacherTripsTable th:nth-child(4),
  #teacherTripsTable td:nth-child(4),
  #pendingTable th:nth-child(4),
  #pendingTable td:nth-child(4),
  #recentSignedTable th:nth-child(4),
  #recentSignedTable td:nth-child(4),
  #histTable th:nth-child(5),
  #histTable td:nth-child(5),
  #tripPickerTable th:nth-child(3),
  #tripPickerTable td:nth-child(3),
  #msTable th:nth-child(3),
  #msTable td:nth-child(3) {
    display: none;
  }
  /* #tdTable: keep Signed By visible; ellipsis + title tooltip handle long names */
  #pendingTable th:nth-child(3),
  #pendingTable td:nth-child(3),
  #recentSignedTable th:nth-child(3),
  #recentSignedTable td:nth-child(3),
  #histTable th:nth-child(4),
  #histTable td:nth-child(4) {
    display: none;
  }
  #teacherTripsTable th:nth-child(2),
  #teacherTripsTable td:nth-child(2),
  #pendingTable th:nth-child(3),
  #pendingTable td:nth-child(3),
  #recentSignedTable th:nth-child(3),
  #recentSignedTable td:nth-child(3),
  #histTable th:nth-child(3),
  #histTable td:nth-child(3),
  #cfPendingTable th:nth-child(3),
  #cfPendingTable td:nth-child(3),
  #tripPickerTable th:nth-child(2),
  #tripPickerTable td:nth-child(2) {
    width: 88px;
  }
  #teacherTripsTable td strong,
  #pendingTable td strong,
  #recentSignedTable td strong,
  #histTable td strong,
  #tdTable td strong {
    display: block;
    line-height: 1.3;
  }
  /* keep toolbar controls aligned and full width on mobile */
  .td-filter-bar,
  .list-toolbar,
  .list-toolbar-actions {
    align-items: stretch;
  }
  .td-filter-bar > *,
  .list-toolbar > *,
  .list-toolbar-actions > * {
    width: 100%;
  }
  #tdStatusFilter,
  #tripPickerSearch,
  #tdSearch,
  #cfSearch,
  #histSearch {
    min-width: 0 !important;
  }
  .ms-pager,
  .list-pager {
    align-items: center;
  }
  .row-actions {
    gap: 8px;
  }
  .hero {
    padding: 24px 18px;
    border-radius: 10px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 15px;
  }
  .hero ul {
    padding-left: 20px;
    margin-top: 12px !important;
  }
  .hero .login-box {
    padding: 16px !important;
  }
  .hero .login-box .grid.cols-2 {
    grid-template-columns: 1fr;
  }
  .hero .login-box .card {
    padding: 16px !important;
  }
  .hero .login-box .btn {
    width: 100%;
    min-height: 44px;
  }
  .login-box {
    padding: 18px 16px;
  }
  .filter-bar {
    gap: 10px;
    padding: 12px;
  }
  .form-row input,
  .form-row select,
  .form-row textarea,
  .ms-filters input,
  .ms-filters select,
  #cfSearch,
  #histSearch,
  #tripPickerSearch,
  #stuSearch,
  #tpOtherText {
    min-height: var(--fsd-touch-min);
    font-size: 16px;
  }
  .filter-bar > * {
    width: 100%;
  }
  .student-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .student-row .meta {
    margin-left: 0;
    width: 100%;
  }
  .risk-select {
    grid-template-columns: 1fr;
  }
  .checkbox-row {
    align-items: center;
  }
  .trip-summary .ts-item label,
  .trip-notes label,
  .trip-info-grid .ti-item label,
  .ti-notes label,
  .sig-label,
  .parent-note .pn-label {
    font-size: 12px;
  }
  .fsd-toast-region { right: 12px; bottom: 12px; }
  .fsd-steps { grid-template-columns: 1fr; }
  .fsd-confirm-actions { flex-direction: column-reverse; }
  .fsd-confirm-actions .btn { width: 100%; }
  .list-toolbar,.list-toolbar-actions { align-items:stretch; }
  .list-toolbar > *, .list-toolbar-actions > * { width:100%; }
  .filter-select,.date-filter input { width:100%; }
  .date-filter { display:grid; grid-template-columns:48px 1fr; }
  .child-card { grid-template-columns:40px minmax(0,1fr); }
  .child-avatar { width:40px; height:40px; }
  .child-card-action { grid-column:2; }
  .sch-row { grid-template-columns:40px minmax(0,1fr); }
  .school-avatar { width:40px; height:40px; }
  .sch-row .btn { grid-column:2; width:100%; }
  #mainContent input[type="checkbox"],
  #mainContent input[type="radio"] {
    width: 20px;
    height: 20px;
  }
  .ack-row input,
  .checkbox-row input {
    width: 20px;
    height: 20px;
  }
}

/* Coarse-pointer ergonomics: match Microsoft-style touch comfort on mobile/tablet */
@media (pointer: coarse) {
  .fsd-nav a,
  .btn,
  .btn-sm,
  .kebab-btn,
  .modal-icon-btn,
  .fsd-theme-btn,
  .ms-toggle-link,
  .note-toggle,
  .breadcrumb a,
  .ms-btn,
  .ms-modal-close,
  .tc-actions-row .btn,
  .tc-actions-row button {
    min-height: var(--fsd-touch-min);
  }
  .kebab-btn,
  .modal-icon-btn,
  .fsd-theme-btn,
  .ms-modal-close {
    min-width: var(--fsd-touch-min);
  }
  .form-row input,
  .form-row select,
  .ms-filters input,
  .ms-filters select,
  .list-toolbar input[type="search"],
  .list-toolbar input[type="date"],
  .filter-select {
    min-height: var(--fsd-touch-min);
    font-size: 16px;
  }
  .ack-row input,
  .checkbox-row input,
  #createTripForm .student-row .stu-cb,
  #createTripForm .form-row label.ms-opt input[type="checkbox"],
  #createTripForm .form-row label.ms-opt input[type="radio"] {
    width: 20px;
    height: 20px;
  }
}

/* Phone-specific button scale: keep touch-safe targets, but use denser sizes than tablet/desktop */
@media (max-width: 768px) {
  .btn {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 14px;
  }
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
  /* Top-level page toolbars should keep equal-height controls like Teams mobile */
  .list-toolbar > .btn,
  .list-toolbar > button,
  .list-toolbar-actions > .btn,
  .list-toolbar-actions > button,
  .td-filter-bar > .btn,
  .td-filter-bar > button,
  .filter-bar > .btn,
  .filter-bar > button {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
  }
  .list-toolbar select,
  .list-toolbar input[type="date"],
  .list-toolbar input[type="text"],
  .filter-bar select,
  .filter-bar input[type="date"],
  .filter-bar input[type="text"] {
    min-height: 44px;
    font-size: 14px;
  }
  /* Dense table actions should stay compact on phones */
  #stuTable .btn-sm,
  #teacherTripsTable .btn-sm,
  #pendingTable .btn-sm,
  #recentSignedTable .btn-sm,
  #histTable .btn-sm,
  #cfPendingTable .btn-sm,
  #tdTable .btn-sm,
  #tripPickerTable .btn-sm {
    min-height: 34px;
    min-width: 52px;
    padding: 5px 10px;
    font-size: 13px;
  }
  .kebab-btn,
  .modal-icon-btn,
  .ms-modal-close {
    min-width: 40px;
    min-height: 40px;
  }
  /* Create/Edit Trip: make picker controls and toolbar actions align predictably on phones */
  #createTripForm .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #createTripForm .filter-bar > * {
    width: 100% !important;
  }
  #createTripForm .ms-btn,
  #createTripForm .stu-toggle-all,
  #createTripForm .stu-grade-dd .ms-btn {
    min-height: 44px;
    font-size: 14px;
  }
  #createTripForm .stu-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }
  #createTripForm .stu-toolbar-actions {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #createTripForm .stu-toolbar-actions > * {
    width: 100%;
  }
  /* Trip Details header actions: stack full-width for cleaner tap targets */
  #tripPublish,
  #tripUnpublish,
  #tripCancel,
  a.btn[href*="/create-trip/?id="] {
    width: 100%;
    justify-content: center;
  }
}
/* ----------------------------------------------------------------- */
/* Moved from consent-form/consent-form.webtemplate.source.html */
/* ----------------------------------------------------------------- */
.consent-head { margin-bottom:6px; }
  .consent-sub { color:var(--fsd-muted,#6b7280); margin-bottom:20px; }

  /* Trip details as a compact summary grid */
  .trip-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:18px 24px; }
  .trip-summary .ts-item label { display:block; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--fsd-muted,#94a3b8); margin-bottom:3px; }
  .trip-summary .ts-item div { font-size:14px; color:#1f2937; font-weight:500; }
  .trip-notes { margin-top:18px; padding-top:14px; border-top:1px solid #eef1f5; }
  .trip-notes label { display:block; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--fsd-muted,#94a3b8); margin-bottom:3px; }
  .trip-notes p { margin:4px 0 0; font-size:14px; color:#374151; line-height:1.5; overflow-wrap:anywhere; word-break:break-word; }

  .section-title { font-size:18px; margin:0 0 4px; color:#0b3d66; }
  .section-hint { color:var(--fsd-muted,#6b7280); font-size:13px; margin:0 0 16px; }

  .risk-form { border:1px solid #e6e9ef; border-radius:12px; overflow:hidden; margin-bottom:18px; background:#fff; }
  .risk-form-head { display:flex; align-items:center; gap:8px; padding:12px 16px; background:#f7f9fc; border-bottom:1px solid #e6e9ef; font-size:15px; }
  .risk-form-head .rf-name { font-weight:600; color:#1f2937; margin:0; font-size:15px; }
  .risk-form-head .badge { background:#e8eef7; color:#0b3d66; padding:2px 9px; border-radius:999px; font-size:11px; font-weight:600; }
  .risk-form-body { padding:14px 16px; }
  .risk-pdf { width:100%; height:600px; border:1px solid #d8dee9; border-radius:8px; background:#fff; display:block; }
  .risk-pdf-bar { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
  .risk-pdf-loading { padding:0; }

  /* Accept / Reject decision footer per risk form */
  .risk-decision { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:12px 16px; border-top:1px solid #e6e9ef; background:#fbfcfe; }
  .risk-decision .rd-prompt { font-size:13px; color:#374151; font-weight:500; }
  .risk-decision .rd-btns { display:flex; gap:8px; flex-wrap:wrap; }
  .rd-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; border:1.5px solid #cbd5e1; background:#fff; color:#475569; transition:all .14s ease; }
  .rd-btn:hover { border-color:#9fb3c8; }
  .rd-accept.is-on { background:#16a34a; border-color:#16a34a; color:#fff; }
  .rd-reject.is-on { background:#dc2626; border-color:#dc2626; color:#fff; }
  html[data-theme="dark"] .rd-accept.is-on { background:#16a34a !important; border-color:#22c55e !important; color:#fff !important; }
  html[data-theme="dark"] .rd-reject.is-on { background:#dc2626 !important; border-color:#ef4444 !important; color:#fff !important; }
  .risk-decision.is-undecided { box-shadow:inset 3px 0 0 var(--fsd-warning,#f2a900); }
  .rd-status { font-size:13px; font-weight:600; }
  .rd-status.is-accepted { color:#16a34a; }
  .rd-status.is-rejected { color:#dc2626; }
  /* Accepted/Rejected highlight tag - makes the risk decision stand out (an important part of consent). */
  .rd-tag { display:none; align-items:center; gap:5px; font-size:12px; font-weight:700; padding:4px 12px; border-radius:999px; white-space:nowrap; }
  .rd-tag.is-accepted { display:inline-flex; background:#dcfce7; color:#166534; border:1px solid #86efac; }
  .rd-tag.is-rejected { display:inline-flex; background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
  .risk-form.is-accepted { box-shadow:inset 4px 0 0 #16a34a; }
  .risk-form.is-rejected { box-shadow:inset 4px 0 0 #dc2626; }
  html[data-theme="dark"] .rd-tag.is-accepted { background:#14532d; color:#dcfce7; border-color:#166534; }
  html[data-theme="dark"] .rd-tag.is-rejected { background:#7f1d1d; color:#fee2e2; border-color:#b91c1c; }
  /* All form controls use the same Segoe UI stack (consistency incl. native date/time pickers). */
  input, select, textarea, button, .btn, .ms-btn, .filter-select { font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, Roboto, Helvetica, Arial, sans-serif; }

  .ack-row { display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-bottom:0; }
  .ack-row + .ack-row { margin-top:4px; }
  .ack-row input { margin-top:3px; width:17px; height:17px; flex:0 0 auto; accent-color:#0b3d66; }
  .ack-row label { font-size:14px; color:#374151; line-height:1.4; }

  .sig-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:8px; }
  @media (max-width:720px){ .sig-grid { grid-template-columns:1fr; } }
  .sig-label { display:block; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--fsd-muted,#94a3b8); margin:0 0 6px; font-weight:600; }
  .sig-input { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; box-sizing:border-box; }
  .sig-pad { width:100%; height:180px; border:2px dashed #b6c2d4; border-radius:10px; background:#fcfdff; touch-action:none; cursor:crosshair; display:block; }
  .sig-actions { display:flex; align-items:center; gap:12px; margin-top:8px; }
  .sig-hint { font-size:12px; }
  .sig-img { max-width:100%; border:1px solid #e2e8f0; border-radius:8px; background:#fff; padding:6px; display:block; }
  .sig-saved { margin-top:6px; }
  /* Signature type/draw tabs + typed-style chooser */
  .sig-tabs { display:inline-flex; border:1px solid #cbd5e1; border-radius:8px; overflow:hidden; margin-bottom:12px; }
  .sig-tab { padding:7px 18px; border:0; background:#fff; font-size:13px; font-weight:600; color:var(--fsd-muted,#6b7280); cursor:pointer; }
  .sig-tab + .sig-tab { border-left:1px solid #cbd5e1; }
  .sig-tab.is-active { background:var(--fsd-navy,#0b3d66); color:#fff; }
  .sig-style-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; max-width:760px; }
  .sig-style { display:flex; align-items:center; justify-content:center; min-height:64px; padding:8px 14px; background:#fcfdff; border:2px solid #d8e0ea; border-radius:10px; cursor:pointer; }
  .sig-style:hover { border-color:#9fb3c8; }
  .sig-style.is-active { border-color:var(--fsd-navy,#0b3d66); box-shadow:0 0 0 2px rgba(11,61,102,.12); background:#fff; }
  .sig-style-preview { font-size:30px; line-height:1; color:#0b3d66; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  html[data-theme="dark"] .sig-tab.is-active { background:var(--fsd-navy) !important; border-color:var(--fsd-navy) !important; color:#fff !important; box-shadow:none !important; }
  html[data-theme="dark"] .sig-pad { background:var(--fsd-surface-soft) !important; border-color:#8cc7ff !important; }
  html[data-theme="dark"] .sig-style { background:var(--fsd-surface-soft) !important; border-color:var(--fsd-border) !important; }
  html[data-theme="dark"] .sig-style.is-active { background:var(--fsd-card) !important; border-color:#8cc7ff !important; box-shadow:0 0 0 2px rgba(140,199,255,.25) !important; }
  html[data-theme="dark"] .sig-style-preview { color:#8cc7ff !important; }
  .consent-actions { display:flex; justify-content:space-between; align-items:center; margin-top:22px; padding-top:18px; border-top:1px solid #eef1f5; gap:12px; flex-wrap:wrap; }
  .consent-actions .note { font-size:12px; color:var(--fsd-muted,#6b7280); }
  .consent-actions > div:last-child { display:flex; align-items:center; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
  @media (max-width: 900px) {
    .risk-pdf { height: 420px; }
    .risk-form-head { align-items: flex-start; flex-direction: column; gap: 6px; }
    .risk-decision { gap: 10px; }
    .risk-decision .rd-btns { width: 100%; }
    .rd-btn { flex: 1 1 140px; justify-content: center; }
    .sig-actions { flex-wrap: wrap; }
    .consent-actions { flex-direction: column; align-items: stretch; }
    .consent-actions .btn { width: 100%; }
    .consent-actions > div:last-child { width:100%; }
    #cfSearch,
    #cfStatus,
    #cfSort { width: 100%; min-width: 0 !important; }
    #cfPendingTable { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    #cfPendingTable thead,
    #cfPendingTable tbody,
    #cfPendingTable tr,
    #cfPendingTable th,
    #cfPendingTable td { white-space: nowrap; }
  }

.student-consent-modal-body { padding:18px 22px; max-height:min(390px, 58vh); overflow-y:auto; }
.student-consent-load-hint { margin:10px 0 0; text-align:center; font-size:12px; color:var(--fsd-muted); }


/* ----------------------------------------------------------------- */
/* Moved from Pages Breadcrumb/Pages Breadcrumb.webtemplate.source.html */
/* ----------------------------------------------------------------- */
.pagesBreadcrumb>li+li:before { content:var(--bs-breadcrumb-divider)}


/* ----------------------------------------------------------------- */
/* Moved from teacher-create-trip/teacher-create-trip.webtemplate.source.html */
/* ----------------------------------------------------------------- */
@media (max-width: 900px) {
    .tc-actions-card { display:block !important; }
    .tc-actions-note { margin-bottom:10px; }
    .tc-actions-row {
      display:grid !important;
      grid-template-columns:1fr !important;
      gap:10px !important;
      width:100%;
    }
    .tc-actions-row .btn,
    .tc-actions-row button {
      width:100%;
      min-height:44px;
    }
    #trip-msg { display:block; margin:0 !important; }
  }

/* Long unbreakable trip/activity names must wrap inside data tables instead of forcing a
   horizontal scrollbar (Bug Bash: long-name overflow in My Trips). */
.card table td, .card table th { overflow-wrap: anywhere; word-break: break-word; }

.ms-btn {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 40px;
        padding: 9px 12px;
        background: #fff;
        border: 1px solid var(--fsd-border, #e5e7eb);
        border-radius: 6px;
        font-size: 14px;
        font-family: inherit;
        cursor: pointer;
        color: var(--fsd-navy, #0b3d66);
        text-align: left;
        transition: border-color .15s ease, box-shadow .15s ease;
      }
      .ms-btn:hover { border-color: var(--fsd-navy, #0b3d66); }
      .ms-btn.is-open { border-color: var(--fsd-navy, #0b3d66); box-shadow: 0 0 0 2px rgba(11,61,102,0.12); }
      .ms-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      .ms-caret { flex:0 0 18px; width:18px; margin-left:8px; color:var(--fsd-muted,#6b7785); font-size:16px; line-height:1; text-align:center; }
      .ms-panel {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        left: 0; right: 0;
        min-width: 210px;
        z-index: 30;
        max-height: 220px;
        overflow-y: auto;
        overflow-x: hidden;
        background: #fff;
        border: 1px solid var(--fsd-border, #e5e7eb);
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(11,61,102,0.12);
        padding: 6px 0;
      }
      .ms-panel.is-open { display: block; }
      /* Empty-state / status messages inside a dropdown (no checkbox) must NOT use the
         option grid, or the text collapses into the 18px checkbox column and wraps one
         character per line. Render them as normal full-width block text. */
      .ms-panel .ms-opt:not(:has(input)) { display: block; white-space: normal; }
      .ms-opt {
        display: grid;
        grid-template-columns: 18px minmax(0,1fr);
        align-items: center;
        column-gap: 10px;
        min-height: 32px;
        padding: 7px 12px;
        font-size: 14px;
        line-height: 18px;
        box-sizing: border-box;
        width: 100%;
        cursor: pointer;
        transition: background .12s ease;
      }
      .ms-opt:hover { background: #f3f6f9; }
      .ms-opt input { display:block; justify-self:center; align-self:center; margin:0; width:16px; height:16px; accent-color:var(--fsd-navy,#0b3d66); }
      .ms-opt > span { display:block; min-width:0; line-height:18px; }
      .ms-opt input:checked + span { color: var(--fsd-navy, #0b3d66); }

      #createTripForm .form-row label.ms-opt {
        display:grid;
        grid-template-columns:18px minmax(0,1fr);
        align-items:center;
        column-gap:10px;
        width:100%;
        min-height:32px;
        margin:0;
        padding:7px 12px;
        box-sizing:border-box;
        color:var(--fsd-text);
        font-size:14px;
        line-height:18px;
      }
      #createTripForm .form-row label.ms-opt input[type="checkbox"],
      #createTripForm .form-row label.ms-opt input[type="radio"] {
        display:block;
        justify-self:center;
        align-self:center;
        width:16px;
        height:16px;
        margin:0;
        padding:0;
        border:0;
        border-radius:2px;
        box-shadow:none;
      }
      #createTripForm .form-row label.ms-opt > span { display:block; min-width:0; line-height:18px; }

      input[name="fsdt_cost"] { appearance:textfield; -moz-appearance:textfield; }
      input[name="fsdt_cost"]::-webkit-outer-spin-button,
      input[name="fsdt_cost"]::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

      a:focus-visible,
      button:focus-visible,
      input:focus-visible,
      select:focus-visible,
      textarea:focus-visible,
      [tabindex]:not([tabindex="-1"]):focus-visible {
        outline:2px solid var(--fsd-focus-outline) !important;
        outline-offset:2px;
      }

      @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
          scroll-behavior:auto !important;
          animation-duration:.01ms !important;
          animation-iteration-count:1 !important;
          transition-duration:.01ms !important;
        }
      }

      /* Make placeholder text clearly look like a hint, not a real value. */
      #createTripForm input::placeholder,
      #createTripForm textarea::placeholder,
      #stuSearch::placeholder,
      #tpOtherText::placeholder { color: #aab4c0; opacity: 1; font-style: italic; }
      #createTripForm input:-ms-input-placeholder,
      #createTripForm textarea:-ms-input-placeholder { color: #aab4c0; font-style: italic; }

      /* Friendly empty state for the student list */
      .stu-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:8px; min-height:200px; padding:28px 24px; border:1px dashed #d8e0ea; border-radius:12px; background:#fbfcfe; }
      .stu-empty-ico { font-size:34px; line-height:1; opacity:.65; }
      .stu-empty-title { font-size:15px; font-weight:600; color:#475569; }
      .stu-empty-sub { font-size:13px; max-width:340px; line-height:1.5; color:var(--fsd-muted,#6b7785); }
      .stu-empty-sub strong { color:#475569; }
      /* Let the student panel fill the card so both columns are the same height */
      #createTripForm .stu-empty { flex:1 1 auto; }
      #createTripForm .student-list { flex:1 1 auto; min-height:120px; overflow:auto; }


/* ----------------------------------------------------------------- */
/* Moved from teacher-trip-detail/teacher-trip-detail.webtemplate.source.html */
/* ----------------------------------------------------------------- */
.trip-info-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:16px 24px; }
  .trip-info-grid .ti-item label, .ti-notes label { display:block; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--fsd-muted,#94a3b8); margin-bottom:3px; }
  .trip-info-grid .ti-item div { font-size:14px; color:#1f2937; font-weight:500; overflow-wrap:anywhere; word-break:break-word; }
  .trip-info-grid .ti-item-full { grid-column:1 / -1; }
  .ti-count { display:inline-block; min-width:18px; padding:0 6px; margin-left:2px; border-radius:999px; background:var(--fsd-navy,#0b3d66); color:#fff; font-size:10px; font-weight:700; line-height:16px; text-align:center; vertical-align:middle; }
  .ti-chips { list-style:none; margin:2px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:7px; }
  .ti-chips .ti-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; background:#eef4fb; border:1px solid #d6e4f5; border-radius:8px; font-size:13px; font-weight:500; color:#1f2937; line-height:1.3; }
  .ti-chips-risk .ti-chip { background:#fff8ec; border-color:#f4e2bd; }
  .ti-chip .ti-chip-ver { font-size:11px; font-weight:700; color:var(--fsd-navy,#0b3d66); background:#dbe8fb; padding:1px 6px; border-radius:6px; }
  .ti-chips-risk .ti-chip .ti-chip-ver { color:#92400e; background:#f6e6c4; }
  .ti-notes { margin-top:18px; padding-top:14px; border-top:1px solid #eef1f5; }
  .ti-notes p { margin:4px 0 0; font-size:14px; color:#374151; line-height:1.5; overflow-wrap:anywhere; word-break:break-word; }
  .badge-draft { background:#fef3c7; color:#92400e; padding:2px 9px; border-radius:999px; font-weight:600; }
  .parent-note-row td { padding:2px 10px 12px !important; border-top:0 !important; }
  .parent-note { display:flex; gap:11px; align-items:flex-start; margin:2px 0 0; padding:12px 14px; background:linear-gradient(180deg,#f8fbff 0%,#f3f8ff 100%); border:1px solid #dbe8fb; border-left:4px solid var(--fsd-gold,#f2a900); border-radius:10px; box-shadow:0 1px 2px rgba(11,61,102,.05); }
  .parent-note .pn-icon { flex:0 0 28px; width:28px; height:28px; border-radius:50%; background:var(--fsd-navy,#0b3d66); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; line-height:1; }
  .parent-note .pn-body { flex:1 1 auto; min-width:0; }
  .parent-note .pn-label { display:block; font-size:11px; letter-spacing:.05em; text-transform:uppercase; font-weight:700; color:var(--fsd-navy,#0b3d66); margin-bottom:2px; }
  .parent-note .pn-text { font-size:13px; color:#1f2937; line-height:1.5; white-space:pre-wrap; word-break:break-word; }
  .note-toggle { display:inline-flex; align-items:center; gap:5px; margin-top:5px; padding:2px 10px; font-size:12px; font-weight:600; color:var(--fsd-navy,#0b3d66); background:#eef4fc; border:1px solid #dbe8fb; border-radius:999px; cursor:pointer; line-height:1.7; transition:background .15s; }
  .note-toggle:hover, .note-toggle[aria-expanded="true"] { background:#dbe8fb; }
  .note-toggle .nt-caret { font-size:10px; transition:transform .15s; }
  .note-toggle[aria-expanded="true"] .nt-caret { transform:rotate(90deg); }
  .badge.badge-incident { background:#fef2f2; color:var(--fsd-danger,#dc2626); border:1px solid #f5c2c2; display:inline-block; margin-top:5px; }
  .badge.badge-inprogress { background:#fef3c7; color:#92400e; }
  .badge.badge-completed { background:#eef2f7; color:#475569; }


/* ===================================================================== */
/* FLUENT UPLIFT (2026-07-22) — depth, hierarchy, hover, high-contrast.  */
/* Appended last so it layers over base rules via the cascade.           */
/* ===================================================================== */

/* 1. Depth / elevation — Fluent surfaces sit on layered shadow, not flat outlines */
.card { box-shadow: 0 1.6px 3.6px rgba(0,0,0,.10), 0 .3px .9px rgba(0,0,0,.07); }
html[data-theme="dark"] .card { box-shadow: 0 1.6px 3.6px rgba(0,0,0,.50), 0 .3px .9px rgba(0,0,0,.40); }

/* 2. Primary-action hierarchy — filled actions get subtle depth + a hover lift */
.btn-primary { box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.btn-primary:hover { box-shadow: 0 2px 6px rgba(11,61,102,.30); }
.btn-primary:active { box-shadow: 0 1px 1px rgba(0,0,0,.20); }
.btn-gold { box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.btn-gold:hover { box-shadow: 0 3px 9px rgba(242,169,0,.38); }
.btn-gold:active { box-shadow: 0 1px 1px rgba(0,0,0,.20); }

/* 3. Data tables — Fluent DataGrid feel: distinct header band + firm rule */
thead th { background: var(--fsd-surface-soft); border-bottom: 1.5px solid var(--fsd-border); white-space: nowrap; }

/* 4. Progress track legibility (visible even when empty / low signal) */
.progress-bar { border: 1px solid var(--fsd-border); box-shadow: inset 0 1px 1px rgba(0,0,0,.05); }

/* 5. Interactive surfaces — clickable school rows lift on hover */
.sch-row { transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease; }
.sch-row:hover { box-shadow: 0 3px 10px rgba(11,61,102,.10); border-color: #cdd8e6; }
html[data-theme="dark"] .sch-row:hover { box-shadow: 0 3px 12px rgba(0,0,0,.45); border-color: #5b7899; }

/* 6. Native date control — themed calendar indicator so it matches custom fields */
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: .85; }
/* Dark mode: render the native date control (icon + popup) in dark scheme so the
   calendar indicator is a visible light glyph instead of a dark-on-dark one. */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"] { color-scheme: dark; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { opacity: .85; }
html[data-theme="dark"] input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* 7. Windows High Contrast / forced-colors — Fluent adaptive contrast support */
@media (forced-colors: active) {
  .card, .btn, .kebab-menu, .ms-modal, .modal-surface,
  input, select, textarea, .badge, .ti-chip, .pill { border: 1px solid CanvasText; }
  .btn:focus-visible, a:focus-visible,
  input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .progress-bar > span { background: Highlight; }
  .fsd-nav a.active { border-bottom-color: Highlight; }
}

/* 8. Fluent iconography — mask-based icons (inline <svg> is stripped by Power Pages),
   coloured via currentColor so they inherit each button's text colour. */
.fsd-ic { display:inline-block; width:16px; height:16px; flex:0 0 auto; background-color:currentColor;
  -webkit-mask:center/contain no-repeat; mask:center/contain no-repeat; }
.btn-sm .fsd-ic { width:14px; height:14px; }
.fsd-ic-search  { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
.fsd-ic-x       { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E"); }
.fsd-ic-download{ -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E"); }
.fsd-ic-eye     { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.fsd-ic-plus    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E"); }
.fsd-ic-edit    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E"); }
.fsd-ic-ban     { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='5.6' y1='5.6' x2='18.4' y2='18.4'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='5.6' y1='5.6' x2='18.4' y2='18.4'/%3E%3C/svg%3E"); }
.fsd-ic-bell    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E"); }
.fsd-ic-printer { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E"); }
.fsd-ic-send    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='22' y1='2' x2='11' y2='13'/%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'/%3E%3C/svg%3E"); }
.fsd-ic-undo    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M3 13a9 9 0 1 0 3-7.7L3 8'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M3 13a9 9 0 1 0 3-7.7L3 8'/%3E%3C/svg%3E"); }
.fsd-ic-reverse { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 14 4 9 9 4'/%3E%3Cpath d='M20 20v-7a4 4 0 0 0-4-4H4'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 14 4 9 9 4'/%3E%3Cpath d='M20 20v-7a4 4 0 0 0-4-4H4'/%3E%3C/svg%3E"); }
.fsd-ic-moon    { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z'/%3E%3C/svg%3E"); }
.fsd-ic-sun     { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cline x1='12' y1='2' x2='12' y2='4'/%3E%3Cline x1='12' y1='20' x2='12' y2='22'/%3E%3Cline x1='4.2' y1='4.2' x2='5.6' y2='5.6'/%3E%3Cline x1='18.4' y1='18.4' x2='19.8' y2='19.8'/%3E%3Cline x1='2' y1='12' x2='4' y2='12'/%3E%3Cline x1='20' y1='12' x2='22' y2='12'/%3E%3Cline x1='4.2' y1='19.8' x2='5.6' y2='18.4'/%3E%3Cline x1='18.4' y1='5.6' x2='19.8' y2='4.2'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cline x1='12' y1='2' x2='12' y2='4'/%3E%3Cline x1='12' y1='20' x2='12' y2='22'/%3E%3Cline x1='4.2' y1='4.2' x2='5.6' y2='5.6'/%3E%3Cline x1='18.4' y1='18.4' x2='19.8' y2='19.8'/%3E%3Cline x1='2' y1='12' x2='4' y2='12'/%3E%3Cline x1='20' y1='12' x2='22' y2='12'/%3E%3Cline x1='4.2' y1='19.8' x2='5.6' y2='18.4'/%3E%3Cline x1='18.4' y1='5.6' x2='19.8' y2='4.2'/%3E%3C/svg%3E"); }
.fsd-ic-desktop { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='1'/%3E%3Cline x1='8' y1='20' x2='16' y2='20'/%3E%3Cline x1='12' y1='16' x2='12' y2='20'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='1'/%3E%3Cline x1='8' y1='20' x2='16' y2='20'/%3E%3Cline x1='12' y1='16' x2='12' y2='20'/%3E%3C/svg%3E"); }
.fsd-ic-check   { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }

/* Theme picker menu (Fluent) */
.fsd-theme-menu { position:relative; display:inline-flex; }
.fsd-theme-btn { display:inline-flex; align-items:center; gap:6px; border:1px solid rgba(255,255,255,.5); background:rgba(255,255,255,.16); color:#fff; border-radius:8px; min-height:32px; padding:5px 10px; cursor:pointer; font:inherit; }
.fsd-theme-btn:hover { background:rgba(255,255,255,.28); }
.fsd-theme-btn:focus-visible { outline:2px solid var(--fsd-gold); outline-offset:2px; }
.fsd-theme-caret { font-size:10px; line-height:1; }
.fsd-theme-pop { position:absolute; right:0; top:calc(100% + 8px); min-width:196px; background:var(--fsd-card); color:var(--fsd-text); border:1px solid var(--fsd-border); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.28); padding:6px; z-index:1200; }
.fsd-theme-pop[hidden] { display:none; }
.fsd-theme-opt { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:transparent; border:0; border-radius:7px; padding:9px 10px; font:inherit; font-size:14px; color:var(--fsd-text); cursor:pointer; }
.fsd-theme-opt:hover, .fsd-theme-opt:focus-visible { background:var(--fsd-hover-row); outline:none; }
.fsd-theme-opt[aria-checked="true"] { font-weight:600; }
.fsd-theme-check { margin-left:auto; opacity:0; }
.fsd-theme-opt[aria-checked="true"] .fsd-theme-check { opacity:1; }

/* Document viewer command bar (Fluent): persistent Close + overflow menu */
.fsd-ic-more { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='12' cy='5' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='12' cy='19' r='1.8'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='12' cy='5' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='12' cy='19' r='1.8'/%3E%3C/svg%3E"); }
.modal-cmdbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 10px 9px 18px; border-bottom:1px solid var(--fsd-border); }
.modal-cmdbar > strong { color:var(--fsd-navy); font-size:15px; }
html[data-theme="dark"] .modal-cmdbar > strong { color:#cfe2ff; }
.modal-cmd-actions { display:flex; align-items:center; gap:4px; }
.modal-icon-btn { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:7px; border:1px solid transparent; background:transparent; color:var(--fsd-text); cursor:pointer; }
.modal-icon-btn:hover { background:var(--fsd-hover-row); }
.modal-icon-btn:focus-visible { outline:2px solid var(--fsd-focus-outline); outline-offset:2px; }
.modal-icon-btn .fsd-ic { width:18px; height:18px; }
.modal-close-btn:hover { background:#fde8e8; color:var(--fsd-danger); }
html[data-theme="dark"] .modal-close-btn:hover { background:#5a2a2a; color:#ffb4b4; }
.fsd-of-menu { position:relative; display:inline-flex; }
.fsd-of-pop { position:absolute; right:0; top:calc(100% + 6px); min-width:184px; background:var(--fsd-card); color:var(--fsd-text); border:1px solid var(--fsd-border); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.28); padding:6px; z-index:1300; }
.fsd-of-pop[hidden] { display:none; }
.fsd-of-item { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:transparent; border:0; border-radius:7px; padding:9px 10px; font:inherit; font-size:14px; color:var(--fsd-text); cursor:pointer; }
.fsd-of-item:hover, .fsd-of-item:focus-visible { background:var(--fsd-hover-row); outline:none; }

/* 9. Sticky table headers so columns stay visible on long lists */
thead th { position: sticky; top: 0; z-index: 2; }

/* =====================================================================
   10. Create Trip — student picker (scoped to #createTripForm)
   Relocated from the teacher-create-trip template <style> block so all
   styling lives in this single source of truth.
   ===================================================================== */
#createTripForm .req{color:var(--fsd-danger,#dc2626);font-weight:800;font-size:15px;line-height:1;margin-left:3px;vertical-align:middle;}
#createTripForm .req-legend{font-size:12px;color:var(--fsd-muted,#6b7280);margin:-4px 0 14px;}
[data-theme="dark"] #createTripForm .req{color:#ff6b6b;}
#createTripForm .filter-bar{gap:8px;margin-bottom:12px;}
#createTripForm .student-roster{flex:1 1 auto;display:flex;flex-direction:column;min-height:200px;max-height:62vh;border:1px solid #e2e6ea;border-radius:10px;background:#fff;}
#createTripForm .student-list{flex:1 1 auto;min-height:120px;overflow-y:auto;border:0;border-radius:0 0 10px 10px;background:transparent;padding:4px;}
#createTripForm .student-list::-webkit-scrollbar{width:10px;}
#createTripForm .student-list::-webkit-scrollbar-thumb{background:#c9d3dd;border-radius:6px;border:2px solid #fff;}
#createTripForm .student-list::-webkit-scrollbar-thumb:hover{background:#adbccb;}
#createTripForm .student-row{display:flex;align-items:center;gap:11px;padding:9px 12px;margin:0;border:0;border-radius:8px;font-size:14px;color:#1b2733;cursor:pointer;transition:background .12s ease;}
#createTripForm .student-row:hover{background:#f2f6fa;}
#createTripForm .student-row.is-selected{background:transparent;}
#createTripForm .student-row .stu-cb{width:17px;height:17px;margin:0;flex:0 0 auto;accent-color:#0b3d66;cursor:pointer;}
#createTripForm .stu-toolbar-actions{display:flex;align-items:center;gap:10px;margin-left:auto;}
#createTripForm .stu-grade-dd{min-width:132px;}
#createTripForm .student-row .stu-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto;}
#createTripForm .student-row .meta{margin-left:auto;flex:0 0 auto;font-size:11px;font-weight:600;color:#5a6b7b;background:#eef2f6;border-radius:10px;padding:2px 9px;min-width:38px;text-align:center;}
#createTripForm .student-row .stu-id{margin-left:6px;background:transparent;color:var(--fsd-muted,#6b7785);font-weight:600;}
#createTripForm .stu-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:10px 16px;background:#fafbfc;border-radius:10px 10px 0 0;flex:0 0 auto;}
#createTripForm .student-roster .stu-empty{border:0;background:transparent;border-radius:0 0 10px 10px;}
#createTripForm .stu-count-wrap{display:inline-flex;align-items:center;font-size:13px;font-weight:700;color:#1b2733;}
#createTripForm .stu-toolbar-right{display:inline-flex;align-items:center;gap:12px;margin-left:auto;}
#createTripForm .stu-toolbar-right .stu-grade-dd{min-width:auto;}
#createTripForm .stu-toolbar-right .ms-btn{width:auto;min-height:32px;padding:5px 10px;font-size:13px;gap:8px;}
#createTripForm .stu-toolbar-right .ms-btn .ms-label{font-weight:500;}
#createTripForm .stu-selectall{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#0b3d66;cursor:pointer;user-select:none;}
#createTripForm .stu-selectall-cb{width:15px;height:15px;margin:0;flex:0 0 auto;accent-color:#0b3d66;cursor:pointer;}
/* Field labels above the school/class/grade/search filters (match trip-detail .form-row label). */
.ms-field-label{display:block;font-size:13px;font-weight:normal;color:var(--fsd-muted);margin:0 0 4px;}
.stu-count-head{font-size:13px;font-weight:600;color:var(--fsd-muted,#6b7785);margin-left:auto;white-space:nowrap;}
#createTripForm .stu-count-num{background:var(--fsd-navy,#0b3d66);color:#fff;font-weight:700;font-size:13px;border-radius:999px;padding:2px 10px;min-width:24px;text-align:center;}
#createTripForm .stu-toggle-all{display:inline-flex;align-items:center;justify-content:center;min-height:40px;background:#fff;border:1px solid #e5e7eb;color:#0b3d66;font:inherit;font-size:13px;font-weight:600;cursor:pointer;padding:9px 14px;border-radius:6px;white-space:nowrap;transition:border-color .15s ease,box-shadow .15s ease;}
#createTripForm .stu-toggle-all:hover{border-color:#0b3d66;}
#createTripForm .stu-toggle-all:focus-visible{outline:2px solid #0b3d66;outline-offset:1px;}
/* Classes dropdown "my classes" toggle */
.ms-panel-tools{padding:8px 10px;border-bottom:1px solid #edf0f3;margin-bottom:4px;}
/* Multi-select panels (Risk Forms, Classes): pin search row, scroll options only */
.ms-dd .ms-panel { top: calc(100% + 6px); z-index: 50; }
.ms-panel:has(.ms-panel-head) {
  padding: 0;
  overflow: hidden;
  max-height: 280px;
  flex-direction: column;
}
.ms-panel:has(.ms-panel-head).is-open { display: flex; }
.ms-panel:has(.ms-panel-head) .ms-panel-head {
  position: relative;
  flex: 0 0 auto;
  top: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--fsd-border, #edf0f3);
  background: var(--fsd-card, #fff);
  margin-bottom: 0;
  box-shadow: none;
}
.ms-panel-body,
#classFilterOptions {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.ms-panel-head .ms-panel-search{position:static;margin:0;width:auto;flex:1 1 auto;min-width:0;}
.ms-panel-head .ms-clear-link,.ms-panel-head .ms-toggle-link{width:auto;flex:0 0 auto;white-space:nowrap;}
[data-theme="dark"] .ms-panel:has(.ms-panel-head) .ms-panel-head{background:var(--fsd-card);border-color:var(--fsd-border);}
/* Currency prefix adornment (Fee per Student) */
.field-prefix{position:relative;display:block;}
.field-prefix>.fp-sym{position:absolute;left:12px;top:0;bottom:0;display:flex;align-items:center;color:var(--fsd-text);font-size:14px;line-height:1;pointer-events:none;z-index:1;}
.field-prefix>input{padding-left:26px;}
#createTripForm .field-prefix>input{padding-left:26px;}
/* Trip Time: one combined box holding the typeable time + the AM/PM dropdown (no inner borders). */
.time-field{display:flex;align-items:stretch;border:1px solid var(--fsd-border);border-radius:6px;background:#fff;}
.time-field:focus-within{border-color:var(--fsd-focus-border,#0b3d66);box-shadow:0 0 0 2px var(--fsd-focus-ring,rgba(11,61,102,.12));}
#createTripForm .time-field:has(.field-error){border-color:var(--fsd-danger,#dc2626);box-shadow:none;}
.time-field .time-ampm-dd{flex:0 0 auto;min-width:76px;position:relative;border-left:1px solid var(--fsd-border);}
[data-theme="dark"] .time-field{background:var(--fsd-card);border-color:var(--fsd-border);}
#createTripForm .time-field .time-text{flex:1 1 auto;min-width:0;border:0;background:transparent;box-shadow:none;}
#createTripForm .time-field .time-text:focus{border:0;box-shadow:none;}
#createTripForm .time-field .ms-btn{border:0;border-radius:0 6px 6px 0;background:transparent;box-shadow:none;}
.ms-toggle-link{display:inline-flex;align-items:center;gap:6px;background:#f2f6fa;border:1px solid #dbe3ec;padding:5px 10px;color:#0b3d66;font:inherit;font-size:12px;font-weight:600;cursor:pointer;border-radius:14px;width:100%;justify-content:center;}
.ms-toggle-link:hover{background:#e6eef7;}
.ms-toggle-link[aria-pressed="true"]{background:#0b3d66;color:#fff;border-color:#0b3d66;}
.ms-clear-link{display:inline-flex;align-items:center;justify-content:center;width:100%;background:#f2f6fa;border:1px solid #dbe3ec;padding:5px 10px;color:#0b3d66;font:inherit;font-size:12px;font-weight:600;cursor:pointer;border-radius:14px;}
.ms-clear-link:hover{background:#e6eef7;}
.ms-clear-link:disabled{opacity:.5;cursor:not-allowed;background:#f2f6fa;}
[data-theme="dark"] .ms-clear-link{background:#26313c;border-color:#3a4652;color:#8cc7ff;}
[data-theme="dark"] .ms-clear-link:disabled{opacity:.45;}
.class-mine-label{font-size:10px;font-weight:600;color:#7a6200;background:#fdf1cf;border-radius:8px;padding:1px 6px;margin-left:4px;}
/* Selected students pane (Fluent token chips) */
.selected-pane{margin-top:14px;border-top:1px solid #edf0f3;padding-top:14px;}
.selected-pane-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-size:13px;}
.selected-pane-title{font-weight:600;color:#1b2733;display:inline-flex;align-items:center;gap:7px;}
.selected-pane-title .sel-count-num{background:#0b3d66;color:#fff;font-weight:600;font-size:12px;border-radius:10px;padding:1px 9px;min-width:20px;text-align:center;}
.selected-pane .btn-link{font-size:12px;font-weight:600;}
.selected-chips{display:flex;flex-wrap:wrap;gap:7px;max-height:140px;overflow-y:auto;padding:2px;}
.sel-chip{display:inline-flex;align-items:center;gap:4px;background:#eef2f6;color:#1b2733;border:1px solid #e2e6ea;border-radius:6px;padding:3px 4px 3px 10px;font-size:12px;line-height:1.5;}
.sel-chip-x{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;color:#6b7785;width:18px;height:18px;border-radius:4px;cursor:pointer;font-size:14px;line-height:1;padding:0;}
.sel-chip-x:hover{background:#dbe3ec;color:#0b3d66;}
/* Dark theme */
[data-theme="dark"] #createTripForm .student-roster{background:var(--fsd-card);border-color:var(--fsd-border);}
[data-theme="dark"] #createTripForm .stu-toolbar{background:rgba(255,255,255,.03);border-bottom-color:var(--fsd-border);}
[data-theme="dark"] #createTripForm .stu-count-wrap{color:var(--fsd-text);}
[data-theme="dark"] #createTripForm .stu-selectall{color:#8cc7ff;}
[data-theme="dark"] #createTripForm .student-list{background:transparent;border-color:var(--fsd-border);}
[data-theme="dark"] #createTripForm .student-list::-webkit-scrollbar-thumb{background:#3a4652;border-color:var(--fsd-card);}
[data-theme="dark"] #createTripForm .student-row{color:var(--fsd-text);}
[data-theme="dark"] #createTripForm .student-row:hover{background:rgba(140,199,255,.08);}
[data-theme="dark"] #createTripForm .student-row.is-selected{background:transparent;}
[data-theme="dark"] #createTripForm .student-row .meta{background:#26313c;color:#aeb9c4;}
[data-theme="dark"] #createTripForm .stu-toggle-all{background:var(--fsd-card);border-color:var(--fsd-border);color:#8cc7ff;}
[data-theme="dark"] #createTripForm .stu-toggle-all:hover{border-color:#8cc7ff;}
[data-theme="dark"] .ms-toggle-link{background:#26313c;border-color:#3a4652;color:#8cc7ff;}
[data-theme="dark"] .ms-toggle-link[aria-pressed="true"]{background:#274b6d;color:#fff;border-color:#274b6d;}
[data-theme="dark"] .selected-pane-title{color:var(--fsd-text);}
[data-theme="dark"] .sel-chip{background:#26313c;border-color:#3a4652;color:var(--fsd-text);}
[data-theme="dark"] .sel-chip-x{color:#aeb9c4;}
[data-theme="dark"] .sel-chip-x:hover{background:#3a4652;color:#8cc7ff;}



