﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-primary: #0d0f14;
  --bg-secondary: #141720;
  --bg-tertiary: #1a1d28;
  --bg-card: #1c1f2b;
  --bg-hover: #232738;
  --border: #2a2e3d;
  --border-light: #353a4d;

  --brand: #00a86b;
  --brand-hover: #00c17a;
  --brand-glow: rgba(0, 168, 107, 0.25);

  --gold: #f5a623;
  --gold-hover: #f7b948;
  --gold-glow: rgba(245, 166, 35, 0.3);

  --red: #e74c3c;
  --red-hover: #ef6456;

  --blue: #3498db;
  --blue-hover: #5dade2;

  --text-primary: #eceded;
  --text-secondary: #8b8fa3;
  --text-muted: #5c6075;
  --text-inverse: #0d0f14;

  --success: #00c853;
  --warning: #ff9800;
  --danger: #f44336;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--brand-glow);

  --font-mono: "JetBrains Mono", "Consolas", monospace;
}

::selection {
  background: var(--brand);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--bg-secondary);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: all 0.2s ease;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #00955e);
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.4);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.3px;
}

.brand span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 2px;
}

.limit-box small {
  color: var(--text-muted);
}

.admin-chat {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 300px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-chat-head strong {
  color: var(--text-primary);
  font-size: 13px;
}

.admin-chat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-chat-head span {
  color: var(--text-muted);
  font-size: 10px;
}

.chat-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chat-toolbar-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.admin-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-chat-empty {
  padding: 16px 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-chat-message {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}

.admin-chat-message.admin {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.10);
}

.admin-chat-message.pinned {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15) inset;
}

.admin-chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.admin-chat-meta-left,
.admin-chat-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-chat-name {
  max-width: 120px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.chat-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.chat-pin-btn:hover {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.admin-chat-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.admin-chat-form {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 6px;
  margin-top: 10px;
}

.admin-chat-form input {
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}

.admin-chat-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  outline: none;
}

.admin-chat-form button {
  height: 36px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-chat-form button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  padding: 11px 16px;
  color: var(--text-secondary);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}


.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: var(--bg-tertiary);
}

.nav-item.active {
  font-weight: 600;
}

.nav-item.active::before {
  opacity: 1;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}

.limit-box {
  margin-top: auto;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-chat + .limit-box {
  margin-top: 0;
}

.limit-box span,
.limit-box strong,
.limit-box small {
  display: block;
}

.limit-box span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.limit-box strong {
  margin: 8px 0;
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--brand);
}

.limit-box small {
  font-size: 12px;
  line-height: 1.4;
}

.main {
  padding: 28px 32px;
  background: var(--bg-primary);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.3px;
}

h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

p { margin-top: 0; }

