/* MISOS app additions — built on mis-design-system.css tokens, not a second theme. */

/* Restore the native [hidden] behavior: the design system's .btn (and potentially
   other components) set an explicit `display`, which beats the browser's default
   [hidden]{display:none} UA rule — without this, hidden elements stay visible. */
[hidden] {
  display: none !important;
}

/* Inline translation captions, from the bl() helper in src/helpers.php.
   Sized relative to the parent (em), so it scales in headings, labels, and
   buttons alike without needing a size variant per context. */
.i18n-cn, .i18n-th {
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.75;
}

/* --- Header brand lockup (icon mark + wordmark), same header bar as mastersinternationalschool.org --- */
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-header__brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-header__brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--mis-accent);
  letter-spacing: 0.01em;
}

.site-header__brand-text small {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mis-ink-muted);
}

/* Account area on the right of the header (email + sign out), sits alongside .site-header__nav */
.site-header__account {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header__account-email {
  color: var(--mis-ink-muted);
  font-size: 0.85rem;
}

/* --- Compact hero for app pages (login/register/etc) — same treatment as the marketing hero, less tall --- */
.hero-section--compact {
  padding-block: 2.75rem 3.25rem;
}

.hero-section--compact .hero-section__heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.35em;
}

.hero-section--compact .hero-section__sub {
  font-size: 1.1rem;
  max-width: 48ch;
}

/* Section directly under a hero, holding the actual form card */
.auth-section {
  display: flex;
  justify-content: center;
  padding-block: 3rem;
}

/* --- Forms --- */
.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mis-ink-soft);
}

.input, .select, textarea {
  width: 100%;
  border: 1px solid var(--mis-rule);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--mis-ink);
  background: var(--mis-surface);
}

