/* ============================================================
   EquipEvals Dashboard — Main Stylesheet
   Equine Equipment Evaluation Management
   Fonts: Instrument Serif (display) + DM Sans (body)
   Self-contained — no external CSS imports required.
   ============================================================ */


/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:        #F4F1EB;
  --surface:   #FDFCF9;
  --surface2:  #EEE9DF;

  /* Borders */
  --border:    #D9D2C5;

  /* Ink (text) */
  --ink:       #1C1A16;
  --ink2:      #6B6455;
  --ink3:      #A09588;

  /* Brand & Accent */
  --accent:    #2D6A4F;
  --accent2:   #52B788;

  /* Semantic */
  --warn:      #E76F51;
  --gold:      #C9942A;
  --sky:       #457B9D;
  --critical:  #C0392B;

  /* Chart Palette */
  --c1:  #2D6A4F;
  --c2:  #52B788;
  --c3:  #C9942A;
  --c4:  #E76F51;
  --c5:  #457B9D;
  --c6:  #A8DADC;
  --c7:  #8B5CF6;
  --c8:  #EC4899;
  --c9:  #F59E0B;
  --c10: #6EE7B7;

  /* Layout */
  --sidebar-bg:     #1C1A16;
  --sidebar-width:  216px;
  --topbar-height:  54px;

  /* Rating Colors */
  --rating-1: #C0392B;
  --rating-2: #E76F51;
  --rating-3: #C9942A;
  --rating-4: #52B788;
  --rating-5: #2D6A4F;

  /* Shape */
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --radius-pill: 20px;

  /* Elevation */
  --shadow:    0 2px 12px rgba(28, 26, 22, 0.08);
  --shadow-lg: 0 8px 32px rgba(28, 26, 22, 0.13);

  /* Typography scale */
  --text-xs:   0.67rem;
  --text-sm:   0.75rem;
  --text-base: 0.875rem;
  --text-lg:   1rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
}


/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base, 14px);
}

body {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
}


/* ── TYPOGRAPHY ──────────────────────────────────────────── */

.display-xl {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.display-lg {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.display-md {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

.label-xs {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink3);
}

.label-sm {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink2);
}

.page-title {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: var(--text-2xl);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-meta {
  font-size: var(--text-sm);
  color: var(--ink3);
  margin-top: 3px;
}


/* ── APP SHELL ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content-area {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}


/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-wordmark {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: 1.45rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-sub {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.context-badge {
  margin: 12px 14px 0;
  background: rgba(82, 183, 136, 0.18);
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: 7px;
  padding: 10px 12px;
}

.context-badge-name,
.context-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.context-badge-meta,
.context-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 3px;
}

.context-badge-clickable {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.context-badge-clickable:hover {
  background: rgba(82, 183, 136, 0.30);
  border-color: rgba(82, 183, 136, 0.55);
}

/* Scope Drill-Down Selects */
.scope-filter {
  padding: 6px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scope-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.5)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}

.scope-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.scope-select:focus {
  outline: none;
  border-color: var(--accent2);
}

.scope-select option {
  background: var(--ink);
  color: #fff;
}

.nav-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}

/* Context Switcher Modal */
.context-modal {
  max-width: 420px;
}

.context-modal-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-modal-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s;
  position: relative;
}

.context-modal-item:hover {
  background: var(--surface2);
}

.context-modal-item.active {
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.2);
}

.context-modal-name {
  font-size: 0.88rem;
  font-weight: 600;
  width: 100%;
}

.context-modal-meta {
  font-size: 0.75rem;
  color: var(--ink3);
}

.context-modal-check {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
}

.sidebar-nav {
  padding: 16px 10px 6px;
  flex: 1;
}

.nav-section-label {
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 8px;
  margin-bottom: 5px;
  margin-top: 14px;
}

/* Subtle divider above the "notifications" nav group. Signals to the user
   that items below (Service Requests, Notes, Alerts, Presentations, Help)
   live OUTSIDE the sidebar scope narrowing — they always show everything
   the role can see, regardless of the selected district/school. */
