:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --text: #1f2933;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f1f3f5;
  --dark: #0b0d10;
  --sidebar-bg: #0b0d10;
  --sidebar-line: #1f2227;
  --sidebar-text: #d1d5db;
  --sidebar-muted: #6b7280;
  --sidebar-hover: #15181d;
  --sidebar-active: #1c2026;
  --accent: #0f172a;
  --accent-dark: #020617;
  --blue: #2563eb;
  --green: #087f5b;
  --green-soft: #e9f7f2;
  --red: #b42318;
  --lime: #e1ff83;
  --tooltip-bg: #0b0d10;
  --tooltip-text: #ffffff;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
  --backdrop: rgba(15, 23, 42, 0.45);
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 600;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  border-color: #b8c0cc;
  background: #f9fafb;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
  border-color: var(--blue);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  min-height: 32px;
}

button.ghost:hover {
  background: var(--line-soft);
  color: var(--text);
}

button.ghost.danger {
  color: var(--red);
}

button.ghost.danger:hover {
  background: #fdecea;
  color: var(--red);
}

button.danger-solid {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

button.danger-solid:hover {
  border-color: #8c1812;
  background: #8c1812;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 11px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  cursor: pointer;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--sidebar-bg);
  padding: 24px;
}

.login-panel {
  display: grid;
  justify-items: center;
  gap: 24px;
  width: min(320px, 100%);
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  background: #111418;
  color: var(--sidebar-text);
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.login-panel .brand-logo {
  width: 110px;
}

.login-notice {
  margin: -8px 0 0;
  color: var(--sidebar-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.login-panel button.primary {
  width: 100%;
  min-height: 42px;
  border-color: var(--lime);
  background: var(--lime);
  color: var(--dark);
  font-weight: 700;
}

.login-panel button.primary:hover {
  border-color: #cdf055;
  background: #cdf055;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: 110px;
  height: auto;
}

.brand-logo.small {
  width: 86px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 800;
}

.loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
}

.inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner.mini {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}

.loading-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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


.ui-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

[data-tooltip] {
  cursor: help;
}

.stats-perform-mark {
  flex: 0 0 auto;
  width: auto;
  height: 13px;
}

.opta-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 0;
  height: 30px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: copy;
}

.opta-id-chip:hover {
  border-color: var(--muted-soft);
  background: var(--panel);
}

.opta-id-chip .stats-perform-mark {
  height: 14px;
}

.opta-id-chip .opta-id-value {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opta-id-chip .copy-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.opta-id-chip:hover .copy-icon {
  color: var(--text);
}

.opta-match-id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

button.opta-match-id {
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: copy;
}

button.opta-match-id:hover {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.opta-match-id .stats-perform-mark {
  height: 11px;
}

.stats-perform-logo {
  display: inline-block;
  width: 61px;
  height: 16px;
  margin-left: 8px;
  background: url('../stats-perform-logo.png') -2.6px -9.1px / 66px 34.3px
    no-repeat;
  vertical-align: -2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
