:root {
  color-scheme: dark;
  --bg: #050608;
  --sidebar: #080a0f;
  --panel: #10131a;
  --panel-2: #151923;
  --line: #2b3342;
  --text: #f4f7ff;
  --muted: #9aa6ba;
  --blue: #2f72ff;
  --red: #e43143;
  --green: #19b36b;
  --yellow: #e3aa24;
  --gold: #f0c35c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(240, 195, 92, 0.10), transparent 28%),
    radial-gradient(circle at 95% 10%, rgba(47, 114, 255, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--text);
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0d1018, #050608);
}

.brand {
  padding: 8px 10px 22px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  font-size: 23px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0;
}

.brand p,
.section-title p,
.hint {
  margin: 6px 0 0;
  color: var(--muted);
}

.menu {
  display: grid;
  gap: 8px;
  padding: 20px 0;
}

.menu a {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dfe6f5;
  font-weight: 800;
}

.menu a:hover {
  border-color: rgba(240, 195, 92, 0.55);
  background: rgba(240, 195, 92, 0.08);
}

.menu a.active {
  border-color: rgba(240, 195, 92, 0.8);
  background: linear-gradient(180deg, rgba(240, 195, 92, 0.18), rgba(240, 195, 92, 0.06));
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.sidebar-footer a,
button,
.primary {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

button:hover,
.sidebar-footer a:hover {
  border-color: var(--gold);
}

.workspace {
  margin-left: 260px;
  padding: 28px;
}

.page-section {
  display: none;
  scroll-margin-top: 20px;
  margin-bottom: 22px;
}

.page-section.is-active {
  display: block;
}

.hero-title h1 {
  font-size: 34px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stats article,
.panel,
.login-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.stats article {
  padding: 18px;
}

.stats b {
  display: block;
  font-size: 30px;
}

.stats span {
  color: var(--muted);
}

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

.panel {
  padding: 20px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.big-mode {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: var(--gold);
}

.section-title {
  margin-bottom: 16px;
}

.section-title h1 {
  margin: 0;
  font-size: 24px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

.code {
  font-family: Consolas, monospace;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.pending {
  background: rgba(227, 170, 36, 0.15);
  color: var(--yellow);
}

.badge.approved {
  background: rgba(25, 179, 107, 0.15);
  color: var(--green);
}

.badge.blocked {
  background: rgba(228, 49, 67, 0.15);
  color: var(--red);
}

.actions form {
  display: flex;
  gap: 6px;
}

.danger {
  color: #fff;
  border-color: #5b1b24;
  background: #311018;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px;
}

.settings-form,
.login-box form {
  display: grid;
  gap: 13px;
}

.split-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.split-form .check-row,
.split-form button {
  align-self: center;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d14;
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 195, 92, 0.12);
}

input[type="color"] {
  min-height: 48px;
  padding: 4px;
}

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

.appearance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 14px;
  align-items: start;
}

.appearance-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 13, 0.42);
}

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

.appearance-card h2,
.asset-head h2 {
  margin: 0;
  font-size: 18px;
}

.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-pair {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  gap: 12px;
}

.asset-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: start;
}

.asset-fields {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.asset-preview-group {
  min-width: 0;
}

.asset-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.asset-preview {
  width: 100%;
  height: 108px;
  min-height: 108px;
  max-height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01)),
    #070a10;
  color: var(--muted);
  font-weight: 800;
}

.asset-preview img,
.asset-preview video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.video-preview {
  height: 108px;
  min-height: 108px;
  max-height: 108px;
}

.video-preview video {
  height: 108px !important;
  max-height: 108px !important;
}

.logo-preview {
  height: 108px;
  min-height: 108px;
  max-height: 108px;
  padding: 10px;
}

.logo-preview img {
  width: auto;
  max-width: 150px;
  max-height: 86px;
}

.bg-preview {
  height: 108px;
  min-height: 108px;
  max-height: 108px;
}

.bg-preview img {
  object-fit: cover;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.primary {
  background: linear-gradient(180deg, #337cff, #1755d8);
  border-color: #3f82ff;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.alert.success {
  border-color: rgba(25, 179, 107, 0.5);
  background: rgba(25, 179, 107, 0.12);
}

.alert.error {
  border-color: rgba(228, 49, 67, 0.5);
  background: rgba(228, 49, 67, 0.12);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  padding: 28px;
}

.login-box h1 {
  margin: 8px 0 22px;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 16px;
  }

  .workspace {
    margin-left: 0;
    padding: 16px;
  }

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

  .menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .status-grid,
  .color-grid,
  .appearance-grid,
  .asset-config-row,
  .asset-pair,
  .split-form,
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .menu {
    grid-template-columns: 1fr;
  }

  .hero-title h1 {
    font-size: 26px;
  }
}