.input:focus, .select:focus, textarea:focus {
  outline: 2px solid var(--mis-accent-soft);
  border-color: var(--mis-accent);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.form-card {
  max-width: 480px;
  width: 100%;
}

.form-card--wide {
  max-width: 720px;
}

.form-card h1 {
  font-size: 1.5rem;
}

.form-card p:last-child {
  margin-bottom: 0;
}

.form-card a {
  color: var(--mis-accent);
}

/* --- Table --- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--mis-surface);
  border: 1px solid var(--mis-rule);
  border-radius: 12px;
  overflow: hidden;
}

.table th, .table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mis-rule-soft);
  font-size: 0.9rem;
}

.table th {
  font-weight: 600;
  color: var(--mis-ink-soft);
  background: var(--mis-rule-soft);
}

.table tr:last-child td {
  border-bottom: none;
}

/* --- Badge --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--active, .badge--approved {
  background: #e3f2e6;
  color: #1f7a3d;
}

.badge--inactive, .badge--rejected {
  background: var(--mis-clay-soft);
  color: var(--mis-clay-ink);
}

.badge--pending, .badge--submitted {
  background: #fdf3d8;
  color: var(--mis-gold-ink);
}

.badge--draft {
  background: #e8e8e8;
  color: #555;
}

.badge--passed { background: #e3f2e6; color: #1f7a3d; }
.badge--failed { background: var(--mis-clay-soft); color: var(--mis-clay-ink); }
.badge--extended { background: #fdf3d8; color: var(--mis-gold-ink); }
.badge--accountant_signed_off { background: #e0e7ff; color: #3730a3; }
.badge--reimbursed { background: #e3f2e6; color: #1f7a3d; }

/* --- Misc --- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar__filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.otp-code-input {
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-align: center;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert--error {
  background: var(--mis-clay-soft);
  color: var(--mis-clay-ink);
}

.alert--info {
  background: var(--mis-wash);
  color: var(--mis-accent-ink);
}

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 260px;
  background: var(--mis-navy, #1a2332);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
  overflow-y: auto;
}

.dashboard-sidebar.collapsed {
  width: 64px;
}

.dashboard-sidebar__header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dashboard-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.dashboard-sidebar__brand-mark {
  width: 32px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.dashboard-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.dashboard-sidebar__brand-text strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.dashboard-sidebar__brand-text small {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.collapsed .dashboard-sidebar__brand-text {
  display: none;
}

/* ── AQI / PM2.5 widget ─────────────────────────────────────────── */

.dashboard-sidebar__aqi {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  animation: aqi-fade-in 0.4s ease-out;
}

@keyframes aqi-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dashboard-sidebar__aqi-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-sidebar__aqi-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.dashboard-sidebar__aqi-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dashboard-sidebar__aqi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.dashboard-sidebar__aqi-detail {
  font-size: 0.72rem;
  color: rgba(30,27,75,0.55);
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard-sidebar__aqi-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: rgba(30,27,75,0.4);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.collapsed .dashboard-sidebar__aqi {
  margin: 8px;
  padding: 8px;
  text-align: center;
}

.collapsed .dashboard-sidebar__aqi-row {
  flex-direction: column;
  gap: 2px;
}

.collapsed .dashboard-sidebar__aqi-info,
.collapsed .dashboard-sidebar__aqi-location {
  display: none;
}

/* ── Compact AQI / on-premises badges with hover-to-expand cards ──── */

.dashboard-sidebar__widgets-row {
  display: flex;
  gap: 8px;
  margin: 12px 16px;
}

.dashboard-sidebar__widget {
  position: relative;
}

.dashboard-sidebar__widget-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: default;
}

.dashboard-sidebar__widget-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 216px;
  z-index: 30;
  margin: 0;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  animation: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.dashboard-sidebar__widget:hover .dashboard-sidebar__widget-panel,
.dashboard-sidebar__widget:focus-within .dashboard-sidebar__widget-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.collapsed .dashboard-sidebar__widgets-row {
  flex-direction: column;
  align-items: center;
  margin: 8px;
}

.collapsed .dashboard-sidebar__widget-panel {
  top: 0;
  left: 100%;
  margin-left: 8px;
}

.dashboard-sidebar__toggle {
  position: absolute;
  top: 20px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--mis-navy, #1a2332);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  z-index: 101;
}

.dashboard-sidebar__toggle:hover {
  background: var(--mis-accent);
  border-color: var(--mis-accent);
}

.dashboard-sidebar__nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* ── Sidebar search input ── */
.dashboard-sidebar__search {
  display: flex;
  align-items: center;
  margin: 4px 12px 4px;
  padding: 0 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s;
}

.dashboard-sidebar__search:focus-within {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
}

.dashboard-sidebar__search .material-symbols-outlined {
  font-size: 18px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.dashboard-sidebar__search input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
  padding: 7px 6px;
  width: 100%;
  font-family: inherit;
}

.dashboard-sidebar__search input::placeholder {
  color: rgba(255,255,255,0.35);
}

.collapsed .dashboard-sidebar__search {
  display: none;
}
  padding: 12px 16px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}

.collapsed .dashboard-sidebar__group-label {
  display: none;
}

.dashboard-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.dashboard-sidebar__link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.dashboard-sidebar__link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-right: 3px solid var(--mis-gold, #d4a843);
}

.dashboard-sidebar__link .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}

.collapsed .dashboard-sidebar__link span:not(.material-symbols-outlined) {
  display: none;
}

/* ── Collapsible sidebar sections (<details>/<summary>) ── */
.dashboard-sidebar__section {
  margin: 0;
  padding: 0;
}

.dashboard-sidebar__section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  user-select: none;
  list-style: none;              /* remove default marker */
  margin-top: 4px;
}

.dashboard-sidebar__section-label::-webkit-details-marker {
  display: none;
}

/* Chevron indicator */
.dashboard-sidebar__section-label::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid rgba(255,255,255,0.35);
  border-bottom: 1.5px solid rgba(255,255,255,0.35);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-left: 8px;
  flex-shrink: 0;
}

.dashboard-sidebar__section[open] > .dashboard-sidebar__section-label::after {
  transform: rotate(45deg);
}

