:root {
  --bg-dark: #0f1318;
  --bg-table: #13181f;
  --bg-header: #171d25;
  --bg-league: #19212a;
  --bg-row-even: #13181f;
  --bg-row-odd: #151b23;
  --bg-row-hover: #1f2732;
  --border-cell: #232c37;
  --border-strong: #2c3746;
  --text-white: #ffffff;
  --text-silver: #cbd5e1;
  --text-muted: #8492a6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --accent-blue: #38bdf8;
  --site-header-h: 50px;
  --group-header-h: 46px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-x: auto;
}

/* Site Global Header */
.site-header {
  background: #11151c;
  border-bottom: 1px solid var(--border-cell);
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  font-size: 18px;
  color: var(--accent-gold);
}

.brand-text .title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-white);
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 500;
}

/* League Pills */
.header-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 3px 0;
  scrollbar-width: none;
}
.header-pills::-webkit-scrollbar { display: none; }

.pill {
  background: #1a222c;
  border: 1px solid var(--border-cell);
  color: var(--text-silver);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.pill:hover {
  background: #232d3b;
  color: var(--text-white);
}

.pill.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #041829;
  font-weight: 700;
}

/* Right Tabs */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-quick-tabs {
  display: flex;
  align-items: center;
  background: #182029;
  border: 1px solid var(--border-cell);
  border-radius: 5px;
  padding: 2px;
}

.btn-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
}

.btn-tab.active {
  background: #253140;
  color: var(--text-white);
}

.dark-date-input {
  background: transparent;
  border: none;
  color: var(--text-silver);
  font-size: 11px;
  padding: 2px 4px;
  outline: none;
  cursor: pointer;
}

.btn-icon {
  background: #182029;
  border: 1px solid var(--border-cell);
  color: var(--text-silver);
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
}

/* Table Container & Matrix Table (Exact Match to User's Cropped Screenshot) */
.bulten-container {
  max-width: 1440px;
  margin: 12px auto 40px;
  padding: 0 12px;
  min-width: 1160px;
}

.table-frame {
  background: var(--bg-table);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  table-layout: auto;
}

.matrix-table thead {
  position: sticky;
  top: var(--site-header-h, 50px);
  z-index: 900;
}

/* Top Group Header (Maç Sonucu | 1. Yarı Sonucu | Handikap | Alt/Üst 2.5 | Karşılıklı Gol) */
.tr-group-header {
  background: #171d25;
  border-bottom: 1px solid var(--border-cell);
}

.tr-group-header th {
  position: sticky;
  top: var(--site-header-h, 50px);
  z-index: 920;
  background: #171d25;
  background-clip: padding-box;
}

.th-search-cell {
  text-align: left;
  padding: 8px 12px;
  border-right: 1px solid var(--border-cell);
  min-width: 460px;
}

.search-box-inner {
  display: flex;
  align-items: center;
  background: #1f2733;
  border: 1px solid #2d3847;
  border-radius: 6px;
  padding: 6px 12px;
}

.search-glyph {
  font-size: 14px;
  margin-right: 8px;
  opacity: 0.8;
}

.search-box-inner input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 12.5px;
  width: 100%;
  font-family: inherit;
}

.search-box-inner input::placeholder {
  color: #64748b;
}

.count-tag {
  background: #102a3a;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
}

.th-cat {
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  border-right: 1px solid var(--border-cell);
  letter-spacing: 0.2px;
}

.th-cat:last-child {
  border-right: none;
}

/* Column Widths */
.cat-ms { width: 132px; }
.cat-iy { width: 132px; }
.cat-h  { width: 168px; }
.cat-ou { width: 88px; }
.cat-kg { width: 88px; }

/* Sub Header Row (1 0 2 | 1 0 2 | H 1 0 2 | Alt Üst | Var Yok) */
.tr-sub-header {
  background: #151a22;
  border-bottom: 2px solid var(--border-strong);
}

.tr-sub-header th {
  position: sticky;
  top: calc(var(--site-header-h, 50px) + var(--group-header-h, 46px));
  z-index: 915;
  background: #151a22;
  background-clip: padding-box;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.th-sub {
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  border-right: 1px solid var(--border-cell);
}

.th-sub:last-child {
  border-right: none;
}

.col-star { width: 28px; min-width: 28px; text-align: center; }
.col-time { width: 52px; min-width: 52px; text-align: center; }
.col-match { min-width: 360px; text-align: left; padding-left: 14px !important; }
.col-action { width: 32px; min-width: 32px; text-align: center; }
.col-odd { width: 44px; min-width: 44px; }
.col-h-line { width: 36px; min-width: 36px; color: #94a3b8 !important; }

/* League Banner Row */
.tr-league-banner td {
  background: #19212a;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-cell);
  padding: 6px 12px;
  text-align: left;
}

.league-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.league-ico {
  font-size: 15px;
}

.league-name-text {
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-transform: uppercase;
}

.badge-target-db {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

.league-day-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-left: 12px;
}

/* Match Row */
.tr-match-row {
  background: var(--bg-row-even);
  border-bottom: 1px solid var(--border-cell);
  transition: background-color 0.12s ease;
}

.tr-match-row:nth-child(even) {
  background: var(--bg-row-odd);
}

.tr-match-row:hover {
  background: var(--bg-row-hover);
}

/* Match Row Cells */
.td-star {
  text-align: center;
  color: #4b5563;
  cursor: pointer;
  font-size: 15px;
  user-select: none;
  border-right: 1px solid var(--border-cell);
}
.td-star.active { color: var(--accent-gold); }

.td-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  border-right: 1px solid var(--border-cell);
}

.td-match {
  text-align: left;
  padding: 8px 14px;
  font-weight: 700;
  color: #ffffff;
  font-size: 13px;
  border-right: 1px solid var(--border-cell);
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  min-width: 360px;
}

.td-match a {
  color: inherit;
  text-decoration: none;
}
.td-match a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.td-action {
  text-align: center;
  border-right: 1px solid var(--border-cell);
  padding: 4px;
}

.btn-crown-copy {
  background: #059669;
  border: 1px solid #10b981;
  color: white;
  width: 24px;
  height: 22px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.btn-crown-copy:hover {
  background: #10b981;
  transform: scale(1.1);
}

/* Odds Values Cells */
.td-odd {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  border-right: 1px solid var(--border-cell);
  padding: 9px 2px;
  cursor: pointer;
  transition: background-color 0.12s;
  user-select: none;
}

.td-odd:last-child {
  border-right: none;
}

.td-odd:hover {
  background: #2a3647;
  color: #38bdf8;
  font-weight: 700;
}

.td-h-line {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  border-right: 1px solid var(--border-cell);
}

/* Loading & States */
.dark-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-table);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  margin-top: 15px;
}

.dark-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #2d3847;
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.warn-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.btn-dark-primary {
  background: var(--accent-green);
  color: #064e3b;
  font-weight: 700;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

/* Modal */
.dark-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.dark-modal-card {
  background: #182029;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.dark-modal-header {
  background: #1f2a36;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-cell);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}
.btn-close:hover { color: white; }

.dark-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dark-modal-body input {
  background: #11161d;
  border: 1px solid var(--border-cell);
  color: white;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.dark-modal-body small {
  color: var(--text-muted);
}

.quota-box {
  margin-top: 10px;
  padding: 10px;
  background: #11161d;
  border: 1px solid var(--border-cell);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-silver);
}

.dark-modal-footer {
  padding: 12px 16px;
  background: #141b23;
  text-align: right;
  border-top: 1px solid var(--border-cell);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #10b981;
  color: #064e3b;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 3000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
