:root {
  --bg: #0a0f1a;
  --bg-elev: #121a2b;
  --bg-soft: #182236;
  --line: rgba(148, 163, 194, 0.16);
  --text: #e9eef8;
  --muted: #8b96ab;
  --amber: #f0a43a;
  --amber-dim: rgba(240, 164, 58, 0.16);
  --mint: #3ee0b0;
  --mint-dim: rgba(62, 224, 176, 0.14);
  --rose: #ff6b7a;
  --rose-dim: rgba(255, 107, 122, 0.14);
  --blue: #6aa8ff;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(240, 164, 58, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(62, 224, 176, 0.08), transparent 50%),
    linear-gradient(180deg, #0c1424 0%, var(--bg) 40%, #070b13 100%);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--mint); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 15, 26, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, var(--amber), #ff7a3d 55%, #3ee0b0);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 10px 30px rgba(240,164,58,0.25);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px 8px 8px 18px;
  border-radius: 3px;
  background: rgba(10,15,26,0.55);
}

.brand span { font-size: 1.15rem; }
.brand small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-actions { display: flex; gap: 10px; align-items: center; }
.who {
  color: var(--muted);
  font-size: 0.92rem;
}
.who strong { color: var(--text); font-weight: 600; }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
  flex: 1;
}

.hero-login {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(24,34,54,0.95), rgba(18,26,43,0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}
.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field label {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: rgba(8, 12, 22, 0.65);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(240,164,58,0.55);
  box-shadow: 0 0 0 3px var(--amber-dim);
}
.field textarea { min-height: 88px; resize: vertical; font-family: var(--mono); font-size: 0.85rem; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, background .12s, border-color .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #ffb14d, var(--amber));
  color: #1a1205;
  box-shadow: 0 10px 28px rgba(240,164,58,0.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-mint {
  background: var(--mint-dim);
  border-color: rgba(62,224,176,0.35);
  color: var(--mint);
}
.btn-danger {
  background: var(--rose-dim);
  border-color: rgba(255,107,122,0.35);
  color: #ff8d98;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn-block { width: 100%; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 0.8rem; margin-bottom: 6px; }
.stat .value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.panel .sub {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.layout-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr:last-child td { border-bottom: 0; }

.beacon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}
.beacon i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
}
.beacon.on { color: var(--mint); border-color: rgba(62,224,176,0.3); background: var(--mint-dim); }
.beacon.on i {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(62,224,176,0.15), 0 0 12px rgba(62,224,176,0.8);
  animation: pulse 1.8s ease-in-out infinite;
}
.beacon.off { color: var(--muted); }
.beacon.err { color: #ff8d98; border-color: rgba(255,107,122,0.3); background: var(--rose-dim); }
.beacon.err i { background: var(--rose); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .beacon.on i { animation: none; }
  .btn:hover { transform: none; }
}

.pass-card {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(240,164,58,0.45);
  background:
    linear-gradient(135deg, rgba(240,164,58,0.12), transparent 40%),
    rgba(8,12,22,0.55);
  padding: 16px;
}
.pass-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--amber);
}
.cred-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.cred-row:last-child { border-bottom: 0; }
.cred-row span { color: var(--muted); font-family: var(--font); }
.cred-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.drop {
  border: 1.5px dashed rgba(148,163,194,0.35);
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  background: rgba(8,12,22,0.35);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.drop.drag {
  border-color: var(--amber);
  background: var(--amber-dim);
}
.drop strong { display: block; margin-bottom: 6px; }
.drop span { color: var(--muted); font-size: 0.9rem; }

.files {
  max-height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: #b7c0d2;
}
.files div { padding: 2px 0; white-space: nowrap; }

.logs {
  height: 260px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  background: #070b12;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  color: #9fb0c9;
}

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85rem; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: min(360px, calc(100% - 24px));
  display: none;
}
.toast.show { display: block; animation: in .2s ease; }
.toast.err { border-color: rgba(255,107,122,0.4); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

.site-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.site-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  font-size: 0.92rem;
  margin-bottom: 14px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

@media (max-width: 860px) {
  .layout-2, .grid-stats { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
  .page { width: min(100% - 24px, 1120px); }
  .table { display: block; overflow-x: auto; }
}