/* Submenu label (smaller, muted heading within a collapsible section) */
.dashboard-sidebar__submenu-label {
  padding: 8px 16px 2px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* Sub-items get a small left indent */
.dashboard-sidebar__link--sub {
  padding-left: 28px;
}

/* Collapsed sidebar: hide section labels, submenu labels, chevrons */
.collapsed .dashboard-sidebar__section-label {
  display: none;
}

.collapsed .dashboard-sidebar__submenu-label {
  display: none;
}

.collapsed .dashboard-sidebar__section {
  /* In collapsed mode, treat sections as flat — all items visible */
}

/* Force <details> to render as open block when sidebar is collapsed */
.collapsed details.dashboard-sidebar__section {
  display: block;
}

.collapsed details.dashboard-sidebar__section > summary {
  display: none;
}

.collapsed details.dashboard-sidebar__section > :not(summary) {
  display: block;
}

.collapsed .dashboard-sidebar__link--sub {
  padding-left: 16px;
}

.dashboard-sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

.collapsed .dashboard-sidebar__footer .dashboard-sidebar__footer-email {
  display: none;
}

/* Main content area */
.dashboard-content {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
  padding: 0;
  transition: margin-left 0.2s ease;
  min-height: 100vh;
  background: var(--mis-cream, #faf7f2);
}

.dashboard-content.expanded {
  margin-left: 64px;
}

.dashboard-content__header {
  background: #fff;
  border-bottom: 1px solid var(--mis-rule-soft);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-content__header h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--mis-navy);
  margin: 0;
}

.dashboard-content__body {
  padding: 24px 32px;
}

/* Module cards for overview/dashboard pages */
.module-card {
  background: #fff;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.15s;
}

.module-card:hover {
  box-shadow: var(--mis-shadow-soft);
}

.module-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0 0 8px;
  color: var(--mis-navy);
}

.module-card p {
  color: var(--mis-ink-muted);
  font-size: 0.88rem;
  margin: 0 0 12px;
}

/* Stat cards for dashboard overviews */
.stat-card {
  background: #fff;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-card__value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--mis-navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--mis-ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Clickable stat cards on HR overview */
a.stat-card--link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}
a.stat-card--link:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-grid--stats {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Section header within dashboard content */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--mis-navy);
  margin: 0;
}

/* Responsive dashboard */
@media (max-width: 768px) {
  .dashboard-sidebar {
    width: 64px;
  }
  .dashboard-sidebar__brand-text,
  .dashboard-sidebar__group-label,
  .dashboard-sidebar__link span:not(.material-symbols-outlined),
  .dashboard-sidebar__footer-email {
    display: none;
  }
  .dashboard-content {
    margin-left: 64px;
  }
  .dashboard-content__body {
    padding: 16px;
  }
}

/* --- Notifications --- */
.dashboard-sidebar__bell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 8px 0;
}
.dashboard-sidebar__bell .material-symbols-outlined { font-size: 1.1rem; }
.dashboard-sidebar__bell-count {
  background: var(--mis-clay);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 1px 7px;
  font-weight: 700;
}

.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 8px;
  background: var(--mis-surface);
}
.notif-item--unread { border-left: 3px solid var(--mis-accent); background: var(--mis-wash); }
.notif-item__body p { margin: 4px 0 0; color: var(--mis-ink-muted); font-size: 0.85rem; }
.notif-item__meta { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--mis-ink-muted); }
.notif-item__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Company Hub --- */
.announcement-card {
  border: 1px solid var(--mis-rule-soft);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--mis-surface);
}
.announcement-card--pinned { border-left: 4px solid var(--mis-gold); }
.announcement-card h3 { margin: 0 0 4px; color: var(--mis-navy); }
.announcement-card__meta { font-size: 0.78rem; color: var(--mis-ink-muted); margin: 4px 0 12px; }
.comment-list {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--mis-rule-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-item { font-size: 0.85rem; }
.comment-item strong { color: var(--mis-navy); }

/* --- Simple CSS bar charts (no charting library) --- */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 32px; align-items: center; gap: 10px; font-size: 0.85rem; }
.bar-row__label { color: var(--mis-ink-muted); }
.bar-row__track { background: var(--mis-rule-soft); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-row__fill { display: block; height: 100%; background: var(--mis-accent); border-radius: 999px; }
.bar-row__value { text-align: right; font-weight: 600; color: var(--mis-navy); }

/* --- Guru-admin portal home --- */
.portal-greeting { margin-bottom: 24px; }
.portal-greeting h1 { margin: 0 0 4px; font-size: 1.6rem; color: var(--mis-navy); }
.portal-greeting p { margin: 0; color: var(--mis-ink-muted); font-size: 0.9rem; }

/* --- Welcome card (universal dashboard landing page) --- */
.welcome-card {
  background: var(--mis-surface);
  border: 1px solid var(--mis-rule-soft);
  border-top: 3px solid var(--mis-gold);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--mis-shadow-soft);
}
.welcome-card__header h1 { margin: 0 0 4px; font-size: 1.6rem; color: var(--mis-navy); }
.welcome-card__header p { margin: 0; color: var(--mis-ink-muted); font-size: 0.9rem; }

