:root {
  color-scheme: dark;
  --bg: #0b0c0c;
  --bg-soft: #121414;
  --surface: #1c1d1d;
  --surface-2: #151717;
  --surface-3: #222424;
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --panel-3: var(--surface-3);
  --line: #343636;
  --line-strong: #4b3026;
  --text: #f6f4ef;
  --soft: #d8d7d1;
  --muted: #a7aaa7;
  --faint: #7f8580;
  --court: #1fb7a6;
  --court-2: rgba(31, 183, 166, 0.14);
  --lime: #d7ef65;
  --fire: #ff5a2b;
  --ember: #f6a531;
  --warning: #f6a531;
  --danger: #ff8a70;
  --danger-bg: rgba(255, 90, 43, 0.12);
  --success: #d7ef65;
  --success-bg: rgba(215, 239, 101, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --control: 40px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(75, 31, 18, 0.34) 0, rgba(11, 12, 12, 0.92) 260px, var(--bg) 560px),
    radial-gradient(1000px 480px at 50% -160px, rgba(246, 165, 49, 0.16), transparent 68%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: var(--control);
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: 0;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--court);
  box-shadow: 0 0 0 3px rgba(31, 183, 166, 0.16);
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  display: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.spin {
  animation: spin 900ms linear infinite;
}

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

.auth-screen {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  width: min(100%, 420px);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-copy {
  color: var(--muted);
}

.auth-loading,
.auth-error,
.inline-status,
.permission-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px 12px;
}

.auth-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--soft);
  font-weight: 700;
}

.auth-error,
.inline-status {
  border-color: rgba(255, 90, 43, 0.48);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
}

.field,
.admin-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.button,
.icon-button,
.square-action,
.mini-button {
  display: inline-flex;
  min-height: var(--control);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 9px 13px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.button-primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--fire), var(--ember));
  color: #170d08;
}

.button-secondary,
.icon-button,
.square-action,
.mini-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button:hover,
.icon-button:hover,
.square-action:hover,
.mini-button:hover {
  border-color: var(--court);
}

.button-danger {
  border: 1px solid rgba(255, 90, 43, 0.7);
  background: var(--fire);
  color: #170d08;
}

.button-caution {
  border-color: rgba(246, 165, 49, 0.46);
  background: rgba(246, 165, 49, 0.1);
  color: var(--warning);
}

.button-danger-soft {
  border-color: rgba(255, 90, 43, 0.44);
  background: rgba(255, 90, 43, 0.1);
  color: var(--danger);
}

.button.is-disabled,
.button:disabled {
  pointer-events: none;
}

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

.admin-page {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 14px 20px 42px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100svh;
  background: var(--bg);
}

.admin-header,
.sidebar,
.panel,
.kpi-card,
.admin-tournament-card,
.empty-state,
.empty-detail,
.invite-card,
.operation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  column-gap: 18px;
  align-items: center;
  background: rgba(13, 14, 14, 0.82);
  padding: 10px;
  backdrop-filter: blur(16px);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100svh;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  box-shadow: none;
  padding: 20px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--fire), var(--ember));
  color: #170d08;
  font-size: 12px;
  font-weight: 900;
}

