:root {
  --bg: #0a1119;
  --panel: #111b25;
  --panel-2: #182533;
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf4fb;
  --muted: #90a8bd;
  --accent: #3aa8ff;
  --accent-2: #238fe2;
  --danger: #ff4d67;
  --ok: #29c27f;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 10% 0%, #13263a 0%, var(--bg) 55%);
  color: var(--text);
}

.adminApp {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

.adminHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.adminHeader h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.adminHeader p {
  margin: 6px 0 0;
  color: var(--muted);
}

.adminHeaderActions {
  display: flex;
  gap: 8px;
}

.kpiGrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpiCard {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.kpiCard small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpiCard b {
  font-size: 1.15rem;
}

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

.panel {
  background: linear-gradient(165deg, rgba(16, 30, 43, 0.96), rgba(13, 22, 33, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.panelWide {
  grid-column: 1 / -1;
}

.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panelHead h2 {
  margin: 0;
  font-size: 1.05rem;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 2px 10px;
  font-size: 0.8rem;
}

.toggleGrid {
  display: grid;
  gap: 8px;
}

.toggleLine {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.actionsRow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

button,
.ghostBtn,
select,
input,
textarea {
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #132131;
  padding: 9px 11px;
  font: inherit;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
}

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

.ghostBtn {
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.dangerBtn {
  background: rgba(255, 77, 103, 0.18);
  border-color: rgba(255, 77, 103, 0.35);
  color: #ffd6dd;
}

input,
select,
textarea {
  width: 100%;
}

textarea {
  resize: vertical;
}

.fieldLabel {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin: 8px 0 6px;
}

.listBox {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.16);
}

.listItem {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.8fr 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.listItem:last-child {
  border-bottom: none;
}

.listMeta {
  color: var(--muted);
  font-size: 0.83rem;
}

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

.auditItem:last-child {
  border-bottom: none;
}

.auditTitle {
  font-weight: 600;
}

.auditMeta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.adminFooter {
  margin-top: 12px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .kpiGrid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

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

  .listItem {
    grid-template-columns: 1fr;
  }

  .kpiGrid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .adminHeader {
    flex-direction: column;
  }
}