.sync-state {
  flex: 0 0 auto;
  padding: 8px 14px;
  color: var(--brand);
  background: rgba(0, 168, 107, 0.1);
  border: 1px solid rgba(0, 168, 107, 0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
}

.view { display: none; }

.view.active {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats-grid.compact .stat {
  border-color: var(--border);
}

.stat,
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stat {
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.stat span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel-title span,
.hint {
  color: var(--text-secondary);
}

.live-clock {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(0, 168, 107, 0.12);
  border: 1px solid rgba(0, 168, 107, 0.25);
  border-radius: var(--radius-sm);
  vertical-align: middle;
  letter-spacing: 1px;
}

.stat strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.stat.accent {
  border-color: rgba(0, 168, 107, 0.3);
}

.stat.accent strong {
  color: var(--brand);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.panel {
  padding: 24px;
}

.panel.full {
  width: 100%;
}

.session-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.session-info-card,
.session-note {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.session-info-card span,
.session-note h4 {
  display: block;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.session-info-card strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.session-note {
  margin-top: 12px;
}

.session-note p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.stack-panel {
  margin-top: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.sub-title {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.entry-form,
.budget-form,
.settings-form,
.inline-form,
.result-form {
  display: grid;
  gap: 12px;
}

.entry-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.result-form label:first-child,
.result-form button {
  grid-column: 1 / -1;
}

label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  outline: none;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

button[type="submit"],
#refreshBtn {
  min-height: 44px;
  padding: 10px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #00955e);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}

button[type="submit"]:hover:not(:disabled),
#refreshBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-hover), #00a86b);
  box-shadow: 0 6px 20px rgba(0, 168, 107, 0.4);
  transform: translateY(-1px);
}

.table-title,
.filters {
  align-items: center;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters select {
  width: auto;
  min-width: 160px;
}

.small-action {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Odds filter tabs & board ===== */
.odds-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filter-btn {
  padding: 6px 14px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.active,
.filter-btn:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.odds-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.odds-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
}

.odds-card:hover,
.odds-card.selected {
  border-color: var(--brand);
  background: rgba(0, 168, 107, 0.1);
  box-shadow: 0 0 12px rgba(0, 168, 107, 0.15);
}

.odds-card .odds-type {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.odds-card .odds-selection {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
}

.odds-card .odds-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
}

.odds-card .odds-match {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Odds Grid (bảng điền kèo hàng loạt) ===== */
.odds-grid-panel {
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.odds-grid-panel > label {
  margin-bottom: 14px;
}

.odds-grid-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
}

#oddsGridTable,
#oddsOUTable,
#wagerHandicapTable,
#wagerOUTable {
  min-width: 500px;
}

#oddsGridTable th,
#oddsOUTable th,
#wagerHandicapTable th,
#wagerOUTable th {
  text-align: center;
  font-size: 10px;
  padding: 8px 6px;
}

#oddsGridTable td,
#oddsOUTable td,
#wagerHandicapTable td,
#wagerOUTable td {
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
}

#oddsGridTable td:first-child,
#oddsOUTable td:first-child,
#wagerHandicapTable td:first-child,
#wagerOUTable td:first-child {
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
}

#oddsGridTable input,
#oddsGridTable select,
#oddsOUTable input,
#oddsOUTable select {
  width: 70px;
  min-height: 34px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

#oddsGridTable input::placeholder,
#oddsOUTable input::placeholder {
  font-size: 10px;
  color: var(--text-muted);
}

.odds-grid-panel h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== Wager Odds Cards ===== */
#wagerOddsGrid,
#wagerBetRow {
  grid-column: 1 / -1;
}

.wager-odds-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wager-odds-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.wager-odds-half h4 {
  margin: 0 0 4px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
}

.wager-odds-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.wager-odds-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
  min-height: 62px;
}

.wager-odds-card:hover {
  border-color: var(--brand);
  background: rgba(0, 168, 107, 0.06);
}

.wager-odds-card.selected {
  border-color: var(--brand);
  background: rgba(0, 168, 107, 0.12);
  box-shadow: 0 0 0 1px var(--brand);
}

.wager-odds-card.empty {
  opacity: 0.25;
  cursor: default;
  border-style: dashed;
}
.wager-odds-card.empty:hover {
  border-color: var(--border);
  background: var(--bg-tertiary);
}

.woc-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.woc-sub {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
}

.woc-odds {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

/* Inline row: date + time + stake */
.wager-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 8px;
  align-items: end;
}
.wager-inline-row label { font-size: 11px; }

.wager-bet-section {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.wager-bet-section h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.wager-bet-section .hint {
  margin: 8px 0;
  font-size: 11px;
}

.wager-bet-section button {
  width: 100%;
}

#wagerDate,
#wagerTime {
  opacity: 0.7;
  cursor: default;
  background: var(--bg-secondary);
  color: var(--brand);
  font-family: var(--font-mono);
  font-weight: 600;
}

.odds-grid-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.odds-grid-actions button {
  flex: 1;
}

.odds-grid-panel button {
  width: 100%;
}

.odds-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--bg-hover);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pill.income,
.pill.playerLost,
.pill.halfLost {
  color: #00e676;
  background: rgba(0, 230, 118, 0.12);
}

.pill.expense,
.pill.playerWon,
.pill.halfWon {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
}

.pill.bet,
.pill.pending {
  color: var(--gold);
  background: rgba(245, 166, 35, 0.12);
}

.pill.push,
.pill.cancelled {
  color: var(--blue);
  background: rgba(52, 152, 219, 0.12);
}

.positive {
  color: #00e676;
  font-weight: 700;
  font-family: var(--font-mono);
}

.negative {
  color: #ff5252;
  font-weight: 700;
  font-family: var(--font-mono);
}

.status-select {
  min-width: 160px;
}

td small {
  color: var(--text-muted);
}

.empty {
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.settings-form {
  gap: 14px;
}

.settings-form label {
  gap: 6px;
}

.setup-steps {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.setup-steps p {
  margin: 0;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  font-size: 14px;
}

.toast.success {
  background: linear-gradient(135deg, #00c853, #009624);
}

.toast.error {
  background: linear-gradient(135deg, #e53935, #b71c1c);
}

.toast.info {
  background: linear-gradient(135deg, var(--blue), #1565c0);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  min-width: 360px;
  max-width: 440px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.modal p {
  margin: 0 0 20px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  min-height: 38px;
  padding: 8px 18px;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-cancel {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-cancel:hover {
  background: var(--bg-hover);
}

.btn-danger {
  color: #fff;
  background: var(--red);
}

.btn-danger:hover {
  background: var(--red-hover);
}

.btn-primary {
  color: #fff;
  background: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
}

/* Login Screen */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-primary);
}
.login-box {
  width: 340px; padding: 36px 28px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-align: center; box-shadow: var(--shadow-lg);
}
.login-box .brand-mark {
  display: inline-grid; place-items: center; width: 56px; height: 56px;
  border-radius: var(--radius-md); font-weight: 900; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--brand), #00955e);
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.4); margin-bottom: 16px;
}
.login-box h2 { margin: 0 0 16px; font-size: 20px; }
.login-box input {
  width: 100%; min-height: 44px; margin-bottom: 10px; padding: 10px 14px;
  color: var(--text-primary); background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; text-align: center;
}
.login-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); outline: none; }
.login-box button {
  width: 100%; min-height: 44px; color: #fff;
  background: linear-gradient(135deg, var(--brand), #00955e); border: none;
  border-radius: var(--radius-md); font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}
.login-error { color: var(--red); font-size: 12px; min-height: 18px; margin: 4px 0; }

.backup-info { margin-top: 16px; padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-sm); }
.backup-info p { margin: 4px 0; font-size: 13px; color: var(--text-secondary); }
.backup-info strong { color: var(--text-primary); }
.backup-info code { color: var(--brand); background: rgba(0,168,107,0.1); padding: 2px 6px; border-radius: 3px; font-size: 12px; }

.restore-btn {
  min-height: 28px; padding: 4px 10px;
  color: var(--brand); background: rgba(0,168,107,0.1);
  border: 1px solid rgba(0,168,107,0.2); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.restore-btn:hover { background: rgba(0,168,107,0.2); }

/* Delete buttons */
.delete-btn {
  min-height: 32px;
  min-width: 32px;
  padding: 5px 10px;
  color: var(--red);
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.delete-btn:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.3);
}

.edit-btn {
  min-height: 32px;
  min-width: 32px;
  padding: 5px 10px;
  color: var(--blue);
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.edit-btn:hover {
  background: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.3);
}

.edit-player-btn {
  min-height: 28px;
  min-width: 28px;
  padding: 3px 6px;
  color: var(--blue);
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
}

.edit-player-btn:hover {
  background: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.3);
}
}

.actions-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Odds display */
.odds-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--gold);
}

