/* Poker bankroll tracker — optional accounting module. */
.view-layout--poker {
  gap: var(--gap);
}

.poker-hero {
  position: relative;
  display: grid;
  gap: 24px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--save) 24%, var(--line));
  background:
    linear-gradient(112deg, color-mix(in srgb, var(--save) 5%, transparent), transparent 38%),
    var(--surface);
}

.poker-hero::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 48px;
  height: 3px;
  background: var(--save);
}

.poker-hero-copy p,
.poker-module-copy p,
.poker-dashboard-copy p,
.poker-chart-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.poker-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-inset);
}

.poker-kpis article {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.poker-kpis article:nth-child(2n) { border-right: 0; }
.poker-kpis article:nth-last-child(-n + 2) { border-bottom: 0; }
.poker-kpis span,
.poker-dashboard-metrics dt {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.poker-kpis strong,
.poker-dashboard-metrics dd {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font: 600 clamp(1.05rem, 2.2vw, 1.45rem)/1.25 var(--font-data);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.poker-value--gain { color: var(--save) !important; }
.poker-value--loss { color: var(--expense) !important; }

.poker-workbench {
  display: grid;
  gap: var(--gap);
}

.poker-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.poker-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.poker-form-grid .field input,
.poker-form-grid .field select {
  width: 100%;
}

.poker-session-impact {
  min-height: 44px;
  margin: 4px 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-inset);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.poker-impact--gain {
  border-color: color-mix(in srgb, var(--save) 30%, var(--line));
  color: var(--save);
}

.poker-impact--loss {
  border-color: color-mix(in srgb, var(--expense) 30%, var(--line));
  color: var(--expense);
}

.poker-chart-panel {
  display: flex;
  min-height: 410px;
  flex-direction: column;
}

.poker-chart-wrap {
  position: relative;
  min-height: 300px;
  flex: 1;
  padding: 12px 8px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chart-well);
}

.poker-chart-wrap canvas { max-width: 100%; }

.poker-chart-legend,
.poker-accounting-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-inset);
  font-size: 0.7rem;
  white-space: nowrap;
}

.poker-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--save);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--save) 14%, transparent);
}

.poker-empty {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
}

.poker-empty strong { color: var(--ink); font-size: 0.95rem; }
.poker-history-empty { min-height: 110px; border: 1px dashed var(--line-strong); border-radius: 8px; }

.poker-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  scrollbar-width: thin;
}

.poker-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.poker-table th,
.poker-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.poker-table thead th {
  color: var(--muted);
  background: var(--surface-inset);
  font-size: 0.7rem;
  font-weight: 500;
}

.poker-table tbody tr:last-child td { border-bottom: 0; }
.poker-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.poker-table-result { font: 600 0.85rem var(--font-data); text-align: right !important; }
.poker-table-actions { display: flex; justify-content: flex-end; gap: 12px; }

.poker-text-button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 0.75rem var(--font);
  cursor: pointer;
}

.poker-text-button:hover { text-decoration: underline; }
.poker-text-button--danger { color: var(--expense); }

.poker-dashboard-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) minmax(220px, 0.7fr);
  align-items: center;
  gap: 22px;
  border-color: color-mix(in srgb, var(--save) 20%, var(--line));
}

.poker-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
}

.poker-dashboard-metrics div { padding: 13px; }
.poker-dashboard-metrics div + div { border-left: 1px solid var(--line); }
.poker-dashboard-metrics dd { margin-inline-start: 0; font-size: 1rem; }
.poker-dashboard-action { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; }
.poker-dashboard-action small { color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.poker-dashboard-action .btn { width: 100%; }

.poker-module-settings { grid-column: 1 / -1; }
.poker-module-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.poker-module-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--save) 30%, var(--line));
  border-radius: 10px;
  color: var(--save);
  background: color-mix(in srgb, var(--save) 8%, var(--surface-inset));
}
.poker-module-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.poker-switch {
  display: grid;
  min-width: 96px;
  min-height: 58px;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.poker-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.poker-switch-track { position: relative; width: 48px; height: 27px; border: 1px solid var(--field-border); border-radius: 999px; background: var(--surface-inset); transition: background 180ms ease, border-color 180ms ease; }
.poker-switch-track i { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform 180ms ease, background 180ms ease; }
.poker-switch input:checked + .poker-switch-track { border-color: var(--save); background: color-mix(in srgb, var(--save) 24%, var(--surface-inset)); }
.poker-switch input:checked + .poker-switch-track i { transform: translateX(21px); background: var(--save); }
.poker-switch input:focus-visible + .poker-switch-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.poker-switch input:disabled + .poker-switch-track { opacity: 0.45; cursor: not-allowed; }
.poker-switch strong { color: var(--muted); font-size: 0.7rem; }
.poker-switch strong.is-active { color: var(--save); }

@media (min-width: 860px) {
  .poker-hero { grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr); align-items: center; }
  .poker-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .poker-kpis article { border-bottom: 0; }
  .poker-kpis article:nth-child(2) { border-right: 1px solid var(--line); }
  .poker-kpis article:last-child { border-right: 0; }
}

@media (min-width: 1024px) {
  .poker-workbench { grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr); align-items: stretch; }
  .poker-session-panel { align-self: start; }
}

@media (max-width: 900px) {
  .poker-dashboard-summary { grid-template-columns: 1fr 1fr; }
  .poker-dashboard-copy { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  #bottom-nav.bottom-nav--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #bottom-nav.bottom-nav--6 .nav-btn { font-size: 0.6rem; }
  .poker-form-grid { grid-template-columns: 1fr; }
  .poker-chart-panel { min-height: 360px; }
  .poker-chart-wrap { min-height: 250px; }
  .poker-dashboard-summary { grid-template-columns: 1fr; }
  .poker-dashboard-copy { grid-column: auto; }
  .poker-dashboard-metrics { width: 100%; }
  .poker-module-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .poker-switch { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: start; min-height: 44px; }
  .poker-section-head { flex-direction: column; }
}

@media (max-width: 390px) {
  #bottom-nav.bottom-nav--6 .nav-btn { gap: 4px; padding-inline: 0; font-size: 0.56rem; }
  #bottom-nav.bottom-nav--6 .nav-btn svg { width: 18px; height: 18px; }
  .poker-kpis { grid-template-columns: 1fr; }
  .poker-kpis article,
  .poker-kpis article:nth-child(2n),
  .poker-kpis article:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .poker-kpis article:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .poker-switch-track,
  .poker-switch-track i { transition: none; }
}
