/* Dashboard (landing) — training sessions list. */
.view-hidden { display: none !important; }
.dashboard-view { flex: 1; min-height: 0; overflow: auto; }
.dash { max-width: 1100px; margin: 0 auto; padding: 18px 8px 40px; display: flex; flex-direction: column; gap: 26px; }

/* tabs (Stats / Sessions / Uploads) */
.dash-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-tab {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 16px; transition: color .12s, border-color .12s, background .12s;
}
.dash-tab:hover { color: var(--text); border-color: var(--gold-soft); }
.dash-tab.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.dash-panel { display: flex; flex-direction: column; gap: 26px; }
.dash-panel[hidden] { display: none; }

/* stacked, labeled sections within a panel */
.dash-section { display: flex; flex-direction: column; gap: 12px; }
.dash-section[hidden] { display: none; }
.dash-section-title { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: 0.2px; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* desktop: 4 equal-width controls (name | depth | table | + New Session) */
.dash-new { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; }
.dash-new > * { width: 100%; min-width: 0; }   /* fill each equal cell (no gaps) */
.dash-depth { cursor: pointer; padding: 10px 10px; }
.dash-clear {
  font-size: 12px; padding: 6px 12px; color: var(--muted);
  border-color: var(--line); background: transparent;
}
.dash-clear:hover { color: #ff9aa5; border-color: #4a2a32; filter: none; }
.dash-clear[hidden] { display: none; }
.dash-input {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; outline: none;
}
.dash-input:focus { border-color: var(--gold-soft); }
.dash-input::placeholder { color: #5e6678; }

/* combined "all sessions" bar (reserved top slot) */
.dash-overall { display: none; }
.dash-overall.show {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; margin-bottom: 18px;
}
.ov-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.ov-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.ov-stat { text-align: center; min-width: 56px; }
.ov-stat b { display: block; font-size: 18px; font-weight: 800; line-height: 1; }
.ov-stat span { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.ov-stat.win b { color: var(--green); }
.ov-stat.lose b { color: var(--red); }
.ov-stat.even b { color: var(--text); }
.ov-grades { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ov-grades-label { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* grade distribution pips (shared by dashboard + review summary) */
.grade-pip {
  display: inline-flex; align-items: baseline; gap: 3px; font-size: 12px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 7px;
}
.grade-pip b { font-size: 11px; font-weight: 800; }
.grade-pip.grade-A b { color: var(--green); }
.grade-pip.grade-B b { color: #8fd16b; }
.grade-pip.grade-C b { color: var(--gold); }
.grade-pip.grade-D b { color: #e0913f; }
.grade-pip.grade-F b { color: var(--red); }

.ov-leaks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-basis: 100%; margin-top: 2px; }

/* named coach-leak pills (shared: dashboard, review popup, end-of-hand) */
.leak-chip {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  color: #ffb4ba; background: rgba(255, 90, 106, 0.10); border: 1px solid #4a2a32;
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}

.dash-msg { font-size: 13px; margin-bottom: 14px; }
.dash-msg:empty { display: none; margin: 0; }
.dash-msg.err { color: #ff9aa5; background: #2a1d22; border: 1px solid #4a2a32; border-radius: 8px; padding: 9px 12px; }

.dash-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.dash-empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); }
.dash-empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.dash-empty-sub { font-size: 13px; max-width: 460px; margin: 0 auto; line-height: 1.55; }
.dash-empty-sub b { color: var(--gold); }

.dash-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; cursor: pointer; transition: border-color 0.15s ease, transform 0.05s ease;
  display: flex; flex-direction: column; gap: 15px;
}
.dash-card:hover { border-color: var(--gold-soft); }
.dash-card:active { transform: translateY(1px); }
.dc-top { display: flex; align-items: center; gap: 10px; }
.dc-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.dc-date { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.dc-type { flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--accent); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.dc-depth { flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--gold); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.dc-table { flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.dc-del {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
}
.dc-del:hover { color: #ff9aa5; background: var(--panel-2); border-color: #4a2a32; }

/* minmax(0,1fr) lets the columns shrink below their content so a wide value
   (e.g. "+118 BB") can't force the card past 100vw */
.dc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dc-stat { min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 4px; text-align: center; }
.dc-stat b { display: block; font-size: 19px; font-weight: 800; line-height: 1; overflow: hidden; text-overflow: ellipsis; }
.dc-stat span { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.dc-stat.win b { color: var(--green); }
.dc-stat.lose b { color: var(--red); }
.dc-stat.even b { color: var(--text); }

.dc-actions { display: flex; gap: 8px; }
.dc-actions .btn { flex: 1; padding: 8px 10px; font-size: 13px; }
.dc-actions .dc-review { flex: 0 0 auto; }

@media (max-width: 640px) {
  .dash { padding: 14px 2px 32px; gap: 22px; }

  /* New Session: 2x2 — [name | depth] / [table | + New Session] */
  .dash-new { width: 100%; grid-template-columns: 1fr 1fr; }

  /* minmax(0,1fr) lets the single column shrink below its content so a card
     can't force the list past 100vw */
  .dash-list { grid-template-columns: minmax(0, 1fr); }
  .dash-card { padding: 16px; gap: 12px; max-width: 100%; overflow: hidden; }
  .dc-top { flex-wrap: wrap; gap: 8px; }               /* chips wrap instead of overflowing */
  .dc-stats { gap: 6px; }
  .dc-stat { padding: 8px 2px; }                       /* was 9px → 1px tighter */
  .dc-stat b { font-size: 14px; }                      /* was 16px */
  .dc-stat span { font-size: 8px; }

  /* All-sessions bar: keep the 5 stats on ONE row (label drops to its own line) */
  .dash-overall.show { gap: 10px 12px; padding: 11px 12px; }
  .ov-label { flex-basis: 100%; }
  .ov-stats { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .ov-stat { min-width: 0; flex: 1; }
  .ov-stat b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ov-stat span { font-size: 8px; white-space: nowrap; }
  .ov-grades { margin-left: 0; flex-basis: 100%; }
}

/* Imported reports section */
.imp-usage { font-size: 12px; color: var(--muted); white-space: nowrap; }
.imp-upload-row { align-items: center; }
.imp-hint { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .imp-hint { flex-basis: 100%; } }

/* clickable grade pips in the review summary (filter the hand list by grade) */
.grade-pip.gp-click { cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.grade-pip.gp-click:hover { border-color: var(--gold-soft); }
.grade-pip.gp-sel { background: var(--gold); border-color: var(--gold); }
.grade-pip.gp-sel b, .grade-pip.gp-sel { color: #1a1406 !important; }

/* import upload loader (spinner + staged message) */
.imp-loader { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 4px 0 2px; }
.imp-loader[hidden] { display: none; }
.imp-spinner {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--gold);
  animation: imp-spin 0.8s linear infinite;
}
@keyframes imp-spin { to { transform: rotate(360deg); } }

/* New Session popup form (inside the shared .popup-card) */
.ns-form { display: flex; flex-direction: column; gap: 14px; min-width: 280px; }
.ns-row { display: flex; flex-direction: column; gap: 5px; }
.ns-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ns-row .dash-input { width: 100%; }
.ns-create { width: 100%; margin-top: 2px; }
.ns-msg { font-size: 12px; min-height: 0; }
.ns-msg.err { color: var(--red); }

/* cash/MTT meta playbook shown under the stake selector */
.ns-tips { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ns-tips-title { font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.ns-tips-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; }
.ns-tips-list li { font-size: 12px; line-height: 1.4; color: var(--muted); }
