/*
 * PAOFI premium interface layer
 * Primitive -> semantic -> component tokens. This file intentionally loads
 * after the legacy stylesheet so every existing workflow receives the same
 * visual, interaction, and accessibility contract without changing its data
 * or permission behavior.
 */

:root {
  /* Primitive brand and neutral palette */
  --p-teal-950: #171a2b;
  --p-teal-900: #202844;
  --p-teal-800: #35416b;
  --p-teal-700: #4b568c;
  --p-teal-600: #616ca3;
  --p-teal-500: #7883b7;
  --p-teal-300: #b5bce0;
  --p-teal-200: #d7dbef;
  --p-teal-100: #eceef8;
  --p-teal-50: #f7f8fc;
  --p-red-700: #a90d18;
  --p-red-600: #c01520;
  --p-red-100: #fee7e8;
  --p-yellow-700: #936900;
  --p-yellow-500: #f8c000;
  --p-yellow-100: #fff3bf;
  --p-blue-700: #245aa8;
  --p-blue-100: #e8f0ff;
  --p-green-700: #31744b;
  --p-green-100: #e4f3e9;
  --p-coral-700: #b74d3c;
  --p-coral-100: #fbe9e4;
  --p-violet-700: #6850a3;
  --p-violet-100: #efeafd;
  --p-slate-950: #172525;
  --p-slate-900: #243231;
  --p-slate-800: #344442;
  --p-slate-700: #4b5b58;
  --p-slate-600: #63716e;
  --p-slate-500: #7d8986;
  --p-slate-400: #9ca6a3;
  --p-slate-300: #c3cbc8;
  --p-slate-200: #dce2df;
  --p-slate-100: #ebefed;
  --p-slate-50: #f5f7f6;
  --p-warm-50: #faf9f6;
  --p-white: #ffffff;

  /* Semantic color tokens */
  --p-bg: #f2f5f4;
  --p-bg-warm: #f8f7f3;
  --p-surface: rgba(255, 255, 255, 0.96);
  --p-surface-muted: #f5f8f6;
  --p-surface-strong: #ffffff;
  --p-text: var(--p-slate-950);
  --p-text-secondary: var(--p-slate-700);
  --p-text-tertiary: var(--p-slate-600);
  --p-border: #d7e0dc;
  --p-border-strong: #bbc9c3;
  --p-primary: var(--program-accent);
  --p-primary-hover: color-mix(in srgb, var(--program-accent) 86%, #171a2b);
  --p-primary-soft: var(--program-accent-soft);
  --p-focus: var(--program-accent);
  --p-danger: var(--p-red-600);
  --p-warning: var(--p-yellow-700);
  --p-success: #267046;
  --p-info: var(--p-blue-700);
  --program-accent: #4b568c;
  --program-accent-soft: #eceef8;
  --program-accent-rgb: 75, 86, 140;

  /* Semantic typography */
  --p-font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --p-font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --p-font-data: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --p-text-xs: 0.75rem;
  --p-text-sm: 0.8125rem;
  --p-text-base: 0.9375rem;
  --p-text-lg: 1.0625rem;
  --p-text-xl: 1.25rem;
  --p-text-2xl: clamp(1.5rem, 1.1rem + 1vw, 2rem);
  --p-text-hero: clamp(2rem, 1.3rem + 2vw, 3.35rem);

  /* Semantic spacing, shape, depth, and motion */
  --p-space-1: 0.25rem;
  --p-space-2: 0.5rem;
  --p-space-3: 0.75rem;
  --p-space-4: 1rem;
  --p-space-5: 1.25rem;
  --p-space-6: 1.5rem;
  --p-space-8: 2rem;
  --p-space-10: 2.5rem;
  --p-space-12: 3rem;
  --p-radius-sm: 0.625rem;
  --p-radius-md: 0.875rem;
  --p-radius-lg: 1.125rem;
  --p-radius-xl: 1.5rem;
  --p-radius-2xl: 2rem;
  --p-shadow-xs: 0 1px 2px rgba(20, 45, 42, 0.05);
  --p-shadow-sm: 0 6px 18px rgba(20, 45, 42, 0.065);
  --p-shadow-md: 0 14px 36px rgba(20, 45, 42, 0.085);
  --p-shadow-lg: 0 28px 72px rgba(20, 45, 42, 0.14);
  --p-ease: cubic-bezier(0.2, 0.72, 0.25, 1);
  --p-fast: 120ms;
  --p-standard: 210ms;
  --p-slow: 360ms;

  /* Compatibility aliases used throughout existing modules */
  --bg: var(--p-bg);
  --surface: var(--p-surface-strong);
  --surface-raised: var(--p-surface-strong);
  --surface-soft: var(--p-surface-muted);
  --surface-muted: #eef4f1;
  --ink: var(--p-text);
  --muted: var(--p-text-secondary);
  --subtle: var(--p-text-tertiary);
  --line: var(--p-border);
  --line-strong: var(--p-border-strong);
  --green: var(--p-primary);
  --green-dark: var(--p-primary-hover);
  --green-soft: var(--p-primary-soft);
  --blue: var(--p-blue-700);
  --blue-soft: var(--p-blue-100);
  --amber: var(--p-yellow-700);
  --amber-soft: var(--p-yellow-100);
  --red: var(--p-danger);
  --red-dark: var(--p-red-700);
  --red-soft: var(--p-red-100);
  --violet: var(--p-violet-700);
  --violet-soft: var(--p-violet-100);
  --radius-sm: var(--p-radius-sm);
  --radius: var(--p-radius-md);
  --radius-lg: var(--p-radius-lg);
  --shadow-sm: var(--p-shadow-xs);
  --shadow: var(--p-shadow-md);
  --shadow-lg: var(--p-shadow-lg);
  --ring: 0 0 0 3px rgba(9, 127, 130, 0.2);
}

body[data-program="livelihood"] {
  --program-accent: var(--p-green-700);
  --program-accent-soft: var(--p-green-100);
  --program-accent-rgb: 49, 116, 75;
}

body[data-program="nutrition"] {
  --program-accent: #9a6500;
  --program-accent-soft: var(--p-yellow-100);
  --program-accent-rgb: 154, 101, 0;
}

body[data-program="scholarship"] {
  --program-accent: var(--p-blue-700);
  --program-accent-soft: var(--p-blue-100);
  --program-accent-rgb: 36, 90, 168;
}

body[data-program="health"] {
  --program-accent: var(--p-coral-700);
  --program-accent-soft: var(--p-coral-100);
  --program-accent-rgb: 183, 77, 60;
}

body[data-program="administration"] {
  --program-accent: var(--p-violet-700);
  --program-accent-soft: var(--p-violet-100);
  --program-accent-rgb: 104, 80, 163;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #aebbb6 transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #aebbb6;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

html {
  color-scheme: light;
  background: var(--p-bg);
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 94% -10%, rgba(104, 80, 163, 0.08), transparent 28rem),
    var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-font-body);
  font-size: var(--p-text-base);
  line-height: 1.5;
  font-feature-settings: "kern" 1, "tnum" 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--p-font-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"],
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
summary,
select {
  cursor: pointer;
}

:where(
  button,
  [href],
  input,
  select,
  textarea,
  summary,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid rgba(9, 127, 130, 0.34);
  outline-offset: 2px;
}

.skip-link {
  z-index: 1000;
  border-radius: 0 0 var(--p-radius-md) 0;
  background: var(--p-teal-950);
  color: var(--p-white);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.sr-only,
.premium-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Route progress and app shell */
.route-progress {
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--p-fast) ease;
}

.route-progress span {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--p-teal-500), var(--p-yellow-500), var(--p-red-600));
  transform: translateX(-110%);
}

.route-progress.is-active {
  opacity: 1;
}

.route-progress.is-active span {
  animation: premium-route-progress 820ms var(--p-ease) infinite;
}

.route-progress[aria-hidden="true"] {
  opacity: 0;
}

@keyframes premium-route-progress {
  to { transform: translateX(420%); }
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  background: transparent;
  transition: grid-template-columns var(--p-standard) var(--p-ease);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-3);
  overflow: hidden;
  padding: 14px 12px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 45% -8%, rgba(181, 188, 224, 0.18), transparent 18rem),
    linear-gradient(180deg, #202844 0%, #171d33 58%, #111525 100%);
  box-shadow: 12px 0 38px rgba(17, 21, 37, 0.16);
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--p-space-2);
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 5px;
  border: 0;
  border-radius: var(--p-radius-lg);
  background: transparent;
  box-shadow: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.brand-mark img {
  width: 39px;
  height: 39px;
}

