:root {
  --bg: #0b1220;
  --bg-elevated: #121b2e;
  --bg-hover: #18233a;
  --border: #24314d;
  --text: #e8eefc;
  --text-muted: #93a4c7;
  --accent: #f7b000;
  --accent-soft: rgba(247, 176, 0, 0.15);
  --success: #3ecf8e;
  --danger: #ff6b6b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", system-ui, sans-serif;
  background: radial-gradient(circle at top left, #15213a, var(--bg) 45%);
  color: var(--text);
}

html {
  overflow-x: hidden;
}

a {
  color: var(--accent);
}

code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(10, 16, 28, 0.92);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
}

.brand__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.brand__subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.menu__item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s ease;
}

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

.menu__item.active {
  background: var(--accent-soft);
  border-color: rgba(247, 176, 0, 0.35);
}

.menu__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  max-width: 56%;
  line-height: 1.25;
}

.menu__meta small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auto-refresh {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer__copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.site-footer__support {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.site-footer__support a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.site-footer__support a:hover {
  text-decoration: underline;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(18, 27, 46, 0.65);
}

.auth-panel__hint {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.auth-panel__email {
  font-size: 0.88rem;
  font-weight: 600;
  word-break: break-all;
}

.auth-panel__credits {
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0.35rem 0 0.65rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.auth-tabs__btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.auth-tabs__btn.active {
  color: var(--text);
  border-color: rgba(247, 176, 0, 0.45);
  background: var(--accent-soft);
}

#auth-error {
  color: var(--danger);
}

.content {
  padding: 1.5rem 1.75rem 2rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.toolbar h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}

.toolbar__hint {
  margin: 0;
  color: var(--text-muted);
}

.toolbar__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: #111;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

#refresh-btn {
  color: var(--text-muted);
}

#ai-bet-btn {
  padding: 0.72rem 1.15rem;
  box-shadow:
    0 0 0 1px rgba(247, 176, 0, 0.35),
    0 8px 24px rgba(247, 176, 0, 0.18);
}

#ai-bet-btn:not(.hidden):hover {
  filter: brightness(1.06);
}

.btn--full {
  width: 100%;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert.hidden {
  display: none;
}

.alert--warning {
  background: rgba(247, 176, 0, 0.12);
  border-color: rgba(247, 176, 0, 0.35);
}

.alert--error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.summary__card {
  background: rgba(18, 27, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.summary__label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.summary__card strong {
  font-size: 1.05rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 27, 46, 0.72);
  box-shadow: var(--shadow);
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.events-table th,
.events-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.events-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.events-table .subhead th {
  font-size: 0.72rem;
  padding-top: 0;
}

.events-table td:nth-child(2) {
  text-align: left;
  min-width: 260px;
}

.event-title {
  font-weight: 600;
}

.event-league {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.cell-pair {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.cell-pair span:first-child {
  color: var(--accent);
  font-weight: 700;
}

.cell-pair span:last-child {
  color: var(--text-muted);
}

.empty {
  padding: 2rem !important;
  color: var(--text-muted);
}

.dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text);
  width: min(560px, calc(100% - 2rem));
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog__content {
  position: relative;
  padding: 1.25rem;
}

.dialog__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 18, 32, 0.85);
  border-radius: 16px;
  backdrop-filter: blur(2px);
}

.dialog__loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.dialog__loading-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(247, 176, 0, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dialog__header h2 {
  margin: 0;
}

.dialog__text {
  color: var(--text-muted);
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1rem;
}

.field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1526;
  color: var(--text);
  padding: 0.75rem;
  font: inherit;
  resize: vertical;
}

.dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

.dialog--wide {
  width: min(860px, calc(100% - 2rem));
}

.field__label {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.field__input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1526;
  color: var(--text);
  padding: 0.75rem;
  font: inherit;
}

.field__hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.field__error {
  margin: 0.5rem 0 0;
  color: #f87171;
  font-size: 0.85rem;
}

.field--radio {
  border: none;
  padding: 0;
  margin-top: 1rem;
}

.field--radio legend {
  padding: 0;
}

.method-selector {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.method-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #0d1526;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.method-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.method-option input {
  accent-color: var(--accent);
}

.brief-options {
  margin-top: 0.35rem;
}

.brief-variant-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.brief-variant-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1526;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.brief-variant-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.brief-variant-card.is-active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.brief-variant-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.brief-variant-card__meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-decoration: none;
  opacity: 1;
}

.brief-variant-card:not(.is-active) .brief-variant-card__meta {
  color: var(--text-muted);
  opacity: 1;
  text-decoration: none;
}

.brief-variant-card__savings {
  font-size: 0.84rem;
  color: #86efac;
  font-weight: 500;
}

@media (max-width: 640px) {
  .brief-variant-picker {
    grid-template-columns: 1fr;
  }
}

.field__input[aria-invalid="true"] {
  border-color: #f87171;
}

.coupon-box {
  margin-top: 1rem;
  display: grid;
  gap: 0.65rem;
}

.coupon-box__text {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1526;
  color: var(--text);
  text-decoration: none;
  opacity: 1;
  -webkit-text-fill-color: currentColor;
  padding: 0.85rem;
  font: 0.88rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}

.coupon-lines {
  text-decoration: none !important;
  opacity: 1;
}

.ai-brief-savings {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 120, 0.35);
  background: rgba(56, 189, 120, 0.08);
  color: #86efac;
  font-size: 0.92rem;
  line-height: 1.45;
}

