/* VPN Панель — тёмная тема в цветах иконки (фон #04081a, акцент голубой/циан). */
:root {
  --bg: #04081a;
  --bg2: #0a1230;
  --card: #0d1638;
  --line: #1c2a5c;
  --text: #e6ecff;
  --muted: #8b98c7;
  --accent: #22d3ee;
  --accent2: #3b82f6;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #0f2a6b55, transparent),
              radial-gradient(900px 500px at -10% 110%, #0b4d6b44, transparent), var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; letter-spacing: .01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.mono, code, textarea.conf { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
code { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .35rem; word-break: break-all; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.2rem;
  background: rgba(4, 8, 26, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { border-radius: 8px; }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: .4rem .7rem; border-radius: 9px; }
.nav a:hover { color: var(--text); background: var(--bg2); }
.nav a.active { color: var(--bg); background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 600; }
.logout { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.who { color: var(--muted); font-size: .9rem; }
.navtoggle, .burger { display: none; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.card {
  background: linear-gradient(180deg, rgba(13, 22, 56, .95), rgba(10, 18, 48, .95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.center { text-align: center; }
.code { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2));
        -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 1.4rem; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
        display: flex; flex-direction: column; color: var(--muted); }
.tile .num { font-size: 2rem; font-weight: 800; color: var(--text); }
.tile.alert { border-color: var(--warn); }
.servers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.srv { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .2rem; background: var(--bg2); }
.srv.off { opacity: .55; }

/* forms */
label { display: flex; flex-direction: column; gap: .3rem; color: var(--muted); font-size: .92rem; }
input, select, textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .7rem; font: inherit; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea.conf { width: 100%; resize: vertical; white-space: pre; }
.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline-form input[name=value] { flex: 1 1 220px; }
.inline-form input[name=comment] { flex: 1 1 180px; }
.inline-form.compact input { width: 150px; padding: .3rem .5rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
fieldset.modes { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; display: flex; gap: .8rem; flex-wrap: wrap; }
fieldset.modes legend { color: var(--muted); padding: 0 .3rem; }
label.radio { flex-direction: row; align-items: flex-start; gap: .5rem; flex: 1 1 220px; color: var(--text); cursor: pointer; }
label.radio span { display: flex; flex-direction: column; }
label.radio small { color: var(--muted); }
.issue-form { max-width: 560px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #021024; border: 0; }
.btn.danger { color: var(--bad); border-color: #5b2333; }
.btn.danger:hover { background: #2a0f1a; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }

/* banners & pills */
.banner { border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.banner.ok { background: #062a22; border-color: #13684f; color: #a7f3d0; }
.banner.warn { background: #2b2108; border-color: #7a5a10; color: #fde68a; }
.banner.error { background: #2c0d16; border-color: #7f1d2d; color: #fecaca; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
        border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.active { color: var(--ok); border-color: #13684f; }
.pill.suspect, .pill.warn { color: var(--warn); border-color: #7a5a10; }
.pill.revoked { color: var(--bad); border-color: #7f1d2d; }
.pill.provisioning, .pill.unblocking, .pill.unknown { color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
tr.dim td { opacity: .55; }
tr.sub td { border-bottom-color: transparent; padding-top: 0; }
td.actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
td.actions form { margin: 0; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin-top: 1rem; }

/* profile card */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .8rem 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.qr { width: 100%; max-width: 320px; border-radius: 12px; background: #fff; padding: 6px; image-rendering: pixelated; }

/* login */
.login-card { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.login-card form { text-align: left; }
.login-logo { border-radius: 16px; margin-bottom: .6rem; }

/* phones */
@media (max-width: 760px) {
  .wrap { padding: 1rem .8rem 2.5rem; }
  .burger { display: flex; flex-direction: column; gap: 4px; margin-left: auto; cursor: pointer; padding: .4rem; }
  .burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; }
  .navtoggle:checked ~ .nav { display: flex; }
  .logout { margin: .5rem 0 0; justify-content: space-between; }
  .grid2 { grid-template-columns: 1fr; }
  td.actions { justify-content: flex-start; }
  h1 { font-size: 1.35rem; }
}

/* traffic */
.periods { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn.period-active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #021024; border: 0; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: .6rem; }
.tile { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.tile strong { font-size: 1.35rem; }
.small { font-size: .85rem; }
svg.chart { width: 100%; height: 180px; display: block; }
.bar-rx { fill: var(--accent); }
.bar-tx { fill: var(--accent2); }
.chart-label { fill: var(--muted); }
.key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: middle; }
.key-rx { background: var(--accent); }
.key-tx { background: var(--accent2); }