.brand-lockup strong {
  color: #ffffff;
  font-family: var(--p-font-display);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.035em;
}

.brand-lockup span {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--p-text-xs);
  line-height: 1.25;
}

.sidebar-collapse-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.25rem;
  transition: background var(--p-fast) ease, transform var(--p-standard) var(--p-ease);
}

.sidebar-collapse-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

body.sidebar-collapsed .sidebar-collapse-button {
  transform: rotate(180deg);
}

.sidebar-command-button,
.topbar-command-button {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-radius: 13px;
  font-size: var(--p-text-sm);
  text-align: left;
}

.sidebar-command-button {
  width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
}

.sidebar-command-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-command-button kbd,
.topbar-command-button kbd {
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-family: var(--p-font-data);
  font-size: 0.625rem;
  opacity: 0.66;
}

.sidebar-nav-label {
  padding: 3px 10px 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.625rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-nav {
  min-height: 0;
  display: grid;
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 3px 18px 0;
}

.nav-program {
  display: grid;
  gap: 3px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.nav-program[open] {
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(255, 255, 255, 0.045);
}

.nav-program summary {
  min-height: 36px;
  padding: 0 9px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.nav-program summary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
}

.nav-program .nav-item {
  width: calc(100% - 4px);
  margin-left: 4px;
}

.nav-item {
  min-height: 41px;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  padding: 0 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.69);
  font-size: var(--p-text-sm);
  font-weight: 650;
  transition:
    color var(--p-fast) ease,
    background var(--p-fast) ease,
    transform var(--p-fast) var(--p-ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(101, 207, 204, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow: inset 3px 0 0 var(--p-yellow-500), 0 8px 20px rgba(0, 0, 0, 0.1);
  color: #ffffff;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.sidebar-user {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
}

.sidebar-user-button {
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background var(--p-fast) ease, transform var(--p-fast) var(--p-ease);
}

.sidebar-user-button:hover,
.sidebar-user-button.active {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user-button:active {
  transform: scale(0.985);
}

.sidebar-user-chevron {
  color: rgba(255, 255, 255, 0.42);
  font-size: 1.25rem;
  transition: color var(--p-fast) ease, transform var(--p-fast) var(--p-ease);
}

.sidebar-user-button:hover .sidebar-user-chevron,
.sidebar-user-button.active .sidebar-user-chevron {
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  display: grid !important;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--p-teal-300), var(--p-yellow-500));
  color: var(--p-teal-950);
  font-weight: 900;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#currentUser {
  margin: 0;
  color: #ffffff;
  font-size: var(--p-text-sm);
  font-weight: 750;
}

#databaseLocation {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.66rem;
}

.sidebar-logout {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 0;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--p-text-xs);
}

.sidebar-logout:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.sidebar-collapsed .brand-lockup {
  grid-template-columns: 46px;
}

body.sidebar-collapsed .brand-lockup > div:last-child,
body.sidebar-collapsed .sidebar-command-button > span:not(.sidebar-command-icon),
body.sidebar-collapsed .sidebar-command-button kbd,
body.sidebar-collapsed .sidebar-nav-label,
body.sidebar-collapsed .nav-item > span:last-child,
body.sidebar-collapsed .nav-program summary,
body.sidebar-collapsed .sidebar-user-copy,
body.sidebar-collapsed .sidebar-user-chevron,
body.sidebar-collapsed .sidebar-logout > span:last-child {
  display: none;
}

body.sidebar-collapsed .sidebar-brand-row,
body.sidebar-collapsed .sidebar-command-button,
body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .sidebar-user {
  grid-template-columns: 1fr;
  justify-items: center;
}

body.sidebar-collapsed .nav-program {
  padding: 0;
  border: 0;
  background: transparent;
}

body.sidebar-collapsed .nav-program:not([open]) {
  display: block;
}

body.sidebar-collapsed .nav-program:not([open]) .nav-item {
  display: none;
}

body.sidebar-collapsed .nav-program .nav-item {
  width: 100%;
  margin-left: 0;
  padding: 0;
}

.sidebar-scrim {
  display: none;
}

.app-main {
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--p-space-4);
  padding: 11px clamp(16px, 2.4vw, 34px);
  border-bottom: 0;
  background: rgba(250, 251, 249, 0.92);
  box-shadow: 0 1px 0 rgba(196, 208, 203, 0.86), 0 10px 28px rgba(20, 45, 42, 0.045);
  backdrop-filter: blur(20px) saturate(145%);
}

.topbar-leading,
.topbar-title-row,
.topbar-tools {
  min-width: 0;
  display: flex;
  align-items: center;
}

.topbar-leading {
  gap: 12px;
}

.topbar-title-group {
  min-width: 0;
}

.route-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: var(--p-text-tertiary);
  font-size: 0.68rem;
  font-weight: 680;
}

.route-breadcrumbs span[aria-hidden] {
  color: var(--p-slate-400);
}

.premium-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.premium-breadcrumb-item:not(:last-child)::after {
  content: "/";
  color: var(--p-slate-400);
}

.topbar-title-row {
  gap: 10px;
}

.topbar h1 {
  max-width: min(56vw, 820px);
  overflow: hidden;
  color: var(--p-text);
  font-size: clamp(1.1rem, 0.95rem + 0.55vw, 1.55rem);
  font-weight: 820;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-context {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid rgba(var(--program-accent-rgb), 0.18);
  border-radius: 999px;
  background: var(--program-accent-soft);
  color: var(--program-accent);
  font-size: 0.65rem;
  font-weight: 780;
  white-space: nowrap;
}

.topbar-tools {
  gap: 10px;
  justify-content: flex-end;
}

.topbar-command-button {
  grid-template-columns: auto auto auto;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--p-text-secondary);
}

.topbar-command-button:hover {
  border-color: var(--p-border-strong);
  background: #ffffff;
  box-shadow: var(--p-shadow-xs);
}

.topbar-actions {
  gap: 7px;
}

.mobile-nav-toggle {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--p-border);
  border-radius: 12px;
  background: #ffffff;
}

.mobile-nav-toggle span {
  width: 17px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--p-text);
}

.page-root {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 2.35vw, 34px);
  scroll-behavior: smooth;
  view-transition-name: page-content;
  background: radial-gradient(circle at 100% 0, rgba(var(--program-accent-rgb), 0.04), transparent 30rem);
}

.page-root > * {
  width: min(100%, 1640px);
  margin-inline: auto;
}

/* Shared action and form components */
.action-button,
.icon-button,
.text-button {
  transition:
    border-color var(--p-fast) ease,
    background var(--p-fast) ease,
    color var(--p-fast) ease,
    box-shadow var(--p-fast) ease,
    transform var(--p-fast) var(--p-ease);
}

.action-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--p-border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--p-text);
  box-shadow: var(--p-shadow-xs);
  font-weight: 750;
}

.action-button:hover:not(:disabled) {
  border-color: #aabbb4;
  background: var(--p-surface-muted);
  box-shadow: var(--p-shadow-sm);
  transform: translateY(-1px);
}

.action-button:active:not(:disabled) {
  box-shadow: var(--p-shadow-xs);
  transform: translateY(0) scale(0.99);
}

.action-button.primary {
  border-color: var(--program-accent);
  background: var(--program-accent);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(var(--program-accent-rgb), 0.18);
}

.action-button.primary:not(:disabled) {
  box-shadow: 0 8px 18px rgba(var(--program-accent-rgb), 0.16);
}

.action-button.primary:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--program-accent), #000 12%);
  background: color-mix(in srgb, var(--program-accent), #000 10%);
}

.action-button.danger {
  border-color: #e8b8bc;
  background: #fff8f8;
  color: var(--p-danger);
}

.action-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.icon-button {
  min-width: 40px;
  min-height: 40px;
  border-radius: 11px;
}

.text-button {
  min-height: 36px;
  color: var(--program-accent);
  font-weight: 750;
}

