:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --success-bg: #052e1a;
  --success-text: #6ee7b7;
  --error-bg: #3b1111;
  --error-text: #fca5a5;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 50%),
              radial-gradient(900px 500px at 100% 0%, #1a2744 0%, transparent 45%),
              var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: #93c5fd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.topbar h1,
.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.login-card {
  max-width: 400px;
  margin: 10vh auto 0;
}

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

.form input[type="url"],
.form input[type="text"],
.form input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1219;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.form input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  border-color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.form-grid .field.full {
  grid-column: 1 / -1;
}

.form-grid .field label {
  margin-bottom: 0.35rem;
}

.form-grid .field input {
  margin-bottom: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-copy {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(110, 231, 183, 0.3);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(252, 165, 165, 0.3);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td.truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.center {
  text-align: center;
}

td.nowrap {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}
