:root {
  --void: #050910;
  --panel: rgba(12, 20, 31, 0.9);
  --panel-strong: rgba(8, 14, 23, 0.98);
  --line: #1d3144;
  --line-bright: #2f5672;
  --ink: #d8e8fa;
  --muted: #8ea3b9;
  --cyan: #6de2ff;
  --amber: #ffb25a;
  --danger: #ff6a6a;
  --ok: #59e5a4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at 8% -15%, rgba(52, 86, 120, 0.18) 0, transparent 46%),
    radial-gradient(circle at 88% -10%, rgba(100, 56, 17, 0.2) 0, transparent 42%),
    linear-gradient(180deg, #060a12 0%, #050911 65%, #04070e 100%);
  color: var(--ink);
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(109, 226, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 226, 255, 0.012) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.62) 22%, transparent 100%);
  opacity: 0.26;
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08'%3E%3Cpath d='M0 17h140M0 67h140M0 117h140M17 0v140M67 0v140M117 0v140'/%3E%3C/g%3E%3C/svg%3E");
}
.frame {
  position: fixed;
  inset: 10px;
  border: 1px solid rgba(109, 226, 255, 0.1);
  border-radius: 16px;
  pointer-events: none;
}
.shell {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 24px 0 52px;
}
.shell-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.topbar {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(160deg, var(--panel), var(--panel-strong));
  box-shadow: inset 0 0 0 1px rgba(109, 226, 255, 0.1), 0 16px 42px rgba(0, 0, 0, 0.34);
}
.brand-wrap { min-width: 0; }
.kicker {
  margin: 0;
  color: var(--cyan);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.brand {
  margin: 2px 0 0;
  letter-spacing: 0.06em;
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
}
.nav a:hover {
  color: var(--cyan);
  border-color: rgba(109, 226, 255, 0.35);
  background: rgba(109, 226, 255, 0.1);
}
.panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(170deg, rgba(12, 20, 31, 0.9), rgba(8, 14, 23, 0.96));
  box-shadow: inset 0 0 0 1px rgba(109, 226, 255, 0.08);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel h2, .panel h3 {
  margin: 3px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(6, 11, 19, 0.62);
}
.stat p {
  margin: 0;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
}
.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  color: var(--cyan);
}
.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  border-bottom: 1px solid rgba(45, 83, 108, 0.65);
  padding: 11px 8px;
}
th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-family: "Space Mono", monospace;
}
td code {
  font-family: "Space Mono", monospace;
  color: #b4cde3;
  font-size: 0.85rem;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 4px 8px;
}
.badge-published {
  color: #8afcc7;
  border-color: rgba(89, 229, 164, 0.45);
  background: rgba(89, 229, 164, 0.11);
}
.badge-draft {
  color: #ffd18f;
  border-color: rgba(255, 178, 90, 0.45);
  background: rgba(255, 178, 90, 0.1);
}
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  color: #dbeeff;
  background: rgba(22, 36, 51, 0.9);
}
.btn-primary {
  color: #07131d;
  border-color: rgba(255, 178, 90, 0.6);
  background: linear-gradient(180deg, #ffc57f, #ffad4a);
}
.btn-subtle {
  border-color: rgba(109, 226, 255, 0.35);
  background: rgba(109, 226, 255, 0.1);
}
.btn-danger {
  border-color: rgba(255, 106, 106, 0.5);
  background: rgba(255, 106, 106, 0.16);
  color: #ffd0d0;
}
.btn:hover { filter: brightness(1.08); }

.editor-form {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}
.editor-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
label {
  display: grid;
  gap: 6px;
}
label span {
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: rgba(4, 9, 16, 0.86);
  color: var(--ink);
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  padding: 10px 11px;
}
textarea { resize: vertical; }
.code {
  font-family: "Space Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(109, 226, 255, 0.15);
}
.stack { margin-top: 2px; }
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.danger-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 106, 106, 0.4);
}
.muted {
  color: var(--muted);
  margin: 0;
}
.flash-stack {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.flash {
  border: 1px solid var(--line);
  background: rgba(8, 13, 22, 0.88);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
}
.flash-success {
  border-color: rgba(89, 229, 164, 0.45);
  color: #aaf8d2;
}
.flash-error {
  border-color: rgba(255, 106, 106, 0.55);
  color: #ffcaca;
}
.auth-panel {
  width: min(450px, 94vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: linear-gradient(170deg, rgba(12, 20, 31, 0.94), rgba(8, 14, 23, 0.98));
  box-shadow: inset 0 0 0 1px rgba(109, 226, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.45);
}
.auth-panel h1 {
  margin: 4px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 11px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}
