:root{
  --bg: #0b1220;
  --surface: rgba(255,255,255,0.06);
  --surface-2: rgba(255,255,255,0.08);
  --border: rgba(148,163,184,0.18);
  --text: #e2e8f0;
  --muted: rgba(226,232,240,0.72);
  --brand: #6366f1;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 18px 55px rgba(0,0,0,0.35);
}

*{ box-sizing:border-box; }
body{
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin:0;
  background: radial-gradient(1200px 800px at 25% 10%, rgba(99,102,241,0.18), transparent 60%),
              radial-gradient(900px 700px at 90% 25%, rgba(34,197,94,0.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: #a5b4fc; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{ max-width: 1050px; margin: 28px auto; padding: 0 18px; }
.container.small{ max-width: 440px; }
.auth-page{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card{
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 18px;
}
.auth-card h1{ margin: 0 0 12px; }

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

.topbar h1{ margin:0; font-size: 22px; letter-spacing: 0.2px; }

.card{
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

h2{ margin:0 0 12px; font-size: 16px; color: var(--text); }

.grid{
  display:grid;
  gap: 10px;
}

@media (min-width: 720px){
  .grid.cols-2{ grid-template-columns: 1fr 1fr; }
}

label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15,23,42,0.65);
  color: var(--text);
  outline: none;
}

input::placeholder{ color: rgba(226,232,240,0.45); }
input:focus{
  border-color: rgba(99,102,241,0.75);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

button{
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: white;
  background: #334155;
  transition: transform 0.05s ease, filter 0.15s ease, background 0.15s ease;
}
button:hover{ filter: brightness(1.08); }
button:active{ transform: translateY(1px); }

.btn-primary{ background: var(--brand); }
.btn-ok{ background: var(--ok); }
.btn-danger{ background: var(--danger); }
.btn-warn{ background: var(--warn); color: #111827; }
.btn-ghost{ background: transparent; border: 1px solid var(--border); color: var(--text); }

table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  overflow:hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

thead th{
  text-align:left;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(226,232,240,0.75);
  background: rgba(2,6,23,0.35);
  border-bottom: 1px solid var(--border);
}

tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.14);
}
tbody tr:hover td{ background: rgba(99,102,241,0.06); }
tbody tr:last-child td{ border-bottom: none; }

.error{
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.note{ color: rgba(226,232,240,0.65); font-size: 13px; margin-top: 12px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
}
.pill.ok{ border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.12); }
.pill.bad{ border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.12); }
.pill.wait{ border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.14); }

.action-cell{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

.modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.7);
  z-index: 1000;
}
.modal-backdrop.open{ display:flex; }
.modal-card{
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--border);
  background: rgba(2,6,23,0.96);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.modal-card h3{
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text);
}
.modal-card input{
  margin-bottom: 10px;
}