.welcome-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--mis-rule-soft);
}

.welcome-card__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.welcome-card__panel-header h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--mis-navy);
}
.welcome-card__panel-header h3 .material-symbols-outlined { color: var(--mis-accent); font-size: 1.2rem; }
.welcome-card__panel-header a { font-size: 0.8rem; color: var(--mis-accent-ink); text-decoration: none; font-weight: 600; }
.welcome-card__panel-header a:hover { text-decoration: underline; }

.welcome-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.welcome-list__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 8px;
  background: var(--mis-wash);
}
.welcome-list__item--task { align-items: center; }
.welcome-list__icon { color: var(--mis-accent); font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.welcome-list__item--task .welcome-list__icon { color: var(--mis-ink-muted); }
.welcome-list__body { flex: 1; min-width: 0; }
.welcome-list__title { display: block; font-size: 0.88rem; font-weight: 600; color: var(--mis-ink); text-decoration: none; }
a.welcome-list__title:hover { color: var(--mis-accent-ink); text-decoration: underline; }
.welcome-list__title--done { text-decoration: line-through; color: var(--mis-ink-muted); font-weight: 500; }
.welcome-list__meta { margin: 3px 0 0; font-size: 0.8rem; color: var(--mis-ink-muted); }

.welcome-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: var(--mis-wash);
  color: var(--mis-ink-muted);
  font-size: 0.85rem;
}
.welcome-empty .material-symbols-outlined { color: #1f7a3d; font-size: 1.1rem; }

.badge--done { background: #e3f2e6; color: #1f7a3d; }
.badge--in_progress { background: #fef3c7; color: #b45309; }
.badge--arranged { background: #ede9fe; color: #6d28d9; }
.badge--confirmed { background: #d1fae5; color: #065f46; }
.badge--cancelled { background: #fee2e2; color: #991b1b; }
.badge--on_hold { background: #fef3c7; color: #92400e; }
.badge--postponed { background: #e0e7ff; color: #3730a3; }

.action-feed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.action-feed__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 8px;
  background: var(--mis-surface);
  text-decoration: none;
  color: var(--mis-ink);
  transition: box-shadow 0.15s ease;
}
.action-feed__item:hover { box-shadow: var(--mis-shadow-soft); }
.action-feed__item .material-symbols-outlined { color: var(--mis-accent); }
.action-feed__label { flex: 1; font-size: 0.92rem; }
.action-feed__count {
  background: var(--mis-clay);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
}
.action-feed__empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-bottom: 28px;
  background: var(--mis-wash);
  border-radius: 8px;
  color: var(--mis-accent-ink);
}

.glance-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.glance-card { border: 1px solid var(--mis-rule-soft); border-radius: 10px; padding: 16px; background: var(--mis-surface); text-align: center; }

.pulse-widget { border: 1px solid var(--mis-rule-soft); border-radius: 10px; padding: 18px 20px; background: var(--mis-surface); margin-bottom: 28px; }

.module-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 28px; }
.module-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid var(--mis-rule-soft);
  border-radius: 8px;
  background: var(--mis-surface);
  text-decoration: none;
  color: var(--mis-ink);
  font-size: 0.8rem;
  text-align: center;
}
.module-tile:hover { box-shadow: var(--mis-shadow-soft); }
.module-tile .material-symbols-outlined { color: var(--mis-accent); font-size: 1.3rem; }

.module-groups { display: flex; flex-direction: column; gap: 18px; margin-bottom: 28px; }
.module-group-card {
  background: var(--mis-surface);
  border: 1px solid var(--mis-rule-soft);
  border-radius: 12px;
  padding: 20px 24px;
}
.module-group-card__title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mis-rule-soft);
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--mis-navy);
}
.module-group-card .module-tile-grid { margin-bottom: 0; }

.kb-highlight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kb-highlight-list li { display: flex; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--mis-rule-soft); border-radius: 8px; }
.kb-highlight-list a { color: var(--mis-accent-ink); text-decoration: none; font-weight: 600; }
.kb-highlight-list span { color: var(--mis-ink-muted); font-size: 0.78rem; }