/* Responsive */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 20px;
  }

  .topbar,
  .panel-title,
  .table-title {
    display: grid;
  }

  .stats-grid,
  .entry-form,
  .nav,
  .inline-form,
  .result-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}

/* ===== Data tab ===== */
.data-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.data-actions button,
.data-actions .file-btn {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#exportBtn {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #00955e);
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}
#exportBtn:hover {
  background: linear-gradient(135deg, var(--brand-hover), #00a86b);
  box-shadow: 0 6px 20px rgba(0, 168, 107, 0.4);
  transform: translateY(-1px);
}

#exportDataJsonBtn {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--gold), #e09610);
  box-shadow: 0 4px 16px var(--gold-glow);
}
#exportDataJsonBtn:hover {
  background: linear-gradient(135deg, var(--gold-hover), var(--gold));
  box-shadow: 0 6px 24px rgba(245, 166, 35, 0.5);
  transform: translateY(-1px);
}

.file-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1565c0);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}
.file-btn:hover {
  background: linear-gradient(135deg, var(--blue-hover), #1976d2);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
  transform: translateY(-1px);
}

.btn-danger-outline {
  color: var(--red);
  background: transparent;
  border: 1px solid rgba(231, 76, 60, 0.4) !important;
}
.btn-danger-outline:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: var(--red) !important;
}

/* Optgroup styling for fixture select */
optgroup {
  color: var(--gold);
  font-weight: 700;
  font-style: normal;
  background: var(--bg-tertiary);
}
optgroup option {
  color: var(--text-primary);
  font-weight: 500;
}

