﻿:root {
  --bg-0: #070c13;
  --bg-1: #0f1724;
  --bg-2: #172436;
  --panel: rgba(17, 24, 36, 0.9);
  --panel-soft: rgba(14, 21, 34, 0.76);
  --panel-strong: #131d2b;
  --line: rgba(118, 157, 191, 0.3);
  --line-soft: rgba(118, 157, 191, 0.14);
  --text: #eef4fb;
  --muted: #9eb2c8;
  --gold: #ffcc7a;
  --gold-soft: #f5b14c;
  --cyan: #54e4ff;
  --green: #4df2bf;
  --danger: #ff7a93;
  --ok: #79ffc8;
  --radius-xl: 1.25rem;
  --radius-lg: 0.95rem;
  --radius-md: 0.72rem;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 18% 10%, #17304b 0%, transparent 35%),
    radial-gradient(circle at 86% 5%, #2c5b58 0%, transparent 34%),
    linear-gradient(155deg, var(--bg-0) 0%, var(--bg-1) 46%, #111b2a 100%);
}

body.menu-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.015em;
}

p {
  margin: 0;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-layer-grid {
  background-image: linear-gradient(rgba(140, 173, 209, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 173, 209, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
}

.bg-layer-gradient {
  background: radial-gradient(circle at 92% 88%, rgba(255, 204, 122, 0.08), transparent 28%),
    radial-gradient(circle at 10% 88%, rgba(84, 228, 255, 0.08), transparent 30%);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(3, 7, 12, 0.74);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 18;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 304px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 26, 0.98) 0%, rgba(12, 21, 34, 0.94) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.sidebar-head {
  display: none;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.brand-block {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(30, 43, 60, 0.6), rgba(17, 25, 39, 0.6));
  border-radius: var(--radius-lg);
  padding: 0.95rem 0.9rem;
}

.brand-crest {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  margin-bottom: 0.55rem;
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  font-weight: 800;
  color: #201508;
  background: linear-gradient(135deg, #ffdca8 0%, #f6b359 60%, #d88d32 100%);
}

.brand-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--gold);
}

.brand-block h1 {
  margin-top: 0.3rem;
  font-size: 1.28rem;
}

.brand-note {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.81rem;
}

.nav-stack {
  display: grid;
  gap: 0.38rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.nav-group {
  margin-top: 0.48rem;
  margin-bottom: 0.14rem;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #7d94ad;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 0.72rem;
  color: #d8e4f4;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.62rem 0.72rem;
  transition: 0.15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  border-color: rgba(255, 204, 122, 0.48);
  background: rgba(255, 204, 122, 0.12);
  color: #fff5e8;
}

.nav-link.is-active {
  border-color: rgba(255, 204, 122, 0.58);
  background: linear-gradient(140deg, rgba(255, 198, 110, 0.28), rgba(253, 154, 98, 0.14));
  color: #fff0d3;
}

.nav-link-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 0.62rem;
}

.operator-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.55rem 0.62rem;
  display: grid;
  gap: 0.12rem;
}

.operator-role {
  color: var(--gold);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.logout-form,
.sidebar-logout {
  width: 100%;
}

.app-content {
  padding: 1.1rem 1.24rem 1.4rem;
}

.topbar {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  padding: 0.65rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.topbar-kicker {
  color: #92a8bf;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topbar-title {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 0.72rem;
  width: 2.34rem;
  height: 2.34rem;
  align-items: center;
  justify-content: center;
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transition: transform 0.2s ease;
}

.menu-toggle-lines::before {
  transform: translateY(-5px);
}

.menu-toggle-lines::after {
  transform: translateY(3px);
}

.page-stage {
  display: grid;
  gap: 0.95rem;
}

.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.36rem 0.66rem;
  font-size: 0.78rem;
  color: #d9e7f8;
  background: rgba(255, 255, 255, 0.03);
  min-width: 6.7rem;
  text-align: center;
}

.page-head {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  padding: 0.82rem;
}

.page-head-inline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.page-kicker {
  color: var(--gold);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2 {
  margin-top: 0.25rem;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
}

h2 small {
  font-size: 0.68em;
  color: #c4d1de;
}

.page-subtitle {
  margin-top: 0.32rem;
  color: var(--muted);
  font-size: 0.89rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.72rem;
}

.kpi-card,
.panel-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 0.78rem 0.82rem;
  display: grid;
  gap: 0.2rem;
}

.kpi-card span {
  font-size: 0.77rem;
  color: var(--muted);
}

.kpi-card strong {
  font-size: clamp(1.16rem, 2.5vw, 1.58rem);
  color: #f3f8ff;
}

.panel-card {
  padding: 0.88rem;
}

.panel-card > header {
  margin-bottom: 0.64rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.panel-card > header h3 {
  font-size: 0.98rem;
}

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

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.82rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 0.72rem;
  border: 1px solid var(--line-soft);
}

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

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 0.58rem 0.52rem;
  vertical-align: top;
  font-size: 0.86rem;
}

.admin-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9db3c9;
  background: rgba(255, 255, 255, 0.015);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
}

.badge {
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-ok {
  background: rgba(77, 242, 191, 0.17);
  color: var(--ok);
}

.badge-danger {
  background: rgba(255, 122, 147, 0.2);
  color: #ffadc0;
}

button,
.btn-main,
.btn-danger,
.ghost-btn {
  border-radius: 0.66rem;
  min-height: 2.15rem;
  padding: 0.44rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

button,
.btn-main {
  border: 0;
  color: #1b1001;
  background: linear-gradient(135deg, #ffd58f 0%, #f7b355 100%);
}

button:hover,
.btn-main:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-danger {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff7a93 0%, #ea4768 100%);
}

.ghost-btn {
  border: 1px solid var(--line);
  color: #d9e8fa;
  background: rgba(255, 255, 255, 0.03);
}

input,
select,
textarea {
  border: 1px solid rgba(118, 157, 191, 0.35);
  border-radius: 0.6rem;
  min-height: 2.2rem;
  color: var(--text);
  background: rgba(8, 14, 24, 0.72);
  padding: 0.43rem 0.58rem;
}

input::placeholder,
textarea::placeholder {
  color: #7f97b0;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.nav-link:focus-visible,
.ghost-btn:focus-visible,
.btn-link:focus-visible {
  outline: 2px solid rgba(84, 228, 255, 0.5);
  outline-offset: 1px;
}

.toolbar-form,
.inline-form,
.actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.actions-row.wrap {
  align-items: flex-start;
}

.inline-form.slim select,
.inline-form.slim input {
  min-width: 126px;
}

.stack-form {
  display: grid;
  gap: 0.55rem;
}

.stack-form label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.58rem;
}

.event-list li {
  border: 1px solid var(--line-soft);
  border-radius: 0.66rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem 0.58rem;
  display: grid;
  gap: 0.2rem;
}

.notice {
  border-radius: 0.75rem;
  padding: 0.58rem 0.76rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.notice-ok {
  border: 1px solid rgba(77, 242, 191, 0.34);
  background: rgba(77, 242, 191, 0.16);
  color: #97ffdd;
}

.notice-error {
  border: 1px solid rgba(255, 122, 147, 0.38);
  background: rgba(255, 122, 147, 0.16);
  color: #ffc3d0;
}

.btn-link {
  color: #9feaff;
  text-decoration: none;
  font-weight: 700;
}

.btn-link:hover {
  color: #d2f8ff;
}

.log-console {
  margin: 0;
  min-height: 390px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.84rem;
  padding: 0.78rem;
  background: #040911;
  color: #a9ffd7;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.34;
}

.log-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-wrap {
  width: 100%;
  overflow: auto;
}

#matchesTrendCanvas,
#promoTrendCanvas {
  width: 100%;
  max-width: 100%;
  height: 300px;
  border: 1px solid var(--line);
  border-radius: 0.82rem;
  background: rgba(5, 11, 20, 0.65);
}

.toolbar-spacer {
  flex: 1;
}

.section-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.quick-link {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(22, 34, 50, 0.95), rgba(15, 22, 34, 0.95));
  border-radius: 0.75rem;
  padding: 0.62rem;
  text-decoration: none;
  color: #e8f2ff;
  display: grid;
  gap: 0.22rem;
}

.quick-link span {
  color: #97acc4;
  font-size: 0.76rem;
}

.quick-link strong {
  font-size: 0.92rem;
}

.quick-link:hover {
  border-color: rgba(84, 228, 255, 0.45);
}

.auth-body {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem;
  position: relative;
  z-index: 2;
}

.auth-shell-single {
  grid-template-columns: minmax(320px, 540px);
  justify-content: center;
}

.auth-showcase,
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-showcase {
  padding: 1.4rem;
}

.auth-card {
  padding: 1.15rem;
}

.auth-kicker {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-note {
  margin-top: 0.5rem;
  color: var(--muted);
}

.auth-features {
  margin-top: 0.8rem;
  padding-left: 1rem;
  color: #dce8f5;
  display: grid;
  gap: 0.4rem;
}

.text-center {
  text-align: center;
}

.display-4 {
  font-size: clamp(1.68rem, 4.4vw, 2.45rem);
}

@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1024px) {
  .grid-two,
  .grid-three {
    grid-template-columns: 1fr;
  }

  .app-content {
    padding: 0.92rem 0.98rem 1.2rem;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .sidebar-head {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    width: min(88vw, 340px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open + .sidebar-backdrop,
  .app-shell.sidebar-open ~ .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar .actions-row {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .kpi-grid,
  .section-links {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0.62rem;
  }

  .topbar-title {
    font-size: 1.02rem;
  }

  .panel-card,
  .kpi-card,
  .page-head {
    border-radius: 0.84rem;
    padding: 0.74rem;
  }

  .toolbar-form,
  .inline-form,
  .actions-row {
    width: 100%;
  }

  .toolbar-form > input,
  .toolbar-form > select,
  .toolbar-form > button,
  .toolbar-form > .ghost-btn,
  .toolbar-form > label,
  .toolbar-form > .btn-link,
  .inline-form > input,
  .inline-form > select,
  .inline-form > button,
  .actions-row > button,
  .actions-row > form,
  .actions-row > a {
    width: 100%;
  }

  .admin-table {
    min-width: 620px;
  }

  .log-console {
    min-height: 320px;
  }

  .auth-shell {
    padding: 0.82rem;
  }
}