.eyebrow {
  color: var(--program-accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--p-border-strong);
  border-radius: 11px;
  background: #ffffff;
  color: var(--p-text);
  box-shadow: inset 0 1px 2px rgba(20, 45, 42, 0.035);
  transition:
    border-color var(--p-fast) ease,
    box-shadow var(--p-fast) ease,
    background var(--p-fast) ease;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover:not(:disabled) {
  border-color: #aebdb7;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: var(--p-focus);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(9, 127, 130, 0.15);
}

:where(input, select, textarea):disabled {
  background: var(--p-slate-50);
  color: var(--p-text-tertiary);
}

label {
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
  font-weight: 690;
}

label > span:first-child {
  display: inline-block;
  margin-bottom: 5px;
}

::placeholder {
  color: #8d9995;
}

/* Shared surfaces, data tables, tabs, and states */
:where(
  .tool-panel,
  .finance-panel-card,
  .scholar-form-section,
  .scholar-view-section,
  .operations-dashboard,
  .scholarship-data-surface,
  .account-status-card,
  .document-panel,
  .records-panel,
  .summary-panel
) {
  border-color: var(--p-border);
  border-radius: var(--p-radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--p-shadow-xs);
}

:where(
  .finance-workspace,
  .scholarship-page,
  .operations-page,
  .organization-tree-page
) {
  min-width: 0;
}

:where(
  .finance-workspace-hero,
  .operations-overview-hero,
  .scholar-view-hero,
  .sponsor-view-hero,
  .scholarship-command-band,
  .financial-command-band
) {
  border-color: var(--p-border);
  background:
    radial-gradient(circle at 92% 8%, rgba(var(--program-accent-rgb), 0.11), transparent 22rem),
    linear-gradient(135deg, var(--program-accent-soft), rgba(255, 255, 255, 0.94) 58%, #f6faf8);
}

:where(.finance-section-tabs, .operations-tabs, .scholarship-segmented) {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--p-border);
  border-radius: 14px;
  background: var(--p-surface-muted);
}

:where(.finance-section-tabs, .operations-tabs, .scholarship-segmented) button {
  min-height: 38px;
  border-radius: 10px;
  font-weight: 730;
}

:where(.finance-section-tabs, .operations-tabs, .scholarship-segmented) button.is-active,
:where(.finance-section-tabs, .operations-tabs, .scholarship-segmented) button.active,
:where(.finance-section-tabs, .operations-tabs, .scholarship-segmented) button[aria-selected="true"] {
  background: #ffffff;
  color: var(--program-accent);
  box-shadow: var(--p-shadow-xs);
}

:where(
  .data-table-scroll,
  .operations-table-scroll,
  .finance-table-scroll,
  .table-scroll,
  .records-table-scroll
) {
  position: relative;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg);
  background: #ffffff;
  box-shadow: var(--p-shadow-xs);
  scrollbar-gutter: stable;
}

:where(.data-table, .records-table, .finance-table, .operations-table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

:where(.data-table, .records-table, .finance-table, .operations-table) th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--p-border-strong);
  background: #f1f6f3;
  color: var(--p-text-secondary);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

:where(.data-table, .records-table, .finance-table, .operations-table) td {
  border-bottom-color: var(--p-border);
  color: var(--p-text);
  font-size: var(--p-text-sm);
}

:where(.data-table, .records-table, .finance-table, .operations-table) tbody tr {
  transition: background var(--p-fast) ease;
}

:where(.data-table, .records-table, .finance-table, .operations-table) tbody tr:hover {
  background: rgba(var(--program-accent-rgb), 0.045);
}

.number-cell,
.money,
.finance-metric strong,
.dashboard-metric strong,
.operations-count,
.scholarship-metric-strip strong {
  font-family: var(--p-font-data);
  font-variant-numeric: tabular-nums;
}

:where(.status-pill, .finance-status, .route-context, .scholarship-readiness-badges span) {
  border-radius: 999px;
  font-weight: 780;
}

.empty-state,
.scholarship-empty,
.finance-empty-compact,
.operations-empty {
  min-height: 150px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed var(--p-border-strong);
  border-radius: var(--p-radius-lg);
  background: var(--p-surface-muted);
  color: var(--p-text-secondary);
  text-align: center;
}

.modal-backdrop {
  background: rgba(23, 26, 43, 0.54);
  backdrop-filter: blur(8px);
}

.modal-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--p-radius-xl);
  background: #ffffff;
  box-shadow: var(--p-shadow-lg);
}

.account-rejection-dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--p-surface-strong);
  color: var(--p-text);
  box-shadow: var(--p-shadow-lg);
}

.account-rejection-dialog[open] {
  animation: account-rejection-dialog-in var(--p-standard) var(--p-ease) both;
}

.account-rejection-dialog::backdrop {
  background: rgba(23, 26, 43, 0.62);
  backdrop-filter: blur(8px);
}

.account-rejection-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.account-rejection-dialog-header {
  padding: 26px 26px 20px;
  border-bottom: 1px solid var(--p-border);
}

.account-rejection-dialog-header h2,
.account-rejection-dialog-header p,
.account-rejection-dialog-reason p,
.account-rejection-dialog-consequence {
  margin: 0;
}

.account-rejection-dialog-header h2 {
  max-width: 22ch;
  color: var(--p-text);
  font-family: var(--p-font-display);
  font-size: var(--p-text-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.account-rejection-dialog-header p {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--p-text-secondary);
  font-size: var(--p-text-base);
  line-height: 1.5;
}

.account-rejection-dialog-body {
  display: grid;
  gap: var(--p-space-4);
  min-height: 0;
  padding: 22px 26px 24px;
  overflow-y: auto;
}

.account-rejection-dialog-details {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--p-surface-muted);
}

.account-rejection-dialog-details > div {
  display: grid;
  grid-template-columns: minmax(108px, 0.55fr) minmax(0, 1.45fr);
  gap: var(--p-space-4);
  align-items: baseline;
  padding: 12px 14px;
}

.account-rejection-dialog-details > div + div {
  border-top: 1px solid var(--p-border);
}

.account-rejection-dialog-details dt {
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-rejection-dialog-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--p-text);
  font-size: var(--p-text-base);
  font-weight: 750;
}

.account-rejection-dialog-reason {
  display: grid;
  gap: 6px;
}

.account-rejection-dialog-reason span {
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-rejection-dialog-reason p {
  max-height: 9rem;
  padding: 13px 14px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--p-warm-50);
  color: var(--p-text);
  font-size: var(--p-text-base);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.account-rejection-dialog-consequence {
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--p-red-100);
  color: var(--p-red-700);
  font-size: var(--p-text-sm);
  line-height: 1.5;
}

.account-rejection-dialog-consequence strong {
  color: inherit;
}

.account-rejection-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--p-space-3);
  padding: 16px 26px 20px;
  border-top: 1px solid var(--p-border);
  background: var(--p-slate-50);
}

.account-rejection-dialog-actions .action-button.danger {
  border-color: var(--p-danger);
  background: var(--p-danger);
  color: var(--p-white);
}

.account-rejection-dialog-actions .action-button.danger:hover:not(:disabled) {
  border-color: var(--p-red-700);
  background: var(--p-red-700);
}

@keyframes account-rejection-dialog-in {
  from {
    opacity: 0.82;
    filter: blur(2px);
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    filter: none;
    transform: translateY(0) scale(1);
  }
}

.toast {
  z-index: 300;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #202844;
  color: #ffffff;
  box-shadow: var(--p-shadow-lg);
}

/* Sign-in experience: privacy-safe branded art only */
.login-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(18px, 3vw, 44px);
  background:
    radial-gradient(circle at 10% 12%, rgba(36, 90, 168, 0.14), transparent 25rem),
    radial-gradient(circle at 92% 84%, rgba(248, 192, 0, 0.16), transparent 24rem),
    #edf4f1;
}

.login-experience {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100dvh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 32px;
  background: #ffffff;
  box-shadow: 0 38px 110px rgba(23, 26, 43, 0.2);
}

.login-story {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 66px);
  background:
    radial-gradient(circle at 14% 76%, rgba(248, 192, 0, 0.22), transparent 17rem),
    radial-gradient(circle at 88% 16%, rgba(181, 188, 224, 0.2), transparent 18rem),
    linear-gradient(145deg, #29345a, #171d33 70%);
  color: #ffffff;
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.login-story::before {
  width: 360px;
  height: 360px;
  right: -160px;
  top: 19%;
  border-radius: 42% 58% 63% 37% / 40% 42% 58% 60%;
  transform: rotate(18deg);
}

.login-story::after {
  width: 210px;
  height: 210px;
  left: -110px;
  bottom: 10%;
  border-radius: 50%;
}

.login-story-brand {
  display: flex;
  gap: 13px;
  align-items: center;
}

.login-story-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.login-story-logo img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.login-story-brand strong,
.login-story-brand small {
  display: block;
}

.login-story-brand strong {
  max-width: 250px;
  font-family: var(--p-font-display);
  font-size: 0.96rem;
  line-height: 1.25;
}

.login-story-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
}