.ai-brief-details {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.ai-brief-details__body {
  margin-top: 0.5rem;
}

.ai-brief-details__intro {
  margin: 0;
}

.ai-brief-details__dynamic {
  margin-top: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: rgba(96, 165, 250, 0.06);
}

.ai-brief-details__dynamic-line {
  margin: 0;
}

.ai-brief-details__dynamic-line + .ai-brief-details__dynamic-line {
  margin-top: 0.45rem;
}

.ai-brief-details__list {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
}

.ai-brief-details__list li + li {
  margin-top: 0.45rem;
}

.ai-brief-details summary {
  cursor: pointer;
  color: var(--accent);
  user-select: none;
}

.ai-brief-details p {
  margin: 0.5rem 0 0;
}

.ai-warnings {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--accent);
}

.ai-picks {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.ai-pick {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.ai-pick__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.45rem;
}

.ai-pick__title {
  font-weight: 600;
}

.ai-pick__outcome {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  white-space: nowrap;
}

.ai-pick__league {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.ai-pick__reason {
  line-height: 1.45;
  font-size: 0.92rem;
}

.uncertainty-info {
  display: inline-flex;
  align-items: center;
  position: relative;
  vertical-align: middle;
  margin-left: 0.1rem;
}

.uncertainty-info__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: help;
  line-height: 1;
  vertical-align: baseline;
}

.uncertainty-info__btn:hover,
.uncertainty-info__btn:focus-visible,
.uncertainty-info.is-open .uncertainty-info__btn {
  color: var(--accent);
  outline: none;
}

.uncertainty-info__tip {
  display: block;
  position: absolute;
  z-index: 30;
  left: 50%;
  top: calc(100% + 0.45rem);
  bottom: auto;
  transform: translateX(-50%);
  box-sizing: border-box;
  min-width: min(18rem, calc(100vw - 2rem));
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #121b2e;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: left;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.uncertainty-info__tip strong {
  color: var(--accent);
  font-weight: 600;
}

.uncertainty-info:hover .uncertainty-info__tip,
.uncertainty-info:focus-within .uncertainty-info__tip,
.uncertainty-info.is-open .uncertainty-info__tip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ai-result-dialog .uncertainty-info__tip {
  max-width: min(22rem, calc(100vw - 2.5rem));
}

.ai-result-dialog .dialog__content {
  overflow: visible;
}

.ai-result-dialog code {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}

.ai-pick__stats {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ai-pick__coupon {
  margin: 0.35rem 0 0.5rem;
}

.ai-visual {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.ai-visual__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.ai-visual__head h3 {
  margin: 0;
  font-size: 1rem;
}

.ai-visual__hint {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}

.coverage-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}

.coverage-card--varies {
  border-color: rgba(247, 176, 0, 0.45);
  background: rgba(247, 176, 0, 0.06);
}

.coverage-card__num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.82rem;
}

.coverage-card__teams {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0.35rem;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
}

.coverage-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.coverage-chip small {
  font-weight: 600;
  opacity: 0.85;
}

.coverage-chip--solid {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(247, 176, 0, 0.35);
}

.coverage-chip--mixed {
  background: rgba(62, 207, 142, 0.12);
  color: var(--success);
  border-color: rgba(62, 207, 142, 0.35);
}

.coverage-chip--minor {
  background: rgba(147, 164, 199, 0.12);
  color: var(--text-muted);
  border-color: var(--border);
}

.variants-wrap {
  margin-top: 1rem;
}

.variants-wrap__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.variants-wrap__controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn--tiny {
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
}

.variants-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.variants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.variants-table th,
.variants-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.4rem;
  text-align: center;
  white-space: nowrap;
}

.variants-table thead th {
  position: sticky;
  top: 0;
  background: #10182b;
  z-index: 1;
}

.variant-index {
  font-weight: 700;
  color: var(--text-muted);
  text-align: left !important;
  position: sticky;
  left: 0;
  background: #10182b;
  z-index: 1;
}

.variant-cell {
  font-weight: 700;
}

.variant-cell--changed {
  background: rgba(247, 176, 0, 0.18);
  color: var(--accent);
}

.admin-page {
  min-height: 100vh;
}

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.admin-header h1 {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
}

.admin-header__back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-header__back:hover {
  color: var(--accent);
}