.nav-section[data-section="notifications"] {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

.nav-icon {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-left: 41px; /* align with text after avatar */
}

.sidebar-action-link {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55) !important;
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-action-link:hover {
  color: #fff !important;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 9px;
}

.role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.role-dot.director  { background: var(--gold); }
.role-dot.staff     { background: var(--accent2); }
.role-dot.manager   { background: var(--sky); }
.role-dot.admin     { background: var(--warn); }

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--sky));
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.avatar-director { background: linear-gradient(135deg, var(--gold), var(--warn)); }
.avatar-staff    { background: linear-gradient(135deg, var(--accent), var(--sky)); }
.avatar-manager  { background: linear-gradient(135deg, var(--sky), var(--accent2)); }
.avatar-admin    { background: linear-gradient(135deg, var(--warn), var(--gold)); }

.user-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
}

.user-org,
.user-role {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.38);
  margin-top: 1px;
}


/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 26px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.breadcrumb-link {
  color: var(--ink3);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--border);
  user-select: none;
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}


/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #245e44;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink2);
}
.btn-ghost:hover {
  background: var(--surface2);
}

.btn-warn {
  background: var(--warn);
  color: #fff;
}
.btn-warn:hover {
  background: #c9623e;
}

.btn-sm {
  padding: 4px 10px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
}
.back-btn:hover { color: #245e44; }


/* ── TAB SWITCHER ────────────────────────────────────────── */
.view-tabs {
  display: flex;
  gap: 5px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 9px;
  width: fit-content;
}

.view-tab {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink2);
  transition: all 0.15s;
  border: none;
  background: transparent;
  font-family: inherit;
}

.view-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}


/* ── FILTER CHIPS ────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink2);
  transition: all 0.15s;
}

.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-chip:hover:not(.active) {
  background: var(--surface2);
}


/* ── KPI CARDS ───────────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-strip-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-strip-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.kpi-green::before  { background: var(--accent2); }
.kpi-orange::before { background: var(--warn); }
.kpi-gold::before   { background: var(--gold); }
.kpi-sky::before    { background: var(--sky); }
.kpi-red::before    { background: var(--critical); }
.kpi-accent::before { background: var(--accent); }

.kpi-label {
  font-size: var(--text-xs);
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.kpi-value {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 4px;
  color: var(--ink);
}

.kpi-sub {
  font-size: 0.7rem;
  margin-top: 3px;
  color: var(--ink3);
}

.kpi-delta {
  font-size: var(--text-xs);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.delta-up   { color: var(--accent2); }
.delta-down { color: var(--warn); }


/* ── CHART / DATA CARDS ──────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-span-2 { grid-column: span 2; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.chart-sub {
  font-size: 0.7rem;
  color: var(--ink3);
  margin-top: 2px;
}

.chart-action {
  font-size: 0.72rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}


/* ── DONUT / PIE CHART HELPERS ───────────────────────────── */
.pie-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label {
  font-size: 0.73rem;
  color: var(--ink2);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-pct {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}


/* ── HORIZONTAL BAR CHART ────────────────────────────────── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.bar-label {
  font-size: 0.72rem;
  color: var(--ink2);
  width: 100px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-label.wide { width: 140px; }

.bar-track {
  flex: 1;
  height: 7px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-val {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--ink);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}


/* ── STAR RATING DISPLAY ─────────────────────────────────── */
.rating-dist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-label {
  display: flex;
  gap: 1px;
  width: 64px;
  flex-shrink: 0;
}

.star       { font-size: 0.66rem; }
.star.on    { color: var(--gold); }
.star.off   { color: var(--border); }


/* ── STATUS & SCORE ELEMENTS ─────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: 500;
}

.s-good     { background: #d8f3dc; color: #1a7a3a; }
.s-fair     { background: #fff3cd; color: #856404; }
.s-poor     { background: #fde8e4; color: #c0392b; }
.s-critical { background: #fde8e4; color: #c0392b; border: 1px solid #f5c6cb; }

.score-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-display, 'Instrument Serif'), serif;
}

.score-good { background: #d8f3dc; color: #1a7a3a; }
.score-fair { background: #fff3cd; color: #856404; }
.score-poor { background: #fde8e4; color: #c0392b; }

.rec-pill {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: var(--text-xs);
  font-weight: 500;
}
.rec-replace { background: #fde8e4; color: var(--warn); }
.rec-refurb  { background: #fff3cd; color: var(--gold); }

.flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
}
.flag-urgent { background: #fde8e4; color: var(--warn); }
.flag-info   { background: #e8f4fd; color: var(--sky); }
.flag-new    { background: #d8f3dc; color: var(--accent); }


/* ── DATA TABLE ──────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* .table-head as a <div> above the table (title + action row) */
div.table-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* .table-head on <thead> must NOT use flex — keep native table display */
thead.table-head {
  display: table-header-group;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink3);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

td {
  padding: 9px 16px;
  font-size: 0.78rem;
  color: var(--ink);
  border-bottom: 1px solid var(--surface2);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td      { background: var(--bg); }

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--ink2);
}

