html, body { margin: 0; min-height: 100%; }
.portal-shell, .portal-shell * { box-sizing: border-box; }
.portal-shell { min-height: 100vh; background: #f4f6fa; color: #172c46; font-family: system-ui, sans-serif; line-height: 1.5; }
.portal-shell header { padding: 20px max(24px, 5vw); background: #173454; color: white; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.portal-shell header a { color: white; font-size: 24px; font-weight: 700; }
.portal-shell main { padding: 32px 0; width: calc(100% - 64px); max-width: 1440px; margin: auto; }
.portal-shell h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 12px; overflow-wrap: anywhere; }
.portal-shell h2 { margin-top: 0; }
.portal-card { background: white; border: 1px solid #d9e1eb; border-radius: 12px; padding: 24px; margin: 24px 0; box-shadow: 0 3px 16px #17345405; }
.portal-auth { min-height: calc(100svh - 145px); display: grid; place-items: center; padding: 16px 0 48px; }
.portal-login { width: 100%; max-width: 540px; padding: 32px; margin: 0; }
.portal-login .portal-actions { margin-top: 24px; }
.portal-eyebrow { color: #526780; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 0 0 10px; }
.portal-help { color: #526780; font-size: .9rem; }
.portal-page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.portal-page-heading p:last-child { margin-bottom: 0; }
.portal-shell label { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; font-weight: 500; }
.portal-shell input, .portal-shell select, .portal-shell textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #b7c5d6; border-radius: 6px; padding: 11px 12px; color: #172c46; background-color: white; font: inherit; line-height: 1.3; }
.portal-shell select { appearance: none; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23526780' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 14px center; background-repeat: no-repeat; }
.portal-shell input[aria-invalid="true"] { border-color: #9c2720; }
.portal-shell button { min-height: 44px; padding: 11px 16px; background: #225b94; color: white; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font: inherit; line-height: 1.3; }
.portal-shell button:disabled { opacity: .5; cursor: default; }
.portal-shell .portal-secondary { color: #225b94; background: white; border-color: #b7c5d6; }
.portal-shell :focus-visible { outline: 3px solid #66a4e8; outline-offset: 2px; }
.portal-actions, .portal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.portal-filter-grid { display: grid; grid-template-columns: minmax(230px, 2fr) repeat(2, minmax(140px, 1fr)) repeat(2, minmax(150px, 1fr)) auto; align-items: end; gap: 16px; }
.portal-filter-grid label, .portal-fields label { margin: 0; min-width: 0; }
.portal-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; gap: 20px; margin: 24px 0; }
.portal-fields textarea { min-height: 88px; }
.portal-table { overflow-x: auto; }
.portal-table table { width: 100%; min-width: 930px; border-collapse: collapse; text-align: left; }
.portal-table th, .portal-table td { padding: 14px 10px; border-bottom: 1px solid #e4e9f0; }
.portal-table th button, .portal-shell .portal-link { min-height: auto; background: none; border: 0; color: #225b94; padding: 0; text-decoration: underline; }
.portal-table small { display: block; color: #64748b; }
.portal-detail { width: min(36rem, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid #d9e1eb; border-radius: 12px; color: #172c46; }
.portal-detail::backdrop { background: #172c4680; }
.portal-detail-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.portal-detail-heading h2 { margin: 0; }
.portal-success { padding: 14px 16px; background: #e6f4eb; color: #215838; border-radius: 6px; overflow-wrap: anywhere; }
.portal-notice { padding: 16px; background: #fff3cd; border-radius: 6px; }
.portal-error { padding: 14px 16px; background: #fde8e6; color: #9c2720; border-radius: 6px; }
@media (max-width: 1150px) { .portal-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 650px) {
    .portal-shell header { padding: 16px 20px; gap: 12px; }
    .portal-shell main { width: calc(100% - 32px); padding: 24px 0; }
    .portal-shell h1 { font-size: 1.65rem; }
    .portal-auth { padding: 8px 0 24px; min-height: calc(100svh - 130px); }
    .portal-card { padding: 20px; }
    .portal-login { padding: 24px; }
    .portal-filter-grid, .portal-fields { grid-template-columns: minmax(0, 1fr); }
    .portal-actions { width: 100%; }
    .portal-actions button { flex: 1; }
    .portal-toolbar { justify-content: space-between; }
}