.admin-header__hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-card {
  background: rgba(18, 27, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.admin-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.admin-card__text {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-stats-summary {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.admin-stats-summary strong {
  font-weight: 700;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 420px;
}

.admin-error {
  color: var(--danger);
}

.admin-tabs {
  display: flex;
  gap: 0.6rem;
}

.admin-tab-btn.is-active {
  border-color: rgba(247, 176, 0, 0.55);
  color: #fff;
  background: rgba(247, 176, 0, 0.18);
}

.admin-users-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-actions-inline {
  display: flex;
  gap: 0.55rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-limit-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.admin-limit-input {
  width: 5rem;
  min-width: 4.5rem;
  padding: 0.4rem 0.5rem;
}

.admin-history-package-btn {
  margin-top: 0.25rem;
}

.admin-history-package-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.admin-history-filter {
  min-width: 9rem;
  flex: 1 1 9rem;
}

.admin-history-stats {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.admin-table--compact th,
.admin-table--compact td {
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
}

.admin-history-table-wrap {
  overflow-x: auto;
}

.admin-history-table th,
.admin-history-table td {
  vertical-align: top;
  font-size: 0.82rem;
}

.admin-history-cell {
  min-width: 7.5rem;
}

.admin-history-cell--empty {
  color: var(--muted);
  text-align: center;
}

.admin-history-cell__hits {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.admin-history-cell__muted {
  color: var(--muted);
}

.admin-history-cell__sep {
  margin: 0 0.15rem;
  color: var(--muted);
}

.admin-history-cell__payout {
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}

.admin-history-row--evaluated {
  box-shadow: inset 3px 0 0 #3fb950;
}

.admin-history-row--progress {
  box-shadow: inset 3px 0 0 rgba(227, 179, 65, 0.75);
}

.admin-history-row--waiting {
  box-shadow: inset 3px 0 0 rgba(139, 148, 158, 0.65);
}

.admin-history-row--error {
  box-shadow: inset 3px 0 0 #f85149;
}

.admin-history-cell--evaluated {
  background: rgba(63, 185, 80, 0.06);
}

.admin-history-cell--progress {
  background: rgba(227, 179, 65, 0.07);
}

.admin-history-cell--waiting {
  background: rgba(139, 148, 158, 0.08);
}

.admin-history-cell--error {
  background: rgba(248, 81, 73, 0.08);
}

.admin-status-pill {
  display: inline-block;
  margin-bottom: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}

.admin-status-pill--evaluated {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.15);
  border-color: rgba(63, 185, 80, 0.35);
}

.admin-status-pill--progress {
  color: #e3b341;
  background: rgba(227, 179, 65, 0.12);
  border-color: rgba(227, 179, 65, 0.3);
}

.admin-status-pill--waiting {
  color: var(--text-muted);
  background: rgba(139, 148, 158, 0.14);
  border-color: rgba(139, 148, 158, 0.35);
}

.admin-status-pill--error {
  color: #f85149;
  background: rgba(248, 81, 73, 0.15);
  border-color: rgba(248, 81, 73, 0.35);
}

.btn--tiny {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

body.admin-modal-open {
  overflow: hidden;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.68);
  overflow-y: auto;
}

.admin-modal__panel {
  width: min(56rem, 100%);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5);
}

.admin-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-modal__meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-modal__body {
  padding: 1rem 1.1rem 1.25rem;
}

.admin-detail-summary {
  margin-bottom: 1rem;
}

.admin-detail-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.65rem 1rem;
}

.admin-detail-summary__label {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.admin-detail-summary__note {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.admin-detail-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-modal__panel .admin-table td {
  color: var(--text);
}

.admin-detail-matches__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.admin-detail-matches-table tr.is-hit {
  background: rgba(46, 160, 67, 0.12);
}

.admin-detail-matches-table tr.is-miss {
  background: rgba(248, 81, 73, 0.08);
}

.admin-detail-matches-table tr.is-pending {
  background: rgba(139, 148, 158, 0.08);
}

.admin-detail-match__teams {
  min-width: 10rem;
}

.admin-detail-match__picks {
  white-space: nowrap;
}

.admin-detail-match__hit {
  text-align: center;
  font-weight: 600;
}

.admin-detail-match__hit--pending {
  color: var(--text-muted);
  font-weight: 400;
}

.admin-outcome-pill-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-right: 0.35rem;
  vertical-align: top;
}

.admin-outcome-package {
  margin-top: 0.12rem;
  font-size: 0.62rem;
  line-height: 1.1;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-outcome-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-outcome-pill.is-selected {
  border-color: var(--accent);
  color: var(--text);
}

.admin-outcome-pill.is-actual {
  border-color: #d29922;
  color: #e3b341;
}

.admin-outcome-pill.is-hit {
  border-color: #3fb950;
  background: rgba(63, 185, 80, 0.18);
  color: #3fb950;
  font-weight: 600;
}

.admin-outcome-pill.is-miss {
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
  font-weight: 600;
}

.admin-outcome-pill.is-pending {
  border-color: rgba(139, 148, 158, 0.55);
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-muted);
}

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

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

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