body.u-portal-mode .u-dashboard {
  display: block;
  --u-dashboard-ink: #10243a;
  --u-dashboard-muted: #60758a;
  --u-dashboard-border: rgba(113, 132, 155, 0.18);
  --u-dashboard-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body.u-portal-mode .u-welcome {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 214, 102, 0.24), transparent 28%),
    linear-gradient(135deg, #11335d 0%, #19647e 42%, #2e8a99 100%);
  border-radius: 22px;
  padding: 22px 24px;
  color: #fff;
  box-shadow: 0 24px 48px rgba(17, 51, 93, 0.24);
  margin-bottom: 18px;
}

body.u-portal-mode .u-welcome::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

body.u-portal-mode .u-welcome__title {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

body.u-portal-mode .u-welcome__subtitle {
  margin: 8px 0 0;
  max-width: 46rem;
  opacity: 0.92;
  font-size: 0.98rem;
}

body.u-portal-mode .u-welcome__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

body.u-portal-mode .u-welcome__avatar {
  flex-shrink: 0;
  position: relative;
}

body.u-portal-mode .u-welcome__photo-upload {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

body.u-portal-mode .u-welcome__photo-upload:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.32);
}

body.u-portal-mode .u-welcome__photo {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  display: block;
}

body.u-portal-mode .u-welcome__photo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.2s ease;
}

body.u-portal-mode .u-welcome__photo-upload:hover .u-welcome__photo-placeholder {
  background: rgba(255, 255, 255, 0.2);
}

body.u-portal-mode .u-welcome__text {
  flex: 1;
  min-width: 0;
}

.u-photo-upload-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.u-photo-upload-box:hover {
  border-color: #1f7a8c;
}

.u-photo-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

body.u-portal-mode .u-insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

body.u-portal-mode .u-insight-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px 18px;
  color: #fff;
  box-shadow: var(--u-dashboard-shadow);
}

body.u-portal-mode .u-insight-card::before {
  content: "";
  position: absolute;
  inset: auto -24px -36px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

body.u-portal-mode .u-insight-card--teal {
  background: linear-gradient(135deg, #0f766e 0%, #128277 100%);
}

body.u-portal-mode .u-insight-card--amber {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

body.u-portal-mode .u-insight-card--cobalt {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

body.u-portal-mode .u-insight-eyebrow {
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.82;
}

body.u-portal-mode .u-insight-value {
  position: relative;
  z-index: 1;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 10px;
}

body.u-portal-mode .u-insight-note {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 0.85rem;
  opacity: 0.9;
}

body.u-portal-mode .u-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

body.u-portal-mode .u-metric-card {
  position: relative;
  overflow: hidden;
  display: block;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 252, 0.98) 100%);
  border: 1px solid var(--u-dashboard-border);
  border-radius: 20px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--u-dashboard-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.u-portal-mode .u-metric-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -55px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  opacity: 0.14;
}

body.u-portal-mode .u-metric-card--finance::after {
  background: #f59e0b;
}

body.u-portal-mode .u-metric-card--academics::after {
  background: #06b6d4;
}

body.u-portal-mode .u-metric-card--attendance::after {
  background: #2563eb;
}

body.u-portal-mode .u-metric-card--performance::after {
  background: #059669;
}

body.u-portal-mode .u-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  border-color: rgba(25, 100, 126, 0.28);
}

body.u-portal-mode .u-metric-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

body.u-portal-mode .u-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.14);
}

body.u-portal-mode .u-metric-icon--primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
body.u-portal-mode .u-metric-icon--warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
body.u-portal-mode .u-metric-icon--info { background: linear-gradient(135deg, #0891b2, #155e75); }
body.u-portal-mode .u-metric-icon--success { background: linear-gradient(135deg, #0f766e, #059669); }

body.u-portal-mode .u-metric-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--u-dashboard-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.u-portal-mode .u-metric-meta {
  position: relative;
  z-index: 1;
}

body.u-portal-mode .u-metric-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--u-dashboard-muted);
}

body.u-portal-mode .u-metric-value {
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 900;
  color: var(--u-dashboard-ink);
  line-height: 1;
  margin-top: 10px;
  letter-spacing: -0.04em;
}

body.u-portal-mode .u-metric-note {
  margin-top: 8px;
  color: var(--u-dashboard-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

body.u-portal-mode .u-metric-progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

body.u-portal-mode .u-metric-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e 0%, #38bdf8 100%);
}

body.u-portal-mode .u-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--u-dashboard-ink);
  margin: 14px 0 12px;
}

body.u-portal-mode .u-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

body.u-portal-mode .u-action-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 249, 252, 0.98) 100%);
  border: 1px solid var(--u-dashboard-border);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--u-dashboard-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body.u-portal-mode .u-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

