:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --muted: #8b98a8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 12px;
  font-family: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
.lead { color: var(--muted); margin: 0 0 1.25rem; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
input, textarea, select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  margin-bottom: 1rem;
}
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--danger { background: var(--danger); }
.err { color: #fca5a5; margin-bottom: 1rem; }
.ok { color: var(--ok); }
.nav { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.nav a { text-decoration: none; font-size: 0.9rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }
.code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  background: rgba(0,0,0,0.35);
  padding: 0.75rem;
  border-radius: 8px;
  margin: 0.5rem 0 1rem;
}
.badge { font-size: 0.75rem; padding: 0.15rem 0.45rem; border-radius: 6px; background: rgba(255,255,255,0.08); }
.badge--off { background: rgba(239,68,68,0.2); color: #fca5a5; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.device-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.15);
}
.device-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.card-head h1 { margin: 0; }
.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-form input {
  width: min(280px, 100%);
  margin: 0;
}
.device-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.meta-label { color: var(--text); }
.subscription-meta {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.12);
}
.subscription-form {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}
.subscription-form h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.slots-details {
  margin-top: 1rem;
}
.slots-details summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.slots-form {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.12);
}
.slots-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.slots-row input {
  width: 6rem;
  margin: 0;
}
.device-settings {
  border-top: 1px solid var(--border);
  margin: 0.75rem 0 1rem;
  padding-top: 0.75rem;
}
.device-settings h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.export-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(0,0,0,0.2);
}
.export-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.export-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}
.qr {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0.75rem 0;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
  /* Keep modules sharp when CSS downscales the PNG — blurred QR = AmneziaVPN ignores it. */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.qr--large {
  width: min(560px, 100%);
}
.export-card--primary {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
}
