/* Neutral application surfaces. Pitch, SVG, chart series and status colours
   keep their own rules; colour continues to communicate game state and alerts. */
:root{
  --ui-canvas:#f5f5f4;
  --ui-surface:#ffffff;
  --ui-subtle:#f1f2f3;
  --ui-border:#d7dadd;
  --ui-input-border:#8c949d;
  --ui-text:#24282e;
  --ui-muted:#606973;
  --ui-accent:#2454ba;
  --ui-focus:#2454ba;
  --muted:var(--ui-muted);
  --border:var(--ui-border);
  color:var(--ui-text);
  background:var(--ui-canvas);
}
body{color:var(--ui-text);background:var(--ui-canvas)}
button,input,select,textarea{color:var(--ui-text);border-radius:7px;border-color:var(--ui-border)}
button{box-shadow:none}
.coach-portal button,.coach-dialog button,.coach-print-dialog button,.club-management button,.club-dialog button,.club-print-dialog button{border-radius:7px;box-shadow:none}
button:hover{background:#eceeef}
button.primary,button.primary:hover{background:var(--green,var(--ui-accent));border-color:var(--green,var(--ui-accent));color:var(--on-primary,#fff)}
:is(input,select,textarea):not([type=checkbox],[type=radio],[type=color]){background:#fff;border-color:var(--ui-input-border)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}
.coach-portal button:focus-visible,.coach-portal a:focus-visible,.coach-portal input:focus-visible,.coach-portal select:focus-visible,.coach-portal textarea:focus-visible,.coach-dialog button:focus-visible,.coach-dialog input:focus-visible,.coach-dialog select:focus-visible,.coach-dialog textarea:focus-visible,.analysis-tabs button:focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}
button:disabled{cursor:not-allowed}
summary{touch-action:manipulation}
.panel{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
.coach-portal .panel{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
dialog{background:#fff;color:var(--ui-text);border-color:#c8cdd2;border-radius:10px;box-shadow:0 10px 36px #151a2424}
dialog::backdrop{background:#1c202799}
.topbar h1,.account-login-panel h1{color:var(--ui-text)}
.legend,.muted,.eyebrow{color:var(--ui-muted)}
.notice{background:var(--ui-subtle);color:#424a54;border:1px solid var(--ui-border);border-radius:7px}
.badge,.pill{background:#eceeef;color:#505963;border-radius:6px}
.empty{background:#fafafa;color:var(--ui-muted);border-color:var(--ui-border);border-radius:7px}
.list-card{border-color:var(--ui-border);border-radius:7px;box-shadow:none}
.kpi{background:#fff;border-color:var(--ui-border);border-radius:8px}
.kpi small{color:var(--ui-muted)}
th{background:#f0f1f2;color:#48515a}
td{border-color:#e1e3e5}
tbody tr:nth-child(even){background:#fafafa}

/* Account, navigation and configuration. */
.sidebar{background:#1c2027;color:#edf0f3;border-right:1px solid #343a43;box-shadow:none}
.sidebar .brand small,.sidebar .foot{color:#bec5ce}
.sidebar .nav{background:transparent;color:#d0d6df;border-radius:7px;box-shadow:none}
.sidebar .nav:hover{background:#2a3039;color:#fff}
.sidebar .nav.active{background:#303743;color:#fff;box-shadow:inset 3px 0 #91adf2}
.sidebar .brand .crest{background:#262d37;border-color:#505a68;border-radius:8px}
.account-login-panel{border-radius:10px;box-shadow:none}
.account-login-help,.account-login-panel .legend,.account-divider{color:var(--ui-muted)}
.account-email-form input{border-radius:7px;border-color:var(--ui-input-border)}
.account-divider:before,.account-divider:after{background:var(--ui-border)}
.account-email-actions button,.account-google-button button{border-radius:7px}
.theme-presets button{border-color:var(--ui-border);border-radius:7px}
.focus-menu,#toast{background:#242b35;color:#fff;border-color:#434d5c;border-radius:7px}
.pulso-web-update{background:#f0f1f2;border-color:var(--ui-border);color:var(--ui-text)}
.pulso-web-update p{color:var(--ui-muted)}

/* Coaching uses quiet surfaces and a compact, grouped navigation. */
.coach-portal{--coach-ink:var(--ui-text);--coach-muted:var(--ui-muted);--coach-line:var(--ui-border);--coach-blue:var(--ui-accent);color:var(--ui-text)}
.coach-portal .coach-cloudbar,.coach-portal .coach-team-identity{background:#fff;border:1px solid var(--ui-border);border-radius:8px;box-shadow:none}
.coach-portal .coach-workspace-switch{background:#eceeef;border:1px solid var(--ui-border);border-radius:8px;padding:5px}
.coach-workspace-switch button{color:#505963;border-radius:6px}
.coach-workspace-switch button.active{background:#fff;color:var(--ui-accent);box-shadow:none}
.coach-other-areas>summary{color:#48515d;border-radius:6px}
.coach-other-areas[open]>summary{background:#fff;border-color:var(--ui-border)}
.coach-other-areas>div{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:0 6px 20px #151a241a}
.coach-other-areas p,.coach-workspace-caption{color:var(--ui-muted)}
.coach-language{background:#eceeef;color:var(--ui-muted);border-radius:6px}
.coach-nav-group{background:#fff;border-color:var(--ui-border);border-radius:8px;padding:8px}
.coach-nav-group h2,.coach-nav-group>summary{color:#59636f;font-weight:700}
.coach-portal .coach-tabs button{color:#3f4752;border-radius:5px;font-weight:600}
.coach-portal .coach-tabs button:hover{background:#f0f1f2}
.coach-portal .coach-tabs button.active{background:#fff;color:var(--ui-accent);box-shadow:inset 3px 0 var(--ui-accent)}
.coach-portal .coach-section-heading h2,.coach-portal .coach-page-header h1{color:var(--ui-text);letter-spacing:-.02em}
.coach-section-heading p,.coach-cloudbar small,.coach-eyebrow,.coach-contact-facts span,.coach-contact-heading small,.coach-member small{color:var(--ui-muted)}
.coach-portal .coach-hero-card,.coach-portal .personal-intro{background:#fff;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;box-shadow:none}
.coach-portal .coach-hero-card h3,.coach-portal .personal-intro h2{color:var(--ui-text)}
.coach-portal .coach-hero-card p,.coach-portal .coach-hero-card .coach-eyebrow,.coach-portal .personal-intro p{color:var(--ui-muted)}
.coach-portal .coach-hero-card button.primary{background:var(--green,var(--ui-accent));border-color:var(--green,var(--ui-accent));color:var(--on-primary,#fff)}
.coach-hero-card .coach-summary-strip{border-color:var(--ui-border)}
.coach-hero-card .coach-summary-strip span,.coach-hero-card .coach-summary-strip b{color:#59636f}
.coach-date-chip,.coach-contact-heading>span,.coach-member-avatar,.coach-avatar,.coach-shirt{background:#eceeef;color:#4c5662}
.coach-date-chip,.coach-contact-heading>span{border-radius:7px}
.coach-game-grid article,.coach-empty-start,.coach-exercise-card,.coach-plan-exercise,.coach-role-card,.coach-team-card,.coach-callup-sheet{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
.coach-calendar{background:#fff;border-color:var(--ui-border);border-radius:8px}
.coach-day.today{background:#f1f2f3;box-shadow:inset 0 2px var(--ui-accent)}
.coach-day.outside{background:#fafafa}
.coach-session-chip{background:#eceeef;color:#3c4652;border-radius:5px!important}
.coach-training-goals,.coach-role-checks label,.coach-logistics>div,.coach-sheet-notes,.coach-player-logistics>div,.coach-guardian-card,.coach-guardians-form>section,.coach-coordinator-bars>div{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.coach-training-goals h3,.coach-player-logistics strong{color:var(--ui-text)}
.coach-logistics{background:var(--ui-border);border-radius:7px}
.coach-selected-count,.coach-guardian-card small,.coach-report-scorers>span{background:#eceeef;color:#4c5662;border-radius:5px}
.coach-player-checks label.selected{background:#fff;border-color:var(--ui-accent);box-shadow:inset 3px 0 var(--ui-accent)}
.coach-callup-list button{border-color:var(--ui-border);border-radius:7px}
.coach-callup-list button.active,.coach-callup-list button.selected{background:#fff;border-color:var(--ui-accent);box-shadow:inset 3px 0 var(--ui-accent)}
.coach-report-kpis>div,.coach-report-fouls{background:#f2f3f4;border-radius:7px}
.coach-unlinked,.personal-training-status{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.coach-unlinked strong,.coach-unlinked p{color:#505a66}
.coach-portal .coach-mobile-section select{background:#fff;border-color:var(--ui-input-border);border-radius:7px;color:var(--ui-text)}
.coach-pill{border-radius:5px}

/* Institutional pages keep their own access scope, with neutral tables. */
.club-management,.fee-setup,.medical-management,.ops-management,.certification{color:var(--ui-text)}
.club-header h1,.club-section-heading h2,.club-stat-cards strong,.club-finance-kpis strong,.club-balance strong{color:var(--ui-text)}
.club-header p,.club-section-heading p,.club-stat-cards small,.club-finance-kpis small{color:var(--ui-muted)}
.coach-portal .club-tabs button{color:#4c5662;border-radius:5px}
.coach-portal .club-tabs button.active{background:#fff;color:var(--ui-accent);box-shadow:inset 0 -2px var(--ui-accent)}
.club-stat-cards article,.club-stat-cards .formation,.club-stat-cards .senior,.club-finance-kpis article,.club-balance{background:#fff;border:1px solid var(--ui-border);border-radius:8px;box-shadow:none}
.club-table-wrap,.club-audit article,.club-season-history button{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
.club-table th,.club-document th{background:#f0f1f2;color:#48515a}
.club-teams-list>div,.club-team-setup>section,.club-receive-lines{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.club-tag,.club-teams-list b{background:#eceeef;color:#515b66;border-radius:5px}
.club-season-history button.selected{background:#fff;border-color:var(--ui-accent)}
.club-status{border-radius:5px}
.club-management .club-mobile-section select{border-color:var(--ui-input-border);border-radius:7px}
.fee-toolbar,.fee-totals article,.fee-note,.club-opening-note,.fee-empty,.fee-month-picker label,.fee-plan-total,.fee-athlete-list section,.fee-month-balances>div{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.fee-month-strip span{background:#eceeef;color:#515b66;border-radius:5px}
.fee-totals strong,.fee-plan-total strong{color:var(--ui-text)}
.medical-toolbar,.medical-note,.medical-empty,.medical-file-picker,.medical-files article,.medical-preview,.medical-review-note,.medical-player-picker label{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.medical-player-icon,.medical-file-icon,.medical-chip:not(.unread){background:#e8eaed;color:#4b5663;border-radius:5px}
.medical-subtabs .active,.cert-nav .active{background:#fff;color:var(--ui-accent);border-color:var(--ui-accent);box-shadow:none}
.ops-toolbar,.ops-admin-kpis>div,.ops-checklist section{background:#f2f3f4;border-color:var(--ui-border);border-radius:8px}
.ops-agenda-row{background:#fff;border-color:var(--ui-border);border-radius:7px}
.ops-badge:not(.danger):not(.complete){background:#eceeef;color:#505a66;border-radius:5px}
.cert-rating-grid select{background:#fff;border-color:var(--ui-input-border)}
.cert-facts,.cert-player-evaluations details{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.cert-status{border-radius:5px}
.cert-status.completed,.ops-badge.complete{background:#e9f2ed;color:#256044;border-radius:5px}

/* Families, personal notes and competition use the same surfaces. */
.participant-summary>div,.participant-callup,.participant-panel,.participant-empty{background:#fff;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
.participant-notes,.participant-live{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.participant-header h1,.participant-heading h2,.participant-summary strong{color:var(--ui-text)}
.participant-summary small,.participant-header p{color:var(--ui-muted)}
.participant-badge{border-radius:5px}
.participant-badge.neutral{background:#eceeef;color:#505a66}
.participant-profile-form input[readonly]{background:#f2f3f4}
.transport-capacity,.transport-policy,.social-authorization,.social-recovery,.game-stream-status{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px;color:#48525e}
.competition-standing.heading{background:#f0f1f2;color:#4c5662}
.competition-standing.is-current{background:#fff;box-shadow:inset 3px 0 var(--ui-accent)}
.competition-roster-review>div,.athlete-form-summary{background:#f2f3f4;border-color:var(--ui-border);border-radius:7px}
.competition-area .panel h3{color:var(--ui-text)}

/* Chart geometry, data colours, heatmaps and the playing surface are untouched. */
.analysis-tabs{background:#eceeef;border-color:var(--ui-border);border-radius:8px;box-shadow:none}
.analysis-tabs button{color:#505a66;border-radius:5px}
.analysis-tabs button.primary{background:#fff!important;color:var(--ui-accent)!important;border-color:var(--ui-border);box-shadow:inset 0 -2px var(--ui-accent)}
.analysis-kpis .kpi:nth-child(n){background:#fff;border-color:var(--ui-border);border-radius:8px}
.analysis-page h2{color:var(--ui-text)}
.ring-legend button{background:#f2f3f4;border-color:var(--ui-border);color:#505a66;border-radius:6px}
.ring-legend button:hover{background:#e9ebed}
.scoreboard{background:#222a35;border-radius:8px;box-shadow:none}

@media(max-width:899px){.sidebar{border-radius:8px 8px 0 0;border-top:1px solid #343a43;border-right:0}.sidebar .nav.active{box-shadow:inset 0 -2px #91adf2}}
@media print{body{background:#fff}.panel,.coach-nav-group{box-shadow:none}.coach-other-areas{display:none}}

.coach-contact-heading>span{flex:0 0 44px}.coach-contact-heading>div{min-width:0;flex:1}.coach-contact-heading h3{overflow-wrap:anywhere}

/* Explicit review of separate team records; readable on a narrow screen. */
.team-record-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px;margin:18px 0}
.team-record-card{min-width:0;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);padding:16px;overflow-wrap:anywhere}
.team-record-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.team-record-card h3{margin:0 0 6px;font-size:1.05rem}
.team-record-card header p{margin:0;color:var(--ui-muted);font-size:.85rem}
.team-record-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.team-record-metrics dt{color:var(--ui-muted);font-size:.8rem}
.team-record-metrics dd{margin:4px 0 0;font-weight:600}
.team-record-options{display:grid;gap:12px;margin-top:18px;padding-top:14px;border-top:1px solid var(--ui-border)}
.team-record-options label{display:flex;align-items:center;gap:10px;font-weight:500;cursor:pointer}
.team-record-options input{width:18px;height:18px;flex-shrink:0}
[data-team-organization-feedback]{color:var(--ui-text);font-weight:600}
[data-team-invitations] article{overflow-wrap:anywhere}

/* Navigation and coach cards must remain flat with the actual portal CSS loaded. */
.coach-portal .coach-overview-grid>.panel{box-shadow:none}
