:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-2: #17233d;
  --text: #f7fbff;
  --muted: #94a3b8;
  --line: #27344f;
  --accent: #5b7cff;
  --accent-2: #dce6ff;
  --danger: #ff8fa3;
  --success: #80e0a7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 0 rgba(0, 0, 0, 0.35);
}

.login-card {
  width: min(100%, 430px);
  padding: 24px;
}

.brand {
  margin: 0 0 6px;
  font-size: 28px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.settings-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.add-effect-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
}

.textarea {
  min-height: 88px;
  resize: vertical;
  padding: 12px;
}

.preview {
  width: min(100%, 360px);
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.effects-list {
  display: grid;
  gap: 14px;
}

.effect-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 35, 61, 0.55);
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

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

.effect-grid .label:nth-child(6) {
  grid-column: span 2;
}

.check-row {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-weight: 900;
}

.button {
  min-height: 42px;
  border: 2px solid #0a0f1d;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}

.button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.button.danger {
  background: #3b1320;
  color: var(--danger);
  border-color: #6b2334;
  box-shadow: none;
}

.upload-button {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  border-right: 2px solid #000;
  background: #09101e;
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav button {
  min-height: 42px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 850;
}

.nav button.active {
  background: var(--accent);
  border-color: #000;
  color: #fff;
  box-shadow: 4px 4px 0 #000;
}

.main {
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
}

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

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

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

.card {
  padding: 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 950;
}

.panel {
  padding: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0;
  font-size: 17px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  background: var(--panel-2);
  color: var(--accent-2);
  border: 1px solid var(--line);
}

.pill.open {
  color: var(--danger);
  border-color: #6b2334;
}

.pill.done {
  color: var(--success);
  border-color: #255f41;
}

.error {
  color: var(--danger);
  font-weight: 800;
}

.post-snippet {
  display: block;
  max-width: 460px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.action-stack {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 2px solid #000;
  }

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

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

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

@media (max-width: 560px) {
  .main {
    padding: 14px;
  }

  .grid,
  .nav,
  .add-effect-form,
  .effect-grid,
  .color-row {
    grid-template-columns: 1fr;
  }

  .effect-grid .label:nth-child(6) {
    grid-column: span 1;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
