/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:      #0c0c0c;
  --s1:      #141414;
  --s2:      #1c1c1c;
  --s3:      #242424;
  --border:  #2c2c2c;
  --text:    #e6e1d8;
  --dim:     #5a5952;
  --accent:  #e8622a;
  --accent-d: rgba(232,98,42,0.12);
  --danger:  #c0392b;
  --safe:    #27ae60;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  min-height: 100vh;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--s1); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-brand span {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.btn:hover { background: var(--s3); border-color: #3a3a3a; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #d45520; border-color: #d45520; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,0.12); }
.btn-sm { padding: 5px 10px; font-size: 10px; }
.btn-icon {
  width: 28px; height: 28px;
  padding: 0;
  justify-content: center;
  font-size: 12px;
}

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-bg.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 28px;
  transform: translateY(10px);
  transition: transform 0.2s;
}
.modal-bg.open .modal { transform: none; }
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--text);
  margin-bottom: 22px;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ── Form ─────────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 2px;
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.12s;
}
.field input:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 11px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.error { border-color: var(--danger); color: #e05050; }
