:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #101722;
  --surface-2: #172232;
  --surface-3: #1d2d3f;
  --line: #2b3c52;
  --text: #f4f7fb;
  --muted: #a9b7c8;
  --blue: #38bdf8;
  --green: #34d399;
  --yellow: #facc15;
  --red: #fb7185;
  --violet: #a78bfa;
  --orange: #fb923c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.12), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(251, 146, 60, 0.1), transparent 28%),
    linear-gradient(180deg, #080b12, #0b111b 48%, #080b12);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid rgba(169, 183, 200, 0.14);
  background:
    linear-gradient(180deg, rgba(16, 23, 34, 0.97), rgba(8, 11, 18, 0.98)),
    var(--surface);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(169, 183, 200, 0.14);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: conic-gradient(from 210deg, var(--blue), var(--green), var(--yellow), var(--orange), var(--blue));
  color: #050816;
  font-weight: 900;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.25);
}

.brand-title {
  font-weight: 900;
  line-height: 1.1;
}

.brand-subtitle,
.muted,
.field-label,
.control-grid span,
.status {
  color: var(--muted);
  font-size: 13px;
}

.field-label,
.control-grid span {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.select,
.input,
.textarea,
.button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(169, 183, 200, 0.18);
  background: rgba(16, 23, 34, 0.88);
  color: var(--text);
  border-radius: 7px;
  padding: 0 11px;
  font: inherit;
}

.textarea {
  min-height: 94px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.35;
}

.input::placeholder {
  color: #607891;
}

.button {
  background: linear-gradient(135deg, #0f6b8f, #168c78);
  color: #effcff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 184, 166, 0.12);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.subtle {
  background: rgba(23, 34, 50, 0.9);
  box-shadow: none;
}

.button:hover,
.icon-button:hover {
  border-color: var(--blue);
}

.button:disabled,
.input:disabled,
.textarea:disabled,
.module:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
}

.auth-card {
  border: 1px solid rgba(169, 183, 200, 0.16);
  background: rgba(16, 23, 34, 0.72);
  border-radius: 8px;
  padding: 12px;
}

.auth-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.section-nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  min-height: 46px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 8px 11px;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.nav-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button small {
  color: #6f8195;
  font-size: 11px;
  font-weight: 800;
}

.nav-button:hover,
.nav-button.active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(52, 211, 153, 0.08));
}

.nav-button.active small {
  color: #cfefff;
}

.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #0f2d45;
  color: #dff7ff;
  border-radius: 7px;
  font-weight: 900;
  cursor: pointer;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.mini-button.danger {
  border-color: rgba(251, 113, 133, 0.6);
  color: #fecdd3;
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.content {
  padding: 28px;
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(169, 183, 200, 0.12);
  background: rgba(16, 23, 34, 0.62);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  letter-spacing: 0;
}

#rangeLabel {
  margin-top: 6px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(169, 183, 200, 0.18);
  background: rgba(16, 23, 34, 0.78);
  color: #d8e7f7;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.command-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(169, 183, 200, 0.13);
  background:
    linear-gradient(135deg, rgba(16, 23, 34, 0.9), rgba(23, 34, 50, 0.76)),
    radial-gradient(circle at 14% 18%, rgba(250, 204, 21, 0.16), transparent 28%);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 160px;
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.72), rgba(52, 211, 153, 0.72));
  border-radius: 999px;
}

.eyebrow {
  color: #9ee8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-copy h2 {
  max-width: 620px;
  margin-top: 12px;
  font-size: 34px;
  line-height: 1.04;
}