.login-story-copy {
  margin-block: auto;
}

.login-story-copy .eyebrow {
  color: var(--p-teal-300);
}

.login-story-copy h2 {
  max-width: 580px;
  margin: 12px 0 20px;
  color: #ffffff;
  font-size: var(--p-text-hero);
  font-weight: 850;
  line-height: 0.98;
}

.login-story-copy > p:last-child {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--p-text-lg);
  line-height: 1.6;
}

.login-story-programs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-story-programs span {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--p-text-xs);
  font-weight: 700;
}

.login-story-programs [data-program-chip="livelihood"] { border-left: 3px solid #8dd0a3; }
.login-story-programs [data-program-chip="nutrition"] { border-left: 3px solid #ffd65c; }
.login-story-programs [data-program-chip="scholarship"] { border-left: 3px solid #8db7ff; }
.login-story-programs [data-program-chip="health"] { border-left: 3px solid #f29283; }

.login-story-trust {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-story-trust > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(101, 207, 204, 0.14);
  color: var(--p-teal-300);
}

.login-story-trust p,
.login-story-trust strong,
.login-story-trust small {
  display: block;
  margin: 0;
}

.login-story-trust strong {
  color: #ffffff;
  font-size: var(--p-text-sm);
}

.login-story-trust small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.56);
}

.login-auth {
  display: grid;
  align-items: center;
  padding: clamp(30px, 5vw, 70px);
  background:
    radial-gradient(circle at 96% 2%, rgba(104, 80, 163, 0.06), transparent 15rem),
    #ffffff;
}

.login-panel {
  width: min(410px, 100%);
  max-width: none;
  display: grid;
  gap: 17px;
  margin-inline: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-panel > img {
  display: none;
}

.login-mobile-brand {
  display: none;
}

.login-panel h1 {
  margin: -4px 0 -5px;
  color: var(--p-text);
  font-size: clamp(1.85rem, 1.5rem + 0.8vw, 2.35rem);
  font-weight: 840;
  line-height: 1.05;
}

.login-subtitle {
  margin: 0 0 5px;
  color: var(--p-text-secondary);
  line-height: 1.55;
}

.login-panel label {
  display: grid;
  gap: 5px;
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
  font-weight: 720;
}

.login-panel input,
.login-panel select {
  min-height: 48px;
  padding-inline: 13px;
  border-radius: 12px;
}

.login-primary {
  min-height: 49px;
  margin-top: 3px;
  border-color: var(--p-teal-800) !important;
  background: var(--p-teal-800) !important;
  font-size: 0.95rem;
}

.login-primary:hover:not(:disabled) {
  background: var(--p-teal-900) !important;
}

.login-secondary {
  justify-self: center;
}

.login-support-note {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--p-border);
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  text-align: center;
}

.signup-panel {
  width: min(720px, 100%);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 2px 10px 2px 2px;
  scrollbar-gutter: stable;
}

.signup-limited-note {
  border: 1px solid #ead99b;
  border-radius: 11px;
  background: #fff9df;
  color: #705817;
}

.login-screen.signup-active .login-experience {
  width: min(1320px, 100%);
  grid-template-columns: minmax(330px, 0.72fr) minmax(620px, 1.28fr);
}

.login-screen.signup-active .login-auth {
  padding: clamp(28px, 3.5vw, 52px);
}

.signup-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
}

.signup-progress::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 11%;
  left: 11%;
  height: 1px;
  background: var(--p-border-strong);
}

.signup-progress li {
  position: relative;
  z-index: 1;
}

.signup-progress button {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--p-text-tertiary);
  font: inherit;
  font-size: var(--p-text-xs);
  font-weight: 720;
  cursor: default;
}

.signup-progress button span {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid var(--p-border-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--p-text-secondary);
  font-size: 0.75rem;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.signup-progress button.is-active,
.signup-progress button.is-complete {
  color: var(--p-text);
}

.signup-progress button.is-active span {
  border-color: var(--p-blue-700);
  background: var(--p-blue-700);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(36, 90, 168, 0.2);
}

.signup-progress button.is-complete {
  cursor: pointer;
}

.signup-progress button.is-complete span {
  border-color: #8bb2ea;
  background: #e8f0ff;
  color: #1e4f94;
}

.signup-step-stack {
  min-height: 390px;
}

.signup-step {
  display: grid;
  gap: 18px;
}

.signup-panel [hidden] {
  display: none !important;
}

.signup-step-heading {
  display: grid;
  gap: 5px;
}

.signup-step-heading h2 {
  margin: 0;
  color: var(--p-text);
  font-family: var(--p-font-display);
  font-size: clamp(1.25rem, 1.08rem + 0.45vw, 1.55rem);
  font-weight: 820;
  letter-spacing: -0.025em;
}

.signup-step-heading h2:focus {
  border-radius: 6px;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(9, 127, 130, 0.15);
}

.signup-step-heading p,
.signup-conditional h3,
.signup-photo-copy p,
.signup-photo-status {
  margin: 0;
  color: var(--p-text-secondary);
  line-height: 1.5;
}

.signup-conditional {
  display: grid;
  gap: 13px;
  padding: 16px;
  border-radius: 14px;
  background: var(--p-surface-muted);
}

.signup-conditional h3 {
  color: var(--p-text);
  font-size: 0.94rem;
}

.signup-choice-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.signup-choice-grid.compact {
  gap: 8px;
}

.signup-choice {
  min-width: 0;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px !important;
  align-items: start;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--p-border-strong);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.signup-choice:hover {
  border-color: #8aa6d0;
  transform: translateY(-1px);
}

.signup-choice:has(input:checked) {
  border-color: var(--p-blue-700);
  background: #f2f6ff;
  box-shadow: 0 8px 20px rgba(36, 90, 168, 0.09);
}

.signup-choice input {
  width: 18px !important;
  min-height: 18px !important;
  margin-top: 2px;
  accent-color: var(--p-blue-700);
}

.signup-choice strong,
.signup-choice small {
  display: block;
}

.signup-choice strong {
  color: var(--p-text);
  font-size: 0.9rem;
}

.signup-choice small {
  margin-top: 5px;
  color: var(--p-text-secondary);
  font-size: var(--p-text-xs);
  font-weight: 520;
  line-height: 1.42;
}

.signup-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.signup-field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 13px;
}

.signup-field-grid .wide {
  grid-column: 1 / -1;
}

.signup-panel label > span small {
  margin-left: 4px;
  color: var(--p-text-tertiary);
  font-weight: 520;
}

.signup-panel textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--p-border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--p-text);
  font: inherit;
}

.signup-panel textarea:focus {
  outline: 3px solid rgba(36, 90, 168, 0.2);
  outline-offset: 1px;
  border-color: var(--p-blue-700);
}

.signup-photo-editor {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 20px;
  border-radius: 16px;
  background: var(--p-surface-muted);
}

.signup-photo-preview {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: #d7dbef;
  color: #35416b;
  font-size: 0.78rem;
  font-weight: 800;
}

.signup-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signup-photo-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.signup-photo-copy strong {
  color: var(--p-text);
  font-size: 1rem;
}

.signup-photo-actions,
.signup-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.signup-step-actions {
  justify-content: flex-end;
  padding-top: 3px;
}

.signup-step-actions [data-signup-back] {
  margin-right: auto;
}

.signup-photo-status {
  min-height: 22px;
  font-size: var(--p-text-xs);
}

.signup-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: #e8f0ff;
  color: #1e4f94;
}

.signup-review strong,
.signup-review span,
.signup-review small {
  min-width: 0;
}

.signup-review strong {
  overflow-wrap: anywhere;
  color: #173c70;
}

.signup-review span {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: var(--p-text-sm);
  font-weight: 760;
}

.signup-review small {
  color: #476c9e;
}

.signup-confirmation {
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start;
}

.signup-confirmation input {
  width: 18px !important;
  min-height: 18px !important;
  margin-top: 2px;
  accent-color: var(--p-blue-700);
}

.signup-confirmation span {
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
  font-weight: 560;
  line-height: 1.45;
}

.scholar-request-profile {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-top: 13px;
  padding: 13px;
  border-radius: 14px;
  background: #f2f6ff;
}

