/* Shared platform chrome owns the masthead. Panel adaptation is opt-in at the
   authenticated response boundary; public cards/tables and standalone pages keep their CSS. */
.brainz-header,.brainz-header *{box-sizing:border-box}
.brainz-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:24px;min-height:80px;height:auto;width:100%;max-width:none;margin:0;padding:16px 24px;background:#10233e;border-bottom:1px solid #29405e;color:#fff;font:14px/1.4 system-ui,-apple-system,'Segoe UI',sans-serif}
.brainz-header .brainz-brand{display:flex;align-items:center;gap:12px;color:#fff;text-decoration:none}
.brainz-header .brainz-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:8px;background:#2563eb;color:#fff;font-size:26px;font-weight:700;line-height:1}
.brainz-header .brainz-identity{font-size:18px;font-weight:650;letter-spacing:-.4px;line-height:1.1}
.brainz-header .brainz-identity small{display:block;margin-top:4px;color:#b8c9df;font-size:10px;font-weight:400;letter-spacing:.4px}
.brainz-header .brainz-navigation{display:flex;align-items:center;min-width:0;margin:0;padding:0;background:transparent}
.brainz-header .brainz-links,.brainz-header .brainz-controls{display:flex;align-items:center;gap:4px;min-width:0;flex-wrap:wrap}
.brainz-header .brainz-controls{justify-content:flex-end;gap:8px;font-size:12px}
.brainz-header .brainz-link,.brainz-header .brainz-logout,.brainz-header select{display:inline-flex;align-items:center;justify-content:center;min-height:40px;max-width:100%;margin:0;padding:8px 12px;border:1px solid transparent;border-radius:6px;background:transparent;color:#c1cfe1;text-decoration:none;font:inherit;white-space:nowrap;cursor:pointer}
.brainz-header .brainz-link:hover,.brainz-header .brainz-logout:hover{background:#243b59;color:#fff}
.brainz-header .brainz-link[aria-current=page]{background:#244977;color:#fff;box-shadow:inset 0 -2px #76a7ff;font-weight:600}
.brainz-header .brainz-logout{border-color:#455b76}
.brainz-header select{border-color:#455b76;background:#10233e;color:#fff;color-scheme:dark}
.brainz-header .brainz-account{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#afc1d9;border-left:1px solid #455b76;padding-left:16px}
.brainz-header .brainz-environment{font-size:11px;color:#b8c9df}
.brainz-header :is(a,button,select):focus-visible{outline:3px solid #93b8ff;outline-offset:2px}
.brainz-header button:disabled{opacity:.55;cursor:not-allowed}
.brainz-header [hidden]{display:none!important}

/* The public body padding previously boxed the header into the data area.
   One content container now owns spacing, rather than negative-margin fixes. */
body.brainz-panel{padding:0;margin:0;background:#f3f6fa}
.brainz-panel .brainz-content{box-sizing:border-box;width:100%;max-width:1600px;min-width:0;margin:0 auto;padding:24px}
.brainz-panel .top-bar{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 24px;padding:0 0 24px;border-bottom:1px solid #dae3ef}
.brainz-panel .top-bar h1{min-width:0;margin:0;color:#142740;font:600 26px/1.3 system-ui,-apple-system,'Segoe UI',sans-serif;letter-spacing:-.6px}
.brainz-panel .top-controls{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:12px;min-width:0;max-width:100%}
.brainz-panel .search-box{min-width:0;flex:1}
.brainz-panel .top-controls input{box-sizing:border-box;width:clamp(240px,30vw,420px);max-width:100%;height:44px;border:1px solid #c5d1df;border-radius:8px;padding:0 16px;font:14px system-ui,-apple-system,'Segoe UI',sans-serif;background:#fff;color:#142740}
.brainz-panel .top-controls select{box-sizing:border-box;height:44px;max-width:100%;border:1px solid #c5d1df;border-radius:8px;padding:0 12px;font:14px system-ui,-apple-system,'Segoe UI',sans-serif;background:#fff;color:#142740}
.brainz-panel .top-controls :is(input,select):focus-visible{outline:3px solid #719dff;outline-offset:2px}
.brainz-panel .sync-info{flex-wrap:wrap;gap:12px;margin-bottom:24px}
.brainz-panel .brainz-content > :is(.cards,.cards-main,.cards-alert,.tables-grid){min-width:0}
.brainz-panel .brainz-content :is(.table-card,.card){min-width:0}
.brainz-panel > footer{padding:0 24px 24px}

/* Auth shell and operational pages share the same 24px content gutter. */
body > #app{max-width:1600px;margin:24px auto 64px;padding:0 24px}
#app .welcome{margin:0 0 24px}
#app .welcome h1{font-size:28px;line-height:1.3;letter-spacing:-.6px;margin:8px 0}
#app .welcome .eyebrow{color:#526580}
#app > h2{font-size:26px;line-height:1.3;letter-spacing:-.6px;margin:0 0 12px}
#app > .muted{margin:0 0 24px}
@media(max-width:1100px){
 .brainz-header{grid-template-columns:1fr auto;gap:12px 24px}
 .brainz-header .brainz-navigation{grid-column:1 / -1;grid-row:2}
 .brainz-header .brainz-controls{grid-column:2;grid-row:1}
 .brainz-panel .top-bar{flex-direction:column;align-items:stretch}
 .brainz-panel .top-controls{width:100%;justify-content:flex-start}
 .brainz-panel .top-controls input{width:100%;flex:1;min-width:0}
 .brainz-panel .brainz-content > .cards-alert{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
 .brainz-header{grid-template-columns:minmax(0,1fr);padding:16px 24px;gap:12px}
 .brainz-header .brainz-navigation{grid-column:1;grid-row:2}
 .brainz-header .brainz-controls{grid-column:1;grid-row:3;justify-content:flex-start;border-top:1px solid #29405e;padding-top:12px}
 .brainz-header .brainz-account{border-left:0;padding-left:0;max-width:120px}
 .brainz-header .brainz-link{padding-inline:10px}
 .brainz-panel .top-bar h1{font-size:24px}
 .brainz-panel .top-controls{flex-wrap:wrap}
 .brainz-panel .search-box,.brainz-panel .top-controls > input{flex-basis:100%}
 .brainz-panel .top-controls select{width:100%}
 .brainz-panel .brainz-content > :is(.cards,.cards-main,.cards-alert,.tables-grid){grid-template-columns:minmax(0,1fr)}
 body > footer{flex-wrap:wrap}
}
