/* Compact dark portal. Presentation only; roles and account logic are unchanged. */
:root{color-scheme:dark;--ink:#e0e3e8;--muted:#aeb4be;--line:#41444b;--accent:#5c89ff;--surface:#292b30;--page:#202124;--teal:#27292d;--sidebar-width:224px;--topbar-height:48px}
body.portal-body,body.auth-body{background:var(--page);color:var(--ink);font-family:"Segoe UI",Arial,sans-serif;font-size:13px;line-height:1.45}
body.portal-body a,body.auth-body a{color:#b9d2ff}
body.portal-body a:hover,body.auth-body a:hover{color:#fff}
body.portal-body :focus-visible,body.auth-body :focus-visible{outline:2px solid #82a7ff;outline-offset:2px}
body.portal-body .portal-header{position:fixed;z-index:40;left:var(--sidebar-width);right:0;top:0;height:var(--topbar-height);padding:0 16px 0 10px;gap:12px;background:#2d2f33;border-bottom:1px solid #51545a;box-shadow:none}
.portal-menu-toggle,.portal-sidebar-close{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:4px;background:transparent;color:#e4e7ec;border:1px solid transparent;border-radius:3px;cursor:pointer}
.portal-menu-toggle:hover,.portal-sidebar-close:hover{background:#41444a}
.portal-topline{display:flex;align-items:center;gap:10px;min-width:0;flex:1;font-size:12px}
.portal-topline>strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.portal-topline>span{color:#8e96a2}
body.portal-body .portal-user{gap:12px;font-size:11px;flex-shrink:0}
body.portal-body .portal-user small{color:#aeb4be;font-size:10px}
body.portal-body .portal-user a{white-space:nowrap}
body.portal-body .portal-user form{margin:0}
body.portal-body .portal-signout{padding:5px 9px;border-color:#51545b;background:#383b40;color:#e4e7ec;border-radius:3px;font-size:11px}
.portal-sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);display:flex;flex-direction:column;z-index:50;background:#282a2e;border-right:1px solid #3f4248;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#565a62 #282a2e}
.portal-sidebar-heading{height:var(--topbar-height);min-height:var(--topbar-height);display:flex;align-items:center;justify-content:space-between;padding:0 17px;border-bottom:1px solid #51545a}
body.portal-body .portal-brand{gap:5px;font-size:17px;font-weight:600;letter-spacing:.3px;color:#e2e5eb;white-space:nowrap}
.portal-brand>span{font-weight:400;color:#b8bfc9}
.portal-sidebar-close{display:none}
body.portal-body .portal-nav{display:flex;flex-direction:column;flex-wrap:nowrap;gap:1px;padding:10px 0 20px;background:transparent;border:0;flex:1}
body.portal-body .portal-nav>a,body.portal-body .portal-nav-group summary{display:block;min-height:34px;padding:8px 15px;color:#c9cdd5;font-size:12px;line-height:18px;border:0;border-left:3px solid transparent;text-align:left;text-decoration:none;border-radius:0}
body.portal-body .portal-nav>a:hover,body.portal-body .portal-nav-group summary:hover{background:#33363c;color:#fff}
body.portal-body .portal-nav>a.active,body.portal-body .portal-nav-group summary.active{background:#30343c;border-left-color:#5986ff;color:#fff}
body.portal-body .portal-nav-group{position:static;min-width:0;margin:3px 0}
body.portal-body .portal-nav-group summary{list-style:none;cursor:pointer;position:relative;padding-right:30px;font-weight:600}
.portal-nav-group summary::-webkit-details-marker{display:none}
body.portal-body .portal-nav-group summary:after{content:"›";position:absolute;right:15px;top:7px;line-height:20px;font-size:17px;transform:rotate(0deg)}
body.portal-body .portal-nav-group[open]>summary:after{transform:rotate(90deg)}
body.portal-body .portal-subnav,body.portal-body .portal-downline-group .portal-subnav{position:static;display:block;min-width:0;padding:3px 0;background:#24262a;border:0;border-radius:0;box-shadow:none}
body.portal-body .portal-subnav a{display:block;min-height:31px;padding:6px 12px 6px 28px;border:0;border-left:3px solid transparent;border-radius:0;color:#bec6d3;font-size:12px;line-height:19px;text-align:left}
body.portal-body .portal-subnav a.active{background:#343840;color:#fff;border-left-color:#5986ff}
body.portal-body .portal-subnav a:hover{background:#363940;color:#fff}
.portal-sidebar-footer{padding:11px 17px;border-top:1px solid #3c3f45;color:#959da9;font-size:10px}
.portal-sidebar-footer a{display:block;margin-bottom:8px;font-size:12px}
body.portal-body fieldset{border-color:var(--line)}
.portal-sidebar-overlay{display:none}
body.portal-body .portal-shell{max-width:none;width:auto;margin:var(--topbar-height) 0 0 var(--sidebar-width);min-width:0}
body.portal-body .portal-main{padding:16px 20px 24px;min-height:calc(100dvh - 91px);min-width:0}
body.portal-body .portal-footer{padding:10px 20px;font-size:10px;border-color:var(--line);color:#949da9}
body.portal-sidebar-collapsed .portal-sidebar{display:none}
body.portal-sidebar-collapsed .portal-header{left:0}
body.portal-sidebar-collapsed .portal-shell{margin-left:0}
body.portal-body .page-heading{gap:12px;margin-bottom:12px;align-items:center}
body.portal-body .page-heading h1{font-size:21px;letter-spacing:0;line-height:1.25;margin:0 0 3px;color:#f0f1f4}
body.portal-body .page-heading p{font-size:12px;color:var(--muted)}
body.portal-body .eyebrow{font-size:9px;margin-bottom:4px;letter-spacing:.8px}
body.portal-body .directory-heading h1{font-size:20px}
.directory-trail{margin:0 0 10px;font-size:11px;gap:8px}
body.portal-body .panel,body.auth-body .auth-card{padding:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:4px;box-shadow:none}
body.portal-body .panel.data-panel{padding:0;border-radius:3px}
body.portal-body .panel h2{font-size:15px;margin:0 0 12px;color:#e4e8ef}
body.portal-body .panel-heading{gap:12px;margin-bottom:10px}
body.portal-body .portal-primary,body.portal-body .portal-section{margin:12px 0}
body.portal-body .portal-hint{font-size:11px;margin:10px 0;color:var(--muted)}
body.portal-body .button,body.auth-body .button{min-height:30px;padding:5px 11px;font-size:12px;line-height:18px;border-radius:3px;border:1px solid #555a64;background:#3a3e45;color:#e4e8f0;box-shadow:none}
body.portal-body .button:hover,body.auth-body .button:hover{background:#484d56;border-color:#788394;color:#fff}
body.portal-body .button.primary,body.auth-body .button.primary{background:#4779f5;border-color:#4779f5;color:#fff}
body.portal-body .button.primary:hover,body.auth-body .button.primary:hover{background:#5b89fc;border-color:#5b89fc}
body.portal-body .button.danger{background:#4b2d34;color:#ffb8c1;border-color:#88515c}
body.portal-body .button.small{min-height:25px;padding:3px 7px;font-size:11px;line-height:17px}
body.portal-body .actions{gap:7px}
body.portal-body .field{gap:5px;margin-bottom:12px;color:#c6ccd6;font-size:12px}
body.portal-body input:not([type=checkbox]):not([type=radio]):not([type=submit]),body.portal-body select,body.portal-body textarea,body.auth-body input,body.auth-body select{background:#34373d;color:#edf0f5;border:1px solid #565b64;border-radius:3px;box-shadow:none}
body.portal-body input::placeholder,body.portal-body textarea::placeholder,body.auth-body input::placeholder{color:#a3acba;opacity:1}
body.portal-body input:read-only{background:#2c2f34;color:#bac1cb}
body.portal-body input[type=checkbox],body.portal-body input[type=radio]{accent-color:#5d88f5}
body.portal-body .field input,body.portal-body .field select{padding:6px 9px;min-height:33px}
body.portal-body textarea{padding:8px 10px}
body.portal-body option{background:#34373d;color:#edf0f5}
body.portal-body .portal-filter{padding:10px 12px;gap:10px;background:#292c31;border-bottom:1px solid #42464e;align-items:flex-end}
body.portal-body .portal-filter label{font-size:10px;gap:4px;color:#b5bdc9;min-width:0}
body.portal-body .portal-filter input,body.portal-body .portal-filter select{height:31px;min-height:31px;padding:5px 8px;font-size:12px;line-height:19px}
body.portal-body .portal-agent-filter input[name="agent_id"],body.portal-body .portal-agent-filter input[name="site_id"]{width:100px}
body.portal-body .portal-agent-filter .portal-upline-filter{flex:0 1 280px;max-width:320px}
body.portal-body .portal-agent-filter input[name="q"]{width:190px}
body.portal-body .form-grid{gap:12px 16px}
body.portal-body .form-actions{gap:8px;margin-top:14px;padding-top:14px;border-color:var(--line)}
body.portal-body .help,body.portal-body .muted,body.portal-body .field small,body.auth-body .muted{color:var(--muted)}
body.portal-body .table-wrap{overflow:auto;max-width:100%;scrollbar-width:thin;scrollbar-color:#666d79 #292b30}
body.portal-body .portal-table{width:100%;border-collapse:collapse;font-size:12px;line-height:1.4;color:#dce1e9;background:#292b30}
body.portal-body .portal-table thead{display:table-header-group}
body.portal-body .portal-table tbody{display:table-row-group}
body.portal-body .portal-table tr{display:table-row;padding:0}
body.portal-body .portal-table th{padding:8px 9px;background:#41454c;color:#eef0f5;border:1px solid #50545c;font-size:10px;font-weight:600;letter-spacing:.3px;white-space:nowrap;text-align:left}
body.portal-body .portal-table td{display:table-cell;padding:6px 9px;font-size:12px;line-height:1.4;border:1px solid #3d4046;vertical-align:middle;white-space:nowrap;text-align:left;max-width:260px;min-width:0!important}
body.portal-body .portal-table td:before{display:none}
body.portal-body .portal-table td.portal-money,body.portal-body .portal-table th.portal-money{text-align:right}
body.portal-body .portal-table td.description{white-space:normal;min-width:150px!important;overflow-wrap:anywhere}
body.portal-body .portal-table td small{font-size:10px;color:#b4bdca;margin-top:2px}
body.portal-body .portal-table tbody tr:nth-child(even){background:#2c2e33}
body.portal-body .portal-table tbody tr:hover{background:#333841}
body.portal-body .portal-table td[colspan]{text-align:center;padding:18px}
body.portal-body .portal-row-actions{display:flex;flex-wrap:wrap;gap:4px 9px;font-size:11px}
body.portal-body .portal-agent-identity{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px}
body.portal-body .portal-agent-name{min-width:190px!important}
body.portal-body .portal-agent-inline-actions{display:flex;gap:4px;min-width:0;margin:0}
body.portal-body .portal-agent-inline-actions .button{min-height:22px;padding:1px 6px;font-size:10px;line-height:18px;background:#343943;border-color:#525b69;color:#bcd1f5}
body.portal-body .table-footer{padding:8px 12px;background:#26282d;border-color:var(--line);font-size:11px;color:var(--muted)}
body.portal-body .tabs{gap:6px;margin:0 0 12px;flex-wrap:wrap}
body.portal-body .tabs a{padding:6px 10px;border:1px solid #505764;border-radius:3px;background:#2b2e34;color:#c6d3e9;font-size:11px}
body.portal-body .tabs a.active{background:#334974;border-color:#6084cc;color:#edf4ff}
body.portal-body .portal-account-row{padding:10px 0;border-color:var(--line);font-size:12px}
body.portal-body .portal-account-row span{color:var(--muted);font-size:10px}
body.portal-body .portal-account-row .portal-money{font-size:13px;color:#dce8ff}
body.portal-body .portal-detail{gap:16px;margin:0}
body.portal-body .portal-detail dt{font-size:10px;color:var(--muted);margin-bottom:3px}
body.portal-body .portal-detail dd{font-size:13px;color:#e1e6ef}
body.portal-body .portal-cards{gap:10px;margin-bottom:14px}
body.portal-body .portal-card{background:#2b2e34;border:1px solid #464c56;border-radius:4px;padding:12px}
body.portal-body .portal-card strong{font-size:21px;color:#e8edf8}
body.portal-body .portal-card span,body.portal-body .portal-card small{color:var(--muted)}
body.portal-body .balance-breakdown>div{padding:9px 0;border-color:var(--line)}
body.portal-body .notice,body.auth-body .notice{background:#2c3d4f;border:1px solid #496582;color:#c9e1fa;border-radius:3px;padding:10px 13px;font-size:12px}
body.portal-body .notice.info{background:#293b50;border-color:#496582;color:#c4ddf8}
body.portal-body .notice.error,body.auth-body .notice.error{background:#4a2d34;border-color:#85505b;color:#ffd0d6}
body.portal-body .status-badge,body.portal-body .review-badge,body.portal-body .pt-badge{font-size:10px;border-radius:3px;padding:4px 7px}
body.portal-body .status-Approved,body.portal-body .review-matched,body.portal-body .pt-new{background:#234638;color:#9fe0bb}
body.portal-body .status-Pending,body.portal-body .review-review,body.portal-body .pt-review,body.portal-body .pt-possible{background:#4a3c24;color:#f0cf8b}
body.portal-body .status-Rejected,body.portal-body .status-Voided,body.portal-body .review-mismatch,body.portal-body .pt-changed,body.portal-body .pt-conflict{background:#4b2d35;color:#f2b5c1}
body.portal-body .status-Deleted,body.portal-body .role-locked{background:#393d44;color:#b9c1ce}
body.portal-body .review-coverage,body.portal-body .pt-duplicate,body.portal-body .pt-repeated,body.portal-body .pt-waiting{background:#2c405e;color:#b5d2ff}
body.portal-body .permission-groups{gap:16px;margin:16px 0}
body.portal-body .permission-group,body.portal-body .staff-role-matrix,body.portal-body .staff-role-row{border-color:var(--line);border-radius:4px}
body.portal-body .permission-group{padding:6px 14px 12px}
body.portal-body .permission-group legend{font-size:14px}
body.portal-body .permission-toggle{padding:10px 0;border-color:var(--line)}
body.portal-body .permission-track{background:#5b6370}
body.portal-body .permission-toggle input:checked+.permission-track{background:#4779f5}
body.portal-body .permission-on{color:#9fdfbd}
body.portal-body .permission-off{color:#a7b0be}
body.portal-body .permission-summary{padding:8px 0;border-color:var(--line)}
body.portal-body .staff-role-head{background:#3c424c;color:#e1e6ef;font-size:12px}
body.portal-body .staff-role-head,body.portal-body .staff-role-row{padding:10px 14px;gap:12px}
body.portal-body .site-visibility-choice{padding:5px 8px;min-height:32px;border-radius:3px}
body.portal-body .review-summary{background:#282f39;border-color:#454f5f;padding:14px;border-radius:4px;margin:14px 0}
body.portal-body .review-inline-stats{gap:8px;margin:10px 0}
body.portal-body .review-inline-stats>a,body.portal-body .review-inline-stats>span{background:#303641;border-color:#4c5667;padding:8px 12px;border-radius:3px}
body.portal-body .review-inline-stats strong{font-size:17px}
body.portal-body .review-evidence-grid{gap:12px}
body.portal-body .pt-mode{background:#293f36;border-color:#496858;color:#b4dfc8;border-radius:4px;padding:5px 9px}
body.portal-body .pt-step>span{background:#3c5a91}
body.portal-body .pt-step h2{font-size:17px}
body.portal-body .pt-section,body.portal-body .pt-result{margin:14px 0}
body.portal-body .pt-warning,body.portal-body .pt-feedback{background:#443b2b;color:#f1d8a4;border-color:#9f7a3b}
body.portal-body .pt-confirm{background:#303b45;border-color:#4f606d;color:#dae2ec}
body.portal-body .pt-feedback.pt-waiting{background:#2c405e;color:#b5d2ff}
body.portal-body .pt-raw th{background:#41454c;color:#e3e8f1}
body.portal-body .pt-raw td,body.portal-body .pt-raw th{border-color:#50545c;padding:6px 8px}
body.portal-body .pt-source pre{background:#23262c;color:#c8d6e9;padding:10px}
body.portal-body .pt-source,body.portal-body .pt-defaults,body.portal-body .pt-notes,body.portal-body .pt-result-heading p,body.portal-body .pt-values dt,body.portal-body .pt-explain p{color:#b5c0d0}
body.portal-body .pt-explain strong{color:#aac8ff}
body.portal-body .pt-result-heading,body.portal-body .pt-source,body.portal-body .pt-defaults,body.portal-body .pt-differences{border-color:var(--line)}
body.portal-body .pt-values{gap:14px;margin:16px 0}
body.portal-body .pt-values dd{font-size:13px;color:#e5e9f0}
body.portal-body .pt-summary-item{padding:10px 12px;border-color:#505764;border-radius:4px}
body.portal-body .pt-differences del{background:#4b2d35;color:#f2b5c1}
body.portal-body .pt-differences ins{background:#234638;color:#9fe0bb}
body.auth-body .auth-brand{color:#e0e7f2}
body.auth-body .portal-logo{background:#4779f5;color:#fff}
body.auth-body .auth-card{max-width:400px;padding:24px}
body.auth-body .auth-card h1{color:#f1f3f7}
body.auth-body .auth-note{color:#aeb9c8;border-color:var(--line)}
body.auth-body input,body.auth-body select{padding:9px 10px}
@media(min-width:901px){body.portal-body .portal-table td{max-width:240px}.portal-table .portal-agent-identity>a{max-width:220px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:1100px) and (min-width:901px){:root{--sidebar-width:204px}body.portal-body .portal-main{padding:14px}body.portal-body .portal-user-label{display:none}body.portal-body .portal-brand{font-size:15px}}
@media(max-width:900px){
 :root{--sidebar-width:248px}
 body.portal-body .portal-header{left:0;padding:0 10px;gap:8px}
 body.portal-body .portal-shell{margin-left:0}
 body.portal-body .portal-sidebar{display:flex;transform:translateX(-100%);transition:transform .18s ease;z-index:70;visibility:hidden}
 body.portal-body.portal-nav-open .portal-sidebar{transform:translateX(0);visibility:visible}
 body.portal-body.portal-nav-open{overflow:hidden}
 .portal-sidebar-close{display:inline-flex;font-size:24px}
 body.portal-body .portal-sidebar-overlay:not([hidden]){display:block;position:fixed;inset:0;z-index:60;background:#0009;border:0;padding:0;cursor:pointer}
 body.portal-body .portal-main{padding:12px}
 body.portal-body .portal-user-label{display:none}
 body.portal-body .portal-user{gap:8px;font-size:10px}
 body.portal-body .portal-user>a{display:none}
 body.portal-body .portal-user .portal-signout{padding:5px 8px;min-height:30px}
 body.portal-body .page-heading h1{font-size:19px}
 body.portal-body .page-heading>.button{width:auto}
 body.portal-body .portal-nav{display:flex;padding:8px 0}
 body.portal-body .portal-nav>a,body.portal-body .portal-nav-group summary{min-height:40px;padding-top:10px;padding-bottom:10px;font-size:13px}
 body.portal-body .portal-subnav a{min-height:38px;padding-top:9px;padding-bottom:9px;font-size:12px}
 body.portal-body .portal-filter{padding:9px;gap:8px}
 body.portal-body .portal-filter label{flex:1 1 120px}
 body.portal-body .portal-filter input,body.portal-body .portal-filter select{width:100%;height:36px;font-size:14px}
 body.portal-body .portal-agent-filter input[name="agent_id"],body.portal-body .portal-agent-filter input[name="site_id"],body.portal-body .portal-agent-filter input[name="q"]{width:100%}
 body.portal-body .portal-agent-filter .portal-upline-filter{flex:1 1 100%;max-width:none}
 body.portal-body .portal-filter .button{min-height:36px}
 body.portal-body .portal-table{min-width:780px}
 body.portal-body .portal-table td,body.portal-body .portal-table th{padding:7px 8px;font-size:11px}
 body.portal-body .portal-table td{max-width:220px!important;text-align:left;white-space:nowrap}
 body.portal-body .portal-table td.description{white-space:normal}
 body.portal-body .portal-table td:before{display:none}
 body.portal-body .portal-agent-inline-actions{justify-content:flex-start}
 body.portal-body .portal-table .portal-row-actions{justify-content:flex-start}
 body.portal-body .portal-table tbody,body.portal-body .portal-table tr{border:0}
 body.portal-body .button{min-height:34px}
 body.portal-body .panel{padding:12px}
 body.portal-body .panel.data-panel{padding:0}
 body.portal-body .portal-detail{gap:12px}
 body.portal-body .table-footer{gap:8px;flex-wrap:wrap}
 body.portal-body .portal-footer{padding:9px 12px}
}
@media(prefers-reduced-motion:reduce){body.portal-body .portal-sidebar{transition:none}}