.brand > span:last-child {
  display: inline;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.brand strong,
.brand small,
.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.brand small,
.sidebar-note span {
  color: var(--muted);
  font-size: 12px;
}

.top-nav,
.side-nav {
  display: flex;
  min-width: 0;
  gap: 4px;
}

.top-nav {
  justify-content: center;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.top-nav a,
.side-nav a {
  border-radius: var(--radius);
  color: var(--soft);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.top-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.top-nav a:hover,
.top-nav a.active,
.side-nav a:hover,
.side-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.top-nav a.admin-only-link {
  border: 1px solid rgba(255, 90, 43, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 90, 43, 0.22), rgba(246, 165, 49, 0.14)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.top-nav a.admin-only-link:hover {
  border-color: rgba(255, 90, 43, 0.65);
  background:
    linear-gradient(135deg, rgba(255, 90, 43, 0.28), rgba(246, 165, 49, 0.2)),
    rgba(255, 255, 255, 0.06);
}

.admin-user-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 23, 23, 0.72);
  padding: 10px;
}

.admin-header .admin-user-card {
  display: flex;
  width: fit-content;
  max-width: min(340px, 100%);
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.admin-user-card > div {
  min-width: 0;
}

.admin-user-card strong,
.admin-user-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-card span {
  color: var(--muted);
  font-size: 12px;
}

.admin-header .admin-user-card .eyebrow {
  display: none;
}

.user-logout {
  flex: 0 0 auto;
}

.admin-header .user-logout span {
  display: none;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 90, 43, 0.1), rgba(255, 255, 255, 0.03));
  padding: 14px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.admin-page .workspace {
  padding: 34px 0 0;
}

.topbar,
.admin-title,
.section-head,
.panel-head {
  display: flex;
  min-width: 0;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.topbar,
.admin-title {
  margin-bottom: 18px;
}

.topbar h1,
.admin-title h1,
.section-head h2,
.panel h2,
.empty-state h2,
.empty-detail h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1,
.admin-title h1 {
  max-width: 840px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12;
}

.section-head h2,
.panel h2 {
  font-size: 20px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--court);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status,
.count-pill,
.type-pill,
.confidence {
  display: inline-flex;
  min-height: 26px;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--soft);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.status-queued {
  background: rgba(167, 170, 167, 0.14);
  color: var(--muted);
}

.status-running {
  background: var(--court-2);
  color: var(--court);
}

.status-review,
.status.warn {
  background: rgba(246, 165, 49, 0.16);
  color: var(--warning);
}

.status-done,
.status.done,
.status.success,
.done {
  background: var(--success-bg);
  color: var(--success);
}

.status-failed,
.status.danger,
.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.count-pill {
  background: var(--court-2);
  color: var(--court);
}

.panel {
  padding: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 14px;
  box-shadow: none;
}

.kpi-card span,
.mini-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.mini-kpi {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.mini-kpi strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.segmented {
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.segment {
  min-height: 34px;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font-weight: 750;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: #f2f0e9;
  color: #111;
}

.tournament-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.45fr);
  gap: 16px;
  align-items: start;
}

.tournaments-section {
  min-width: 0;
}

.section-head {
  margin-bottom: 12px;
}

.tournaments-section .section-head {
  align-items: center;
}

.admin-filters-panel {
  display: grid;
  width: min(1120px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 0 auto 24px;
}

.admin-filter-group {
  display: grid;
  min-width: 0;
  gap: 6px;
  justify-items: center;
}

.admin-filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.admin-filter-segmented {
  width: 100%;
  padding: 4px;
}

.admin-filter-segmented .segment {
  flex: 1 1 0;
  min-height: 38px;
  border-right: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 850;
}

.list-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--soft);
  font-weight: 700;
}

.admin-tournament-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.admin-tournament-grid > .empty-state {
  grid-column: 1 / -1;
}

.admin-tournament-card {
  display: flex;
  min-width: 0;
  min-height: 360px;
  flex-direction: column;
  box-shadow: none;
  padding: 22px;
  transition: border-color 140ms ease, background 140ms ease;
}

.admin-tournament-card:hover,
.admin-tournament-card.active {
  border-color: rgba(255, 90, 43, 0.58);
  background: #202222;
}

.admin-card-date {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
  color: var(--soft);
  margin-bottom: 20px;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.18;
}

.admin-card-date .icon {
  color: var(--fire);
}

.admin-card-date time {
  overflow-wrap: anywhere;
}

.admin-card-details {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-card-details li {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  color: var(--soft);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.28;
}

.admin-card-details .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--faint);
}

.admin-card-details .icon.accent {
  color: var(--fire);
}

.admin-card-details span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.button-card {
  width: 100%;
  min-height: 44px;
}

.square-action {
  width: 46px;
  min-height: 44px;
  padding: 0;
}

.tournament-drawer {
  position: fixed;
  z-index: 30;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(480px, calc(100vw - 28px));
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 90, 43, 0.06), rgba(255, 255, 255, 0.015) 220px),
    var(--surface-2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
}