.sortable-table-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-table-th:hover { color: var(--mis-accent); }
.sortable-table-arrow { font-size: 0.75em; opacity: 0.4; margin-left: 4px; }
.sortable-table-arrow.active { opacity: 1; }

/* --- AQI alert banner — full-width, fixed at viewport top, above sidebar --- */
.aqi-alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  border-bottom: 3px solid;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.aqi-alert-banner--warning {
  background: #fff3e0;
  border-color: #ff9933;
  color: #7c4700;
}
.aqi-alert-banner--critical {
  background: #fce4ec;
  border-color: #7e0023;
  color: #7e0023;
}
.aqi-alert-banner__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
}
.aqi-alert-banner__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
}
.aqi-alert-banner__content {
  flex: 1;
  min-width: 0;
}
.aqi-alert-banner__content strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}
.aqi-alert-banner__content p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.4;
}
.aqi-alert-banner__aqi {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
/* Push sidebar and content below the banner when present */
body:has(.aqi-alert-banner) {
  --aqi-banner-offset: var(--aqi-banner-height, 0px);
  padding-top: var(--aqi-banner-offset);
}
body:has(.aqi-alert-banner) .dashboard-sidebar {
  top: var(--aqi-banner-offset);
}
/* Impersonation banner pushes everything further down */
body:has(.impersonation-banner) {
  --impersonation-offset: var(--impersonation-banner-height, 0px);
  padding-top: calc(var(--impersonation-offset, 0px) + var(--aqi-banner-offset, 0px));
}
body:has(.impersonation-banner) .dashboard-sidebar {
  top: calc(var(--impersonation-offset, 0px) + var(--aqi-banner-offset, 0px));
}
body:has(.impersonation-banner) .aqi-alert-banner {
  top: var(--impersonation-offset, 0px);
}
/* Responsive: stack vertically on small screens */
@media (max-width: 640px) {
  .aqi-alert-banner__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px 16px;
  }
  .aqi-alert-banner__icon {
    font-size: 1.5rem;
  }
  .aqi-alert-banner__aqi {
    text-align: center;
  }
}

/* ── Impersonation exit banner ────────────────────────────────────────────── */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10002; /* above the AQI banner (10001) and sidebar */
  background: #1a2233;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.impersonation-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
}
.impersonation-banner__icon {
  font-size: 1.25rem;
  color: #fbbf24; /* amber warning color */
}
.impersonation-banner__text {
  font-size: 0.9rem;
  line-height: 1.4;
}
.impersonation-banner__text strong {
  color: #fbbf24;
}
.impersonation-banner__form {
  margin: 0;
  padding: 0;
}
.impersonation-banner__exit {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.impersonation-banner__exit:hover {
  background: #b91c1c;
}
.impersonation-banner__exit:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* Responsive: stack on small screens */
@media (max-width: 640px) {
  .impersonation-banner__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px 16px;
  }
}

/* Prominent parent-facing call-to-action banner (e.g. "Order Meals") on
   the main dashboard — reuses the hero section's navy+gold gradient
   treatment for visual consistency with the rest of the site. */
.dashboard-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  background-image:
    radial-gradient(120% 130% at 100% 0px, rgba(234, 183, 42, 0.14) 0px, rgba(234, 183, 42, 0) 45%),
    linear-gradient(162deg, #243a73, #1a2a57 50%, #111d40);
  color: #f6f7f9; border-radius: 16px; padding: 1.75rem 2rem; margin-bottom: 1.5rem;
}
.dashboard-cta__icon { font-size: 2.75rem; flex-shrink: 0; }
.dashboard-cta__text { flex: 1; min-width: 200px; }
.dashboard-cta__text h3 { margin: 0 0 0.25rem; font-size: 1.35rem; color: #fff; }
.dashboard-cta__text p { margin: 0; color: rgba(255,255,255,0.85); }
.dashboard-cta .btn--primary { background: #fff; color: var(--mis-accent); white-space: nowrap; }
.dashboard-cta .btn--primary:hover { background: rgba(255,255,255,0.9); }
