/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0a0a0a;
  --d1:      #111111;
  --d2:      #181818;
  --d3:      #222222;
  --d4:      #2a2a2a;
  --border:  #2e2e2e;
  --border2: #383838;
  --text:    #e8e8e8;
  --text-2:  #999;
  --text-3:  #666;
  --red:     #e3000f;
  --red-dim: #7f0009;
  --green:   #22c55e;
  --yellow:  #f59e0b;
  --sidebar: 220px;
  --topbar:  56px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ──────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar);
  min-width: var(--sidebar);
  background: var(--d1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo-brand { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.logo-sub   { font-size: 10px; font-weight: 500; color: var(--text-3); display: block; letter-spacing: 0.5px; text-transform: uppercase; }

.view-as-banner {
  background: #1a0f00;
  border-bottom: 1px solid #4a2500;
  padding: 8px 16px;
  font-size: 12px;
  color: #f97316;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.exit-tag {
  margin-left: auto;
  background: #4a2500;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: color .15s, background .15s;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--d2); color: var(--text); }
.nav-item.active {
  color: var(--text);
  background: var(--d2);
  border-left-color: var(--red);
}
.nav-item .ti { font-size: 16px; }

.sidebar-bottom {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.coach-chip { display: flex; align-items: center; gap: 10px; }
.coach-avatar-sm {
  width: 30px; height: 30px;
  background: var(--d3);
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.coach-name-sm  { font-size: 12px; font-weight: 600; color: var(--text); display: block; }
.coach-role-sm  { font-size: 11px; color: var(--text-3); display: block; }

/* ── Main wrap ───────────────────────────────────────────────────────────── */
#main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar);
  min-height: var(--topbar);
  background: var(--d1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.page-title { font-size: 16px; font-weight: 600; color: var(--text); }

.autoflag-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
  background: var(--d2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}
.pulse-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

.role-select {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.notif-btn {
  position: relative;
  background: var(--d2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: color .15s;
}
.notif-btn:hover { color: var(--text); }
#notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── Content area ────────────────────────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--black);
}

/* ── Notification Panel ──────────────────────────────────────────────────── */
#notif-panel {
  position: fixed;
  top: var(--topbar); right: 0;
  width: 320px;
  height: calc(100vh - var(--topbar));
  background: var(--d1);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 100;
  display: flex; flex-direction: column;
}
#notif-panel.open { transform: translateX(0); }
.notif-panel-hd {
  padding: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
#notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  border: 1px solid transparent;
}
.notif-critical { background: rgba(127,0,9,.2); border-color: var(--red-dim); color: #fca5a5; }
.notif-overdue  { background: rgba(245,158,11,.1); border-color: #92400e; color: #fcd34d; }
.notif-inactive { background: var(--d2); border-color: var(--border); color: var(--text-2); }
.notif-empty    { display: flex; align-items: center; gap: 8px; padding: 20px 12px; color: var(--text-3); font-size: 13px; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
#modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
}
#modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(780px, 96vw);
  max-height: 90vh;
  background: var(--d1);
  border: 1px solid var(--border2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 201;
  display: flex; flex-direction: column;
}
.hidden { display: none !important; }

.modal-inner { display: flex; flex-direction: column; height: 100%; max-height: 90vh; }
.modal-header {
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.modal-title-block {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-client-name { font-size: 20px; font-weight: 700; color: var(--text); }
.modal-client-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.modal-health-badge {
  display: flex; flex-direction: column; align-items: center;
  font-size: 22px; font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--d2);
  line-height: 1.1;
}
.modal-health-badge span { font-size: 10px; font-weight: 400; color: var(--text-3); }
.modal-tabs { display: flex; gap: 0; }
.modal-tab {
  padding: 10px 16px;
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: color .15s;
}
.modal-tab:hover  { color: var(--text); }
.modal-tab.active { color: var(--text); border-bottom-color: var(--red); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--d2); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--d3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 999;
  transition: transform .2s ease;
}
#toast.show { transform: translateX(-50%) translateY(0); }
.toast-error { border-color: var(--red-dim); background: rgba(127,0,9,.3); }

/* ── Shared components ───────────────────────────────────────────────────── */
.section-card {
  background: var(--d1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.danger-card   { border-color: var(--red-dim); }
.green-card-light { border-color: #14532d; background: rgba(20,83,45,.15); }
.section-hd    { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.section-hd h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.section-desc  { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }

.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }

.btn-secondary {
  background: var(--d3);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: #555; }

.btn-danger {
  background: rgba(127,0,9,.3);
  color: #fca5a5;
  border: 1px solid var(--red-dim);
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { background: rgba(127,0,9,.5); }

.btn-icon-danger {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 14px; padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.btn-icon-danger:hover { color: var(--red); }

.form-input {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--red); }

.form-input-sm {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.form-field.full { grid-column: 1 / -1; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.log-textarea {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  width: 100%;
}
.log-textarea:focus { outline: none; border-color: var(--red); }

.search-input {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 220px;
}
.search-input:focus { outline: none; border-color: var(--red); }

.empty-msg    { color: var(--text-3); font-size: 13px; padding: 8px 0; }
.empty-msg-sm { color: var(--text-3); font-size: 12px; }

/* Health / status colors */
.health-green { color: var(--green) !important; }
.health-yellow { color: var(--yellow) !important; }
.health-red    { color: var(--red) !important; }
.green  { color: var(--green) !important; }
.yellow { color: var(--yellow) !important; }
.red    { color: var(--red) !important; }
.red-icon { color: var(--red); }
.red-txt  { color: #fca5a5; }
.green-txt { color: #86efac; }
.overdue-txt { color: var(--red); }

.health-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px; font-weight: 700;
  background: var(--d2);
}
.health-pill.health-green  { background: rgba(34,197,94,.15); color: var(--green); }
.health-pill.health-yellow { background: rgba(245,158,11,.15); color: var(--yellow); }
.health-pill.health-red    { background: rgba(227,0,15,.15); color: #f87171; }

.health-badge {
  font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.hb-critical { background: rgba(127,0,9,.3); color: #fca5a5; }
.hb-warn     { background: rgba(245,158,11,.15); color: var(--yellow); }

.priority-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-high { background: rgba(227,0,15,.2); color: #f87171; }
.badge-med  { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-low  { background: var(--d3); color: var(--text-3); }

/* Task dots */
.task-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin: 0 1px;
}
.dot-done    { background: var(--green); }
.dot-pending { background: var(--yellow); }
.dot-overdue { background: var(--red); }
.dot-na      { background: var(--border2); }

/* Task status select colors */
.task-status-select {
  background: var(--d2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.status-done    { border-color: var(--green); color: var(--green); }
.status-pending { border-color: var(--yellow); color: var(--yellow); }
.status-overdue { border-color: var(--red); color: #f87171; }
.status-na      { border-color: var(--border2); color: var(--text-3); }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.view-dashboard {}

.metrics-grid {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--d1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  min-width: 130px; flex: 1;
}
.metric-num  { font-size: 32px; font-weight: 700; line-height: 1.1; }
.metric-lbl  { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.green-card  { border-color: #14532d; }
.green-card .metric-num { color: var(--green); }
.red-card    { border-color: var(--red-dim); }
.red-card .metric-num { color: #f87171; }

.task-bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row   { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 200px; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.bar-track { flex: 1; height: 6px; background: var(--d3); border-radius: 3px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 3px; transition: width .4s ease; }
.bar-green  { background: var(--green); }
.bar-yellow { background: var(--yellow); }
.bar-red    { background: var(--red); }
.bar-pct   { width: 36px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-2); }

.coach-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.coach-card {
  background: var(--d2); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px;
}
.coach-card-hd   { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar-lg       { width: 40px; height: 40px; background: var(--red); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.coach-card-name { font-size: 14px; font-weight: 600; }
.coach-card-sub  { font-size: 11px; color: var(--text-3); }
.coach-metrics-row { display: flex; gap: 12px; }
.cm-stat { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cm-val  { font-size: 18px; font-weight: 700; }
.cm-lbl  { font-size: 10px; color: var(--text-3); }

.neglect-list { display: flex; flex-direction: column; gap: 8px; }
.neglect-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--d2); border-radius: 6px;
  cursor: pointer; transition: background .15s;
}
.neglect-row:hover { background: var(--d3); }
.neglect-name  { flex: 1; font-size: 13px; font-weight: 500; }
.neglect-coach { font-size: 12px; color: var(--text-3); }

.log-feed      { display: flex; flex-direction: column; gap: 6px; }
.log-feed-row  {
  display: grid;
  grid-template-columns: 70px 160px 120px 1fr;
  gap: 12px; align-items: center;
  padding: 8px 12px;
  background: var(--d2); border-radius: 6px;
  cursor: pointer; transition: background .15s;
  font-size: 12px;
}
.log-feed-row:hover { background: var(--d3); }
.lf-date   { color: var(--text-3); }
.lf-client { font-weight: 600; }
.lf-coach  { color: var(--text-2); }
.lf-summary { color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Clients ─────────────────────────────────────────────────────────────── */
.view-clients {}
.clients-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.toolbar-count { font-size: 13px; color: var(--text-2); }

.filter-tabs { display: flex; gap: 6px; }
.filter-tab {
  background: var(--d2); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 6px;
  padding: 5px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.filter-tab.active { background: var(--d3); color: var(--text); border-color: var(--border2); }
.filter-tab:hover  { color: var(--text); }

.clients-table-wrap { overflow-x: auto; }
.clients-table {
  width: 100%; border-collapse: collapse;
  background: var(--d1); border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.clients-table th {
  text-align: left; padding: 11px 14px;
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--d2); border-bottom: 1px solid var(--border);
}
.clients-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.clients-table tbody tr:last-child td { border-bottom: none; }
.client-row { cursor: pointer; transition: background .12s; }
.client-row:hover { background: var(--d2); }
.client-name-cell .cn-name { font-size: 13px; font-weight: 600; }
.client-name-cell .cn-goal { font-size: 11px; color: var(--text-3); }
.task-dots-cell { white-space: nowrap; }
.coach-cell    { font-size: 12px; color: var(--text-2); }
.lastlog-cell  { font-size: 12px; color: var(--text-2); }
.empty-cell    { text-align: center; padding: 40px; color: var(--text-3); }

/* ── Client Modal tabs ───────────────────────────────────────────────────── */
.task-rows      { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.task-row       { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--d2); border-radius: 8px; gap: 12px; }
.task-row-name  { font-size: 13px; font-weight: 500; }
.task-row-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.overdue-tag    { background: rgba(127,0,9,.3); color: #fca5a5; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-left: 6px; }

.heatmap-section { margin-bottom: 20px; }
.heatmap-section h4 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.heatmap { display: flex; gap: 4px; flex-wrap: wrap; }
.hm-cell { width: 20px; height: 20px; background: var(--d3); border-radius: 3px; }
.hm-active { background: var(--red); }

.quick-log-section h4 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.quick-log-section .btn-primary { margin-top: 10px; }

.logs-list      { display: flex; flex-direction: column; gap: 12px; }
.log-entry      { background: var(--d2); border-radius: 8px; padding: 14px; }
.le-header      { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.le-date        { font-size: 12px; color: var(--text-3); }
.le-coach       { font-size: 12px; font-weight: 500; color: var(--text-2); flex: 1; }
.le-summary     { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.le-tasks       { display: flex; flex-wrap: wrap; gap: 6px; }
.le-task-tag    { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.tag-done  { background: rgba(34,197,94,.15); color: var(--green); }
.tag-other { background: var(--d3); color: var(--text-3); }

.comments-tab .comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.comment-item   { background: var(--d2); border-radius: 8px; padding: 12px 14px; }
.comment-meta   { display: flex; gap: 10px; margin-bottom: 6px; }
.comment-author { font-size: 12px; font-weight: 600; }
.comment-date   { font-size: 11px; color: var(--text-3); }
.comment-text   { font-size: 13px; }
.comment-compose { display: flex; flex-direction: column; gap: 8px; }

.fields-tab     { display: flex; flex-direction: column; gap: 12px; }
.field-row      { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 12px; }
.field-label    { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field-input    { background: var(--d2); border: 1px solid var(--border2); color: var(--text); border-radius: 6px; padding: 7px 10px; font-size: 13px; font-family: inherit; width: 100%; }

.edit-tab       { display: flex; flex-direction: column; gap: 16px; }
.edit-actions   { display: flex; gap: 10px; align-items: center; }

/* ── Logs view ───────────────────────────────────────────────────────────── */
.view-logs {}
.logs-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.logs-list-full { display: flex; flex-direction: column; gap: 12px; }
.log-card { background: var(--d1); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.log-card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.log-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lc-client { font-size: 14px; font-weight: 600; cursor: pointer; }
.lc-client:hover { color: var(--red); }
.lc-coach  { font-size: 12px; color: var(--text-2); }
.lc-date   { font-size: 12px; color: var(--text-3); }
.log-card-summary { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.log-card-tasks { display: flex; flex-wrap: wrap; gap: 6px; }

.log-task-updates { margin-bottom: 8px; }
.log-task-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.log-task-row:last-child { border-bottom: none; }
.log-task-name { font-size: 12px; color: var(--text-2); }

/* ── Reports ─────────────────────────────────────────────────────────────── */
.view-reports {}
.report-selector {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.report-client-row { display: flex; gap: 8px; align-items: center; }
.report-client-row .form-input { width: 200px; }

.report-output-inner {
  background: var(--d1); border: 1px solid var(--border);
  border-radius: 10px; padding: 32px;
}
.report-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 2px solid var(--red);
}
.report-logo { font-size: 22px; font-weight: 800; color: var(--red); line-height: 1.1; }
.report-logo span { font-size: 11px; font-weight: 400; color: var(--text-3); display: block; }
.report-title-block h2 { font-size: 20px; font-weight: 700; }
.report-date { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.report-section { margin-bottom: 28px; }
.report-section h3 {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.report-metrics { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.rm { text-align: center; }
.rm-val { font-size: 28px; font-weight: 800; }
.rm-lbl { font-size: 11px; color: var(--text-3); }
.rm-bad .rm-val { color: #f87171; }

.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; padding: 8px 12px; background: var(--d2); border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.report-table td { padding: 8px 12px; border: 1px solid var(--border); }

.report-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.rle-meta    { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.rle-summary { font-size: 13px; color: var(--text); margin-bottom: 14px; }

.report-log-entry { margin-bottom: 12px; padding: 12px; background: var(--d2); border-radius: 6px; }
.report-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Coaches ─────────────────────────────────────────────────────────────── */
.view-coaches {}
.coaches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.coach-profile-card {
  background: var(--d1); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
}
.cpc-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-xl  {
  width: 48px; height: 48px;
  background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; flex-shrink: 0;
}
.cpc-info { flex: 1; }
.cpc-name { font-size: 16px; font-weight: 700; }
.cpc-role-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 4px;
}
.role-head { background: rgba(227,0,15,.2); color: #f87171; }
.role-asst { background: var(--d3); color: var(--text-3); }
.cpc-stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.cpc-stat  { flex: 1; text-align: center; padding: 10px 6px; border-right: 1px solid var(--border); }
.cpc-stat:last-child { border-right: none; }
.cpc-val   { font-size: 18px; font-weight: 700; display: block; }
.cpc-lbl   { font-size: 10px; color: var(--text-3); display: block; }
.cpc-footer { font-size: 11px; color: var(--text-3); margin-bottom: 12px; }
.cpc-clients { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.cpc-client-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 4px 0; }
.cpc-client-row:hover .cpc-client-name { color: var(--red); }
.cpc-client-name { font-size: 13px; }

/* ── Settings ────────────────────────────────────────────────────────────── */
.view-settings {}
.threshold-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.threshold-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 16px;
  padding: 10px 14px; background: var(--d2); border-radius: 7px;
}
.threshold-input-wrap { display: flex; align-items: center; gap: 8px; }
.threshold-input {
  background: var(--d1); border: 1px solid var(--border2); color: var(--text);
  border-radius: 6px; padding: 6px 10px; width: 64px; text-align: center;
  font-size: 14px; font-weight: 600; font-family: inherit;
}
.settings-actions { display: flex; gap: 10px; }

.cf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--d2); border-radius: 6px; margin-bottom: 6px;
}
.cf-label { flex: 1; font-size: 13px; font-weight: 500; }
.cf-type  { font-size: 11px; color: var(--text-3); background: var(--d3); border-radius: 4px; padding: 2px 8px; }
.add-field-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.add-field-form .form-input { flex: 1; min-width: 140px; }

.data-actions { display: flex; flex-direction: column; gap: 2px; }
.data-action-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  gap: 16px; flex-wrap: wrap;
}
.data-action-row:last-child { border-bottom: none; }
.data-action-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.data-action-desc  { font-size: 12px; color: var(--text-3); }
.danger-row .data-action-title { color: #f87171; }

/* ── My Tasks ────────────────────────────────────────────────────────────── */
.view-mytasks {}
.mytasks-snapshot { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.mytasks-snapshot .metric-card { min-width: 120px; }

.priority-list { display: flex; flex-direction: column; gap: 8px; }
.priority-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s;
}
.priority-item:hover { opacity: .85; }
.sev-critical { background: rgba(127,0,9,.25); border-color: var(--red-dim); }
.sev-high     { background: rgba(245,158,11,.12); border-color: #92400e; }
.sev-med      { background: var(--d2); border-color: var(--border); }
.sev-warn     { background: rgba(245,158,11,.08); border-color: var(--border); }
.pi-left      { display: flex; flex-direction: column; gap: 3px; }
.pi-right     { display: flex; align-items: center; gap: 10px; }
.pi-client    { font-size: 13px; font-weight: 600; }
.pi-task      { font-size: 11px; color: var(--text-3); }
.pi-days      { font-size: 12px; font-weight: 700; color: #f87171; }
.pi-health    { font-size: 12px; font-weight: 700; }

.my-roster    { display: flex; flex-direction: column; gap: 8px; }
.roster-row   { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--d2); border-radius: 8px; cursor: pointer; }
.roster-row:hover { background: var(--d3); }
.roster-name  { font-size: 13px; font-weight: 600; min-width: 150px; }
.roster-goal  { flex: 1; font-size: 12px; color: var(--text-3); }
.roster-dots  { display: flex; gap: 3px; }

/* ── My Clients ──────────────────────────────────────────────────────────── */
.view-myclients {}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--d4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
}
