:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-2: #171717;
  --text: #f7f7f7;
  --muted: #b7b7b7;
  --line: rgba(255, 255, 255, 0.14);
  --red: #ff0719;
  --good: #39d98a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f1;
  --panel: #ffffff;
  --panel-2: #ecece7;
  --text: #111;
  --muted: #5d5d5d;
  --line: rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.portal-login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 7, 25, 0.18), transparent 34%),
    #030303;
}

.login-shell {
  width: min(460px, 100%);
}

.login-panel,
.portal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-panel {
  padding: 34px;
}

.login-panel img {
  width: 190px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  line-height: 1.06;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.15rem, 1.9vw, 1.65rem);
  line-height: 1.14;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.password-wrap {
  display: grid;
  grid-template-columns: 1fr 48px;
}

.password-wrap input {
  border-right: 0;
}

.eye-button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.portal-button,
.mode-toggle {
  border: 1px solid var(--red);
  background: var(--red);
  color: white;
  padding: 12px 16px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.form-error,
.notice {
  border-left: 4px solid var(--red);
  padding: 12px;
  background: rgba(255, 7, 25, 0.1);
}

.portal-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100svh;
}

.control-bar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  text-decoration: none;
}

.portal-brand img {
  width: 66px;
}

.control-bar nav {
  display: grid;
  gap: 10px;
}

.control-bar nav a,
.bar-bottom a {
  padding: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
}

.main-site-link {
  border-color: var(--red) !important;
  background: var(--red);
  color: white;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.bar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.portal-main {
  padding: clamp(28px, 5vw, 64px);
}

.portal-top {
  margin-bottom: 34px;
}

.stat-grid,
.team-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid article,
.portal-card {
  padding: 24px;
}

.stat-grid span,
.portal-card p,
td {
  color: var(--muted);
}

.stat-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 2.1rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
}

.pill.real {
  color: var(--good);
}

.pill.bot,
.text-danger {
  color: var(--red);
}

.editor-form {
  display: grid;
  gap: 6px;
}

.team-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.team-thumb {
  width: min(220px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.text-danger {
  margin-top: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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

  .control-bar {
    position: relative;
    height: auto;
  }

  .stat-grid,
  .team-editor-grid {
    grid-template-columns: 1fr;
  }
}