.scholar-request-profile > img,
.scholar-request-photo-fallback {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
}

.scholar-request-photo-fallback {
  display: grid;
  place-items: center;
  background: #d7dbef;
  color: #35416b;
  font-weight: 820;
}

.scholar-request-profile dl {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 13px;
  margin: 0;
}

.scholar-request-profile dl div,
.scholar-request-profile dt,
.scholar-request-profile dd {
  min-width: 0;
  margin: 0;
}

.scholar-request-profile dt {
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  font-weight: 700;
}

.scholar-request-profile dd {
  overflow-wrap: anywhere;
  color: var(--p-text);
  font-size: var(--p-text-sm);
  font-weight: 720;
}

.login-loader {
  color: var(--p-text-secondary);
}

.login-loader span {
  background: var(--p-teal-700);
}

.login-message:not(:empty) {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid #efc0c3;
  border-radius: 10px;
  background: #fff5f5;
  color: var(--p-red-700);
  font-size: var(--p-text-sm);
}

/* Premium dashboard and official media */
.dashboard-page {
  gap: 26px;
  min-height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-intro {
  position: relative;
  isolation: isolate;
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 34px;
  align-items: end;
  overflow: hidden;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--p-radius-2xl);
  background:
    linear-gradient(90deg, rgba(23, 29, 51, 0.98) 0%, rgba(32, 40, 68, 0.93) 43%, rgba(32, 40, 68, 0.4) 72%, rgba(32, 40, 68, 0.22) 100%),
    var(--dashboard-hero-image-large, var(--dashboard-hero-image, linear-gradient(135deg, #29345a, #171d33)));
  background-position: center;
  background-size: cover;
  box-shadow: var(--p-shadow-lg);
  color: #ffffff;
}

.dashboard-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -80px -170px auto;
  width: 410px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
}

.dashboard-intro-copy {
  align-self: center;
}

.dashboard-intro-copy .eyebrow {
  color: var(--p-teal-300);
}

.dashboard-intro-copy h2 {
  max-width: 660px;
  margin: 10px 0 15px;
  color: #ffffff;
  font-size: var(--p-text-hero);
  font-weight: 860;
  line-height: 0.98;
}

.dashboard-intro-copy span {
  max-width: 590px;
  color: rgba(255, 255, 255, 0.74);
  font-size: var(--p-text-lg);
}

.dashboard-media-caption {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 18px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 39, 41, 0.38);
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.66rem;
  font-weight: 680;
}

.dashboard-metrics-strip {
  align-self: end;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-metric {
  min-height: 104px;
  gap: 6px;
  margin: 4px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(12px);
}

.dashboard-metric:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.dashboard-metric:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.dashboard-metric strong {
  color: #ffffff;
  font-size: clamp(1.4rem, 1.1rem + 0.8vw, 2rem);
}

.dashboard-metric span {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-metric em {
  color: rgba(255, 255, 255, 0.52);
}

.dashboard-workspace {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
}

.dashboard-actions-panel,
.dashboard-activity-panel {
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xl);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--p-shadow-xs);
}

.dashboard-section-heading h3 {
  color: var(--p-text);
  font-size: var(--p-text-xl);
}

.dashboard-command-list,
.recent-update-list {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-command,
.recent-update-row {
  margin-top: 7px;
  border: 1px solid var(--p-border);
  border-radius: 14px !important;
  background: var(--p-surface-muted);
}

.dashboard-command:last-child,
.recent-update-row:last-child {
  border-bottom: 1px solid var(--p-border);
}

.dashboard-command:hover,
.recent-update-row:hover {
  border-color: rgba(var(--program-accent-rgb), 0.28);
  background: var(--program-accent-soft);
  transform: translateX(2px);
}

.dashboard-command-icon {
  border-radius: 11px;
  background: var(--p-primary-soft);
  color: var(--p-primary);
}

.dashboard-authority-row {
  padding: 14px 0;
}

.dashboard-analytics-section {
  padding-top: 4px;
}

.dashboard-analytics-loading,
.dashboard-analytics-content,
.dashboard-analytics-error {
  border-radius: var(--p-radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--p-shadow-sm);
}

.dashboard-analytics-landscape {
  min-height: 0;
  grid-template-columns: minmax(210px, 0.55fr) minmax(360px, 1.15fr) minmax(310px, 0.95fr);
  grid-template-rows: minmax(300px, auto) minmax(250px, auto);
  grid-template-areas:
    "stats reach coverage"
    "stats controls controls";
  padding: 20px;
  background:
    radial-gradient(circle at 9% 7%, rgba(104, 80, 163, 0.08), transparent 21rem),
    linear-gradient(145deg, #f8fbfa, #ffffff);
}

.dashboard-analytics-landscape.without-administration {
  grid-template-rows: minmax(300px, auto);
  grid-template-areas: "stats reach coverage";
}

.analytics-ribbon {
  grid-area: stats;
  border-radius: var(--p-radius-xl);
  background:
    radial-gradient(circle at 12% 8%, rgba(101, 207, 204, 0.2), transparent 14rem),
    linear-gradient(180deg, var(--p-teal-900), var(--p-teal-950));
}

.analytics-shape {
  border-radius: var(--p-radius-xl) !important;
  background: #ffffff !important;
  box-shadow: var(--p-shadow-xs);
}

.analytics-shape.growth-pulse { grid-area: reach; }
.analytics-shape.month-flow { grid-area: coverage; }
.analytics-shape.group-current { grid-area: controls; }
.analytics-shape.status-stream { grid-area: controls; }

.dashboard-insight {
  position: relative;
  min-width: 0;
}

.dashboard-insight-reach { grid-area: reach; }
.dashboard-insight-matrix { grid-area: coverage; }
.dashboard-insight-controls { grid-area: controls; }

.dashboard-insight-copy {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
}

.dashboard-insight .chart-copy-button {
  background: rgba(255, 255, 255, 0.9);
}

.dashboard-insight .paofi-insight-heading {
  display: grid;
}

.dashboard-insight .paofi-insight-meta {
  width: 100%;
}

.dashboard-insight .paofi-insight-meta dd {
  max-width: none;
  text-align: left;
}

.dashboard-analytics-stat strong {
  font-family: var(--p-font-data);
}

.analytics-shape-heading {
  border-bottom-color: var(--p-border);
}

.analytics-shape-heading strong {
  color: var(--p-primary);
}

.vega-chart {
  min-width: 0;
}

.dashboard-copyright {
  color: var(--p-text-tertiary);
}

/* Reusable insight figure */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.insight-figure {
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xl);
  background: #ffffff;
  box-shadow: var(--p-shadow-xs);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

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

.insight-figure-title {
  margin: 0;
  color: var(--p-text);
  font-size: var(--p-text-lg);
  font-weight: 600;
}

.insight-figure-takeaway {
  margin: 4px 0 0;
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
}

.insight-figure-meta {
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  font-weight: 400;
  white-space: nowrap;
}

.insight-chart-host {
  min-height: 220px;
}

.insight-data-fallback {
  border-top: 1px solid var(--p-border);
  padding-top: 10px;
}

.insight-data-fallback summary {
  color: var(--p-primary);
  font-size: var(--p-text-sm);
  font-weight: 600;
}

.insight-error {
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 20px;
  border: 1px dashed #dfb8ba;
  border-radius: var(--p-radius-lg);
  background: #fff8f8;
  color: var(--p-red-700);
}

.paofi-insight {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  gap: 13px;
  margin: 0;
  padding: clamp(17px, 2vw, 24px);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xl);
  background: #ffffff;
  box-shadow: var(--p-shadow-xs);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

.paofi-insight-heading {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-right: 40px;
}

.paofi-insight-heading h3 {
  margin: 0;
  color: var(--p-text);
  font-size: var(--p-text-lg);
  font-weight: 600;
}

.paofi-insight-takeaway {
  max-width: 700px;
  margin: 5px 0 0;
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
  line-height: 1.5;
}

.paofi-insight-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--p-text-tertiary);
  font-size: 0.66rem;
}

.paofi-insight-meta div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
}

.paofi-insight-meta dt {
  font-weight: 400;
}

.paofi-insight-meta dd {
  max-width: 230px;
  margin: 0;
  text-align: right;
}

.paofi-insight-chart {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 220px;
  display: grid;
  place-items: stretch;
  --insight-focus-x: 50%;
  --insight-focus-y: 50%;
}

