:root {
  color-scheme: dark;
  --bg: #07100f;
  --surface: #0d1917;
  --surface-2: #12221f;
  --line: #213b36;
  --text: #eef7f4;
  --muted: #8eaaa4;
  --green: #45e6a1;
  --green-dark: #173d31;
  --amber: #ffbf66;
  --red: #ff7d77;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 5%, rgba(69,230,161,.10), transparent 28rem),
    linear-gradient(145deg, #07100f, #091512 55%, #06100e);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
.topbar {
  min-height: 74px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(7,16,15,.78);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.brand-mark {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  color: #062018; background: var(--green);
  font-weight: 900; letter-spacing: -.04em;
  box-shadow: 0 10px 35px rgba(69,230,161,.18);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
nav { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
nav a { text-decoration: none; }
.text-button { border: 0; color: var(--muted); background: none; cursor: pointer; }
.dashboard { width: min(1120px, 90vw); margin: 54px auto 72px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.eyebrow {
  margin: 0 0 10px; color: var(--green);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(38px, 6vw, 68px); line-height: .98; letter-spacing: -.055em; }
h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.55; }
.status-pill {
  padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: rgba(13,25,23,.86); white-space: nowrap;
}
.status-pill span {
  display: inline-block; width: 8px; height: 8px; margin-right: 9px;
  border-radius: 50%; background: var(--amber);
}
.status-pill.online { color: var(--green); border-color: rgba(69,230,161,.32); }
.status-pill.online span { background: var(--green); box-shadow: 0 0 14px var(--green); }
.status-pill.offline { color: var(--red); }
.status-pill.offline span { background: var(--red); }
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 38px 0 22px; padding: 1px; border-radius: 18px; overflow: hidden;
  background: var(--line);
}
.metrics article { min-width: 0; padding: 22px; background: var(--surface); }
.metrics span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
.control-card, .details-card, .actions-card, .notice {
  border: 1px solid var(--line); border-radius: 20px; background: rgba(13,25,23,.90);
}
.route-editor {
  margin-top: 22px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(13,25,23,.90);
}
.fixed-route {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 12px;
  padding: 13px 15px;
  border: 1px solid rgba(69,230,161,.25);
  border-radius: 11px;
  background: rgba(69,230,161,.06);
}
.fixed-route span { color: var(--muted); }
.fixed-route strong { font-family: "Cascadia Code", Consolas, monospace; }
textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: #081310;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1.55;
}
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(69,230,161,.10); }
.editor-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.editor-button { width: auto; min-width: 220px; padding: 0 20px; }
.control-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 30px;
}
.adblock-control { margin-top: 22px; }
.switch input { position: absolute; opacity: 0; }
.switch span {
  display: block; width: 66px; height: 36px; padding: 4px;
  border-radius: 999px; background: #263c38; cursor: pointer; transition: .2s ease;
}
.switch span::after {
  content: ""; display: block; width: 28px; height: 28px; border-radius: 50%;
  background: #b7c9c5; transition: .2s ease;
}
.switch input:checked + span { background: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green); }
.switch input:checked + span::after { transform: translateX(30px); background: var(--green); }
.switch input:disabled + span { cursor: wait; opacity: .55; }
.details-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 22px; margin-top: 22px; }
.details-card, .actions-card { padding: 28px 30px; }
dl { margin: 20px 0 0; }
dl div {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-family: "Cascadia Code", Consolas, monospace; }
.action {
  width: 100%; min-height: 44px; margin-top: 12px; display: grid; place-items: center;
  border-radius: 11px; text-decoration: none; cursor: pointer;
}
.secondary { border: 1px solid var(--line); color: var(--text); background: var(--surface-2); }
.kerio-action { border-color: rgba(69,230,161,.42); }
.route-hint {
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.action-message { min-height: 20px; color: var(--green); font-size: 13px; }
.notice { margin-top: 22px; padding: 18px 22px; color: var(--muted); line-height: 1.5; }
.notice strong { color: var(--text); }
.login-page { display: grid; place-items: center; padding: 28px; }
.login-card {
  width: min(430px, 100%); padding: 42px; border: 1px solid var(--line);
  border-radius: 24px; background: rgba(13,25,23,.94);
  box-shadow: 0 30px 90px rgba(0,0,0,.32);
}
.login-card h1 { margin-top: 22px; font-size: 48px; }
form { margin-top: 28px; }
label { display: block; margin: 16px 0; color: var(--muted); font-size: 13px; }
input {
  width: 100%; margin-top: 8px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 11px; outline: none; color: var(--text); background: #081310;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(69,230,161,.10); }
.primary {
  width: 100%; min-height: 46px; border: 0; border-radius: 11px;
  color: #062018; background: var(--green); font-weight: 800; cursor: pointer;
}
.error { min-height: 20px; color: var(--red); font-size: 13px; }
.back-link { display: block; margin-top: 24px; color: var(--muted); text-align: center; text-decoration: none; font-size: 13px; }
@media (max-width: 780px) {
  .topbar { padding: 14px 5vw; }
  nav a { display: none; }
  .dashboard { margin-top: 38px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .metrics { grid-template-columns: 1fr; }
  .control-card { padding: 22px; }
  .login-card { padding: 28px; }
  .fixed-route, .editor-actions { align-items: flex-start; flex-direction: column; }
  .editor-button { width: 100%; }
}
.user-configs {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
}

.user-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.user-config-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-strong);
}

.user-config-card div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-config-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.config-warning {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 800px) {
  .user-config-grid {
    grid-template-columns: 1fr;
  }
}