body.u-portal-mode .u-action-card[aria-disabled='true'] {
  opacity: 0.65;
  cursor: not-allowed;
}

body.u-portal-mode .u-action-title {
  font-weight: 900;
  margin: 0;
  color: var(--u-dashboard-ink);
  font-size: 0.97rem;
}

body.u-portal-mode .u-action-subtitle {
  margin: 3px 0 0;
  color: var(--u-dashboard-muted);
  font-size: 0.82rem;
}

body.u-portal-mode .u-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

body.u-portal-mode .u-chart-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
}

body.u-portal-mode .u-chart-grid--secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

body.u-portal-mode .u-panel {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(246, 249, 252, 0.99) 100%);
  border: 1px solid var(--u-dashboard-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--u-dashboard-shadow);
}

body.u-portal-mode .u-panel--feature {
  padding-bottom: 12px;
}

body.u-portal-mode .u-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

body.u-portal-mode .u-panel__title {
  margin: 0;
  font-weight: 900;
  color: var(--u-dashboard-ink);
  font-size: 1rem;
}

body.u-portal-mode .u-panel__subtitle {
  color: var(--u-dashboard-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

body.u-portal-mode .u-panel-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.u-portal-mode .u-panel-kpi {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(113, 132, 155, 0.12);
}

body.u-portal-mode .u-panel-kpi__label {
  display: block;
  color: var(--u-dashboard-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

body.u-portal-mode .u-panel-kpi__value {
  display: block;
  margin-top: 7px;
  color: var(--u-dashboard-ink);
  font-size: 1.18rem;
  font-weight: 900;
}

body.u-portal-mode .u-chart {
  height: 290px;
  position: relative;
}

body.u-portal-mode .u-chart--compact {
  height: 210px;
}

body.u-portal-mode .u-chart--finance {
  height: 230px;
}

body.u-portal-mode .u-finance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

body.u-portal-mode .u-finance-chip {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.04);
}

body.u-portal-mode .u-finance-chip__label {
  display: block;
  color: var(--u-dashboard-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

body.u-portal-mode .u-finance-chip__value {
  display: block;
  margin-top: 7px;
  color: var(--u-dashboard-ink);
  font-weight: 900;
  font-size: 1rem;
}

body.u-portal-mode .u-activity {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.u-portal-mode .u-activity__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(113, 132, 155, 0.12);
}

body.u-portal-mode .u-activity__item:last-child {
  border-bottom: none;
}

body.u-portal-mode .u-activity__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  flex: 0 0 auto;
}

body.u-portal-mode .u-activity__title {
  margin: 0;
  font-weight: 900;
  color: var(--u-dashboard-ink);
  font-size: 0.9rem;
}

body.u-portal-mode .u-activity__meta {
  margin: 2px 0 0;
  color: var(--u-dashboard-muted);
  font-size: 0.8rem;
}

body.u-portal-mode .u-activity__badge {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.78rem;
  background: #e0ecff;
  color: #1d4ed8;
}

body.u-portal-mode .u-activity__badge--success {
  background: #d1fae5;
  color: #065f46;
}

body.u-portal-mode .u-activity__badge--warning {
  background: #ffedd5;
  color: #c2410c;
}

@media (max-width: 1100px) {
  body.u-portal-mode .u-insight-strip,
  body.u-portal-mode .u-chart-grid--secondary,
  body.u-portal-mode .u-finance-metrics,
  body.u-portal-mode .u-panel-kpis {
    grid-template-columns: 1fr;
  }

  body.u-portal-mode .u-chart-layout {
    grid-template-columns: 1fr;
  }

  body.u-portal-mode .u-chart-stack {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  body.u-portal-mode .u-welcome__inner {
    flex-direction: column;
    text-align: center;
  }

  body.u-portal-mode .u-welcome__photo-upload,
  body.u-portal-mode .u-welcome__photo,
  body.u-portal-mode .u-welcome__photo-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 16px;
  }

  body.u-portal-mode .u-chart-stack,
  body.u-portal-mode .u-chart-grid--secondary {
    grid-template-columns: 1fr;
  }

  body.u-portal-mode .u-panel__header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body.u-portal-mode .u-welcome {
    padding: 18px;
  }

  body.u-portal-mode .u-metric-card,
  body.u-portal-mode .u-action-card,
  body.u-portal-mode .u-panel,
  body.u-portal-mode .u-insight-card {
    border-radius: 18px;
  }
}
