/* Customer and admin portal surfaces use the same light ivory, violet and gold brand. */
#root main.portal-main {
  min-height: 62vh;
  padding: 126px 0 0 !important;
  background: var(--yu-brand-cream, #fbfaf7) !important;
  color: var(--yu-brand-copy, #4d4558) !important;
}

.portal-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 32px 22px 76px;
}

.portal-shell,
.portal-shell * { box-sizing: border-box; }

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--yu-brand-violet, #65408a);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.portal-kicker::before {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--yu-brand-gold, #d9a638);
  content: "";
}

.portal-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 25px;
}

.portal-heading h1 {
  margin: 0;
  color: var(--yu-brand-plum, #281a38);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.08;
}

.portal-subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--yu-brand-muted, #776f82);
  font-size: 15px;
  line-height: 1.65;
}

.portal-card {
  border: 1px solid var(--yu-brand-line, #e5deeb);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgb(40 26 56 / 6%);
}

.portal-login-card {
  width: min(500px, 100%);
  margin: 8px auto 0;
  padding: clamp(22px, 5vw, 38px);
}

.portal-login-card .portal-heading {
  display: block;
  margin-bottom: 24px;
}

.portal-form {
  display: grid;
  gap: 17px;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.portal-field label,
.portal-field-label {
  color: var(--yu-brand-plum, #281a38);
  font-size: 13px;
  font-weight: 700;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dcd3e5 !important;
  border-radius: 11px !important;
  padding: 11px 13px !important;
  background: #fff !important;
  color: var(--yu-brand-plum, #281a38) !important;
  font: inherit;
  font-size: 14px;
  box-shadow: 0 1px 2px rgb(40 26 56 / 4%) !important;
}

.portal-field textarea {
  min-height: 96px;
  resize: vertical;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus { border-color: var(--yu-brand-violet, #65408a) !important; }

.portal-hint {
  margin: 0;
  color: var(--yu-brand-muted, #776f82);
  font-size: 12px;
  line-height: 1.55;
}

.portal-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--yu-brand-violet-deep, #4e2f70);
  border-radius: 11px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--yu-brand-violet, #65408a), var(--yu-brand-violet-deep, #4e2f70));
  color: #fff !important;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.portal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgb(78 47 112 / 18%);
}

.portal-button:disabled { opacity: .62; cursor: wait; transform: none; }

.portal-button--quiet {
  border-color: #ded3e8;
  background: #fff;
  color: var(--yu-brand-violet-deep, #4e2f70) !important;
  box-shadow: none;
}

.portal-button--small { min-height: 34px; padding: 7px 11px; font-size: 12px; }

.portal-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 18px;
  color: var(--yu-brand-muted, #776f82);
  font-size: 13px;
}

.portal-inline-links a,
.portal-text-link {
  color: var(--yu-brand-violet-deep, #4e2f70) !important;
  font-weight: 750;
  text-underline-offset: 3px;
}

.portal-message {
  margin: 0 0 18px;
  border: 1px solid #e9dfcb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff9ec;
  color: #72521b;
  font-size: 13px;
  line-height: 1.55;
}

.portal-message--error {
  border-color: #efd1d1;
  background: #fff5f4;
  color: #842c32;
}

.portal-message--success {
  border-color: #cee6d6;
  background: #f3fbf5;
  color: #235b37;
}

.portal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 14px;
}

.portal-toolbar input[type="search"] {
  width: min(360px, 100%);
  min-height: 42px;
  border: 1px solid #dcd3e5;
  border-radius: 11px;
  padding: 9px 12px;
  background: #fff;
  color: var(--yu-brand-plum, #281a38);
  font: inherit;
}

.portal-toolbar-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.portal-stat {
  min-width: 0;
  border: 1px solid var(--yu-brand-line, #e5deeb);
  border-radius: 17px;
  padding: 18px 19px;
  background: linear-gradient(145deg, #fff, #fbf9fd);
  box-shadow: 0 6px 20px rgb(40 26 56 / 4%);
}

.portal-stat strong {
  display: block;
  color: var(--yu-brand-plum, #281a38);
  font-size: 28px;
  font-weight: 850;
  line-height: 1.1;
}

.portal-stat span {
  display: block;
  margin-top: 7px;
  color: var(--yu-brand-muted, #776f82);
  font-size: 12px;
  font-weight: 650;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--yu-brand-line, #e5deeb);
}

.portal-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 14px;
  background: transparent;
  color: var(--yu-brand-muted, #776f82);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.portal-tab[aria-selected="true"] {
  border-bottom-color: var(--yu-brand-violet, #65408a);
  color: var(--yu-brand-violet-deep, #4e2f70);
}

.portal-table-card { overflow: hidden; }
.portal-table-scroll { width: 100%; overflow-x: auto; }
.portal-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  text-align: left;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid #eee9f2;
  padding: 12px 13px;
  vertical-align: top;
  font-size: 12px;
}

.portal-table th {
  background: #f3eff7;
  color: var(--yu-brand-plum, #281a38);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .035em;
  white-space: nowrap;
}

.portal-table tbody tr:hover { background: #fcfafc; }
.portal-cell-title { color: var(--yu-brand-plum, #281a38); font-weight: 750; }
.portal-cell-sub { display: block; margin-top: 4px; color: var(--yu-brand-muted, #776f82); }
.portal-cell-message { display: block; max-width: 270px; color: #655d6f; white-space: pre-wrap; }

.portal-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5deeb;
  border-radius: 99px;
  padding: 4px 9px;
  background: #f7f4fa;
  color: var(--yu-brand-violet-deep, #4e2f70);
  font-size: 11px;
  font-weight: 750;
  text-transform: capitalize;
  white-space: nowrap;
}

.portal-status--paid,
.portal-status--active,
.portal-status--converted {
  border-color: #cee6d6;
  background: #f1faf4;
  color: #27613b;
}

.portal-status--overdue,
.portal-status--inactive,
.portal-status--closed {
  border-color: #efd1d1;
  background: #fff5f4;
  color: #842c32;
}

.portal-status--pending,
.portal-status--partial,
.portal-status--new,
.portal-status--contacted {
  border-color: #eddfbd;
  background: #fff9ec;
  color: #72521b;
}

.portal-profile {
  padding: clamp(18px, 3vw, 28px);
}

.portal-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.portal-profile-head h2 {
  margin: 0;
  color: var(--yu-brand-plum, #281a38);
  font-size: 24px;
}

.portal-profile-head p { margin: 6px 0 0; color: var(--yu-brand-muted, #776f82); font-size: 13px; }

.portal-personal-grid,
.portal-student-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.portal-detail {
  min-width: 0;
  border: 1px solid #eee9f2;
  border-radius: 13px;
  padding: 13px 14px;
  background: #fdfcfe;
}

.portal-detail span {
  display: block;
  color: var(--yu-brand-muted, #776f82);
  font-size: 11px;
  font-weight: 650;
}

.portal-detail strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 5px;
  color: var(--yu-brand-plum, #281a38);
  font-size: 14px;
  font-weight: 750;
}

.portal-alert {
  margin: 0 0 22px;
  border: 1px solid #eddfbd;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff9ec;
  color: #72521b;
  font-size: 13px;
  line-height: 1.6;
}

.portal-alert strong { display: block; margin-bottom: 3px; color: #614311; }
.portal-divider { height: 1px; margin: 24px 0; background: var(--yu-brand-line, #e5deeb); }
.portal-section-title { margin: 0 0 14px; color: var(--yu-brand-plum, #281a38); font-size: 17px; }
.portal-empty { padding: 28px; color: var(--yu-brand-muted, #776f82); text-align: center; }
.portal-muted { color: var(--yu-brand-muted, #776f82); }
.portal-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.yu-contact-portal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 20px;
  border: 1px solid var(--yu-brand-line, #e5deeb);
  border-radius: 14px;
  padding: 15px 17px;
  background: #fff;
  color: var(--yu-brand-copy, #4d4558);
  font-size: 13px;
}

.yu-contact-portal-links a {
  color: var(--yu-brand-violet-deep, #4e2f70) !important;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  #root main.portal-main { padding-top: 104px !important; }
  .portal-shell { padding: 24px 15px 56px; }
  .portal-heading { align-items: flex-start; flex-direction: column; }
  .portal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .portal-stat { padding: 14px; }
  .portal-stat strong { font-size: 24px; }
  .portal-toolbar { align-items: stretch; flex-direction: column; }
  .portal-toolbar input[type="search"] { width: 100%; }
  .portal-form-grid { grid-template-columns: 1fr; }
  .portal-personal-grid,
  .portal-student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-profile-head { flex-direction: column; }
  .portal-login-card { margin-top: 0; }
}

@media (max-width: 440px) {
  .portal-personal-grid,
  .portal-student-grid { grid-template-columns: 1fr; }
  .portal-actions > * { flex: 1; }
}
