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

:root {
  /* Dark admin — neutros + un acento azul (legible en web) */
  --bg-page: #0f1219;
  --bg: #151922;
  --surface: #1c2130;
  --surface-raised: #252b3b;
  --surface-hover: #2d3548;
  --surface-input: #12151e;
  --text: #f0f2f5;
  --text-secondary: #c5cad3;
  --muted: #8b93a7;
  --primary: #4d8ef7;
  --primary-hover: #3b7fe8;
  --accent: #4d8ef7;
  --success: #34c759;
  --success-hover: #2db84e;
  --danger: #ff5c5c;
  --warning: #e5a029;
  --border: #2e3648;
  --border-light: #3a4358;
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App header (2 rows) ── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.header-bar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

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

.user-pill {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  background: var(--surface-raised);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.nav-menu {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar { display: none; }

.nav-item {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  text-decoration: none;
  display: inline-block;
}

.nav-item:hover { color: var(--text); background: var(--surface-hover); }

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

/* ── Layout ── */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.panel { display: block; }
.panel.hidden { display: none !important; }

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  border-left-width: 3px;
}

.stat-channels { border-left-color: var(--primary); }
.stat-extracted { border-left-color: #a78bfa; }
.stat-direct { border-left-color: #38bdf8; }
.stat-iptv { border-left-color: var(--warning); }
.stat-users { border-left-color: #38bdf8; }
.stat-devices { border-left-color: var(--success); }

.stat .label {
  color: var(--muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat .value {
  font-size: 1.625rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Quick actions ── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.quick-card:hover {
  background: var(--surface-raised);
  border-color: var(--primary);
}

.quick-card:hover .qc-desc { color: var(--muted); }

.quick-card .qc-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.quick-card .qc-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.quick-card .qc-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Cards & panels ── */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card-panel-title {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.card .muted { margin: 0 0 1rem; font-size: 0.8125rem; }

/* ── Forms ── */
.field { margin-bottom: 1rem; }

.field label,
label.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea,
label:not(.import-item) > input:not([type="checkbox"]):not([type="radio"]),
label:not(.import-item) > select,
label:not(.import-item) > textarea {
  display: block;
  width: 100%;
}

input, select, textarea {
  background: var(--surface-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s;
}

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

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
}

label.inline input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input[type="search"],
.toolbar input:not([type="checkbox"]) {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}

/* ── Buttons ── */
.btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
  color: var(--text);
}

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

.btn.accent {
  background: var(--surface-raised);
  border-color: var(--primary);
  color: var(--primary);
}
.btn.accent:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn.ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: transparent;
}

.btn.sm { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }

.btn.play {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  min-width: 2rem;
}
.btn.play:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
  color: #fff;
}

/* ── Tables ── */
.table-wrap {
  overflow: auto;
  max-height: 54vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

th, td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  z-index: 1;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-raised); }

.pager {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.875rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8125rem;
}

.muted { color: var(--muted); }
.error { color: var(--danger); }
.mt-sm { margin-top: 0.75rem; }

.notify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.quiniela-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: fit-content;
}

.quiniela-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.quiniela-tab:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.quiniela-tab.active {
  background: var(--primary);
  color: #fff;
}

.quiniela-subpanel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

@media (max-width: 960px) {
  .matches-form-grid {
    grid-template-columns: 1fr;
  }
}

.quiniela-matches-panel {
  margin-top: 0.25rem;
}

.standings-panel {
  max-width: 720px;
}

.standings-note {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.875rem;
}

.standings-table tbody tr.rank-gold td:first-child {
  color: #f5c842;
  font-weight: 700;
}

.standings-table tbody tr.rank-silver td:first-child {
  color: #b8c4d0;
  font-weight: 700;
}

.standings-table tbody tr.rank-bronze td:first-child {
  color: #d4956a;
  font-weight: 700;
}

.standings-table td:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

.table-scroll {
  max-height: 420px;
  overflow: auto;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill.pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.status-pill.claimed { background: rgba(33, 150, 243, 0.2); color: #64b5f6; }
.status-pill.paid { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.status-pill.cancelled { background: rgba(255, 92, 92, 0.15); color: #ff8a8a; }

.import-list {
  margin: 0.75rem 0;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.import-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.import-item:hover {
  border-color: var(--border-light);
  background: var(--surface-hover);
}

.import-item strong { color: var(--text); font-weight: 600; }
.import-item .muted { color: var(--muted); font-size: 0.8125rem; }

.import-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.import-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.import-item .match-teams-cell.compact {
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  font-size: 0.95rem;
}

.import-item .match-teams-cell.compact strong {
  font-size: 0.95rem;
  white-space: nowrap;
}

.import-item .team-logo,
.import-item .team-logo-ph {
  width: 32px;
  height: 32px;
}

.import-item .team-logo-ph {
  font-size: 18px;
}

.import-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
}

.match-teams-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.match-teams-cell.compact strong { font-size: 0.9rem; }

.team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-logo-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  background: var(--surface);
  border-radius: 50%;
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(255, 92, 92, 0.35);
}

.btn.danger:hover {
  background: rgba(255, 92, 92, 0.12);
}

td.actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.import-empty {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.import-loading {
  padding: 1rem;
  text-align: center;
  color: var(--primary);
}

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

.source-channel-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.source-channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.source-channel-item .name {
  font-weight: 500;
  font-size: 0.8125rem;
}

.source-channel-item .url {
  font-size: 0.6875rem;
  word-break: break-all;
  margin-top: 0.15rem;
}

.lookup, .log-view {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.75rem;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--text-secondary);
}

.log-view { max-height: 48vh; }

.toast {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #152318;
  border: 1px solid var(--success);
  color: #86efac;
  font-size: 0.875rem;
}
.toast.error {
  background: #231515;
  border-color: var(--danger);
  color: #fca5a5;
}

.alert {
  margin-top: 0.875rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  background: #231515;
  border: 1px solid var(--danger);
  color: #fca5a5;
  font-size: 0.8125rem;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.badge.extracted { background: #1e1a30; border-color: #7c6df0; color: #c4b5fd; }
.badge.iptv { background: #2a2210; border-color: var(--warning); color: #fcd34d; }
.badge.direct { color: var(--muted); }
.badge.ok { background: #152318; border-color: var(--success); color: #86efac; }
.badge.off { background: #231515; border-color: var(--danger); color: #fca5a5; }

td.actions { white-space: nowrap; }
td.actions .btn { margin-right: 0.25rem; }

/* ── Player ── */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .player-layout { grid-template-columns: 1fr; }
  .header-bar { padding: 0 1rem; }
  .nav-menu { padding: 0 1rem; }
  .layout { padding: 1.25rem 1rem 2rem; }
}

.player-box {
  background: #0a0c10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  position: relative;
}

.player-box video {
  width: 100%;
  height: 100%;
  background: #0a0c10;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0a0c10;
  color: var(--muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.player-overlay.hidden { display: none; }

.player-meta {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.player-meta h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; }

.player-meta code {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  word-break: break-all;
  color: var(--primary);
}

.channel-list {
  max-height: calc(56vh + 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5625rem 0.75rem;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.channel-item:hover {
  border-color: var(--border-light);
  background: var(--surface-raised);
}

.channel-item.active {
  border-color: var(--primary);
  background: #1a2438;
}

.channel-item .name {
  font-weight: 500;
  font-size: 0.8125rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-status { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--muted); }
.player-status.error { color: var(--danger); }

/* ── Login ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.login-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.login-header .brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  margin: 0 auto 1rem;
  font-size: 1rem;
}

.login-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.login-body {
  padding: 1.5rem 2rem 2rem;
}

.login-body button[type="submit"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6875rem;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.login-body button[type="submit"]:hover { background: var(--primary-hover); }

.hidden { display: none !important; }

/* ── Channel modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.modal-body input[type="text"],
.modal-body input:not([type]),
.modal-body textarea,
.modal-body input[type="file"] {
  font: inherit;
  color: var(--text);
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.modal-actions .spacer { flex: 1; }

/* ── Scraper result modal ── */
.scraper-modal-card {
  width: min(640px, 100%);
}

.scraper-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scraper-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  text-align: center;
}

.scraper-loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: scraper-spin 0.75s linear infinite;
}

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

.scraper-loader-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.scraper-summary {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.scraper-summary.is-ok {
  background: #0f2918;
  border: 1px solid #22c55e;
  color: #86efac;
}

.scraper-summary.is-error {
  background: #2a1212;
  border: 1px solid var(--danger, #ef4444);
  color: #fca5a5;
}

.scraper-modal-detail {
  margin: 0;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  line-height: 1.5;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--muted);
}

.scraper-modal-actions {
  padding: 0 1.25rem 1.25rem;
  border-top: none;
  justify-content: flex-end;
}

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

.btn.danger:hover {
  background: rgba(255, 92, 92, 0.12);
}

.ch-logo-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.ch-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.ch-logo-fields { flex: 1; min-width: 0; }

.ch-logo-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: var(--surface-input);
  border-radius: 4px;
  vertical-align: middle;
}

.ch-logo-placeholder {
  display: inline-block;
  width: 36px;
  height: 36px;
  background: var(--surface-input);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 36px;
  text-align: center;
}

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

/* ── Match settle / participants modals ── */
.modal-card-wide {
  max-width: min(720px, 96vw);
}

.settle-teams-preview {
  margin-bottom: 1rem;
}

.settle-teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: var(--surface-input);
  border-radius: var(--radius);
}

.settle-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 100px;
  text-align: center;
}

.settle-team-role {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.settle-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.team-name-label {
  font-weight: 600;
  color: var(--text);
}