.drawer-shell {
  display: grid;
  max-height: 100%;
  min-width: 0;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
}

.drawer-head {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.drawer-head h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.14;
}

.drawer-close {
  width: 40px;
  padding: 0;
}

.drawer-notice {
  border: 1px solid rgba(31, 183, 166, 0.32);
  border-radius: var(--radius);
  background: rgba(31, 183, 166, 0.1);
  color: var(--soft);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.drawer-section {
  display: grid;
  min-width: 0;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.drawer-section-head {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.drawer-section-head .eyebrow {
  margin-bottom: 0;
}

.drawer-kv {
  display: grid;
  min-width: 0;
  gap: 9px;
  margin: 0;
}

.drawer-kv div {
  display: grid;
  min-width: 0;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
}

.drawer-kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drawer-kv dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.drawer-kv a {
  color: var(--soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.drawer-hint {
  margin: 0;
  border-left: 2px solid rgba(246, 165, 49, 0.52);
  color: var(--muted);
  padding-left: 10px;
  font-size: 13px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drawer-actions.compact {
  grid-template-columns: 1fr 1fr;
}

.drawer-actions .button {
  width: 100%;
  min-width: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  min-width: 0;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.drawer-local-chip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drawer-note textarea {
  min-height: 108px;
  resize: vertical;
}

.tournament-detail-panel {
  position: sticky;
  top: 90px;
  min-width: 0;
}

.empty-state,
.empty-detail {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-style: dashed;
  box-shadow: none;
  padding: 22px;
  text-align: center;
}

.empty-state p,
.empty-detail p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.detail-head {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.detail-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.detail-list dt {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wide {
  grid-column: span 2;
}

.invite-grid,
.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.operation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invite-card,
.operation-card {
  box-shadow: none;
  padding: 14px;
}

.invite-card h3 {
  margin: 0;
}

.invite-card textarea {
  margin-top: 12px;
}

.invite-feed {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.feed-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.feed-item strong,
.feed-item span,
.operation-card strong,
.operation-card span {
  display: block;
}

.feed-item span,
.operation-card span {
  color: var(--muted);
  font-size: 13px;
}

.operation-card {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.operation-card .icon {
  color: var(--court);
}

.operation-card strong {
  margin-bottom: 3px;
  color: var(--text);
}

@media (max-width: 1160px) {
  .admin-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .admin-header .admin-user-card {
    max-width: none;
    justify-content: space-between;
  }

  .tournament-workbench {
    grid-template-columns: 1fr;
  }

  .tournament-detail-panel {
    position: static;
  }

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

  .tournament-drawer {
    width: min(460px, calc(100vw - 20px));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-width: 0 0 1px;
    padding: 16px;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-note {
    margin-top: 0;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .admin-title,
  .section-head,
  .panel-head {
    display: grid;
    justify-content: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .kpi-grid,
  .admin-form,
  .invite-grid,
  .operation-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters-panel,
  .admin-tournament-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters-panel {
    margin-bottom: 18px;
  }

  .tournament-drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .auth-screen {
    padding: 14px;
  }

  .auth-card {
    padding: 18px;
  }

  .admin-page {
    padding: 10px 12px 28px;
  }

  .admin-page .workspace {
    padding-top: 24px;
  }

  .topbar h1,
  .admin-title h1 {
    font-size: 28px;
  }

  .topbar-actions,
  .admin-card-actions,
  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions .button,
  .topbar-actions .icon-button,
  .admin-card-actions .button,
  .detail-actions .button {
    width: 100%;
  }

  .drawer-shell {
    gap: 14px;
    padding: 14px;
  }

  .drawer-kv div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .drawer-actions,
  .drawer-actions.compact,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-card-details {
    grid-template-columns: 1fr;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