.page-btn {
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.74rem;
  font-family: inherit;
  color: var(--ink2);
}

.page-btn:hover      { background: var(--surface2); }
.page-btn.active-pg  { background: var(--accent); color: #fff; border-color: var(--accent); }


/* ── SEARCH INPUT ────────────────────────────────────────── */
.search-wrap {
  position: relative;
}

.search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 9px 5px 27px;
  font-size: 0.76rem;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  width: 190px;
}

.search-input:focus {
  border-color: var(--accent2);
}

.search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--ink3);
  pointer-events: none;
}


/* ── FORMS ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink3);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A09588' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

.select-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}

.select-input:focus { border-color: var(--accent2); }

.form-hint {
  font-size: var(--text-xs);
  color: var(--ink3);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--warn);
}


/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-card-header .logo-wordmark {
  color: var(--ink);
  font-size: 1.8rem;
}

.login-card-header .logo-sub {
  color: var(--ink3);
  font-size: var(--text-sm);
  margin-top: 6px;
  text-transform: none;
  letter-spacing: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

.login-input:focus {
  border-color: var(--accent2);
}

.login-input::placeholder {
  color: var(--ink3);
}

.login-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #245e44;
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  font-size: var(--text-sm);
  color: var(--warn);
  text-align: center;
}

.login-sent {
  font-size: var(--text-sm);
  color: var(--accent);
  text-align: center;
  padding: 8px;
  background: rgba(45, 106, 79, 0.08);
  border-radius: var(--radius-sm);
}

.login-error-banner {
  background: #fde8e4;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #c0392b;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: var(--text-sm);
  color: var(--ink3);
}


/* ── CONTEXT SWITCHER ────────────────────────────────────── */
.context-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.context-page-title {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: var(--text-2xl);
  color: var(--ink);
  text-align: center;
}

.context-page-sub {
  font-size: var(--text-sm);
  color: var(--ink3);
  text-align: center;
  margin-top: 4px;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.context-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow);
}

.context-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.context-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.context-card-meta {
  font-size: var(--text-xs);
  color: var(--ink3);
}


/* ── CARDS GRID ──────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.child-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.child-card:hover {
  border-color: var(--accent2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.child-card.alert    { border-left: 3px solid var(--warn); }
.child-card.critical { border-left: 3px solid var(--critical); }

.child-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.child-card-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.child-card-meta {
  font-size: var(--text-xs);
  color: var(--ink3);
  margin-top: 1px;
}

.child-card-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.child-card-stat {
  font-size: 0.7rem;
  color: var(--ink3);
}

.child-card-stat strong {
  color: var(--ink);
  font-weight: 600;
}

.child-card-mini-bar {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.mini-seg { height: 100%; }


/* ── NOTES FEED ──────────────────────────────────────────── */
.notes-feed {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.note-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(28,26,22,0.06);
  transition: border-color 0.15s;
}

.note-item:hover {
  border-color: var(--accent2);
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.note-author {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
}

.note-date {
  font-size: var(--text-xs);
  color: var(--ink3);
}

.note-ref {
  font-size: var(--text-xs);
  color: var(--accent);
  margin-bottom: 3px;
}

.note-body {
  font-size: 0.74rem;
  color: var(--ink2);
  line-height: 1.4;
}

.notes-compose {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

textarea.note-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.76rem;
  font-family: inherit;
  color: var(--ink);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s;
  min-height: 58px;
}

textarea.note-input:focus {
  border-color: var(--accent2);
}


/* ── SERVICE REQUESTS ────────────────────────────────────── */
.request-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.request-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.request-item:hover {
  border-color: var(--accent2);
}

.request-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.request-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink);
}

.request-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  flex-shrink: 0;
}