.paofi-insight-chart.has-liquid-focus-support::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    circle 132px at var(--insight-focus-x) var(--insight-focus-y),
    rgba(var(--program-accent-rgb, 36, 90, 168), 0.13),
    rgba(var(--program-accent-rgb, 36, 90, 168), 0.035) 46%,
    transparent 72%
  );
  opacity: 0;
  transition: opacity 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.paofi-insight-chart.is-liquid-focused::before {
  opacity: 1;
}

.paofi-insight-liquid-focus {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  min-width: 112px;
  max-width: min(220px, calc(100% - 24px));
  display: grid;
  gap: 1px;
  padding: 9px 13px 10px;
  pointer-events: none;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px 24px 24px 9px;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(145deg, #202844 0%, var(--program-accent, #245aa8) 100%);
  box-shadow: 0 12px 28px rgba(24, 33, 58, 0.22);
  color: #ffffff;
  opacity: 0;
  filter: blur(5px) saturate(0.84);
  clip-path: inset(20% 28% 24% 18% round 28px);
  transform:
    translate3d(var(--insight-focus-x, 50%), var(--insight-focus-y, 50%), 0)
    translate(-50%, calc(-100% - 16px))
    scale(0.84)
    rotate(-1.5deg);
  transform-origin: 18% 100%;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 120ms cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 180ms cubic-bezier(0.2, 0.7, 0.2, 1),
    clip-path 240ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: auto;
}

.paofi-insight-liquid-focus::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: -5px;
  width: 11px;
  height: 11px;
  border-radius: 2px 7px 8px 7px;
  background: var(--program-accent, #245aa8);
  transform: rotate(32deg) scale(0.7);
  transform-origin: 50% 50%;
  opacity: 0;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 140ms ease-out;
}

.paofi-insight-liquid-focus.is-visible {
  opacity: 1;
  filter: blur(0) saturate(1);
  clip-path: inset(0 round 24px 24px 24px 9px);
  transform:
    translate3d(var(--insight-focus-x, 50%), var(--insight-focus-y, 50%), 0)
    translate(-50%, calc(-100% - 16px))
    scale(1)
    rotate(0deg);
  will-change: transform, opacity, filter, clip-path;
}

.paofi-insight-liquid-focus.is-visible::after {
  opacity: 1;
  transform: rotate(32deg) scale(1);
}

.paofi-insight-liquid-label,
.paofi-insight-liquid-value,
.paofi-insight-liquid-context {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paofi-insight-liquid-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.paofi-insight-liquid-value {
  color: #ffffff;
  font-family: var(--p-font-data);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.15;
}

.paofi-insight-liquid-context {
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
  line-height: 1.2;
}

.paofi-insight-chart .vega-embed,
.paofi-insight-chart .vega-embed > div {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.paofi-insight-chart svg,
.paofi-insight-chart canvas {
  display: block;
  max-width: 100%;
}

.paofi-insight-chart > svg.marks {
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .paofi-insight-chart.has-liquid-focus-support::before,
  .paofi-insight-liquid-focus,
  .paofi-insight-liquid-focus::after {
    transition: none;
  }

  .paofi-insight-liquid-focus,
  .paofi-insight-liquid-focus.is-visible {
    filter: none;
    clip-path: none;
    transform:
      translate3d(var(--insight-focus-x, 50%), var(--insight-focus-y, 50%), 0)
      translate(-50%, calc(-100% - 16px));
  }
}

.paofi-insight-status {
  margin: 0;
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
}

.paofi-insight-data {
  padding-top: 10px;
  border-top: 1px solid var(--p-border);
}

.paofi-insight-data summary {
  width: max-content;
  color: var(--p-primary);
  font-size: var(--p-text-sm);
  font-weight: 600;
}

.paofi-insight-table-scroll {
  max-height: 280px;
  overflow: auto;
  margin-top: 10px;
  border: 1px solid var(--p-border);
  border-radius: 11px;
}

.paofi-insight-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--p-text-xs);
}

.paofi-insight-table caption {
  padding: 8px 10px;
  color: var(--p-text-secondary);
  font-weight: 600;
  text-align: left;
}

.paofi-insight-table th,
.paofi-insight-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--p-border);
  text-align: left;
}

.paofi-insight-table th {
  background: var(--p-surface-muted);
  color: var(--p-text-secondary);
}

.paofi-insight-error,
.paofi-insight-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--p-border-strong);
  border-radius: var(--p-radius-lg);
  background: var(--p-surface-muted);
  color: var(--p-text-secondary);
  text-align: center;
}

.paofi-insight-error {
  border-color: #dfb8ba;
  background: #fff8f8;
  color: var(--p-red-700);
}

/* Official media is introduced only on authenticated program overview pages. */
.premium-program-story {
  position: relative;
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xl);
  background: #ffffff;
  box-shadow: var(--p-shadow-sm);
}

.premium-program-story-copy {
  align-self: center;
  padding: clamp(22px, 3vw, 38px);
}

.premium-program-story-copy h2 {
  margin: 7px 0 9px;
  font-size: var(--p-text-2xl);
}

.premium-program-story-copy p:last-child {
  max-width: 700px;
  margin: 0;
  color: var(--p-text-secondary);
}

.premium-program-story-media {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background: var(--program-accent-soft);
}

.premium-program-story-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ffffff 0%, transparent 32%);
  pointer-events: none;
}

.premium-program-story-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.premium-media-credit {
  position: absolute;
  z-index: 1;
  right: 10px;
  bottom: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(23, 26, 43, 0.76);
  color: #ffffff;
  font-size: 0.62rem;
}

/* Command palette */
.premium-command-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--p-shadow-lg);
}

.premium-command-dialog::backdrop {
  background: rgba(5, 35, 36, 0.52);
  backdrop-filter: blur(8px);
}

.premium-command-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.premium-command-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 20px 12px;
}

.premium-command-header p,
.premium-command-header h2 {
  margin: 0;
}

.premium-command-header h2 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.premium-command-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--p-border);
}

.premium-command-search input {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.05rem;
}

.premium-command-search input:focus {
  box-shadow: none;
}

.premium-command-search kbd {
  padding: 3px 7px;
  border: 1px solid var(--p-border);
  border-radius: 7px;
  color: var(--p-text-tertiary);
  font-family: var(--p-font-data);
  font-size: 0.65rem;
}

.premium-command-results {
  min-height: 180px;
  overflow-y: auto;
  padding: 10px;
}

.premium-command-group-label {
  padding: 8px 9px 5px;
  color: var(--p-text-tertiary);
  font-size: 0.65rem;
  font-weight: 840;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.premium-command-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--p-text);
  text-align: left;
}

.premium-command-item:hover,
.premium-command-item.is-selected {
  background: var(--p-primary-soft);
  color: var(--p-primary-hover);
}

.premium-command-item small {
  color: var(--p-text-tertiary);
}

.premium-command-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--p-text-secondary);
}

.premium-command-status {
  margin: 0;
  padding: 0 18px 13px;
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
}

.premium-command-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--p-border);
  background: var(--p-surface-muted);
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
}

/* Module-specific polish */
.finance-workspace {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.finance-workspace-hero {
  min-height: 230px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xl) var(--p-radius-xl) 0 0;
}

.finance-section {
  padding: clamp(18px, 2.5vw, 32px);
  border: 1px solid var(--p-border);
  border-top: 0;
  border-radius: 0 0 var(--p-radius-xl) var(--p-radius-xl);
  background: rgba(255, 255, 255, 0.91);
}

.finance-metric-grid,
.scholarship-metric-strip,
.operations-signal-strip {
  gap: 10px;
}

.finance-insight {
  min-width: 0;
  margin-block: 18px;
}

.finance-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 22px;
}

.finance-insight-grid .finance-insight {
  margin: 0;
}

.finance-insight .paofi-insight {
  border-radius: var(--p-radius-lg);
}

.nutrition-growth-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.nutrition-growth-insight {
  min-width: 0;
}

.nutrition-growth-insight .paofi-insight {
  border-radius: var(--p-radius-lg);
}

.finance-metric,
.finance-book-card,
.finance-quick-actions,
.finance-task-list,
.finance-reconciliation-list,
.finance-period-list {
  border-color: var(--p-border);
  border-radius: var(--p-radius-lg);
  box-shadow: var(--p-shadow-xs);
}

.finance-book-card,
.finance-quick-actions {
  transition:
    transform var(--p-fast) var(--p-ease),
    border-color var(--p-fast) ease,
    box-shadow var(--p-fast) ease;
}

