:root {
    --portal-red: #d62f36;
    --portal-red-soft: #fef2f2;
    --portal-text: #17212f;
    --portal-muted: #667085;
    --portal-border: #e4e8ee;
    --portal-surface: #fff;
    --portal-bg: #f7f8fa;
}
.fi-body { background: var(--portal-bg); }
.fi-topbar nav { box-shadow: none; border-bottom: 1px solid var(--portal-border); }
.fi-sidebar { background: #fff; border-inline-end: 1px solid var(--portal-border); }
.fi-sidebar-group-label { color: #667085; font-size: .72rem; font-weight: 700; letter-spacing: .045em; }
.fi-sidebar-item-button { border-radius: .6rem; transition: background-color .15s ease; }
.fi-main { padding-bottom: 2.5rem; }
/* One SVG keeps the NIER lettering and portal title on the same baseline. */
.portal-brand { display: block; width: 15.75rem; max-width: 100%; }
.portal-brand__image { display: block; width: 100%; height: auto; }
.fi-simple-header .portal-brand { width: 17.5rem; }
.portal-footer { padding: 1.1rem 1.5rem; color: #7b8493; font-size: .75rem; text-align: center; border-top: 1px solid var(--portal-border); background: #fff; }
.portal-footer a { color: var(--portal-red); }
.portal-dashboard { display: grid; gap: 1.5rem; }
.portal-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.8rem 2rem; border-radius: 1rem; background: var(--portal-surface); border: 1px solid var(--portal-border); border-top: 3px solid var(--portal-red); }
.portal-hero__eyebrow { display: flex; align-items: center; gap: .6rem; color: var(--portal-muted); font-size: .78rem; margin-bottom: .75rem; }
.portal-hero h2 { color: var(--portal-text); font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.25; }
.portal-hero p { margin-top: .6rem; color: var(--portal-muted); max-width: 44rem; font-size: .92rem; line-height: 1.6; }
.portal-hero__actions { display: flex; gap: .6rem; flex-wrap: wrap; flex: none; }
.portal-badge { display: inline-flex; align-items: center; padding: .28rem .6rem; border-radius: 99px; font-size: .7rem; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.portal-badge--red { background: #fff0f1; color: #b4232d; }
.portal-badge--amber { background: #fff7e6; color: #925b07; }
.portal-badge--green { background: #eaf8f0; color: #24704b; }
.portal-badge--blue { background: #edf4ff; color: #2d5e9d; }
.portal-badge--gray { background: #f0f2f5; color: #596273; }
.portal-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.portal-metric { background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: .9rem; padding: 1.2rem 1.3rem; display: grid; grid-template-columns: 1fr auto; gap: .45rem .7rem; transition: border-color .15s ease, transform .15s ease; }
.portal-metric:hover { border-color: #c8ced8; transform: translateY(-1px); }
.portal-metric__label { color: var(--portal-muted); font-size: .8rem; font-weight: 600; }
.portal-metric__value { color: var(--portal-text); font-size: 2rem; font-weight: 750; letter-spacing: -.05em; line-height: 1.15; }
.portal-metric__description { grid-column: 1 / -1; color: var(--portal-muted); font-size: .75rem; margin-top: .15rem; }
.portal-metric__icon { grid-column: 2; grid-row: 1 / 3; width: 2.6rem; height: 2.6rem; padding: .65rem; border-radius: .7rem; }
.portal-tone-red { background: #fff0f1; color: #d12d36; }
.portal-tone-blue { background: #edf4ff; color: #4274bd; }
.portal-tone-green { background: #eaf8f0; color: #288159; }
.portal-tone-amber { background: #fff7e6; color: #b77717; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.portal-card { background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: .9rem; overflow: hidden; min-width: 0; }
.portal-card__head { padding: 1.15rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--portal-border); }
.portal-card__head h3 { color: var(--portal-text); font-size: .95rem; font-weight: 700; }
.portal-card__subtitle { font-size: .75rem; color: var(--portal-muted); margin-top: .2rem; }
.portal-grid--attention { align-items: stretch; }
.portal-contact-card { display: flex; flex-direction: column; }
.portal-count-summary { display: grid; justify-items: center; gap: .45rem; padding: 1.25rem 1.3rem; text-align: center; }
.portal-count-summary strong { color: var(--portal-text); font-size: 2rem; font-weight: 750; line-height: 1.15; }
.portal-count-summary p { color: var(--portal-muted); font-size: .76rem; line-height: 1.5; }
.portal-contact-card > .portal-count-summary { flex: 1; align-content: center; }
a.portal-count-summary:hover { background: #f7f8fa; }
.portal-inline-link { font-size: .78rem; color: var(--portal-red); font-weight: 650; white-space: nowrap; }
.portal-attention { list-style: none; padding: .65rem 1.3rem; }
.portal-attention li + li { border-top: 1px solid #eef0f3; }
.portal-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.portal-notice strong { display: block; color: var(--portal-text); font-size: .83rem; font-weight: 650; }
.portal-notice p { color: var(--portal-muted); font-size: .76rem; line-height: 1.5; margin-top: .3rem; }
.portal-notice .portal-badge { flex: none; font-size: .85rem; padding: .35rem .65rem; }
.portal-activity-list { list-style: none; padding: .4rem 1.3rem; }
.portal-activity-list li + li { border-top: 1px solid #eef0f3; }
.portal-activity { padding: .85rem 0; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.portal-activity__body { display: grid; gap: .25rem; min-width: 0; }
.portal-activity__title { font-size: .83rem; font-weight: 650; color: var(--portal-text); overflow-wrap: anywhere; }
.portal-activity__description { color: var(--portal-muted); font-size: .76rem; overflow-wrap: anywhere; }
.portal-activity__meta { color: #89919d; font-size: .7rem; }
.portal-activity__end { display: flex; align-items: flex-end; gap: .5rem; flex-direction: column; flex: none; }
.portal-chevron { width: .85rem; height: .85rem; color: #adb4bf; }
.portal-empty { display: grid; justify-items: center; text-align: center; padding: 1.7rem 1.3rem; gap: .4rem; }
.portal-empty__icon { width: 1.8rem; height: 1.8rem; color: #a8b2c0; margin-bottom: .35rem; }
.portal-empty__title { color: #515e70; font-size: .83rem; font-weight: 600; }
.portal-empty__description { color: #8a94a3; font-size: .76rem; line-height: 1.6; max-width: 32rem; }
.portal-empty .portal-inline-link { margin-top: .5rem; }
.portal-section-label { font-size: .82rem; font-weight: 650; color: #5c6575; margin-bottom: -.5rem; }
.portal-card--wide { grid-column: 1 / -1; }
a:focus-visible.portal-metric, a:focus-visible.portal-activity, a:focus-visible.portal-notice, a:focus-visible.portal-count-summary { outline: 2px solid var(--portal-red); outline-offset: 3px; }
@media (max-width: 1100px) { .portal-hero { align-items: flex-start; flex-direction: column; } }
@media (max-width: 700px) {
    .portal-grid { grid-template-columns: 1fr; gap: 1rem; }
    .portal-dashboard { gap: 1rem; }
    .portal-hero { padding: 1.25rem; }
    .portal-metrics { grid-template-columns: 1fr 1fr; gap: .65rem; }
    .portal-metric { padding: 1rem; }
    .portal-metric__icon { width: 1.9rem; height: 1.9rem; padding: .4rem; }
    .portal-metric__value { font-size: 1.7rem; }
    .portal-metric__label { font-size: .72rem; }
    .portal-card__head { padding: 1rem; }
    .portal-activity-list, .portal-attention { padding-left: 1rem; padding-right: 1rem; }
    .portal-brand { width: 14.25rem; }
    .portal-footer { padding: 1rem; font-size: .7rem; }
}
@media (max-width: 370px) { .portal-metrics { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .fi-simple-header .portal-brand { width: 15.25rem; } }

/* Backup: keep explanatory text, status and actions visually separate. */
.portal-data-management { display: grid; gap: 1.5rem; }
.portal-data-management p { line-height: 1.7; }
.portal-backup-status { margin-top: 1rem; }
.portal-backup-actions, .portal-section-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.portal-backup-preview { margin-top: 1.5rem; padding: 1.4rem; border: 1px solid var(--portal-border); border-radius: .75rem; background: #fafbfd; }
.portal-backup-preview p { margin-top: .7rem; }
.portal-backup-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1.25rem; margin-bottom: 1rem; }
.portal-backup-link { display: inline-flex; margin-top: 1.3rem; }
.portal-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.portal-guide-grid p { line-height: 1.7; }
@media (max-width: 700px) { .portal-guide-grid { grid-template-columns: 1fr; } }