/* Pill cho cancelled tách màu khỏi push */
.pill.cancelled {
  color: var(--text-muted);
  background: rgba(140, 140, 140, 0.15);
}

/* Status select trong cell action ngắn lại để khớp delete button */
.actions-cell .status-select {
  min-width: 140px;
}

/* Sub-title spacing nhẹ */
.sub-title h2 {
  font-size: 15px;
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    align-items: center;
  }

  .brand {
    padding-bottom: 0;
    border-bottom: none;
    flex: 1;
  }
  .brand strong { font-size: 13px; }
  .brand span { font-size: 10px; }
  .brand-mark { width: 32px; height: 32px; font-size: 14px; }

  .nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex-wrap: wrap;
  }
  .nav-item {
    width: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
  .nav-item.active::after { display: none; }

  .limit-box {
    margin-top: 0;
    padding: 8px 12px;
    flex: 1 1 100%;
  }
  .limit-box strong { font-size: 20px; }

  .main { padding: 14px 12px; }

  .topbar { flex-direction: column; gap: 10px; }
  h1 { font-size: 20px; }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat strong { font-size: 22px; }

  .entry-form,
  .result-form {
    grid-template-columns: 1fr;
  }

  .wager-odds-row-pair {
    grid-template-columns: 1fr;
  }

  .wager-inline-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .odds-grid-actions {
    flex-direction: column;
  }

  .odds-filters { justify-content: center; }

  .data-actions {
    flex-direction: column;
  }
  .data-actions button,
  .data-actions .file-btn {
    width: 100%;
    justify-content: center;
  }

  .filters {
    flex-direction: column;
  }
  .filters select { width: 100%; min-width: auto; }

  table { min-width: 600px; font-size: 11px; }
  th, td { padding: 6px; }

  .panel { padding: 14px; }

  .login-box {
    width: 90%;
    max-width: 320px;
    padding: 28px 20px;
  }

  .odds-grid-panel { padding: 12px; }
  #oddsGridTable input,
  #oddsGridTable select,
  #oddsOUTable input,
  #oddsOUTable select {
    width: 52px;
    min-height: 30px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .wager-inline-row {
    grid-template-columns: 1fr 1fr;
  }
  .wager-inline-row label:last-child {
    grid-column: 1 / -1;
  }

  .topbar h1 { font-size: 17px; }
  .eyebrow { font-size: 11px; }

  .nav-item { padding: 6px 10px; font-size: 11px; }
}

/* ===== SBOBET ODDS FETCH ROW ===== */
.odds-sbobet-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}
.odds-sbobet-row input {
  min-width: 280px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.odds-sbobet-row input:focus {
  border-color: var(--accent);
  outline: none;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-accent:hover { filter: brightness(1.1); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Admin Chat (giống player chat) === */
.admin-chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 420px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.admin-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-chat-head strong { font-size: 13px; color: var(--text-primary); }
.admin-chat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-chat-tools span { color: var(--text-muted); font-size: 10px; }
.admin-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
/* Reuse player chat message classes - same look */
.chat-message {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.chat-message:hover { border-color: rgba(255,255,255,0.18); }
.chat-message.pinned {
  border-color: rgba(245,158,11,0.70);
  box-shadow: 0 0 0 1px rgba(245,158,11,0.12) inset;
}
.chat-message.selected {
  border-color: var(--accent);
  background: rgba(245,158,11,0.10);
}
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
}
.chat-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.chat-name {
  max-width: 120px;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #f59e0b;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.chat-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-actions {
  display: none;
  margin-top: 6px;
  gap: 6px;
  justify-content: flex-end;
}
.chat-message.selected .chat-actions { display: flex; }
.chat-actions button {
  padding: 2px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: #ccc;
}
.chat-actions button:hover { background: rgba(255,255,255,0.14); color: #fff; }
.chat-actions .chat-action-del:hover { border-color: #ef4444; color: #ef4444; }
.chat-actions .chat-action-pin:hover { border-color: #f59e0b; color: #f59e0b; }
.admin-chat-form {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 6px;
  margin-top: 10px;
}
.admin-chat-form input {
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.admin-chat-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  outline: none;
}
.admin-chat-form button {
  height: 36px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chat-toolbar-btn {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  color: #999;
  font-size: 11px;
}
.chat-toolbar-btn:hover { background: rgba(239,68,68,0.20); color: #ef4444; border-color: #ef4444; }