/* Trainer workspace follows the CRM palette with flat surfaces and local controls. */
.crm-role-switch {
  display:flex; flex:none; gap:2px; padding:2px; border:1px solid var(--border-strong);
  border-radius:9px; background:var(--surface);
}
.crm-role-switch button,.trainer-workspace button {
  font:650 14px/1.3 var(--font-ui,system-ui); color:var(--text);
  cursor:pointer; box-shadow:none; min-height:48px;
}
.crm-role-switch button {
  padding:0 10px; border:0; border-radius:6px; background:transparent;
}
.crm-role-switch button[aria-pressed="true"] { background:var(--primary); color:var(--on-primary); }
.crm-role-switch button:focus-visible,.trainer-workspace :is(button,summary,select):focus-visible {
  outline:2px solid var(--focus); outline-offset:2px;
}
#scannerSection[data-crm-role="trainer"] { grid-template-columns:minmax(0,1fr); }
.trainer-workspace {
  width:min(100%,850px); margin:0 auto; padding:clamp(12px,3vw,28px) 0 32px;
  min-width:0; color:var(--text);
}
.trainer-workspace [hidden] { display:none!important; }
.tr-identity { padding-bottom:14px; border-bottom:1px solid var(--border); }
.tr-identity h1 { margin:1px 0 0; font-size:clamp(22px,4vw,36px); overflow-wrap:anywhere; line-height:1.15; }
.tr-club,.tr-kicker { margin:0; color:var(--muted); font-size:13px; font-weight:700; }
.tr-nav {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px;
  margin:12px 0 22px; border:1px solid var(--border); border-radius:10px;
  background:var(--surface); padding:4px;
}
.tr-nav-button,.tr-button {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  background:var(--surface-2); border:1px solid var(--border-strong); border-radius:7px; padding:7px 12px;
}
.tr-nav-button { background:transparent; border-color:transparent; }
.tr-nav-button[aria-current="page"],.trainer-workspace .tr-primary { background:var(--primary); color:var(--on-primary); border-color:var(--primary); }
.trainer-workspace button:hover:not([aria-current="page"],.tr-primary) { border-color:var(--text); }
.tr-nav svg { width:18px; height:18px; flex:none; }
.tr-panel { display:grid; gap:12px; min-width:0; }
.tr-page-title { margin:0; color:var(--text); font:700 clamp(22px,3vw,30px)/1.2 var(--font-ui,system-ui); }
.tr-page-title:focus { outline:none; }
.tr-card { min-width:0; padding:15px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.tr-card h3 { margin:3px 0 5px; color:var(--text); font-size:20px; }
.tr-muted { margin:0; color:var(--muted); font-size:14px; overflow-wrap:anywhere; }
.tr-items { display:grid; gap:8px; padding:0; margin:0; list-style:none; }
.tr-current { border-color:var(--text); }
@media (max-width:620px) {
  #scannerSection[data-crm-role="trainer"] .app-topbar { gap:6px; }
  .crm-role-switch button { padding-inline:8px; }
  .trainer-workspace { padding-bottom:calc(100px + env(safe-area-inset-bottom)); }
  .tr-nav {
    position:fixed; z-index:40; inset:auto 0 0;
    margin:0; padding:4px max(8px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    border-radius:0; border-width:1px 0 0;
  }
  .trainer-workspace .tr-nav-button {
    flex-direction:column; gap:3px; min-height:54px; padding:4px 2px; font-size:12px;
  }
  .tr-identity { margin-bottom:12px; }
}

.tr-feature .tr-primary { margin-top:14px; }
.tr-panel > .tr-button { justify-self:start; }
.tr-group { display:grid; gap:10px; }
.tr-group h3 { margin:0; }
.tr-count {
  justify-self:start; background:var(--surface-3); border-radius:6px; padding:5px 8px;
  color:var(--text); font-size:14px; font-weight:750;
}
.tr-actions,.tr-tags { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tr-member {
  display:grid; align-items:center; grid-template-columns:auto minmax(0,1fr) auto; gap:6px 8px;
  border:1px solid var(--border); border-radius:9px; padding:8px; color:var(--text); background:var(--surface-2);
}
.tr-member-body { min-width:0; overflow-wrap:anywhere; }
.tr-member-body strong { display:block; line-height:1.3; }
.tr-tags { margin-top:4px; }
.tr-avatar {
  display:grid; place-items:center; width:32px; height:32px; border-radius:50%;
  background:var(--surface-3); color:var(--text); font-size:11px; font-weight:750;
}
.tr-tag {
  width:fit-content; padding:2px 5px; border:1px solid var(--border-strong); border-radius:5px;
  background:var(--surface-3); color:var(--text); font-size:11px; line-height:1.35; font-weight:700;
}
.tr-warning { grid-column:2 / -1; margin:0; color:var(--text-2); font-size:12px; line-height:1.4; }
.tr-present { min-width:82px; padding-inline:7px; }
.tr-present[aria-pressed="true"] { background:var(--primary); color:var(--on-primary); border-color:var(--primary); }
.tr-present[aria-pressed="true"]::before { content:"✓"; }
@media (max-width:430px) {
  .tr-group { padding:9px; }
  .tr-member { padding:6px; }
  .tr-present { min-width:75px; }
}

.tr-nav-button { position:relative; }
.tr-notice-badge,.tr-new { background:var(--primary); color:var(--on-primary); }
.tr-notice-badge {
  min-width:19px; padding:1px 4px; border-radius:10px; font-size:11px; line-height:1.5; text-align:center;
}
.tr-nav-button[aria-current="page"] .tr-notice-badge { background:var(--on-primary); color:var(--primary); }
.tr-range { display:flex; flex-wrap:wrap; gap:6px; }
.tr-range [aria-selected="true"] { background:var(--primary); color:var(--on-primary); border-color:var(--primary); }
.tr-schedule-days { display:grid; gap:16px; }
.tr-day h3 { margin:0 0 6px; font-size:16px; text-transform:capitalize; }
.tr-session {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center;
}
.tr-session .tr-tag { display:inline-block; margin-top:4px; }
.tr-notice-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:3px; }
.trainer-workspace button:disabled { cursor:default; }
.trainer-workspace button:disabled:hover { border-color:var(--border-strong); }
.tr-inline-status:empty { display:none; }
@media (max-width:620px) {
  .tr-notice-badge { position:absolute; top:3px; left:calc(50% + 10px); }
}

.tr-management > summary,.tr-history-card > summary {
  min-height:48px; padding:12px 3px; color:var(--text); cursor:pointer;
  font-size:15px; font-weight:750; line-height:1.5; overflow-wrap:anywhere;
}
.tr-management { padding-block:3px 7px; }
.tr-management[open] { padding-bottom:13px; }
.tr-management > p { margin:0 0 7px; }
.tr-absence {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:center;
  border-top:1px solid var(--border); padding:5px 0;
}
.tr-absence .tr-tag { display:block; margin-top:4px; }
.tr-select {
  min-height:48px; padding:7px 10px; border:1px solid var(--border-strong); border-radius:6px;
  background:var(--surface-2); color:var(--text); font:650 16px/1.3 var(--font-ui,system-ui);
}
.tr-absence .tr-select { grid-column:1 / -1; width:100%; }
.tr-field-label { display:block; margin:8px 0 4px; color:var(--text); }
#trainerMoveTime { margin:0 6px 6px 0; }
.tr-history-card { margin-top:5px; padding:0 6px; border-top:1px solid var(--border); }
.tr-history-card .tr-muted { margin-top:4px; }
.tr-history { list-style:none; margin:6px 0; padding:0; }
.tr-history li {
  display:flex; justify-content:space-between; gap:6px; padding:4px 0; 
  color:var(--text-2); border-top:1px solid var(--border);
}


html.theme-transition body[data-view="trainer"],
html.theme-transition body[data-view="trainer"] :is(.app-topbar,.crm-role-switch button,.trainer-workspace button,.trainer-workspace select) {
  transition:none;
}
