/* Portal shell + components. ONE copy for BOTH hosts: the Blazor PortalLayout (legacy routes)
   and Areas/Portal _PortalLayout.cshtml (real /portal/* MVC islands). Keep tokens from app.css. */
    /* Themed via the main app tokens (app.css) so the portal follows light/dark
       like the rest of the site; the brand blue is the --portal-brand token. */
    .portal-shell { min-height:100vh; display:flex; flex-direction:column; background:var(--page-grad); background-color:var(--bg); font-family:var(--font-body); color:var(--text); }
    .portal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 24px;
        background:var(--card); border-bottom:1px solid var(--hairline); color:var(--heading); }
    .portal-brand { display:flex; align-items:center; text-decoration:none; }
    .portal-brand img { height:28px; width:auto; display:block; }
    .portal-logout { margin:0; }
    .portal-logout-btn { background:var(--card); border:1.5px solid var(--hairline); color:var(--heading);
        padding:6px 14px; border-radius:9px; font-weight:600; font-size:13px; cursor:pointer; text-decoration:none;
        transition:border-color .14s, color .14s; }
    .portal-logout-btn:hover { border-color:var(--blue); color:var(--blue); }
    .portal-main { flex:1; width:100%; max-width:760px; margin:0 auto; padding:28px 20px; }
    .portal-footer { text-align:center; color:var(--text-3); font-size:12px; padding:18px; }
    .portal-card { background:var(--card); border:1px solid var(--hairline); border-radius:14px; box-shadow:var(--shadow-card); padding:28px; }
    .portal-card h1 { font-family:var(--font-display); font-size:clamp(1.375rem,1.9vw,1.625rem); font-weight:800; letter-spacing:-.015em; line-height:1.1; margin:0 0 6px; color:var(--heading); }
    .portal-muted { color:var(--text-3); font-size:14px; }
    .portal-field { margin:14px 0; }
    .portal-field label { display:block; font-weight:600; font-size:13px; margin-bottom:6px; }
    .portal-field input { width:100%; padding:11px 13px; border:1.5px solid var(--hairline); border-radius:10px;
        font-size:15px; background:var(--card); color:var(--text); transition:border-color .14s, box-shadow .14s; }
    .portal-field input:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(3,133,255,.18); }
    .portal-tinhint { font-family:var(--font-mono); font-size:20px; letter-spacing:2px; color:var(--blue-ink); background:var(--blue-soft); padding:10px 14px; border-radius:8px; display:inline-block; }
    .portal-btn { background:var(--blue); color:#fff; border:none; padding:12px 22px; border-radius:11px;
        font-weight:700; font-size:14.5px; cursor:pointer; width:100%; box-shadow:var(--shadow-button);
        transition:background .14s, transform .14s; }
    .portal-btn:hover { background:var(--blue-dk, #0270D9); transform:translateY(-1px); }
    .portal-btn:disabled { opacity:.5; cursor:not-allowed; }
    .portal-error { background:var(--danger-bg); border-left:4px solid var(--danger); color:var(--danger-text); padding:12px 16px; border-radius:0 8px 8px 0; margin:14px 0; font-size:14px; }
    .portal-consent { background:var(--bg-2); border:1px solid var(--hairline); border-radius:10px; padding:16px; font-size:12.5px; color:var(--text-2); white-space:pre-wrap; max-height:200px; overflow:auto; margin:14px 0; }
    .portal-year { font-weight:800; font-size:18px; margin:22px 0 10px; color:var(--blue-ink); }
    /* Portal pages inside the app shell: rows live in .payer-group cards on the app scale. */
    .portal-page .filings-topline { margin-bottom:16px; }
    .portal-pgroup { margin:14px 0 18px; }
    .portal-pgroup .portal-grow { display:flex; align-items:center; justify-content:space-between;
        gap:12px; flex-wrap:wrap; padding:13px 22px; border-top:1px solid var(--hairline); }
    .portal-pgroup .portal-grow:first-of-type { border-top:0; }
    .portal-grow-label { font-weight:600; font-size:14px; color:var(--heading); }
    .portal-grow-pad { padding:13px 22px; }
    .portal-pgroup .portal-badge { margin-top:6px; }
    .portal-badge { display:inline-block; margin-top:4px; padding:3px 10px; border-radius:999px;
        font-size:12px; font-weight:600; }
    .portal-badge-ok { background:var(--success-bg, #E8F7EE); color:var(--success-text, #157347); }
    .portal-badge-warn { background:var(--warning-bg, #FFF4E0); color:var(--warning-text, #8A5A00); }
    /* Portal-realm shell: mirrors the STAFF shell's scoped NavMenu/TopbarActions rules so the
       portal's own layout looks identical. Keep in sync with NavMenu.razor.css/TopbarActions.razor.css. */
    .portal-realm .sidebar-inner { display:flex; flex-direction:column; height:100%; padding:16px 0; }
    .portal-realm .sidebar-brand { display:flex; align-items:center; justify-content:center; gap:10px;
        padding:14px 18px 18px; text-decoration:none; margin:0 8px 8px; border-bottom:1px solid var(--hairline); }
    .portal-realm .sidebar-brand-img { height:46px; width:auto; max-width:100%; display:block; background:transparent; }
    .portal-realm .sidebar-brand-img.brand-dark { display:none; }
    :root[data-theme="dark"] .portal-realm .sidebar-brand-img.brand-light { display:none; }
    :root[data-theme="dark"] .portal-realm .sidebar-brand-img.brand-dark { display:block; }
    .portal-realm .sidebar-nav { padding:8px 12px; display:flex; flex-direction:column; gap:2px; flex:1; }
    .portal-realm .sidebar-link { display:flex; align-items:center; gap:12px; padding:9px 12px; border-radius:10px;
        color:var(--text-2); text-decoration:none; font-family:var(--font-body); font-size:14px; font-weight:600;
        transition:background 140ms ease, color 140ms ease; }
    .portal-realm .sidebar-link svg { width:18px; height:18px; flex-shrink:0; }
    .portal-realm .sidebar-link:hover { background:var(--bg-muted); color:var(--heading); text-decoration:underline; }
    .portal-realm .sidebar-link.active { background:var(--blue-soft); color:var(--blue); }
    .portal-realm .topbar-actions { display:flex; align-items:center; justify-content:flex-end; flex:1; gap:6px; }
    .portal-realm .topbar-scope-group { order:-1; margin-right:auto; display:flex; align-items:center; gap:8px; min-width:0; }
    .portal-realm .topbar-drop { position:relative; margin:0; }
    .portal-realm .topbar-drop > summary { display:flex; align-items:center; gap:9px; padding:5px 10px; }
    .portal-realm .topbar-drop .scope-ico { width:16px; height:16px; color:var(--text-3); flex:0 0 auto; }
    .portal-realm .topbar-drop .scope-co { display:flex; flex-direction:column; line-height:1.1; min-width:0; }
    .portal-realm .topbar-drop .scope-eyebrow { font-size:9px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--text-3); }
    .portal-realm .topbar-drop .scope-name { font-weight:700; font-size:12.5px; color:var(--heading);
        white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .portal-realm .topbar-drop .scope-menu { position:absolute; top:calc(100% + 6px); left:0; z-index:70; min-width:168px; margin-top:0; }
    .portal-topbar-email { font-size:12.5px; font-weight:600; color:var(--text-2); max-width:220px;
        white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

    .portal-consent-inline { margin:0 0 12px; }
    .portal-consent-inline > summary { cursor:pointer; font-weight:700; font-size:13.5px; color:var(--blue);
        padding:8px 0; list-style-position:inside; }
    .portal-consent-inline > summary:hover { color:var(--blue-dk, #0270D9); }
    .portal-consent-inline form { margin-top:10px; }
    .portal-form-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:14px 16px; background:var(--card); border:1px solid var(--hairline); border-radius:10px; margin-bottom:8px; }
    @media (max-width:400px) { .portal-header { padding:14px 16px; } .portal-main { padding:20px 14px; } .portal-card { padding:20px; } }
    .portal-row-actions { display:flex; align-items:center; gap:8px; }
    .portal-btn-secondary { color:var(--heading); font-weight:600; text-decoration:none; font-size:13.5px;
        padding:8px 12px; border:1.5px solid var(--hairline); border-radius:9px; transition:border-color .14s, color .14s; }
    .portal-btn-secondary:hover { border-color:var(--blue); color:var(--blue); }
    @media (max-width:600px) {
        .portal-form-row { flex-direction:column; align-items:flex-start; }
        .portal-row-actions { width:100%; }
        .portal-row-actions .portal-btn { width:auto; flex:1; }
        .portal-tinhint { font-size:17px; letter-spacing:1px; word-break:break-all; }
        .portal-view-top { flex-direction:column; align-items:stretch; }
        .portal-view-dl { width:100%; }
        .portal-viewer { height:60vh; }
    }
    @media (max-width:480px) {
        .portal-btn, .portal-btn-secondary { min-height:44px; }
        input[type="checkbox"], input[type="radio"] { min-width:20px; min-height:20px; }
    }
