/* Portal ARCA: isolated styles. This file intentionally does not import arca.css. */
.portal {
  --p-navy-deep: #0b1530;
  --p-navy: #13234a;
  --p-navy-mid: #1b3268;
  --p-blue: #0d5bff;
  --p-blue-dark: #0a47cc;
  --p-cyan: #19d3ff;
  --p-ink: #101a2c;
  --p-graphite: #3d4a63;
  --p-muted: #636f85;
  --p-line: #e3e8f0;
  --p-surface: #f6f8fc;
  --p-surface-2: #edf1f8;
  --p-white: #fff;
  --p-green: #168a48;
  --p-red: #c9363f;
  --p-shadow-sm: 0 1px 2px rgba(16, 26, 44, .05), 0 2px 8px rgba(16, 26, 44, .05);
  --p-shadow-md: 0 12px 35px rgba(16, 26, 44, .1);
  --p-radius-sm: 8px;
  --p-radius: 13px;
  --p-radius-lg: 20px;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--p-ink);
  background: var(--p-surface);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.portal *, .portal *::before, .portal *::after { box-sizing: border-box; }
.portal img, .portal svg { display: block; max-width: 100%; }
.portal button, .portal input, .portal select, .portal textarea { color: inherit; font: inherit; }
.portal button, .portal a { -webkit-tap-highlight-color: transparent; }
.portal button { cursor: pointer; }
.portal a { color: var(--p-blue); text-decoration: none; }
.portal h1, .portal h2, .portal h3, .portal p { margin: 0; }
.portal h1, .portal h2, .portal h3 { line-height: 1.2; letter-spacing: -.025em; }
.portal .hidden { display: none !important; }
.portal .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.portal :focus-visible { outline: 3px solid rgba(25, 211, 255, .65); outline-offset: 3px; }
.portal ::selection { background: rgba(13, 91, 255, .18); }

.portal-skip {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--p-white);
  background: var(--p-blue);
  transform: translateY(-150%);
}
.portal-skip:focus { transform: none; }

.portal-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.portal-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(13, 91, 255, .17);
  border-top-color: var(--p-blue);
  border-radius: 50%;
  animation: portal-spin .75s linear infinite;
}
.portal-spinner-small { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes portal-spin { to { transform: rotate(360deg); } }

.portal-boot, .portal-state {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--p-muted);
}
.portal-state { min-height: min(55vh, 560px); text-align: center; }
.portal-state > .portal-icon { width: 40px; height: 40px; color: var(--p-red); }
.portal-state h2 { font-size: 1.25rem; }
.portal-state p { max-width: 460px; }
.portal-noscript { position: fixed; inset: auto 20px 20px; z-index: 1000; padding: 16px; color: #fff; background: var(--p-red); text-align: center; }

/* Authentication */
.portal-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 44%) 1fr; background: #fff; }
.portal-auth-panel {
  width: min(100%, 580px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(38px, 7vw, 96px);
  margin-inline: auto;
}
.portal-auth-brand { position: absolute; top: 40px; }
.portal-auth-brand .portal-brand { color: var(--p-navy); }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.portal-brand img { width: 125px; height: auto; object-fit: contain; }
.portal-brand > span { padding-left: 12px; border-left: 1px solid currentColor; font-size: .65rem; font-weight: 800; letter-spacing: .22em; opacity: .65; }
.portal-auth-copy { margin-bottom: 30px; }
.portal-eyebrow { display: block; margin-bottom: 10px; color: var(--p-blue); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.portal-eyebrow-light { color: var(--p-cyan); }
.portal-auth-copy h1 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 2.75rem); color: var(--p-navy-deep); }
.portal-auth-copy p { max-width: 420px; color: var(--p-muted); }
.portal-auth-form { display: grid; gap: 18px; }
.portal-auth-form label:not(.portal-check), .portal-form label:not(.portal-check):not(.portal-toggle) { display: grid; gap: 7px; color: var(--p-graphite); font-size: .84rem; font-weight: 650; }
.portal input:not([type="checkbox"]):not([type="radio"]), .portal select, .portal textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cbd4e2;
  border-radius: 9px;
  color: var(--p-ink);
  background: #fff;
  font-weight: 400;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.portal textarea { resize: vertical; }
