/* Shared portal design. Legacy Razor components use the same tokens. */
:root {
    --portal-ink: #1d2a40;
    --portal-muted: #66758b;
    --portal-border: #e2e8f0;
    --portal-primary: #3565dc;
    --portal-surface: #fff;
    --portal-background: #f5f7fb;
    --portal-soft: #edf3ff;
    --portal-sidebar: 232px;
}
body.portal-body {
    --ios-bg-main: var(--portal-background);
    --ios-card-bg: var(--portal-surface);
    --ios-blue: var(--portal-primary);
    --ios-text-primary: var(--portal-ink);
    --ios-text-secondary: var(--portal-muted);
    --ios-divider: var(--portal-border);
    --ios-green: #23815b;
    --ios-red: #ce3c4d;
    --ios-orange: #ac6b14;
    --primary-color: var(--portal-primary);
    --text-color: var(--portal-ink);
    --text-secondary: var(--portal-muted);
    --border-color: var(--portal-border);
    color: var(--portal-ink);
    background: var(--portal-background);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
}
.portal-body *, .portal-body *::before, .portal-body *::after { box-sizing: border-box; }
.portal-body [hidden] { display: none !important; }
.portal-body a { text-decoration: none; }
.portal-body a:hover { text-decoration: none; }
.portal-body :focus-visible { outline: 3px solid #9bb8fb; outline-offset: 3px; }
.portal-body button, .portal-body input, .portal-body select, .portal-body textarea { font-family: inherit; }
/* A few legacy views set compact text sizes inline. Keep their text controls readable. */
.portal-body :is(.ios-btn-primary,.ios-btn-secondary,.ios-btn-danger,.ios-button)[style*="font-size"] { font-size: 15px !important; }
.portal-body :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select)[style*="font-size"] { font-size: 16px !important; }
.portal-body .portal-tabs .ios-button > span { font-size: 14px !important; }
.portal-body :is(.ios-table,.table) td[style*="font-size"] { font-size: 15px !important; }
.portal-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.portal-skip-link { position: fixed; top: -80px; left: 16px; z-index: 4000; padding: 12px 18px; background: #fff; border-radius: 8px; color: var(--portal-primary); }
.portal-skip-link:focus { top: 12px; }
.portal-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--portal-sidebar); background: #fff; border-right: 1px solid var(--portal-border); z-index: 1020; display: flex; flex-direction: column; padding: 26px 14px 18px; }
.portal-brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 7px; margin-bottom: 30px; }
.portal-brand { display: flex; align-items: center; gap: 11px; color: var(--portal-ink); }
.portal-brand:hover { color: var(--portal-ink); }
.portal-brand-mark { width: 36px; height: 40px; display: grid; place-items: center; }
.portal-brand-mark img { width: 31px; max-height: 39px; }
.portal-brand strong { display: block; font-size: 16px; font-weight: 750; letter-spacing: -.4px; }
.portal-brand small { display: block; font-size: 12px; color: #7a8799; margin-top: 2px; }
.portal-navigation { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.portal-nav-group { margin-top: 24px; }
.portal-nav-label { display: block; padding: 0 14px 8px; color: #7b899e; font-size: 12px; font-weight: 650; letter-spacing: 1.1px; text-transform: uppercase; }
.portal-nav-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 10px 13px; margin: 3px 0; border-radius: 8px; color: #617086; font-size: 15px; font-weight: 550; }
.portal-nav-link .portal-icon { width: 18px; height: 18px; flex-basis: 18px; color: #7e8ba0; }
.portal-nav-link:hover { background: #f5f7fb; color: var(--portal-ink); }
.portal-nav-link.is-active { background: var(--portal-soft); color: var(--portal-primary); font-weight: 650; }
.portal-nav-link.is-active .portal-icon { color: var(--portal-primary); }
.portal-account { padding: 17px 10px 0; border-top: 1px solid var(--portal-border); margin-top: 20px; }
.portal-account-person { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.portal-account-person>span:last-child { min-width: 0; }
.portal-account-person strong { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.portal-account-person small { display: block; font-size: 12px; color: #7b899c; margin-top: 3px; }
.portal-account-dot { width: 8px; height: 8px; border-radius: 50%; background: #4e9d81; box-shadow: 0 0 0 4px #eff7f3; flex-shrink: 0; margin: 0 4px; }
.portal-logout { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #7d899c; background: transparent; border: 0; padding: 5px 0; }
.portal-logout:hover { color: #bc3a4e; }
.portal-logout .portal-icon { width: 16px; height: 16px; flex-basis: 16px; }
.portal-content { margin-left: var(--portal-sidebar); min-width: 0; }
.portal-topbar { height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--portal-border); background: #fff; }
.portal-topbar-leading { display: flex; align-items: center; gap: 15px; min-width: 0; }
.portal-breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #34435d; }
.portal-breadcrumb a { color: #8290a4; }
.portal-breadcrumb .portal-icon { width: 12px; height: 12px; flex-basis: 12px; color: #aab4c2; }
.portal-topbar-user { display: flex; align-items: center; gap: 12px; color: #69778d; font-size: 13px; }
.portal-user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #e2e9f4; background: #f2f5fb; border-radius: 50%; font-size: 12px; font-weight: 650; color: #627caa; }
.portal-icon-button { width: 38px; height: 38px; padding: 9px; border: 1px solid var(--portal-border); border-radius: 9px; background: #fff; color: #66768f; display: inline-flex; align-items: center; justify-content: center; }
.portal-menu-toggle, .portal-menu-close, .portal-backdrop { display: none; }
.portal-body main.portal-main { background: transparent; box-shadow: none; border: 0; border-radius: 0; margin: 0 auto; padding: 34px 34px 38px; min-height: calc(100vh - 122px); max-width: 1640px; animation: none; outline: none; }
.portal-footer { display: flex; justify-content: space-between; gap: 16px; padding: 17px 34px; border-top: 1px solid #e8edf4; color: #8895a7; font-size: 12px; }

/* Page structure, including existing operational screens. */
.portal-body .ios-page { min-height: 0; background: transparent; }
.portal-body .ios-page>.container, .portal-body .ios-page>.container-fluid { padding: 0; max-width: none; }
.portal-body .ios-top-bar, .portal-body .ios-list-top-bar { position: static; background: transparent; padding: 0; margin-bottom: 25px; }
.portal-body .ios-top-bar-content { gap: 18px; flex-wrap: wrap; align-items: center; margin: 0; }
.portal-body .ios-top-bar-divider, .portal-body .ios-list-divider { display: none; }
.portal-body h1, .portal-body .ios-page-title, .portal-body .ios-list-title { color: var(--portal-ink); font-size: 30px; line-height: 1.2; font-weight: 740; letter-spacing: -.8px; padding: 0; margin: 0; }
.portal-body h1::after { display: none; }
.portal-body h2 { font-size: 20px; font-weight: 680; letter-spacing: -.3px; }
.portal-body h3 { font-size: 17px; font-weight: 650; border: 0; margin: 0 0 14px; padding: 0; }
.portal-body .ios-section-title { color: #596d8a; font-size: 13px; letter-spacing: .8px; }
.portal-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.portal-eyebrow { display: block; color: #7b8aa1; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; margin-bottom: 9px; }
.portal-description, .portal-body .portal-description { color: var(--portal-muted); font-size: 15px; font-weight: 400; line-height: 1.6; margin: 9px 0 0; }
.portal-actions, .portal-body .ios-top-bar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.portal-panel, .portal-body .ios-section-card, .portal-body .ios-details-card, .portal-body .ios-detail-card, .portal-body .ios-form-container, .portal-body .card { background: #fff; border: 1px solid var(--portal-border); border-radius: 13px; box-shadow: 0 2px 5px #192a4403; }
.portal-panel { padding: 24px; margin-bottom: 22px; }
.portal-body .card:hover { transform: none; box-shadow: 0 2px 5px #192a4403; }
.portal-body .card-header { background: #f9fafd; border-bottom: 1px solid var(--portal-border); color: var(--portal-ink); padding: 17px 21px; }
.portal-body .card-header :is(h3,h4,h5) { color: inherit; font-size: 16px; }
.portal-body .card-body { padding: 22px; border-radius: inherit; }
.portal-body .card-body .card-title { font-size: 15px; color: var(--portal-muted); }
.portal-body .ios-form-container { max-width: 720px; padding: 26px; }
.portal-body .ios-detail-page { max-width: 1050px; padding: 0; }
.portal-body .ios-detail-header { padding: 0 0 22px; }
.portal-body .ios-detail-back { font-size: 14px; margin-bottom: 20px; }
.portal-body .ios-detail-card-header { background: #fafbfd; border-bottom: 1px solid var(--portal-border); padding: 18px 22px; }
.portal-body .ios-detail-card-header h2 { margin: 0; font-size: 18px; }
.portal-body .ios-details-label { color: var(--portal-muted); font-size: 14px; }
.portal-body .ios-details-value { min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.portal-body .ios-stats { font-size: 13px; color: #7a889d; line-height: 1.6; flex-wrap: wrap; margin: 17px 2px 0; }
.portal-body .ios-empty-state { padding: 50px 22px; border: 1px dashed #d8e1ef; background: #fafbfd; border-radius: 13px; color: #758399; }
.portal-body .ios-empty-state h2 { color: #354661; font-size: 19px; margin: 14px 0 9px; }
.portal-body .ios-empty-state p { margin-bottom: 0; font-size: 15px; }
.portal-body .ios-empty-state .portal-icon { width: 35px; height: 35px; color: #8aa1c8; }
.portal-body .ios-empty-icon { font-size: 32px; margin-bottom: 14px; opacity: .7; }

/* Buttons and forms. IDs, field names and behavior remain view-owned. */
.portal-body :is(.ios-btn-primary,.ios-btn-secondary,.ios-btn-danger,.ios-button,.ios-detail-btn,.btn) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1.5; min-height: 40px; padding: 10px 15px; border: 1px solid transparent; box-shadow: none; transition: background .15s,border-color .15s; text-decoration: none; }
.portal-body :is(.ios-btn-primary,.ios-button-primary,.ios-detail-btn-primary,.btn-primary) { color: #fff; background: var(--portal-primary); border-color: var(--portal-primary); }
.portal-body :is(.ios-btn-primary,.ios-button-primary,.ios-detail-btn-primary,.btn-primary):hover { background: #2856c9; border-color: #2856c9; color: #fff; transform: none; opacity: 1; }
.portal-body :is(.ios-btn-secondary,.ios-button-secondary,.ios-detail-btn-secondary,.btn-secondary,.btn-outline-secondary,.btn-outline-primary) { color: #526681; background: #fff; border-color: #d8e1ee; }
.portal-body :is(.ios-btn-secondary,.ios-button-secondary,.ios-detail-btn-secondary,.btn-secondary,.btn-outline-secondary,.btn-outline-primary):hover { color: var(--portal-primary); background: #f4f7fd; border-color: #bfcde4; transform: none; }
.portal-body :is(.ios-btn-danger,.ios-button-danger,.ios-detail-btn-danger,.btn-danger) { background: #c33d50; border-color: #c33d50; color: #fff; }
.portal-body .btn-outline-danger { color: #b93c4b; background: #fff; border-color: #efd9de; }
.portal-body .btn-outline-danger:hover { color: #a62b3c; background: #fff3f5; border-color: #e7c3cc; }
.portal-body :is(.ios-btn-primary,.ios-btn-secondary,.ios-button,.btn):active { transform: none; }
.portal-body .btn::before { display: none; }
.portal-body :is(.btn-sm,.ios-btn-sm) { min-height: 34px; font-size: 13px; padding: 7px 11px; }
.portal-body .ios-btn-capsule { border: 1px solid var(--portal-border); box-shadow: none; border-radius: 9px; }
.portal-body .ios-btn-capsule-item { font-size: 14px; min-height: 40px; gap: 7px; }
.portal-body :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select) { color: var(--portal-ink); border: 1px solid #dce3ed; border-radius: 8px; background-color: #fff; font-size: 16px; padding: 10px 13px; min-height: 42px; box-shadow: none; min-width: 0; max-width: 100%; }
.portal-body :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select):focus { border-color: #90abeb; box-shadow: 0 0 0 3px #edf3ff; outline: none; }
.portal-body :is(.ios-form-label,.form-label,.ios-label) { color: #52617a; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.portal-body input::placeholder, .portal-body textarea::placeholder { color: #94a0b3; }
.portal-body input[type=file] { border: 1px dashed #cbd7e8; background: #fafbfd; }
.portal-body .form-check { margin-bottom: 8px; }
.portal-body .form-check-input { border: 1px solid #bdcadf; }
.portal-body .form-check-input:checked { background-color: var(--portal-primary); border-color: var(--portal-primary); }
.portal-body .ios-form-actions { justify-content: flex-start; border-top: 1px solid var(--portal-border); padding-top: 21px; }
.portal-body .ios-form-actions .ios-button { flex: 0 1 auto; min-width: 140px; }
.portal-toolbar, .portal-body .ios-filter-bar { background: #fff; border: 1px solid var(--portal-border); border-radius: 11px; padding: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.portal-directory-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.portal-search { display: flex; align-items: center; gap: 9px; border: 1px solid #dce3ed; background: #fff; border-radius: 9px; padding: 10px 13px; width: min(100%,350px); color: #8b99af; }
.portal-search:focus-within { border-color: #90abeb; box-shadow: 0 0 0 3px #edf3ff; }
.portal-search input { font: inherit; font-size: 14px; border: 0; outline: none!important; background: transparent; min-width: 0; width: 100%; color: var(--portal-ink); }
.portal-search .portal-icon { width: 17px; height: 17px; flex-basis: 17px; }
.portal-result-count { color: #7b899f; font-size: 13px; }
.portal-no-results { text-align: center; color: #6c7c94; padding: 25px; background: #fff; border: 1px solid var(--portal-border); border-radius: 10px; margin-top: 12px; }
.portal-body .ios-table-container, .portal-body .table-responsive { border: 1px solid var(--portal-border); background: #fff; border-radius: 12px; box-shadow: 0 2px 5px #192a4403; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portal-body :is(.ios-table,.table) { width: 100%; color: var(--portal-ink); font-size: 15px; margin-bottom: 0; border-color: #edf0f5; }
.portal-body :is(.ios-table,.table) th { background: #fafbfd; color: #6d7f99; font-size: 12px; font-weight: 650; letter-spacing: .55px; text-transform: uppercase; white-space: nowrap; padding: 14px 18px; border-bottom: 1px solid var(--portal-border); }
.portal-body :is(.ios-table,.table) td { color: #36455e; font-size: 14px; padding: 17px 18px; border-bottom: 1px solid #edf0f5; vertical-align: middle; line-height: 1.5; }
.portal-body :is(.ios-table,.table) tbody tr:last-child td { border-bottom: 0; }
.portal-body :is(.ios-table,.table) tbody tr:hover td { background-color: #f8faff; }
.portal-body .table-striped>tbody>tr:nth-of-type(odd)>* { --bs-table-accent-bg: transparent; color: inherit; }
.portal-body :is(.ios-action-group,.portal-table-actions) { display: flex; align-items: center; flex-wrap: nowrap; gap: 7px; }
.portal-body .ios-action-btn { border: 1px solid #e2e8f2; border-radius: 7px; box-shadow: none; background: #f7f9fd; color: #526c96; min-width: 32px; min-height: 32px; font-size: 13px; }
.portal-body .ios-action-btn-delete { color: #b55162; background: #fff6f7; border-color: #f2dfe4; }
.portal-body .ios-badge, .portal-body .badge { padding: 4px 8px; font-size: 12px; line-height: 1.4; font-weight: 600; border-radius: 5px; }
.portal-body .ios-alert, .portal-body .alert { border-radius: 9px; font-size: 15px; border-width: 1px; box-shadow: none; padding: 14px 17px; }
.portal-body .ios-alert-success { color: #287158; background: #eff8f3; border-color: #d7ebdf; }
.portal-body .ios-alert-danger { color: #a73d4e; background: #fff2f4; border-color: #f2dce1; }
.portal-body :is(.ios-modal-overlay,.ios-filter-modal) { z-index: 1200; }
.portal-body .ios-grid { gap: 22px; }
.portal-body dl.row { background: #fafbfd; border: 1px solid var(--portal-border); padding: 20px; }
.portal-body dt { color: #6f7e95; font-size: 14px; }
.portal-body dd { font-size: 16px; }
.portal-body .portal-main .access-workspace { padding: 0; max-width: none; }
.portal-body .portal-main .ac-editor-sidebar { top: 24px; }
.portal-body .portal-main .ac-page-heading h1 { padding: 0; }
.portal-body .portal-main>.container, .portal-body .portal-main>.container-fluid { padding: 0; background: transparent; box-shadow: none; }

/* Dashboard. Counts describe available navigation, never business totals. */
.portal-workspace-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #7b89a0; white-space: nowrap; }
.portal-workspace-label>span { width: 6px; height: 6px; border-radius: 50%; background: #649c8c; }
.portal-overview-banner { display: flex; align-items: center; gap: 21px; padding: 25px 28px; border: 1px solid #dfe7f8; border-radius: 13px; background: #eef3fd; margin-bottom: 34px; }
.portal-overview-symbol { display: grid; place-items: center; width: 52px; height: 52px; flex-shrink: 0; background: #fff; border: 1px solid #e0e8f7; border-radius: 14px; color: #5279cc; }
.portal-overview-symbol .portal-icon { width: 25px; height: 25px; }
.portal-overview-banner h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.35px; color: #284777; }
.portal-overview-banner p { font-size: 14px; color: #7186a8; margin: 0; }
.portal-overview-count { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #8091ad; font-size: 12px; }
.portal-overview-count strong { font-size: 34px; font-weight: 650; letter-spacing: -1px; color: #5275b7; }
.portal-overview-count span { width: 65px; }
.portal-module-section { margin-bottom: 30px; }
.portal-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 15px; }
.portal-section-heading h2 { font-size: 16px; margin: 0; letter-spacing: -.2px; }
.portal-section-heading>span { font-size: 12px; color: #8491a5; }
.portal-module-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.portal-module-card { display: flex; align-items: center; gap: 15px; padding: 22px; min-height: 100px; background: #fff; border: 1px solid var(--portal-border); border-radius: 11px; color: var(--portal-ink); transition: border-color .15s,box-shadow .15s; }
.portal-module-card:hover { color: var(--portal-ink); border-color: #b9caec; box-shadow: 0 3px 12px #344e7b08; }
.portal-module-icon { display: grid; place-items: center; width: 40px; height: 40px; background: #f2f5fb; border: 1px solid #e8edf6; color: #6480b2; border-radius: 11px; flex-shrink: 0; }
.portal-module-card h3 { font-size: 16px; margin: 0 0 5px; letter-spacing: -.2px; }
.portal-module-card p { margin: 0; font-size: 13px; color: #8491a5; line-height: 1.6; }
.portal-module-arrow { margin-left: auto; color: #9aabc6; }
.portal-module-arrow .portal-icon { width: 17px; height: 17px; }
.portal-access-shortcut { display: flex; align-items: center; gap: 15px; padding: 18px 22px; border: 1px dashed #d1dcec; border-radius: 11px; color: #55709a; background: #f9fbff; }
.portal-access-shortcut strong { display: block; font-size: 14px; }
.portal-access-shortcut small { display: block; font-size: 12px; color: #8b99ad; margin-top: 4px; }
.portal-access-shortcut>.portal-icon { margin-left: auto; }
.portal-body .portal-team-create { max-width: 720px; }
.portal-team-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 25px; }
.portal-body .portal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.portal-body .portal-directory-summary { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; padding: 18px 21px; background: #fff; border: 1px solid var(--portal-border); border-radius: 11px; }
.portal-directory-summary strong { font-size: 25px; font-weight: 650; letter-spacing: -.8px; }
.portal-directory-summary span { color: #8390a5; font-size: 14px; }
.portal-password { color: #8390a5; font-size: 14px; }
.portal-password summary { cursor: pointer; font-size: 13px; color: #667eaa; }
.portal-password code { display: inline-block; margin-top: 7px; padding: 4px 7px; background: #f6f8fc; color: #64728a; border-radius: 4px; }

@media (min-width: 1600px) { .portal-module-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1199px) {
    :root { --portal-sidebar: 216px; }
    .portal-topbar { padding: 0 25px; }
    .portal-body main.portal-main { padding: 28px 25px 34px; }
    .portal-footer { padding: 16px 25px; }
    .portal-overview-count { display: none; }
    .portal-module-card { padding: 19px; }
    .portal-workspace-label { display: none; }
}
@media (max-width: 1023px) {
    .portal-sidebar { width: 280px; max-width: calc(100vw - 40px); transform: translateX(-100%); transition: transform .2s ease; z-index: 1040; padding-top: max(20px,env(safe-area-inset-top)); box-shadow: 12px 0 40px #182d571a; }
    .portal-content { margin-left: 0; }
    .portal-topbar { height: 63px; position: sticky; top: 0; z-index: 1000; padding: 0 22px; }
    .portal-menu-toggle, .portal-menu-close { display: inline-flex; }
    .portal-brand-row { margin-bottom: 24px; padding-right: 0; }
    .portal-menu-close { width: 31px; height: 31px; border: 0; background: #f5f7fb; }
    .portal-menu-close .portal-icon { width: 16px; height: 16px; }
    .portal-backdrop { position: fixed; inset: 0; background: #17294766; z-index: 1030; }
    .portal-nav-open { overflow: hidden; }
    .portal-nav-open .portal-sidebar { transform: translateX(0); }
    .portal-nav-open .portal-backdrop { display: block; }
    .portal-body main.portal-main { min-height: calc(100vh - 115px); }
    .portal-body:not(.portal-ready) .portal-sidebar { position: static; width: 100%; max-width: none; transform: none; box-shadow: none; }
    .portal-body:not(.portal-ready) .portal-menu-toggle, .portal-body:not(.portal-ready) .portal-menu-close { display: none; }
}
@media (max-width: 767px) {
    .portal-topbar { padding: 0 17px; gap: 12px; }
    .portal-topbar-leading { gap: 11px; }
    .portal-breadcrumb { font-size: 14px; }
    .portal-breadcrumb>a, .portal-breadcrumb>.portal-icon { display: none; }
    .portal-topbar-user>span:first-child { display: none; }
    .portal-body main.portal-main { padding: 25px 18px 30px; }
    .portal-footer { padding: 15px 18px; }
    .portal-body h1, .portal-body .ios-page-title, .portal-body .ios-list-title { font-size: 26px; letter-spacing: -.65px; }
    .portal-page-heading, .portal-body .ios-top-bar-content { align-items: flex-start; gap: 18px; }
    .portal-page-heading { flex-direction: column; margin-bottom: 23px; }
    .portal-description, .portal-body .portal-description { font-size: 14px; }
    .portal-body .ios-top-bar { margin-bottom: 22px; }
    .portal-body :is(.ios-top-bar-actions,.portal-actions) { width: 100%; gap: 8px; }
    .portal-body :is(.btn,.ios-btn-primary,.ios-btn-secondary,.ios-button) { width: auto; margin-bottom: 0; }
    .portal-body :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select) { font-size: 16px; }
    .portal-body :is(.ios-section-card,.ios-details-card,.ios-form-container,.portal-panel,.card-body) { padding: 20px; }
    .portal-body .ios-details-row { gap: 5px; flex-direction: column; }
    .portal-body .ios-details-label { flex: auto; }
    .portal-body .ios-filter-bar>* { max-width: 100%; }
    .portal-body .ios-filter-bar :is(input,select) { width: 100%!important; min-width: 0; }
    .portal-body :is(.ios-table,.table) th { padding: 12px 14px; }
    .portal-body :is(.ios-table,.table) td { padding: 15px 14px; }
    .portal-body .ios-stats { gap: 5px; }
    .portal-body .ios-form-actions .ios-button { flex: 1 1 130px; }
    .portal-body .ios-grid-2 { grid-template-columns: minmax(0,1fr); }
    .portal-body .ios-grid>div { min-width: 0; }
    .portal-overview-banner { padding: 20px; gap: 14px; margin-bottom: 28px; }
    .portal-overview-symbol { width: 43px; height: 43px; border-radius: 11px; }
    .portal-overview-banner h2 { font-size: 17px; }
    .portal-overview-banner p { font-size: 13px; }
    .portal-module-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
    .portal-module-card { min-height: 90px; padding: 18px; }
    .portal-section-heading>span { font-size: 12px; }
    .portal-access-shortcut { padding: 17px; gap: 12px; }
    .portal-access-shortcut small { font-size: 12px; line-height: 1.6; }
    .portal-directory-tools { align-items: stretch; gap: 11px; }
    .portal-search { width: 100%; }
    .portal-search input { font-size: 16px; }
    .portal-directory-summary { padding: 15px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-body *, .portal-body *::before, .portal-body *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; transition-duration: .01ms!important; }
}
.portal-table-link { border: 0; padding: 0; background: none; color: var(--portal-primary); font: inherit; font-weight: 600; text-align: left; }
.portal-table-link:hover { text-decoration: underline; }
.portal-body .validation-summary-valid { display: none; }
.portal-sidebar .portal-navigation { scrollbar-width: thin; scrollbar-color: #e3e8f1 transparent; }
.portal-sidebar .portal-navigation::-webkit-scrollbar { width: 4px; }
.portal-sidebar .portal-navigation::-webkit-scrollbar-thumb { background: #e3e8f1; border-radius: 4px; }
.portal-body .ios-card { background: #fff; border: 1px solid var(--portal-border); border-radius: 13px; padding: 24px; box-shadow: 0 2px 5px #192a4403; }
.portal-body .ios-card:active { transform: none; }
.portal-body .portal-record-form { max-width: 720px; }
.portal-body .ios-login-page { background: transparent; min-height: calc(100vh - 230px); padding: 20px 0 35px; }
.portal-body .ios-login-header { margin-bottom: 25px; }
.portal-body .ios-login-emblem { width: 64px; height: 76px; object-fit: contain; margin-bottom: 23px; }
.portal-body h1.ios-login-title { font-size: 26px; letter-spacing: -.5px; line-height: 1.35; }
.portal-body .ios-login-card { border: 1px solid var(--portal-border); border-radius: 13px; padding: 29px; box-shadow: 0 5px 20px #22385d06; }
.portal-public .portal-sidebar, .portal-public .portal-menu-toggle { display: none!important; }
.portal-public .portal-content { margin-left: 0; }
.portal-public .portal-topbar { justify-content: center; }
.portal-body .ios-login-card #login-submit { width: 100%; }
@media(max-width:767px) { .portal-body .ios-card { padding: 19px; } .portal-body .ios-card>div[style*="justify-content: space-between"] { flex-wrap: wrap; gap: 12px; } }
@media(min-width:1024px) {
    .portal-sidebar { padding-top: 22px; padding-bottom: 16px; }
    .portal-brand-row { margin-bottom: 22px; }
    .portal-nav-link { min-height: 38px; padding-top: 8px; padding-bottom: 8px; margin: 0; }
    .portal-nav-group { margin-top: 14px; }
    .portal-nav-label { padding-bottom: 6px; }
    .portal-account { padding-top: 13px; margin-top: 15px; }
    .portal-account-person { margin-bottom: 10px; }
}
/* Secondary copy stays readable at the compact desktop scale. */
.portal-module-card p, .portal-section-heading>span, .portal-workspace-label, .portal-access-shortcut small,
.portal-result-count, .portal-directory-summary span, .portal-overview-banner p, .portal-overview-count,
.portal-breadcrumb a, .portal-brand small, .portal-account-person small, .portal-footer { color: #68788f; }
.portal-body .btn-outline-success { background: #f3faf6; border-color: #d4e7dc; color: #32795c; }
.portal-body .btn-outline-success:hover { background: #e9f5ee; border-color: #b9d8c6; color: #246448; }
.portal-body .btn-success { background: #2b7c5d; border-color: #2b7c5d; color: #fff; }
.portal-body .btn-warning, .portal-body .btn-outline-warning { background: #fff8ec; border-color: #eddfbf; color: #8f6426; }
.portal-body h2, .portal-body h3 { color: var(--portal-ink); }
.portal-body .portal-table-actions-cell { white-space: nowrap; }
.portal-topbar-user { min-width: 0; }
.portal-topbar-user>span:first-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-table-actions-cell .ios-action-btn { display: inline-flex; vertical-align: middle; }
@media(max-width:1023px) {
    .portal-ready .portal-sidebar { visibility: hidden; }
    .portal-ready.portal-nav-open .portal-sidebar { visibility: visible; }
}

/* Desktop workspace: retain the page hierarchy with a denser, full-width canvas. */
@media (min-width: 1024px) {
    body.portal-body { font-size: 14px; --portal-background: #f3f5f8; --portal-border: #dce2ea; }
    .portal-sidebar { padding: 18px 12px 14px; }
    .portal-brand-row { margin-bottom: 22px; }
    .portal-nav-link { min-height: 34px; padding: 6px 12px; border-radius: 5px; font-size: 14px; }
    .portal-nav-group { margin-top: 16px; }
    .portal-nav-label { padding: 0 12px 6px; font-size: 11px; letter-spacing: .7px; }
    .portal-topbar { height: 56px; padding: 0 24px; }
    .portal-body main.portal-main { width: 100%; max-width: none; margin: 0; padding: 24px; min-height: calc(100vh - 101px); }
    .portal-footer { padding: 12px 24px; }
    .portal-page-heading, .portal-body .ios-top-bar, .portal-body .ios-list-top-bar { margin-bottom: 20px; }
    .portal-body .portal-main :is(h1,.ios-page-title,.ios-list-title) { font-size: 24px; line-height: 1.3; letter-spacing: -.45px; }
    .portal-description, .portal-body .portal-description { font-size: 14px; margin-top: 6px; }
    .portal-body .portal-main :is(.portal-panel,.ios-section-card,.ios-details-card,.ios-detail-card,.ios-form-container,.ios-card,.card) { border-radius: 7px; box-shadow: none; }
    .portal-panel, .portal-body .ios-card { padding: 20px; margin-bottom: 18px; }
    .portal-body .card-body { padding: 18px 20px; }
    .portal-body .card-header, .portal-body .ios-detail-card-header { padding: 12px 20px; }
    .portal-body .ios-form-container, .portal-body .portal-record-form, .portal-body .portal-team-create { width: 100%; max-width: 1080px; margin-left: 0; margin-right: 0; padding: 20px; }
    .portal-body .ios-detail-page { max-width: none; margin: 0; }
    .portal-body .ios-detail-header { padding-bottom: 18px; }
    .portal-body .ios-detail-back { margin-bottom: 14px; }
    .portal-body .ios-details-value { font-size: 14px; }
    .portal-body .portal-main :is(.ios-btn-primary,.ios-btn-secondary,.ios-btn-danger,.ios-button,.ios-detail-btn,.btn) { min-height: 36px; padding: 6px 12px; border-radius: 5px; font-size: 14px; }
    .portal-body .portal-main :is(.btn-sm,.ios-btn-sm) { min-height: 30px; padding: 4px 9px; font-size: 13px; }
    .portal-body .portal-main :is(.ios-btn-primary,.ios-btn-secondary,.ios-btn-danger,.ios-button)[style*="font-size"] { font-size: 14px !important; }
    .portal-body .portal-main :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select) { min-height: 36px; padding: 6px 10px; border-radius: 5px; font-size: 14px; }
    .portal-body .portal-main :is(.ios-form-control,.ios-form-select,.ios-input,.form-control,.form-select)[style*="font-size"] { font-size: 14px !important; }
    .portal-body :is(.ios-form-label,.form-label,.ios-label) { font-size: 13px; margin-bottom: 6px; }
    .portal-body .ios-form-actions { padding-top: 16px; }
    .portal-body .ios-form-actions .ios-button { min-width: 110px; }
    .portal-toolbar, .portal-body .ios-filter-bar { padding: 12px 14px; gap: 10px; border-radius: 6px; margin-bottom: 16px; }
    .portal-search { padding: 7px 10px; border-radius: 5px; }
    .portal-directory-tools { margin-bottom: 14px; }
    .portal-body .ios-table-container, .portal-body .table-responsive { border-radius: 6px; box-shadow: none; }
    .portal-body :is(.ios-table,.table) th { padding: 10px 14px; font-size: 12px; letter-spacing: .3px; }
    .portal-body :is(.ios-table,.table) td { padding: 10px 14px; font-size: 14px; }
    .portal-body :is(.ios-table,.table) td[style*="font-size"] { font-size: 14px !important; }
    .portal-body .ios-stats { margin-top: 12px; }
    .portal-body .portal-directory-summary { padding: 12px 16px; margin-bottom: 16px; border-radius: 6px; }
    .portal-directory-summary strong { font-size: 22px; }
    .portal-module-section { margin-bottom: 24px; }
    .portal-section-heading { margin-bottom: 10px; }
    .portal-module-grid { gap: 10px; }
    .portal-module-card { min-height: 68px; padding: 14px 18px; gap: 12px; border-radius: 6px; }
    .portal-module-card:hover { transform: none; box-shadow: none; border-color: #aebfda; }
    .portal-module-card h3 { font-size: 15px; margin-bottom: 0; }
    .portal-module-icon { width: 34px; height: 34px; border-radius: 6px; }
    .portal-module-icon .portal-icon { width: 19px; height: 19px; }
    .portal-access-shortcut { padding: 12px 18px; border-radius: 6px; }
    .portal-body .ios-btn-capsule { border-radius: 5px; }
    .portal-body .ios-btn-capsule-item { min-height: 36px; }
    .portal-body .ios-filter-modal { align-items: center; padding: 24px; z-index: 1055; }
    .portal-body .ios-filter-sheet { border-radius: 8px; max-height: calc(100dvh - 48px); border: 1px solid var(--portal-border); box-shadow: 0 18px 60px #17294733; animation: none; }
    .portal-body .ios-filter-title { font-size: 17px; }
    .portal-body .ios-filter-option { padding: 9px 0; }
}
