:root {
  --bg: #000000;
  --text: #33ff33;
  --muted: #1fa31f;
  --accent: #66ff66;
  --accent-soft: #031a03;
  --card: #000000;
  --border: #0f4f0f;
  --scanline: rgba(0, 255, 102, 0.03);
  --glow: rgba(51, 255, 51, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-shadow: 0 0 3px var(--glow);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--scanline) 0px,
    var(--scanline) 1px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.24;
  z-index: 1;
}

body.no-scanlines::before {
  display: none;
}

body.theme-amber {
  --text: #ffb347;
  --muted: #c6862d;
  --accent: #ffc065;
  --accent-soft: #1a1205;
  --border: #6e4a18;
  --scanline: rgba(255, 176, 70, 0.03);
  --glow: rgba(255, 179, 71, 0.28);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #000;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.brand::before {
  content: "> ";
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

nav a {
  color: var(--muted);
  text-decoration: underline;
  padding: 0.15rem 0.3rem;
  border-radius: 0;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  background: transparent;
  text-decoration: underline;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  padding: 0.15rem 0.35rem;
}

.theme-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.2rem;
}

nav a.theme-btn {
  text-decoration: none;
  border: 1px solid transparent;
  padding: 0.08rem 0.35rem;
}

nav a.theme-btn:hover,
nav a.theme-btn.active {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.6rem 1rem 3rem;
  position: relative;
  z-index: 2;
}

h1, h2, h3 {
  color: var(--accent);
  font-weight: 700;
}

h1::before,
h2::before,
h3::before,
label::before {
  content: "> ";
  color: var(--muted);
}

h1::after {
  content: "_";
  margin-left: 0.2rem;
  color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: none;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  max-width: 24rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0;
  border: 1px solid var(--border);
  background: #000;
  color: var(--text);
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

textarea {
  max-width: 32rem;
  resize: vertical;
}

select[multiple] {
  max-width: 32rem;
}

button,
.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 0;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  font-family: inherit;
}

button:hover,
.btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

button.secondary,
.btn.secondary {
  border-color: var(--muted);
  color: var(--muted);
}

.alert {
  padding: 0.65rem 0.85rem;
  border-radius: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.alert.err {
  border-color: #a02222;
  background: #140606;
  color: #ff8f8f;
}

.alert.ok {
  border-color: #1d6e35;
  background: #06160b;
  color: #8dffba;
}

@keyframes blink-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: #000;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.card.stat {
  margin-bottom: 0;
}

.stat .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.panel-grid .card {
  margin-bottom: 0;
}

.panel-grid h3 {
  margin-top: 0;
}

.issue-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.issue-list li {
  margin: 0.2rem 0;
}

.inline-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.inline-filter label {
  margin-bottom: 0;
}

.zone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.2rem 0.6rem;
  background: #000;
  font-size: 0.86rem;
  color: var(--text);
}
