/* =========================================================================
   Reusable components
   Page headings, cards, buttons, badges, chips, tabs, forms, switches,
   notices, empty and loading states, tables, modals and toasts.
   ========================================================================= */

/* Page header ------------------------------------------------------------ */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}
.page-header__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold-700);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-gold-500);
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--brand-navy-900);
}
.page-subtitle { max-width: 64ch; margin: 10px 0 0; color: var(--color-text-muted); font-size: 0.9375rem; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 44px 0 18px;
}
.section-title { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--brand-navy-900); }
.section-head p { margin: 4px 0 0; color: var(--color-text-muted); font-size: 0.9375rem; }

/* Cards ------------------------------------------------------------------ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 24px; }

.card--interactive {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card--interactive:hover { transform: translateY(-2px); border-color: #d3dbe6; box-shadow: var(--shadow-md); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
  margin-bottom: 14px;
}
.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}
.card__title .icon { color: var(--brand-blue-600); }
.card__body { padding: 0 24px 24px; }
.card__intro { margin: 8px 0 18px; color: var(--color-text-muted); font-size: 0.9375rem; }

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.card__link .icon { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.card__link:hover .icon { transform: translateX(2px); }

/* Tone helpers for icon tiles ------------------------------------------- */
.tone-blue   { background: var(--brand-blue-50); color: var(--brand-blue-600); }
.tone-gold   { background: var(--brand-gold-100); color: var(--brand-gold-700); }
.tone-green  { background: var(--green-50); color: var(--green-700); }
.tone-violet { background: var(--violet-50); color: var(--violet-700); }
.tone-rose   { background: var(--rose-50); color: var(--rose-700); }
.tone-teal   { background: var(--teal-50); color: var(--teal-700); }
.tone-navy   { background: var(--brand-navy-900); color: #fff; }
.tone-red    { background: var(--red-50); color: var(--red-700); }

.icon-tile {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
}
.icon-tile--lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-tile--lg .icon { width: 24px; height: 24px; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--color-text);
  --btn-border: var(--color-border-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--primary { --btn-bg: var(--brand-navy-900); --btn-fg: #fff; --btn-border: var(--brand-navy-900); }
.btn--primary:hover:not(:disabled) { --btn-bg: var(--brand-navy-700); --btn-border: var(--brand-navy-700); box-shadow: 0 6px 16px rgba(11, 31, 58, 0.18); }

.btn--gold { --btn-bg: var(--brand-gold-500); --btn-fg: var(--brand-navy-950); --btn-border: var(--brand-gold-500); }
.btn--gold:hover:not(:disabled) { --btn-bg: var(--brand-gold-400); --btn-border: var(--brand-gold-400); box-shadow: 0 6px 18px rgba(201, 162, 39, 0.28); }

.btn--secondary:hover:not(:disabled) { --btn-bg: var(--color-surface-muted); --btn-border: #9aa8bb; }

.btn--ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--color-text-muted); }
.btn--ghost:hover:not(:disabled) { --btn-bg: rgba(15, 27, 45, 0.05); --btn-fg: var(--color-text); }

.btn--danger { --btn-bg: var(--red-700); --btn-fg: #fff; --btn-border: var(--red-700); }
.btn--danger:hover:not(:disabled) { --btn-bg: #982a25; --btn-border: #982a25; }

.btn--danger-outline { --btn-fg: var(--red-700); --btn-border: #efb9b5; }
.btn--danger-outline:hover:not(:disabled) { --btn-bg: var(--red-50); }

.btn--on-dark { --btn-bg: rgba(255, 255, 255, 0.08); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.22); }
.btn--on-dark:hover:not(:disabled) { --btn-bg: rgba(255, 255, 255, 0.16); --btn-border: rgba(255, 255, 255, 0.36); }

.btn--sm { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 0.8125rem; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--icon { width: 42px; padding: 0; }
.btn--icon.btn--sm { width: 34px; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-link);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Badges ----------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #eef2f7;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge--blue   { background: var(--brand-blue-50); color: var(--brand-blue-600); }
.badge--gold   { background: var(--brand-gold-100); color: var(--brand-gold-700); }
.badge--green  { background: var(--green-50); color: var(--green-700); }
.badge--amber  { background: var(--amber-50); color: var(--amber-700); }
.badge--red    { background: var(--red-50); color: var(--red-700); }
.badge--violet { background: var(--violet-50); color: var(--violet-700); }
.badge--teal   { background: var(--teal-50); color: var(--teal-700); }
.badge--navy   { background: var(--brand-navy-900); color: #fff; }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Chips, tabs and toolbars ---------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--brand-navy-700); color: var(--color-text); }
.chip[aria-pressed="true"] { background: var(--brand-navy-900); border-color: var(--brand-navy-900); color: #fff; }
.chip__count { font-size: 0.75rem; opacity: 0.7; }

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e7ecf3;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tab:hover { color: var(--color-text); }
.tab[aria-pressed="true"],
.tab[aria-selected="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-xs); }

/* Underlined tabs for in-page sections (role="tablist") */
.tabs--line {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: none;
  scrollbar-width: none;
}
.tabs--line .tab {
  flex-shrink: 0;
  min-height: 46px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tabs--line .tab[aria-selected="true"] { border-bottom-color: var(--brand-gold-500); background: none; box-shadow: none; color: var(--brand-navy-900); }
.tab-panel { padding-top: 24px; }
.tab-panel:focus-visible { outline-offset: 6px; }

/* Breadcrumb ------------------------------------------------------------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.875rem; color: var(--color-text-subtle); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "/"; color: var(--color-border-strong); }
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--brand-blue-600); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: 600; }

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px dashed var(--brand-navy-700);
  border-radius: var(--radius-md);
  background: var(--brand-blue-50);
  font-size: 0.875rem;
  color: var(--brand-navy-900);
}
.admin-bar p { display: flex; align-items: center; gap: 8px; margin: 0; }
.admin-bar .icon { color: var(--brand-blue-600); }
.tab__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(15, 27, 45, 0.07);
  font-size: 0.75rem;
}

.results-summary { margin: 0 0 14px; color: var(--color-text-subtle); font-size: 0.875rem; }

/* Forms ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field__label { font-size: 0.875rem; font-weight: 600; color: var(--color-text); }
.field__label .optional { font-weight: 400; color: var(--color-text-subtle); }
.field__hint { margin: 0; font-size: 0.8125rem; color: var(--color-text-subtle); }

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--red-700);
}
.field__error::before {
  content: "!";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-700);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9375rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #8391a5; }
.input:hover, .select:hover, .textarea:hover { border-color: #a3b0c2; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-blue-500);
  box-shadow: 0 0 0 4px rgba(58, 114, 194, 0.16);
}
.input:disabled, .input[readonly] { background: var(--color-surface-muted); color: var(--color-text-muted); }
.input[readonly]:hover { border-color: var(--color-border-strong); }

.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--red-700); }
.has-error .input:focus, .has-error .select:focus, .has-error .textarea:focus { box-shadow: 0 0 0 4px rgba(179, 51, 45, 0.14); }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
}
.select--auto { width: auto; min-width: 180px; }
.textarea { min-height: 128px; line-height: 1.55; resize: vertical; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 6px; }

.input-group { position: relative; }
.input-group .input { padding-right: 48px; }
.input-group__btn {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
}
.input-group__btn:hover { background: var(--color-surface-muted); color: var(--color-text); }
.input-group__btn .icon { width: 18px; height: 18px; }

.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--color-text-subtle);
  pointer-events: none;
}
.search .input { padding-left: 42px; }

.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  cursor: pointer;
}
.check input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand-navy-900);
  cursor: pointer;
}

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.radio-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.radio-card:hover { border-color: #9aa8bb; }
.radio-card input { margin: 3px 0 0; accent-color: var(--brand-navy-900); }
.radio-card strong { display: block; font-size: 0.9375rem; }
.radio-card span span { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--color-text-subtle); }
.radio-card:has(input:checked) { border-color: var(--brand-navy-900); background: var(--brand-blue-50); box-shadow: 0 0 0 1px var(--brand-navy-900); }

.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch__track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: #c3ccd8;
  transition: background var(--dur) var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 27, 45, 0.25);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--brand-navy-900); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Notices ---------------------------------------------------------------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cfdef3;
  border-radius: var(--radius-md);
  background: var(--brand-blue-50);
  color: #1e3a66;
  font-size: 0.875rem;
  line-height: 1.5;
}
.notice > .icon { margin-top: 1px; color: var(--brand-blue-600); }
.notice p { margin: 0; }
a.notice--link { color: inherit; text-decoration: none; margin-bottom: 16px; }
a.notice--link:hover { border-color: var(--brand-blue-600); }
a.notice--link .icon { vertical-align: -2px; }
.notice--demo { border-color: #ecdca6; background: var(--brand-gold-100); color: #5e4708; }
.notice--demo > .icon { color: var(--brand-gold-700); }
.notice--warning { border-color: #f2c5c2; background: var(--red-50); color: var(--red-700); }
.notice--warning > .icon { color: var(--red-700); }

/* Date block and meta list --------------------------------------------- */
.date-block {
  flex-shrink: 0;
  width: 58px;
  padding: 8px 0 7px;
  border-radius: 12px;
  background: var(--brand-blue-50);
  color: var(--brand-navy-900);
  text-align: center;
}
.date-block__month {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-blue-600);
}
.date-block__day { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.meta > * { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.meta .icon { width: 16px; height: 16px; color: var(--color-text-subtle); }
.meta--stack { flex-direction: column; gap: 6px; }

/* Progress --------------------------------------------------------------- */
.progress { height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: #e7ecf3; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--brand-blue-600); transition: width 400ms var(--ease); }
.progress--gold .progress__bar { background: var(--brand-gold-500); }
.progress--full .progress__bar { background: var(--amber-700); }

/* Avatar ----------------------------------------------------------------- */
.avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-gold-500);
  color: var(--brand-navy-950);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar--md { width: 52px; height: 52px; font-size: 1.0625rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 2rem; font-family: var(--font-display); font-weight: 600; }
.avatar--navy { background: var(--brand-navy-900); color: #fff; }
.avatar--photo { overflow: hidden; background: var(--color-surface-muted, #e9edf3); }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Empty and loading states --------------------------------------------- */
.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  text-align: center;
}
.empty-state--compact { padding: 28px 20px; }
.empty-state__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-blue-50);
  color: var(--brand-blue-600);
}
.empty-state__icon .icon { width: 26px; height: 26px; }
.empty-state__title { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 600; }
.empty-state__text { max-width: 44ch; margin: 0 auto; color: var(--color-text-muted); font-size: 0.9375rem; }
.empty-state__action { margin-top: 18px; }

.skeleton {
  background: linear-gradient(90deg, #e7ecf3 25%, #f2f5f9 37%, #e7ecf3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--color-surface-muted); }
.table__primary { font-weight: 600; }
.table__secondary { display: block; font-size: 0.8125rem; color: var(--color-text-subtle); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 5px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); color: var(--color-text-subtle); font-size: 0.8125rem; font-weight: 600; text-align: left; }
  .table--stack .num { text-align: right; }
  .table--stack td { flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
  .table--stack td::before { margin-right: auto; }
  .table--stack .table__secondary { flex-basis: 100%; text-align: right; }
}

/* Modal (native <dialog>) ---------------------------------------------- */
.modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
.modal--sm { width: 440px; }
.modal--lg { width: 760px; }
.modal--xl { width: 1040px; }
.modal::backdrop { background: rgba(6, 20, 42, 0.55); backdrop-filter: blur(3px); animation: fade-in 180ms var(--ease); }
.modal.is-closing::backdrop { opacity: 0; transition: opacity 160ms var(--ease); }

.modal__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 220ms var(--ease);
}
.modal.is-closing .modal__panel { animation: modal-out 160ms var(--ease) forwards; }

.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal__title { margin: 6px 0 0; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.modal__close { margin: -2px -8px 0 0; }
.modal__body { padding: 16px 24px 24px; overflow-y: auto; }
.modal__text { margin: 0; color: var(--color-text-muted); }
.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

/* Toasts ----------------------------------------------------------------- */
.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  background: var(--brand-navy-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 240ms var(--ease);
}
.toast.is-leaving { animation: toast-out 200ms var(--ease) forwards; }
.toast__icon { margin-top: 1px; }
.toast--success .toast__icon { color: #7ee0b4; }
.toast--error .toast__icon { color: #ffaaa3; }
.toast--info .toast__icon { color: #9cc3f5; }
.toast__msg { flex: 1; margin: 0; font-size: 0.9375rem; line-height: 1.45; }
.toast__close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #9fb1cb;
  cursor: pointer;
}
.toast__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.toast__close .icon { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .toolbar__group { justify-content: stretch; }
  .search { max-width: none; }
  .select--auto { flex: 1; }
  .toast-region { right: 16px; bottom: 16px; }
  .modal__header { padding: 18px 18px 0; }
  .modal__body { padding: 14px 18px 20px; }
  .modal__footer { padding: 14px 18px; }
  .modal__footer .btn { flex: 1; }
}

/* Animations ------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* Links to related pages under a page title (e.g. Who we are · Vision · Leadership). */
.section-nav { margin-top: 14px; }
.section-nav .chip[aria-current="page"] { background: var(--brand-navy-900); border-color: var(--brand-navy-900); color: #fff; }
