:root {
  --bg: #0e141b;
  --bg-elev: #17212c;
  --line: #2b3a4a;
  --text: #e7eef6;
  --muted: #8aa0b5;
  --accent: #3dd6c6;
  --accent-dim: #1e8f84;
  --danger: #ef6b6b;
  --warn: #e3b341;
  --ok: #6bcf8e;
  --radius: 14px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, #1b3a3a 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

a { color: var(--accent); }

h1, h2, h3 { margin: 0 0 0.4rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

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

.login-card,
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.login-card { width: min(420px, 100%); }

.stack, label { display: flex; flex-direction: column; gap: 0.35rem; }
.stack { gap: 0.9rem; }

label { font-size: 0.85rem; color: var(--muted); }

input, select, button {
  font: inherit;
  color: var(--text);
}

input, select {
  background: #0f1821;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}

select[size] {
  min-height: 8rem;
}

input:focus, select:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent);
}

button {
  background: var(--accent);
  color: #062924;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-weight: 650;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #6a3030;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.4rem 1.6rem 0.8rem;
}

.topbar-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  background: #123833;
  color: var(--accent);
  border: 1px solid #1f5e56;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 1rem;
  padding: 0 1.6rem 2rem;
}

.grow { min-width: 0; }

.grid-form {
  display: grid;
  gap: 0.75rem;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.checkbox input { width: auto; }

.form-actions { display: flex; gap: 0.5rem; }

.hint { font-size: 0.75rem; color: var(--muted); }

.banner {
  margin: 0 1.6rem 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
}

.login-card .banner { margin: 0 0 0.8rem; }

.banner.error { background: #3a1b1b; color: #ffc4c4; }
.banner.warn { background: #3a3218; color: #ffe7a3; }
.banner.ok { background: #173325; color: #c8f0d6; }
.hidden { display: none !important; }

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

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

.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.row-actions button { padding: 0.3rem 0.55rem; font-size: 0.8rem; }

.status-on { color: var(--ok); }
.status-off { color: var(--muted); }

.plain-list {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.used-block { margin-top: 1.2rem; }

@media (max-width: 960px) {
  .layout, .topbar { display: flex; flex-direction: column; }
  .topbar { align-items: flex-start; }
}