.request-status.open     { background: #e8f4fd; color: var(--sky); }
.request-status.pending  { background: #fff3cd; color: #856404; }
.request-status.resolved { background: #d8f3dc; color: #1a7a3a; }
.request-status.closed   { background: var(--surface2); color: var(--ink3); }

.request-meta {
  font-size: var(--text-xs);
  color: var(--ink3);
  margin-bottom: 6px;
}

.request-body {
  font-size: 0.78rem;
  color: var(--ink2);
  line-height: 1.45;
}

.reply-thread {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.reply-author {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
}

.reply-date {
  font-size: var(--text-xs);
  color: var(--ink3);
  margin-left: 8px;
}

.reply-body {
  font-size: 0.74rem;
  color: var(--ink2);
  line-height: 1.4;
  margin-top: 3px;
}


/* ── ALERTS ──────────────────────────────────────────────── */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(28,26,22,0.06);
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.alert-item:hover {
  border-color: var(--accent2);
}

.alert-item.alert-urgent {
  background: linear-gradient(135deg, #fff3e0, #fde8e4);
  border-color: #f5c6a0;
}

.alert-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.3;
  vertical-align: middle;
}
.alert-tag-urgent { background: #fde8e4; color: var(--warn); }
.alert-tag-reminder { background: #fff3cd; color: #856404; }
.alert-tag-push { background: #d8f3dc; color: #1a7a3a; }
.alert-tag-system { background: #e8f4fd; color: var(--sky); }

.alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.alert-desc {
  font-size: var(--text-xs);
  color: var(--ink3);
  margin-top: 2px;
}

.alert-time {
  font-size: var(--text-xs);
  color: var(--ink3);
  flex-shrink: 0;
}

.alert-dismiss {
  margin-left: auto;
  color: var(--ink3);
  cursor: pointer;
  padding: 4px;
}

.alert-banner {
  background: linear-gradient(135deg, #fff3e0, #fde8e4);
  border: 1px solid #f5c6a0;
  border-radius: var(--radius);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.78rem;
}


/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.anim-fade-up {
  animation: fadeUp 0.4s ease both;
}

.anim-fade-in {
  animation: fadeIn 0.3s ease both;
}

.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.10s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.20s; }
.anim-delay-5 { animation-delay: 0.25s; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ── UTILITY CLASSES ─────────────────────────────────────── */

/* Display */
.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.inline-flex     { display: inline-flex; }
.grid            { display: grid; }
.hidden          { display: none; }

/* Flex alignment */
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1; }

/* Gap */
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-5  { gap: 20px; }
.gap-6  { gap: 24px; }

/* Raw pixel gaps matching design system */
.gap-4px   { gap: 4px; }
.gap-6px   { gap: 6px; }
.gap-8px   { gap: 8px; }
.gap-10px  { gap: 10px; }
.gap-12px  { gap: 12px; }
.gap-16px  { gap: 16px; }
.gap-20px  { gap: 20px; }

/* Margin top */
.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }

/* Margin bottom */
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 4px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }

/* Margin left */
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Padding */
.p-0   { padding: 0; }
.p-1   { padding: 4px; }
.p-2   { padding: 8px; }
.p-3   { padding: 12px; }
.p-4   { padding: 16px; }

/* Text */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-left     { text-align: left; }

.text-xs   { font-size: var(--text-xs); color: var(--ink3); }
.text-sm   { font-size: var(--text-sm); color: var(--ink2); }
.text-base { font-size: var(--text-base); color: var(--ink); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.text-muted    { color: var(--ink3); }
.text-accent   { color: var(--accent); }
.text-warn     { color: var(--warn); }
.text-good     { color: var(--accent2); }

.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.font-bold     { font-weight: 700; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Width */
.w-full { width: 100%; }

/* Cursor */
.pointer { cursor: pointer; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }


/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .kpi-strip,
  .kpi-strip-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-grid,
  .chart-grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-span-2 {
    grid-column: span 1;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile hamburger — hidden on desktop */
.mobile-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 8px;
}
.mobile-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}
.mobile-backdrop {
  display: none;
}

@media (max-width: 768px) {
  /* Collapse the full ancestor trail on narrow screens — leave only the
     current leaf visible. Context (K-12), separators, and intermediate
     scope crumbs all hide. */
  .breadcrumb .breadcrumb-link,
  .breadcrumb .breadcrumb-sep,
  .breadcrumb .breadcrumb-context {
    display: none;
  }
  .mobile-hamburger {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: calc(var(--sidebar-width) * -1 - 20px);
    width: calc(var(--sidebar-width) + 20px);
    height: 100vh;
    z-index: 300;
    transition: left 0.25s ease;
    flex-shrink: 0;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .mobile-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 299;
  }
  .topbar {
    padding: 0 16px;
  }
  .content-area {
    padding: 16px;
  }
  .kpi-strip,
  .kpi-strip-4,
  .kpi-strip-3 {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 24px 20px;
  }
  .modal-panel {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    margin: 5vh auto;
  }
}


/* ── MODAL ───────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 22, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(28, 26, 22, 0.2);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeSlideUp 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display, 'Instrument Serif'), serif;
  font-size: 1.2rem;
  margin: 0;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--ink3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--surface2);
  color: var(--ink);
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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


/* ── PAGE SPACING FIXES ─────────────────────────────────── */

.page-header {
  margin-bottom: 20px;
}

.page-header .page-title {
  margin-bottom: 4px;
}

.filter-row {
  margin-bottom: 16px;
}

.filter-row + .table-card,
.filter-row + .request-list,
.filter-row + .notes-feed,
.filter-row + .alert-list {
  margin-top: 8px;
}

.request-list,
.notes-feed,
.alert-list {
  margin-top: 16px;
}

.request-item,
.note-item,
.alert-item {
  margin-bottom: 2px;
}


/* ── PROFILE PAGE ────────────────────────────────────────── */

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

.email-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  gap: 8px;
}

.email-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.email-address {
  font-size: 0.85rem;
  color: var(--ink);
  word-break: break-all;
}

.email-primary-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(45, 106, 79, 0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.email-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.profile-msg {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.msg-success {
  background: rgba(45, 106, 79, 0.1);
  color: var(--accent);
}

.msg-error {
  background: rgba(192, 57, 43, 0.1);
  color: var(--critical);
}

/* Dashboard legend items — clickable links */
a.legend-link {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.12s;
}
a.legend-link:hover {
  background: var(--surface2);
}

/* Dashboard recent items — list container (x-show safe) */
.dash-item-list {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* Dashboard recent items — clickable cards */
.dash-item {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dash-item:hover {
  background: var(--surface2);
  border-color: var(--ink3);
}

/* Tag bar — flex container safe with x-show */
.ee-tag-bar {
  display: flex !important;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* Tag pills — used on location & equipment detail pages */
.ee-tag-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  color: #fff;
  white-space: nowrap;
  line-height: 1.3;
  margin: 1px 0;
}

/* Equipment photo grid (x-show safe) */
.eq-photo-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

/* Location hero header */
.loc-hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.loc-hero-info {
  flex: 1;
  min-width: 0;
}
.loc-hero-photo {
  flex-shrink: 0;
  width: 240px;
  height: 160px;
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 768px) {
  .loc-hero {
    flex-direction: column-reverse;
  }
  .loc-hero-photo {
    width: 100%;
    height: 180px;
  }
}

/* Evaluation gear button (reassign) */
.eval-gear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink3);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.eval-gear-btn:hover {
  color: var(--accent);
  background: var(--bg2);
}

/* Location quick-links grid (x-show safe) */
.loc-links-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* Location quick-link cards */
.loc-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 2px;
}
.loc-link-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.loc-link-icon {
  font-size: 1.3rem;
  opacity: 0.6;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.loc-link-body { flex: 1; min-width: 0; }
.loc-link-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.loc-link-sub {
  font-size: 0.76rem;
  color: var(--ink3);
  margin-top: 2px;
}
.loc-link-arrow {
  font-size: 1.4rem;
  color: var(--ink3);
  flex-shrink: 0;
}

/* Settings page — section spacing (x-show safe) */
.settings-sections {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

/* Settings page — WP Admin quick links */
.settings-wp-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.settings-wp-link:hover {
  border-color: var(--accent);
  background: rgba(45,106,79,0.04);
}
.settings-wp-link-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.settings-wp-link-sub {
  font-size: 0.72rem;
  color: var(--ink3);
}