.portal input:focus, .portal select:focus, .portal textarea:focus { border-color: var(--p-blue); box-shadow: 0 0 0 3px rgba(13, 91, 255, .12); }
.portal input:disabled { color: var(--p-muted); background: var(--p-surface-2); cursor: not-allowed; }
.portal-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-check { display: inline-flex; align-items: center; gap: 8px; color: var(--p-graphite); font-size: .84rem; cursor: pointer; }
.portal-check input { width: 17px; height: 17px; accent-color: var(--p-blue); }
.portal-text-btn { padding: 2px; border: 0; color: var(--p-blue); background: transparent; font-size: .84rem; font-weight: 650; }
.portal-auth-help { margin-top: 24px; color: var(--p-muted); font-size: .8rem; text-align: center; }
.portal-inline-message { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #b9d0ff; border-radius: 9px; color: var(--p-navy-mid); background: #eef4ff; font-size: .86rem; }
.portal-config-warning { display: flex; gap: 13px; padding: 17px; border: 1px solid #f4cf80; border-radius: 12px; color: #694800; background: #fff8e8; }
.portal-config-warning .portal-icon { margin-top: 2px; }
.portal-config-warning p { margin-top: 5px; font-size: .85rem; }
.portal-config-warning code { font-size: .76rem; }
.portal-auth-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 75% 25%, rgba(25, 211, 255, .2), transparent 28%), linear-gradient(145deg, #081127, #132b60 65%, #0d5bff);
}
.portal-auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom right, transparent, #000);
}
.portal-orbit { position: absolute; border: 1px solid rgba(25, 211, 255, .25); border-radius: 50%; }
.portal-orbit::after { content: ""; position: absolute; top: 50%; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--p-cyan); box-shadow: 0 0 20px var(--p-cyan); }
.portal-orbit-one { width: 560px; height: 560px; top: 9%; right: -15%; transform: rotate(-18deg); }
.portal-orbit-two { width: 340px; height: 340px; right: 22%; bottom: -12%; }
.portal-visual-copy { position: absolute; z-index: 1; left: 10%; bottom: 12%; }
.portal-visual-copy span { display: block; margin-bottom: 15px; color: var(--p-cyan); font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
.portal-visual-copy strong { font-size: clamp(2.2rem, 4.8vw, 4.8rem); line-height: 1.05; letter-spacing: -.05em; }

/* Controls */
.portal-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .87rem;
  font-weight: 700;
  line-height: 1;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .12s;
}
.portal-btn:active { transform: translateY(1px); }
.portal-btn:disabled { opacity: .65; cursor: wait; }
.portal-btn-primary { color: #fff; background: var(--p-blue); box-shadow: 0 6px 18px rgba(13, 91, 255, .22); }
.portal-btn-primary:hover { background: var(--p-blue-dark); }
.portal-btn-outline { border-color: #cbd4e2; color: var(--p-navy); background: #fff; }
.portal-btn-outline:hover { border-color: var(--p-blue); color: var(--p-blue); background: #f5f8ff; }
.portal-btn-danger { color: #fff; background: var(--p-red); }
.portal-btn-block { width: 100%; min-height: 48px; }
.portal-btn-small { min-height: 34px; padding: 8px 12px; font-size: .78rem; }
.portal-btn .portal-icon { width: 17px; height: 17px; }
.portal-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
}
.portal-icon-btn:hover { background: rgba(13, 91, 255, .08); color: var(--p-blue); }
.portal-icon-btn.portal-danger:hover { color: var(--p-red); background: #fff0f1; }

/* App shell */
.portal-shell { min-height: 100vh; }
.portal-sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: 264px;
  display: flex;
  flex-direction: column;
  color: rgba(255,255,255,.78);
  background: linear-gradient(180deg, var(--p-navy-deep), #0f2046);
  box-shadow: 8px 0 30px rgba(6, 15, 36, .1);
}
.portal-sidebar-head { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid rgba(255,255,255,.08); }
.portal-close-menu { display: none; }
.portal-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 24px 14px; overflow-y: auto; }
.portal-nav a { position: relative; display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 9px; color: rgba(255,255,255,.68); font-size: .9rem; font-weight: 550; }
.portal-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.portal-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(13,91,255,.85), rgba(13,91,255,.45)); box-shadow: 0 6px 20px rgba(2, 10, 30, .2); }
.portal-nav a.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--p-cyan); }
.portal-nav a:last-child { margin-top: auto; }
.portal-sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 18px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.portal-mini-user { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.portal-mini-user > span:last-child { min-width: 0; display: grid; }
.portal-mini-user strong, .portal-mini-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-mini-user strong { color: #fff; font-size: .8rem; }
.portal-mini-user small { color: rgba(255,255,255,.52); font-size: .67rem; }
.portal-avatar { width: 36px; height: 36px; display: inline-grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--p-blue), #3e86ff); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.portal-workspace { min-height: 100vh; margin-left: 264px; }
.portal-topbar { position: sticky; z-index: 40; top: 0; height: 70px; display: flex; align-items: center; justify-content: flex-end; padding: 0 32px; border-bottom: 1px solid var(--p-line); background: rgba(255,255,255,.91); backdrop-filter: blur(14px); }
.portal-menu-btn, .portal-topbar-brand { display: none; }
.portal-topbar-user { display: flex; align-items: center; gap: 12px; color: var(--p-muted); font-size: .83rem; }
.portal-topbar-user strong { color: var(--p-ink); }
.portal-main { width: min(100%, 1440px); min-height: calc(100vh - 70px); padding: 40px clamp(24px, 3.4vw, 52px) 72px; margin-inline: auto; outline: none; }
.portal-mobile-backdrop { display: none; }

/* Page elements */
.portal-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.portal-page-head h1 { color: var(--p-navy-deep); font-size: clamp(1.75rem, 3vw, 2.35rem); }
.portal-page-head p { margin-top: 8px; color: var(--p-muted); }
.portal-section { margin-top: 34px; }
.portal-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.portal-section-head h2 { color: var(--p-navy); font-size: 1.13rem; }
.portal-section-head p { margin-top: 4px; color: var(--p-muted); font-size: .8rem; }
.portal-section-head > a { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 700; }
.portal-section-head > a .portal-icon { width: 15px; height: 15px; }
.portal-hero-card { position: relative; min-height: 210px; display: flex; align-items: center; overflow: hidden; padding: clamp(28px, 5vw, 54px); border-radius: var(--p-radius-lg); color: #fff; background: radial-gradient(circle at 85% 15%, rgba(25,211,255,.28), transparent 22%), linear-gradient(120deg, var(--p-navy-deep), var(--p-navy-mid)); box-shadow: var(--p-shadow-md); }
.portal-hero-card::after { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(120deg, transparent 48%, rgba(255,255,255,.3) 49%, transparent 50%); background-size: 45px 45px; }
.portal-hero-card > div:first-child { position: relative; z-index: 1; max-width: 620px; }
.portal-hero-card h2 { margin-bottom: 10px; color: #fff; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.portal-hero-card p { color: rgba(255,255,255,.67); }
.portal-hero-mark { position: absolute; z-index: 1; right: 6%; color: transparent; font-size: 12rem; font-weight: 800; line-height: 1; -webkit-text-stroke: 1px rgba(255,255,255,.16); transform: rotate(-8deg); }
.portal-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 28px; }
.portal-shortcut-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.portal-shortcut-grid-large { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
.portal-shortcut { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--p-line); border-radius: var(--p-radius); color: var(--p-ink); background: #fff; box-shadow: var(--p-shadow-sm); transition: border-color .18s, box-shadow .18s, transform .18s; }
.portal-shortcut:hover { border-color: #b8ccfa; color: var(--p-ink); box-shadow: 0 10px 25px rgba(13, 91, 255, .09); transform: translateY(-2px); }
.portal-shortcut > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.portal-shortcut strong, .portal-shortcut small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-shortcut strong { font-size: .86rem; }
.portal-shortcut small { margin-top: 3px; color: var(--p-muted); font-size: .7rem; }
.portal-shortcut > .portal-icon { width: 16px; height: 16px; color: #9aa5b7; }
.portal-shortcut-icon { width: 40px; height: 40px; display: grid !important; flex: 0 0 auto !important; place-items: center; border-radius: 10px; color: var(--p-blue); background: #edf3ff; }
.portal-shortcut-icon .portal-icon { width: 20px; height: 20px; }
.portal-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.portal-search { min-width: 260px; max-width: 520px; flex: 1; display: flex; align-items: center; gap: 10px; padding-left: 14px; border: 1px solid var(--p-line); border-radius: 10px; color: var(--p-muted); background: #fff; }
.portal-search input { min-height: 46px !important; padding-left: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
.portal-select-label select { min-width: 190px; }
.portal-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.portal-content-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; box-shadow: var(--p-shadow-sm); }
.portal-file-icon { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--p-blue); background: #edf3ff; }
.portal-file-link { color: #7252c6; background: #f3efff; }
.portal-card-body { min-width: 0; }
.portal-card-body h3 { margin: 8px 0 5px; overflow-wrap: anywhere; font-size: .96rem; }
.portal-card-body p { display: -webkit-box; overflow: hidden; color: var(--p-muted); font-size: .78rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.portal-card-body > small { display: block; margin-top: 8px; color: #8b96a8; font-size: .68rem; }
.portal-card-topline { display: flex; align-items: center; gap: 9px; }
.portal-badge { display: inline-flex; width: fit-content; align-items: center; padding: 3px 8px; border-radius: 99px; color: #174caa; background: #eaf1ff; font-size: .63rem; font-weight: 750; letter-spacing: .02em; }
.portal-muted-label { color: var(--p-muted); font-size: .65rem; }
.portal-card-actions { display: flex; align-items: center; gap: 2px; }
.portal-info-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 12px 15px; border: 1px solid #cbdcfe; border-radius: 10px; color: #284d8e; background: #eef4ff; font-size: .78rem; }
.portal-info-strip .portal-icon { width: 17px; height: 17px; }
.portal-announcement-list { max-width: 920px; display: grid; gap: 16px; }
.portal-announcement { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 20px; padding: 23px; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; box-shadow: var(--p-shadow-sm); }
.portal-announcement.compact { padding: 16px; border-radius: 11px; box-shadow: none; }
.portal-announcement-date { width: 54px; height: 58px; display: grid; place-content: center; border-radius: 10px; color: var(--p-blue); background: #edf3ff; text-align: center; }
.portal-announcement-date strong { font-size: 1.25rem; line-height: 1; }
.portal-announcement-date span { margin-top: 3px; font-size: .58rem; font-weight: 750; text-transform: uppercase; }
.portal-announcement h3 { margin: 8px 0 7px; font-size: 1rem; }
.portal-richtext { color: var(--p-graphite); font-size: .82rem; }
.portal-announcement small { display: block; margin-top: 10px; color: #9099a9; font-size: .65rem; }
.portal-mini-list { display: grid; overflow: hidden; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; }
.portal-mini-list > button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--p-line); background: #fff; text-align: left; }
.portal-mini-list > button:last-child { border-bottom: 0; }
.portal-mini-list > button:hover { background: #f8faff; }
.portal-mini-list .portal-file-icon { width: 34px; height: 34px; }
.portal-mini-list .portal-file-icon .portal-icon { width: 17px; height: 17px; }
.portal-mini-list button > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.portal-mini-list strong, .portal-mini-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-mini-list strong { font-size: .78rem; }
.portal-mini-list small { color: var(--p-muted); font-size: .65rem; }
.portal-mini-list button > .portal-icon { width: 15px; height: 15px; color: #a2acbb; }
.portal-training-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.portal-training { min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; box-shadow: var(--p-shadow-sm); }
.portal-training-art { height: 105px; display: flex; align-items: flex-end; justify-content: space-between; padding: 17px; color: rgba(255,255,255,.92); background: radial-gradient(circle at 85% 25%, rgba(25,211,255,.45), transparent 24%), linear-gradient(120deg, var(--p-navy), var(--p-blue)); }
.portal-training-art { position: relative; overflow: hidden; }
.portal-training-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(11,21,48,.12), rgba(13,91,255,.58)); }
.portal-training-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-training-art .portal-icon { position: relative; z-index: 1; width: 32px; height: 32px; }
.portal-training-art span { position: relative; z-index: 1; font-size: .58rem; font-weight: 800; letter-spacing: .12em; }
.portal-training .portal-card-body { flex: 1; padding: 17px; }
.portal-training > .portal-btn { align-self: flex-start; margin: 0 17px 17px; }
.portal-training-meta { min-height: 20px; display: flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--p-muted); font-size: .68rem; }
.portal-training-meta .portal-icon { width: 14px; height: 14px; }
.portal-empty { grid-column: 1 / -1; min-height: 210px; display: grid; place-content: center; justify-items: center; padding: 30px; border: 1px dashed #c6d0df; border-radius: var(--p-radius); color: var(--p-muted); background: rgba(255,255,255,.55); text-align: center; }
.portal-empty > .portal-icon { width: 36px; height: 36px; margin-bottom: 12px; color: #9eabc0; }
.portal-empty strong { color: var(--p-graphite); }
.portal-empty p { max-width: 360px; margin: 5px 0 15px; font-size: .78rem; }
.portal-no-results { padding: 30px; color: var(--p-muted); text-align: center; }

/* Profile and forms */
.portal-profile-layout { display: grid; grid-template-columns: 280px minmax(0, 680px); gap: 22px; align-items: start; }
.portal-profile-card { display: grid; justify-items: center; padding: 35px 24px; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; text-align: center; box-shadow: var(--p-shadow-sm); }
.portal-avatar-large { width: 78px; height: 78px; margin-bottom: 16px; font-size: 1.35rem; }
.portal-profile-card h2 { font-size: 1.15rem; }
.portal-profile-card p { margin: 5px 0 13px; color: var(--p-muted); font-size: .8rem; }
.portal-form { display: grid; gap: 18px; }
.portal-profile-form { padding: 26px; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: #fff; box-shadow: var(--p-shadow-sm); }
.portal-form-head { margin-bottom: 4px; }
.portal-form-head h2 { font-size: 1.1rem; }
.portal-form-head p { margin-top: 5px; color: var(--p-muted); font-size: .77rem; }
.portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-span-2 { grid-column: span 2; }
.portal-form-actions, .portal-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.portal-choice { display: flex; gap: 10px; padding: 0; border: 0; }
.portal-choice legend, .portal-grants legend { margin-bottom: 8px; color: var(--p-graphite); font-size: .8rem; font-weight: 700; }
.portal-choice label { flex: 1; display: flex !important; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: 1px solid var(--p-line); border-radius: 9px; cursor: pointer; }
.portal-choice label:has(input:checked) { border-color: var(--p-blue); color: var(--p-blue); background: #f0f5ff; }
.portal-choice-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-choice .portal-icon { width: 18px; height: 18px; }
.portal-choice input { accent-color: var(--p-blue); }
.portal-grants { padding: 16px; border: 1px solid var(--p-line); border-radius: 10px; }
.portal-grants > p { margin: -3px 0 12px; color: var(--p-muted); font-size: .72rem; }
.portal-grant-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-grant-columns > div > strong { font-size: .75rem; }
.portal-check-list { max-height: 145px; display: grid; gap: 7px; overflow-y: auto; margin-top: 7px; padding: 10px; border-radius: 8px; background: var(--p-surface); }
.portal-toggle-row { display: flex; flex-wrap: wrap; gap: 24px; }
.portal-toggle { display: inline-flex !important; align-items: center; gap: 9px; cursor: pointer; }
.portal-toggle input { position: absolute; opacity: 0; }
.portal-toggle span { position: relative; width: 38px; height: 21px; border-radius: 99px; background: #bbc5d3; transition: background .18s; }
.portal-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.portal-toggle input:checked + span { background: var(--p-blue); }
.portal-toggle input:checked + span::after { transform: translateX(17px); }
.portal-toggle input:focus-visible + span { outline: 3px solid rgba(25,211,255,.65); outline-offset: 3px; }
.portal-permissions { padding: 16px; border: 1px solid var(--p-line); border-radius: 10px; }
.portal-permissions legend { color: var(--p-graphite); font-size: .8rem; font-weight: 700; }
.portal-permissions > p { margin: 0 0 12px; color: var(--p-muted); font-size: .72rem; }
.portal-permission-list { max-height: 270px; display: grid; overflow-y: auto; border: 1px solid var(--p-line); border-radius: 9px; }
.portal-permission-list > label { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--p-line); }
.portal-permission-list > label:last-child { border-bottom: 0; }
.portal-permission-list label > span { min-width: 0; display: grid; }
.portal-permission-list strong { font-size: .76rem; }
.portal-permission-list small { color: var(--p-muted); font-size: .65rem; }
.portal-permission-list select { width: 120px; min-height: 36px; padding-block: 6px; font-size: .75rem; }

/* Administration */
.portal-admin-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding: 4px; border: 1px solid var(--p-line); border-radius: 11px; background: #fff; scrollbar-width: thin; }
.portal-admin-tabs button { min-width: max-content; flex: 1; padding: 9px 13px; border: 0; border-radius: 8px; color: var(--p-muted); background: transparent; font-size: .78rem; font-weight: 650; }
.portal-admin-tabs button:hover { color: var(--p-blue); background: #f4f7fd; }
.portal-admin-tabs button.active { color: #fff; background: var(--p-navy); }
.portal-admin-list { display: grid; gap: 8px; }
.portal-admin-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--p-line); border-radius: 10px; background: #fff; }
.portal-admin-item > div:first-child { min-width: 0; }
.portal-admin-item strong, .portal-admin-item p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-admin-item strong { font-size: .86rem; }
.portal-admin-item p { margin-top: 3px; color: var(--p-muted); font-size: .7rem; }
.portal-admin-status { display: flex; align-items: center; gap: 3px; }
.portal-status { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; color: var(--p-green); font-size: .68rem; font-weight: 700; }
.portal-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.portal-status.inactive { color: #929bab; }

/* Dialog and messages */
.portal-dialog { width: min(620px, calc(100% - 28px)); max-height: min(88vh, 900px); padding: 0; overflow: auto; border: 0; border-radius: 16px; color: var(--p-ink); background: #fff; box-shadow: 0 24px 80px rgba(4, 12, 30, .32); }
.portal-dialog::backdrop { background: rgba(5, 13, 31, .64); backdrop-filter: blur(3px); }
.portal-dialog-frame { padding: 25px; }
.portal-dialog.portal-dialog-large { width: min(820px, calc(100% - 28px)); }
.portal-dialog-frame > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.portal-dialog-frame > header h2 { color: var(--p-navy); font-size: 1.3rem; }
.portal-dialog-frame > header p { margin-top: 5px; color: var(--p-muted); font-size: .78rem; }
.portal-toasts { position: fixed; z-index: 200; top: 18px; right: 18px; width: min(380px, calc(100% - 36px)); display: grid; gap: 9px; }
.portal-toast { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid #baddc8; border-radius: 10px; color: #145b33; background: #f0fff6; box-shadow: var(--p-shadow-md); animation: portal-toast-in .24s ease-out; }
.portal-toast-error { border-color: #f0bfc2; color: #92242b; background: #fff3f4; }
.portal-toast > .portal-icon { width: 19px; height: 19px; }
.portal-toast span { flex: 1; font-size: .8rem; font-weight: 600; }
.portal-toast button { padding: 4px; border: 0; color: inherit; background: transparent; }
.portal-toast button .portal-icon { width: 16px; height: 16px; }
@keyframes portal-toast-in { from { opacity: 0; transform: translateY(-10px); } }

@media (max-width: 1100px) {
  .portal-shortcut-grid, .portal-shortcut-grid-large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-content-grid { grid-template-columns: 1fr; }
  .portal-training-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .portal-auth { grid-template-columns: 1fr; }
  .portal-auth-panel { padding: 92px 34px 48px; }
  .portal-auth-brand { top: 28px; }
  .portal-auth-visual { display: none; }
  .portal-sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  .portal-workspace { margin-left: 0; }
  .portal-topbar { justify-content: space-between; padding: 0 20px; }
  .portal-menu-btn, .portal-topbar-brand { display: inline-grid; }
  .portal-topbar-brand { flex: 1; margin-left: 10px; color: var(--p-navy); font-size: .82rem; font-weight: 800; letter-spacing: .04em; }
  .portal-close-menu { display: inline-grid; color: #fff; }
  .portal-mobile-backdrop { position: fixed; z-index: 55; inset: 0; background: rgba(5, 13, 31, .58); }
  .portal.menu-open { overflow: hidden; }
  .portal.menu-open .portal-sidebar { transform: none; }
  .portal.menu-open .portal-mobile-backdrop { display: block; }
  .portal-profile-layout { grid-template-columns: 1fr; }
  .portal-profile-card { grid-template-columns: auto 1fr; justify-items: start; column-gap: 18px; text-align: left; }
  .portal-profile-card .portal-avatar { grid-row: span 3; margin: 0; }
  .portal-profile-card p { margin-bottom: 7px; }
}

@media (max-width: 620px) {
  .portal-topbar { height: 62px; padding-inline: 12px; }
  .portal-topbar-user > span { display: none; }
  .portal-main { min-height: calc(100vh - 62px); padding: 28px 15px 55px; }
  .portal-page-head { align-items: flex-start; margin-bottom: 24px; }
  .portal-page-head > .portal-btn { min-width: 42px; }
  .portal-page-head > .portal-btn .portal-icon { margin: 0; }
  .portal-hero-card { min-height: 230px; padding: 27px; }
  .portal-hero-mark { right: -10%; font-size: 9rem; }
  .portal-shortcut-grid, .portal-shortcut-grid-large, .portal-training-grid { grid-template-columns: 1fr; }
  .portal-toolbar { align-items: stretch; flex-direction: column; }
  .portal-search { min-width: 0; max-width: none; }
  .portal-select-label select { width: 100%; }
  .portal-content-card { grid-template-columns: auto minmax(0, 1fr); }
  .portal-content-card .portal-card-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--p-line); }
  .portal-content-card .portal-card-actions .portal-btn { margin-right: auto; }
  .portal-form-grid, .portal-grant-columns { grid-template-columns: 1fr; }
  .portal-span-2 { grid-column: auto; }
  .portal-dialog-frame { padding: 20px 17px; }
  .portal-dialog-actions, .portal-form-actions { flex-wrap: wrap; }
  .portal-dialog-actions .portal-btn, .portal-form-actions .portal-btn { flex: 1; }
  .portal-choice { flex-direction: column; }
  .portal-choice-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-permission-list > label { align-items: stretch; flex-direction: column; }
  .portal-permission-list select { width: 100%; }
  .portal-announcement { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 17px; }
  .portal-announcement-date { width: 44px; height: 50px; }
  .portal-admin-item { align-items: flex-start; flex-direction: column; }
  .portal-admin-status { align-self: stretch; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--p-line); }
  .portal-status { margin-right: auto; }
  .portal-auth-panel { padding-inline: 23px; }
}

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