.finance-book-card:hover,
.finance-quick-actions:hover {
  border-color: rgba(var(--program-accent-rgb), 0.28);
  box-shadow: var(--p-shadow-sm);
  transform: translateY(-2px);
}

.scholarship-document-grid {
  gap: 14px;
}

.scholarship-lollipops {
  display: grid;
  gap: 12px;
}

.scholarship-lollipop-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.52fr) minmax(130px, 1fr) minmax(36px, auto);
  gap: 11px;
  align-items: center;
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
}

.scholarship-lollipop-row > div {
  position: relative;
  height: 18px;
}

.scholarship-lollipop-row > div::before {
  content: "";
  position: absolute;
  inset: 8px 0 auto;
  height: 2px;
  border-radius: 999px;
  background: var(--p-slate-200);
}

.scholarship-lollipop-row i {
  position: absolute;
  top: 2px;
  left: clamp(0px, var(--lollipop-position), calc(100% - 14px));
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--program-accent);
  box-shadow: 0 0 0 1px rgba(var(--program-accent-rgb), 0.28), 0 3px 8px rgba(var(--program-accent-rgb), 0.2);
}

.scholarship-lollipop-row strong {
  color: var(--p-text);
  font-family: var(--p-font-data);
  text-align: right;
}

.scholarship-chart-data {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--p-border);
}

.scholarship-chart-data summary {
  color: var(--program-accent);
  font-size: var(--p-text-xs);
  font-weight: 750;
}

.scholarship-shared-insight {
  position: relative;
  min-width: 0;
}

.scholarship-shared-insight .paofi-insight {
  border-color: rgba(var(--program-accent-rgb), 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(var(--program-accent-rgb), 0.035), transparent 92px),
    #ffffff;
  box-shadow: 0 10px 28px rgba(32, 40, 68, 0.08);
}

.scholarship-shared-insight .paofi-insight-heading h3 {
  color: #18213a;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.scholarship-shared-insight .paofi-insight-takeaway {
  color: #55627b;
}

.scholarship-shared-insight .paofi-insight-meta {
  color: #68758d;
}

.scholarship-shared-insight .paofi-insight-chart {
  overflow: hidden;
  border-radius: 12px;
}

.scholarship-shared-insight .chart-copy-button {
  border-color: rgba(var(--program-accent-rgb), 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(32, 40, 68, 0.08);
}

.scholarship-shared-insight:focus-within .paofi-insight {
  border-color: rgba(var(--program-accent-rgb), 0.42);
  box-shadow: 0 0 0 3px rgba(var(--program-accent-rgb), 0.1), 0 12px 30px rgba(32, 40, 68, 0.1);
}

.scholarship-shared-insight.wide {
  grid-column: 1 / -1;
}

.scholarship-shared-insight-copy {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
}

.scholarship-shared-insight .paofi-insight-heading {
  padding-right: 42px;
}

.scholarship-analytics-flow .paofi-insight-data,
.math-analytics-grid .paofi-insight-data {
  margin-top: 2px;
}

.scholarship-document-card {
  border-color: var(--p-border);
  border-radius: var(--p-radius-lg);
  box-shadow: var(--p-shadow-xs);
  transition:
    transform var(--p-fast) var(--p-ease),
    border-color var(--p-fast) ease,
    box-shadow var(--p-fast) ease;
}

.scholarship-document-card:hover {
  border-color: rgba(var(--program-accent-rgb), 0.3);
  box-shadow: var(--p-shadow-md);
  transform: translateY(-3px);
}

.scholarship-document-search,
.search-band,
.operations-toolbar,
.scholarship-data-toolbar {
  border-color: var(--p-border);
  border-radius: var(--p-radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--p-shadow-xs);
}

.organization-tree-page {
  border-radius: var(--p-radius-xl);
}

.org-chart-node,
.org-chart-unit {
  border-color: var(--p-border);
  border-radius: var(--p-radius-lg);
  box-shadow: var(--p-shadow-xs);
}

.app-loading-overlay {
  background: rgba(240, 246, 243, 0.68);
  backdrop-filter: blur(10px);
}

.app-loading-panel {
  border-radius: var(--p-radius-xl);
  box-shadow: var(--p-shadow-lg);
}

/* Responsive behavior */
@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 258px minmax(0, 1fr);
  }

  .dashboard-intro {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  }

  .dashboard-analytics-landscape {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "stats"
      "reach"
      "coverage"
      "controls";
  }

  .dashboard-analytics-landscape.without-administration {
    grid-template-rows: auto;
    grid-template-areas:
      "stats"
      "reach"
      "coverage";
  }

  .analytics-ribbon {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px;
  }

  .dashboard-analytics-stat {
    min-height: 88px;
    padding: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 0;
  }

  .dashboard-analytics-stat:last-child {
    border-right: 0;
  }
}