.hero-copy p {
  max-width: 610px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-button {
  width: auto;
  min-width: 128px;
  padding: 0 16px;
}

.hero-button.secondary {
  background: rgba(23, 34, 50, 0.92);
  box-shadow: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-panel {
  min-height: 124px;
  border: 1px solid rgba(169, 183, 200, 0.13);
  background:
    linear-gradient(180deg, rgba(23, 34, 50, 0.92), rgba(16, 23, 34, 0.92));
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.status-panel span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.status-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.status-panel p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.runtime-online {
  color: #86efac;
}

.runtime-offline {
  color: #fda4af;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.drift-scene {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(169, 183, 200, 0.13);
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.22), transparent 26%),
    radial-gradient(circle at 78% 72%, rgba(251, 146, 60, 0.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.09), transparent 38%),
    linear-gradient(160deg, #101722, #0b111b 58%, #151926);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.drift-scene::before {
  content: "";
  position: absolute;
  inset: 64px -12% 70px;
  border: 2px solid rgba(145, 168, 192, 0.2);
  border-left-color: rgba(56, 189, 248, 0.36);
  border-bottom-color: rgba(250, 204, 21, 0.28);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.track-line {
  position: absolute;
  width: 280px;
  height: 72px;
  border-bottom: 4px solid rgba(238, 246, 255, 0.18);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.track-line.one {
  left: 12%;
  top: 56%;
}

.track-line.two {
  right: 12%;
  top: 35%;
}

.drift-car {
  position: absolute;
  left: 48%;
  top: 50%;
  width: 170px;
  height: 82px;
  transform: translate(-50%, -50%) rotate(-14deg);
  animation: drift-car 4s ease-in-out infinite;
}

.car-body {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 18px;
  height: 38px;
  background: linear-gradient(90deg, #f97316, #facc15 45%, #38bdf8);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px 24px 13px 13px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.car-top {
  position: absolute;
  left: 58px;
  top: 13px;
  width: 58px;
  height: 28px;
  background: #dff7ff;
  border-radius: 20px 20px 6px 6px;
  transform: skewX(-14deg);
}

.wheel {
  position: absolute;
  bottom: 9px;
  width: 28px;
  height: 28px;
  border: 6px solid #020617;
  background: #94a3b8;
  border-radius: 50%;
  animation: wheel-spin 0.55s linear infinite;
}

.wheel.front {
  right: 26px;
}

.wheel.rear {
  left: 27px;
}

.smoke {
  position: absolute;
  width: 110px;
  height: 48px;
  border-radius: 50%;
  background: rgba(203, 213, 225, 0.18);
  filter: blur(10px);
  animation: smoke-drift 4s ease-in-out infinite;
}

.smoke-a {
  left: 31%;
  top: 55%;
}

.smoke-b {
  left: 38%;
  top: 62%;
  animation-delay: 0.45s;
}

.home-modules {
  min-height: 360px;
  border: 1px solid rgba(169, 183, 200, 0.13);
  background: rgba(16, 23, 34, 0.76);
  border-radius: 8px;
  overflow: hidden;
}

.quick-panel {
  min-height: 360px;
  border: 1px solid rgba(169, 183, 200, 0.13);
  background: rgba(16, 23, 34, 0.76);
  border-radius: 8px;
  overflow: hidden;
}

.quick-grid {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.quick-card {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(169, 183, 200, 0.14);
  background: linear-gradient(135deg, rgba(29, 45, 63, 0.86), rgba(16, 23, 34, 0.94));
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.quick-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card strong {
  font-size: 15px;
}

.quick-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.panel-header.compact {
  min-height: 50px;
}

.module-readonly {
  display: inline-flex;
  align-items: center;
  cursor: default;
}

@keyframes drift-car {
  0%, 100% {
    transform: translate(-53%, -48%) rotate(-16deg);
  }
  45% {
    transform: translate(-44%, -53%) rotate(-6deg);
  }
  70% {
    transform: translate(-48%, -46%) rotate(-22deg);
  }
}

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

@keyframes smoke-drift {
  0% {
    opacity: 0.1;
    transform: translate(0, 0) scale(0.7);
  }
  45% {
    opacity: 0.5;
    transform: translate(-42px, 14px) scale(1.1);
  }
  100% {
    opacity: 0.05;
    transform: translate(-86px, 22px) scale(1.35);
  }
}

.kpi,
.panel {
  border: 1px solid rgba(169, 183, 200, 0.13);
  background: rgba(16, 23, 34, 0.78);
  border-radius: 8px;
}

.kpi {
  padding: 15px;
}

.kpi span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.kpi strong {
  margin-top: 6px;
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.activity-report {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-card {
  min-height: 124px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 15px;
}

.report-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.report-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.report-card p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-wide {
  grid-column: 1 / -1;
}

.moderation-panel {
  order: -1;
}

.panel-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.chart {
  padding: 16px;
  min-height: 250px;
}

.chart svg {
  width: 100%;
  height: 230px;
  display: block;
}

.settings-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  margin: 0;
}

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

.settings-list dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 800;
}

.module-list {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.module {
  border: 1px solid rgba(169, 183, 200, 0.14);
  background: linear-gradient(135deg, rgba(29, 45, 63, 0.94), rgba(16, 23, 34, 0.96));
  border-radius: 7px;
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  min-height: 92px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}

.module.on {
  border-color: rgba(52, 211, 153, 0.52);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.08);
}

.module.off {
  border-color: rgba(251, 113, 133, 0.34);
  opacity: 0.82;
}

.module:hover {
  border-color: rgba(56, 189, 248, 0.62);
}

.module-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 9px;
  background: rgba(52, 211, 153, 0.14);
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 900;
}

.module.off .module-status {
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.module strong,
.module small {
  display: block;
}

.module strong {
  font-size: 15px;
}

.module small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.achievement-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.achievement-item {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.achievement-item strong,
.achievement-item span,
.achievement-item small {
  display: block;
}

.achievement-item strong {
  font-size: 14px;
}

.achievement-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.achievement-item small {
  margin-top: 6px;
  color: #c7d8eb;
  font-size: 12px;
  line-height: 1.35;
}

.achievement-item.on {
  border-color: rgba(52, 211, 153, 0.7);
}

.achievement-item.off {
  border-color: rgba(251, 113, 133, 0.55);
  opacity: 0.78;
}

.achievement-item.active {
  outline: 2px solid rgba(250, 204, 21, 0.45);
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
  padding: 16px;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.config-form h3 {
  margin: 0;
  font-size: 14px;
}

.config-form label span,
.switch-line span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.config-form label small,
.level-admin-form label small,
.automod-form label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.config-form-wide {
  min-width: 0;
}

.form-grid,
.switch-grid {
  display: grid;
  gap: 10px;
}

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

.form-wide {
  grid-column: 1 / -1;
}

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

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

.managed-list-field {
  min-width: 0;
}

.hidden-list-source {
  display: none;
}

.chip-list {
  min-height: 94px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
}

.list-chip {
  max-width: 100%;
  min-height: 30px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: #102a40;
  color: var(--text);
  border-radius: 7px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.list-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-chip strong {
  color: #fecdd3;
  font-size: 14px;
  line-height: 1;
}

.empty-chip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  align-self: center;
}

.automod-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.automod-rules {
  display: grid;
  align-content: start;
  gap: 8px;
}

.automod-rule {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.automod-rule strong,
.automod-rule span {
  display: block;
}

.automod-rule strong {
  font-size: 14px;
}

.automod-rule span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automod-rule.on {
  border-color: rgba(52, 211, 153, 0.7);
}

.automod-rule.off {
  border-color: rgba(251, 113, 133, 0.55);
}

.automod-rule.active {
  outline: 2px solid rgba(56, 189, 248, 0.45);
}

.automod-form {
  min-width: 0;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 40px;
  padding: 8px 10px;
  background: var(--surface-2);
}

.switch-line span {
  margin: 0;
  color: var(--text);
}

.switch-line input {
  width: 17px;
  height: 17px;
  margin: 0;
}

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

.moderation-filters {
  display: grid;
  grid-template-columns: 140px 140px minmax(200px, 1fr) minmax(220px, 1fr) 120px 120px;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.moderation-filter-results {
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--line);
}

.moderation-premium-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.moderation-config-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(18, 36, 58, 0.55);
  border-radius: 8px;
  overflow: hidden;
}

.compact-header {
  padding: 10px 12px;
}

.compact-header h3 {
  margin: 0;
  font-size: 15px;
}

.config-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.config-item {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.config-item:hover,
.config-item.active {
  border-color: var(--blue);
}

.config-item strong,
.config-item span {
  display: block;
}

.config-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.config-form-inline {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.risk-summary {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.risk-summary.low {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.55);
}

.risk-summary.medium {
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.55);
}

.risk-summary.high,
.risk-summary.critical {
  color: #ffe4e6;
  border-color: rgba(251, 113, 133, 0.65);
}

.audit-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr) 110px 110px;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.metadata {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.moderation-action-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.level-admin-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.access-hint {
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.08);
  color: #fde68a;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.resource-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.danger-button {
  border-color: rgba(251, 113, 133, 0.65);
  color: #ffe4e6;
}

.search-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.search-result,
.empty-result {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 10px;
  text-align: left;
}

.search-result {
  cursor: pointer;
}

.search-result:hover {
  border-color: var(--blue);
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result span,
.empty-result {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.picker-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px minmax(220px, 1fr) 120px;
  gap: 10px;
  align-items: end;
}

.picker-grid span,
.user-picker span,
.moderation-action-form span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-picker {
  display: grid;
  gap: 10px;
}

.compact-results {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-height: 220px;
  overflow-y: auto;
}

.moderation-filters span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}

.case-status.active {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.7);
}

.case-status.revoked {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.45);
}

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

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

th {
  color: var(--muted);
  font-weight: 900;
}

td.reason {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none !important;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.two-factor-qr {
  width: 164px;
  height: 164px;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

body.locked .content,
body.locked .control-grid,
body.locked .section-nav,
body.locked #refreshButton,
body.locked #guildSelect,
body.locked label[for="guildSelect"] {
  display: none;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .dashboard-grid,
  .home-grid,
  .home-hero,
  .kpi-grid,
  .config-layout,
  .form-grid,
  .switch-grid,
  .list-grid,
  .activity-report,
  .automod-layout,
  .moderation-filters,
  .moderation-premium-grid,
  .picker-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}