@media (max-width: 1020px) {
  .topbar-command-button > span:nth-child(2),
  .topbar-command-button kbd {
    display: none;
  }

  .topbar-command-button {
    grid-template-columns: 1fr;
    min-width: 40px;
  }

  .dashboard-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    background:
      linear-gradient(90deg, rgba(23, 29, 51, 0.97), rgba(32, 40, 68, 0.77)),
      var(--dashboard-hero-image-small, var(--dashboard-hero-image-large, var(--dashboard-hero-image, linear-gradient(135deg, #29345a, #171d33))));
  }

  .dashboard-metrics-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .premium-program-story {
    grid-template-columns: 1fr;
  }

  .premium-program-story-media {
    min-height: 260px;
    order: -1;
  }

  .premium-program-story-media::after {
    background: linear-gradient(0deg, #ffffff 0%, transparent 32%);
  }

  .finance-insight-grid {
    grid-template-columns: 1fr;
  }

  .nutrition-growth-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  body.sidebar-collapsed .app-shell,
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, calc(100vw - 44px));
    max-height: 100dvh;
    transform: translateX(-102%);
    transition: transform var(--p-standard) var(--p-ease);
  }

  body.mobile-nav-open,
  body.premium-drawer-open {
    overflow: hidden;
  }

  body.mobile-nav-open .app-sidebar,
  body.premium-drawer-open .app-sidebar,
  .app-sidebar.is-open {
    transform: translateX(0);
  }

  body.mobile-nav-open .sidebar-scrim,
  body.premium-drawer-open .sidebar-scrim,
  .premium-nav-scrim:not([hidden]) {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(5, 35, 36, 0.48);
    backdrop-filter: blur(4px);
  }

  .sidebar-collapse-button {
    display: none;
  }

  .mobile-nav-toggle {
    display: grid;
  }

  .topbar {
    min-height: 72px;
    padding-inline: 13px;
  }

  .route-breadcrumbs {
    display: none;
  }

  .route-context {
    display: none;
  }

  .topbar h1 {
    max-width: 47vw;
  }

  .page-root {
    padding: 15px;
  }

  .login-screen {
    padding: 0;
    background: #ffffff;
  }

  .login-experience {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-story {
    display: none;
  }

  .login-auth {
    padding: 28px 22px;
  }

  .login-mobile-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    color: var(--p-teal-900);
    font-weight: 820;
  }

  .login-mobile-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .signup-panel {
    max-height: none;
    width: min(720px, 100%);
    padding-right: 2px;
  }

  .login-screen.signup-active .login-experience {
    grid-template-columns: 1fr;
  }

  .dashboard-analytics-landscape {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stats"
      "reach"
      "coverage"
      "controls";
  }

  .dashboard-analytics-landscape.without-administration {
    grid-template-areas:
      "stats"
      "reach"
      "coverage";
  }

  .analytics-ribbon {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .dashboard-analytics-stat {
    min-height: 84px;
    padding: 12px;
    border: 0;
    border-radius: 13px;
  }

  .dashboard-analytics-stat:nth-child(even) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-leading {
    width: calc(100% - 48px);
  }

  .topbar-tools {
    margin-left: auto;
  }

  .topbar-actions:not(:empty) {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 3;
  }

  .topbar-actions .action-button {
    min-width: 0;
    padding-inline: 10px;
  }

  .topbar-command-button {
    display: none;
  }

  .topbar h1 {
    max-width: 68vw;
  }

  .dashboard-intro {
    padding: 24px 18px;
    border-radius: var(--p-radius-xl);
  }

  .dashboard-intro-copy h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .dashboard-intro-copy span {
    font-size: var(--p-text-base);
  }

  .dashboard-metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric {
    min-height: 96px;
    padding: 14px;
  }

  .dashboard-actions-panel,
  .dashboard-activity-panel {
    padding: 16px;
    border-radius: var(--p-radius-lg);
  }

  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .dashboard-command {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .dashboard-command i {
    display: none;
  }

  .analytics-shape {
    padding: 16px;
  }

  .analytics-shape-heading {
    gap: 8px;
  }

  .analytics-shape-insight {
    max-width: 54%;
  }

  .scholarship-lollipop-row {
    grid-template-columns: minmax(88px, 0.7fr) minmax(90px, 1fr) 34px;
    gap: 8px;
  }

  .paofi-insight-heading {
    display: grid;
  }

  .paofi-insight-meta {
    grid-template-columns: 1fr;
  }

  .paofi-insight-meta dd {
    max-width: none;
    text-align: left;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .premium-program-story {
    border-radius: var(--p-radius-lg);
  }

  .premium-program-story-media {
    min-height: 200px;
  }

  :where(
    .data-table-scroll,
    .operations-table-scroll,
    .finance-table-scroll,
    .table-scroll,
    .records-table-scroll
  ) {
    border-radius: var(--p-radius-md);
  }

  .finance-section {
    padding: 14px;
  }

  .premium-command-footer {
    display: none;
  }
}

@media (max-width: 390px) {
  .dashboard-metrics-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-metric {
    min-height: 84px;
  }

  .analytics-ribbon {
    grid-template-columns: 1fr;
  }
}

/* Personal account settings */
.profile-page {
  display: grid;
  gap: clamp(18px, 2.2vw, 28px);
}

.profile-hero {
  position: relative;
  min-height: 216px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: clamp(18px, 2.4vw, 34px);
  align-items: center;
  overflow: hidden;
  padding: clamp(24px, 3.2vw, 44px);
  border-radius: var(--p-radius-xl);
  background:
    radial-gradient(circle at 88% 18%, rgba(var(--program-accent-rgb), 0.34), transparent 22rem),
    linear-gradient(132deg, #202844 0%, #171d33 66%, #111525 100%);
  box-shadow: 0 24px 56px rgba(17, 21, 37, 0.18);
  color: #ffffff;
  isolation: isolate;
}

.profile-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 330px;
  height: 330px;
  right: -116px;
  bottom: -226px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, 0.025), 0 0 0 108px rgba(255, 255, 255, 0.018);
}

.profile-hero-avatar-wrap {
  position: relative;
  width: clamp(96px, 10vw, 126px);
  height: clamp(96px, 10vw, 126px);
}

.profile-hero-avatar,
.profile-picture-image {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
}

.profile-hero-avatar {
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 34px;
  background: linear-gradient(135deg, var(--p-teal-300), var(--p-yellow-500));
  box-shadow: 0 18px 34px rgba(5, 10, 24, 0.28);
  color: var(--p-teal-950);
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 900;
}

.profile-avatar-status {
  position: absolute;
  width: 18px;
  height: 18px;
  right: -2px;
  bottom: 8px;
  border: 3px solid #202844;
  border-radius: 50%;
  background: #62c985;
}

.profile-hero-copy {
  min-width: 0;
}

.profile-hero-copy h2 {
  max-width: 18ch;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.75rem, 2vw + 1rem, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.profile-hero-copy > p {
  max-width: 58ch;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--p-text-lg);
}

.profile-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.profile-identity-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--p-text-xs);
  font-weight: 700;
}

.profile-identity-meta svg,
.profile-privacy-note svg,
.profile-setting-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-privacy-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(255, 255, 255, 0.74);
}

.profile-privacy-note > svg {
  width: 25px;
  height: 25px;
  color: #f8c000;
}

.profile-privacy-note strong,
.profile-privacy-note small {
  display: block;
}

.profile-privacy-note strong {
  margin-bottom: 3px;
  color: #ffffff;
  font-size: var(--p-text-sm);
}

.profile-privacy-note small {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--p-text-xs);
  line-height: 1.45;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}

.profile-setting-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: clamp(20px, 2.4vw, 30px);
  border: 0;
  border-radius: var(--p-radius-lg);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 45, 42, 0.06), 0 16px 38px rgba(20, 45, 42, 0.075);
}

.profile-setting-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.profile-setting-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--program-accent-soft);
  color: var(--program-accent);
}

.profile-setting-icon svg {
  width: 21px;
  height: 21px;
}

.profile-setting-heading h3 {
  margin: 0;
  color: var(--p-text);
  font-size: var(--p-text-xl);
  line-height: 1.22;
}

.profile-setting-heading p {
  max-width: 60ch;
  margin: 5px 0 0;
  color: var(--p-text-secondary);
  font-size: var(--p-text-sm);
}

.profile-picture-editor {
  min-height: 152px;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: 15px;
  background: var(--p-surface-muted);
}

.profile-picture-preview {
  width: 126px;
  height: 126px;
  overflow: hidden;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--p-teal-300), var(--p-yellow-500));
  box-shadow: 0 12px 28px rgba(20, 45, 42, 0.14);
}

.profile-avatar-fallback {
  color: var(--p-teal-950);
  font-size: 2rem;
  font-weight: 900;
}

.profile-picture-copy strong,
.profile-picture-copy > span {
  display: block;
}

.profile-picture-copy strong {
  color: var(--p-text);
  font-size: var(--p-text-sm);
}

.profile-picture-copy > span {
  max-width: 38ch;
  margin-top: 4px;
  color: var(--p-text-secondary);
  font-size: var(--p-text-xs);
}

.profile-picture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.profile-picture-actions .text-button {
  min-height: 40px;
  padding-inline: 10px;
}

.profile-password-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-password-fields label:first-child {
  grid-column: 1 / -1;
}

.profile-password-fields label span {
  display: block;
  margin-bottom: 6px;
  color: var(--p-text-secondary);
  font-size: var(--p-text-xs);
  font-weight: 750;
}

.profile-password-fields input {
  width: 100%;
}

.profile-password-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-password-checks span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--p-text-tertiary);
  font-size: var(--p-text-xs);
  font-weight: 650;
}

.profile-password-checks span::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--p-slate-400);
  border-radius: 50%;
  background: transparent;
}

.profile-password-checks span.is-met {
  color: var(--p-success);
}

.profile-password-checks span.is-met::before {
  border-color: var(--p-success);
  background: var(--p-success);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.profile-form-status {
  min-height: 1.4em;
  margin: -8px 0 0;
  color: var(--p-text-secondary);
  font-size: var(--p-text-xs);
}

.profile-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 2px;
}

.profile-panel-actions .action-button {
  min-width: 138px;
}

@media (max-width: 1040px) {
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-privacy-note {
    grid-column: 1 / -1;
  }

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .account-rejection-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .account-rejection-dialog-header,
  .account-rejection-dialog-body {
    padding-inline: 20px;
  }

  .account-rejection-dialog-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .account-rejection-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-inline: 20px;
  }

  .signup-progress button {
    font-size: 0.65rem;
  }

  .signup-choice-grid,
  .signup-field-grid,
  .signup-field-grid.three,
  .signup-photo-editor {
    grid-template-columns: 1fr;
  }

  .signup-choice {
    min-height: 0;
  }

  .signup-photo-preview {
    width: 112px;
    height: 112px;
  }

  .signup-step-actions .action-button:not([data-signup-back]) {
    flex: 1;
  }

  .signup-review {
    grid-template-columns: 1fr;
  }

  .signup-review span {
    grid-row: auto;
    grid-column: auto;
  }

  .scholar-request-profile,
  .scholar-request-profile dl {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: start;
    min-height: 0;
    border-radius: var(--p-radius-lg);
  }

  .profile-hero-avatar-wrap {
    width: 92px;
    height: 92px;
  }

  .profile-identity-meta {
    margin-top: 15px;
  }

  .profile-picture-editor,
  .profile-password-fields {
    grid-template-columns: 1fr;
  }

  .profile-picture-preview {
    width: 112px;
    height: 112px;
  }

  .profile-password-fields label:first-child {
    grid-column: auto;
  }

  .profile-panel-actions .action-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .route-progress {
    display: none;
  }

  .page-root > *,
  .scroll-reveal,
  .scroll-reveal.is-visible {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}

@media print {
  .route-progress,
  .sidebar-scrim,
  .premium-command-dialog,
  .account-rejection-dialog {
    display: none !important;
  }

  body,
  .page-root {
    background: #ffffff !important;
  }
}
