/* ════════════════════════════════════════════════════════
   FONTS & VARIABLES
════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg:        #080c14;
  --surface:   #0d1220;
  --surface2:  #131928;
  --border:    #1e2840;
  --border2:   #2a3554;
  --teal:      #00c8a8;
  --teal-dim:  rgba(0,200,168,.10);
  --teal-mid:  rgba(0,200,168,.25);
  --teal-btn:  #00a98d;
  --teal-hover:#00c4a4;
  --text:      #e8edf8;
  --text-soft: #8a93b2;
  --text-muted:#4a5270;
  --green:     #34d399;
  --red:       #f87171;
  --amber:     #fbbf24;
  --font:      'Syne', sans-serif;
  --mono:      'IBM Plex Mono', monospace;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

code { font-family: var(--mono); font-size: 12px; background: var(--surface2); color: var(--teal); padding: 1px 6px; border-radius: 4px; }
label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
strong { font-weight: 600; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════
   INPUTS
════════════════════════════════════════════════════════ */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus { border-color: var(--teal-mid); box-shadow: 0 0 0 3px var(--teal-dim); }
input::placeholder { color: var(--text-muted); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.4); }
.mono-inp { font-family: var(--mono); font-size: 12px; }

.sel-inp, .role-sel, .device-sel {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color .18s;
}
.role-sel { width: auto; padding: 6px 10px; font-size: 12px; }
.sel-inp:focus, .device-sel:focus { border-color: var(--teal-mid); box-shadow: 0 0 0 3px var(--teal-dim); }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row .field { margin-bottom: 0; }
.field-err { font-size: 12px; color: var(--red); min-height: 18px; padding-top: 3px; }
.hint { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-btn); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 11px 22px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .18s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--teal-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; transform: none; }

.btn-primary-sm {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--teal-btn); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 7px 14px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-primary-sm:hover { background: var(--teal-hover); }

.btn-ghost-sm {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 6px 13px; font-family: var(--font); font-size: 12px;
  cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap;
}
.btn-ghost-sm:hover { border-color: var(--teal-mid); color: var(--teal); }
.btn-ghost-sm.danger:hover { border-color: rgba(248,113,113,.4); color: var(--red); }

.btn-danger-sm {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--red);
  border: 1px solid rgba(248,113,113,.25); border-radius: var(--r-sm);
  padding: 6px 14px; font-family: var(--font); font-size: 12px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-danger-sm:hover { border-color: var(--red); background: rgba(248,113,113,.05); }

.btn-act {
  font-family: var(--font); font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap;
}
.btn-act:hover { border-color: var(--teal-mid); color: var(--teal); }
.btn-act.danger:hover { border-color: rgba(248,113,113,.4); color: var(--red); }

.act-row { display: flex; gap: 5px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════
   TOPBAR / LOGO
════════════════════════════════════════════════════════ */
.topbar-logo {
  font-family: var(--font); font-weight: 700; font-size: 18px;
  letter-spacing: -.02em; color: var(--text); user-select: none; flex-shrink: 0;
}
.topbar-logo span { color: var(--teal); }

/* ════════════════════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════════════════════ */
#v-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; position: relative; overflow: hidden; }
.login-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 50% 60% at 50% -10%, rgba(0,200,168,.18) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 80% 100%, rgba(0,100,200,.08) 0%, transparent 60%);
}
.login-card {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 44px 40px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: fadeUp .35s ease both;
}
.login-logo { font-family: var(--font); font-weight: 700; font-size: 26px; letter-spacing: -.03em; margin-bottom: 4px; }
.login-logo span { color: var(--teal); }
.login-tagline { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; font-weight: 400; }
.login-form { display: flex; flex-direction: column; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; }
.pass-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; display: flex; align-items: center;
  transition: color .15s;
}
.pass-eye:hover { color: var(--text); }
.login-err { font-size: 12px; color: var(--red); min-height: 18px; padding-top: 4px; }
.btn-login {
  margin-top: 8px; width: 100%; padding: 12px;
  background: var(--teal-btn); color: #fff; border: none;
  border-radius: var(--r-sm); font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .18s, transform .1s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { background: var(--teal-hover); transform: translateY(-1px); }
.btn-login:disabled { background: var(--border); transform: none; cursor: not-allowed; }
.btn-spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

/* ════════════════════════════════════════════════════════
   ADMIN PANEL
════════════════════════════════════════════════════════ */
#v-admin { display: none; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; height: 56px;
  background: rgba(8,12,20,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); z-index: 100; flex-shrink: 0;
}
.topbar-nav { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.topbar-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-who { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }

.nav-btn {
  background: transparent; border: none; border-radius: var(--r-sm);
  padding: 7px 12px; font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s; white-space: nowrap;
  letter-spacing: .02em;
}
.nav-btn:hover { background: rgba(255,255,255,.04); color: var(--text-soft); }
.nav-btn.active { background: var(--teal-dim); color: var(--teal); }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 32px 28px 80px; }

.tab { display: none; animation: fadeUp .22s ease both; }
.tab.active { display: block; }

/* ── Section heads ── */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.sec-head h2 { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.section { margin-top: 28px; }

/* ── Warn bar ── */
.warn-bar {
  background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.2);
  border-radius: var(--r-sm); padding: 10px 16px; font-size: 13px; color: var(--amber);
  margin-bottom: 20px;
}
.warn-bar a { color: var(--amber); text-decoration: underline; }

/* ── Stat cards ── */
.stat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px;
}
@media(max-width:900px) { .stat-grid { grid-template-columns: repeat(3,1fr); } }
@media(max-width:540px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
}
.stat-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 6px; }
.stat-val  { font-size: 18px; font-weight: 600; color: var(--text); }
.stat-val.hi    { color: var(--teal); }
.stat-val.green { color: var(--green); }
.stat-val.red   { color: var(--red); }
.stat-val.mono  { font-family: var(--mono); font-size: 14px; }

/* ── Panel row ── */
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:700px) { .panel-row { grid-template-columns: 1fr; } }

/* ── Card ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px 22px; }
.card-title { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }

/* ── Resource bars ── */
.res-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.res-lbl { font-size: 11px; color: var(--text-muted); width: 36px; flex-shrink: 0; letter-spacing: .04em; font-weight: 600; }
.res-val { font-family: var(--mono); font-size: 12px; color: var(--text); width: 44px; text-align: right; flex-shrink: 0; }
.res-sub { font-size: 11px; color: var(--text-muted); margin-top: -6px; margin-bottom: 10px; }
.bar-wrap { flex: 1; }
.bar-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--teal); border-radius: 99px; transition: width .6s ease; }
.bar-fill.amber { background: var(--amber); }
.bar-fill.red   { background: var(--red); }

/* ── Toggles ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.tog-name { font-size: 14px; font-weight: 600; color: var(--text); }
.tog-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle   { position: relative; width: 44px; height: 24px; background: var(--border); border: none; border-radius: 12px; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.toggle.on { background: var(--teal-btn); }
.tog-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.toggle.on .tog-knob { transform: translateX(20px); }

/* ── WG log ── */
.wg-log {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
  font-family: var(--mono); font-size: 11px; line-height: 1.9;
  color: var(--teal); white-space: pre-wrap; word-break: break-all;
  max-height: 180px; overflow-y: auto;
}

/* ── Tables ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
th { padding: 10px 16px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,200,168,.025); }
.mono-cell { font-family: var(--mono); font-size: 11px; color: var(--teal); }
.hi-cell   { font-weight: 600; color: var(--teal); }
.dim-cell  { font-size: 12px; color: var(--text-muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,.6); }
.pill { display: inline-block; font-family: var(--mono); font-size: 10px; color: var(--text-muted); padding: 1px 7px; background: var(--surface2); border-radius: 4px; margin-right: 4px; }
.empty-msg { text-align: center; padding: 40px 20px; font-size: 13px; color: var(--text-muted); }

/* ── Badges ── */
.badge { background: var(--teal-dim); color: var(--teal); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.sm { font-size: 9px; padding: 1px 6px; }
.badge-you { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--teal-dim); color: var(--teal); margin-left: 5px; vertical-align: middle; }

/* ── Add bar ── */
.add-bar { display: flex; gap: 10px; margin-bottom: 10px; }
.add-bar input { flex: 1; }

/* ── Locations grid ── */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.loc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px; position: relative;
  transition: border-color .18s;
}
.loc-card:hover { border-color: var(--border2); }
.loc-card.inactive { opacity: .5; }
.loc-x {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; padding: 2px 5px; border-radius: 4px;
}
.loc-card:hover .loc-x { opacity: 1; }
.loc-x:hover { color: var(--red); }
.lc-flag    { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.lc-name    { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.lc-country { font-size: 11px; color: var(--text-soft); margin-bottom: 6px; }
.lc-ep      { font-family: var(--mono); font-size: 10px; color: var(--text-muted); word-break: break-all; }
.loc-default-badge { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--teal-dim); color: var(--teal); }
.loc-inactive-badge { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(251,191,36,.1); color: var(--amber); }

/* ── Account ── */
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.acc-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.acc-row:last-child { border-bottom: none; }
.acc-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.acc-val { font-size: 14px; color: var(--text); }
.acc-val.mono { font-family: var(--mono); font-size: 13px; }

/* ── Loc check list ── */
.loc-checks { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; padding: 4px 0; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.check-row input[type="checkbox"] { accent-color: var(--teal); width: 14px; height: 14px; cursor: pointer; }

/* ════════════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════════════ */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 28px 30px;
  max-width: 420px; width: 100%;
  animation: fadeUp .2s ease both;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-wide { max-width: 580px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-x { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 3px 7px; border-radius: 5px; transition: color .15s, background .15s; line-height: 1; }
.modal-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }
.modal-fields { margin-bottom: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); }

/* Loc picker (config modal) */
.loc-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.lpick { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 12px; transition: border-color .15s; }
.lpick.sel { border-color: var(--teal); background: var(--teal-dim); }
.lpick-flag    { font-size: 22px; margin-bottom: 6px; line-height: 1; }
.lpick-country { font-size: 13px; font-weight: 600; color: var(--text); }
.lpick-name    { font-size: 11px; color: var(--text-muted); margin: 2px 0 8px; }
.lpick-acts    { display: flex; gap: 5px; }
.lpick-btn {
  flex: 1; font-family: var(--font); font-size: 11px; font-weight: 600; padding: 5px 0;
  border-radius: 5px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-muted); cursor: pointer; text-align: center; text-decoration: none; display: block;
  transition: border-color .15s, color .15s;
}
.lpick-btn:hover { border-color: var(--teal-mid); color: var(--teal); }

.qr-wrap-m { text-align: center; padding: 16px 0 4px; }
.qr-loc-title { font-size: 13px; font-weight: 600; color: var(--teal); margin-bottom: 14px; }
.qr-img { width: 200px; height: 200px; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; margin: 0 auto; }
.qr-sub { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* Presets */
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); }
.presets-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.preset { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 10px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap; }
.preset:hover { border-color: var(--teal-mid); color: var(--teal); }

/* ════════════════════════════════════════════════════════
   USER PANEL
════════════════════════════════════════════════════════ */
#v-user { display: none; flex-direction: column; min-height: 100vh; }

.user-bar {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 56px;
  background: rgba(8,12,20,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); z-index: 100; flex-shrink: 0;
}
.user-bar-end { display: flex; align-items: center; gap: 8px; }

.user-view { display: none; flex: 1; }
.user-view.active { display: flex; }

/* VPN app layout */
#uv-vpn.active { flex-direction: row; height: calc(100vh - 56px); overflow: hidden; }

/* Server sidebar */
.srv-sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.srv-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.srv-sidebar-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.srv-list { flex: 1; overflow-y: auto; padding: 6px; }

.srv-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 10px; cursor: pointer; text-align: left; font-family: var(--font);
  transition: background .14s, border-color .14s;
}
.srv-item:hover { background: rgba(0,200,168,.06); border-color: var(--border); }
.srv-item.active { background: var(--teal-dim); border-color: var(--teal-mid); }
.srv-item.active .srv-check { opacity: 1; }
.srv-flag    { font-size: 20px; flex-shrink: 0; line-height: 1; }
.srv-info    { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.srv-country { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-name    { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-check   { font-size: 11px; color: var(--teal); opacity: 0; flex-shrink: 0; transition: opacity .14s; }
.srv-empty   { padding: 24px 16px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* Connection panel */
.conn-panel { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; }

.sel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 32px 24px; text-align: center; display: flex; flex-direction: column;
  align-items: center; min-height: 150px; justify-content: center;
}
.sel-placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); }
.sel-placeholder-icon { font-size: 40px; opacity: .2; }
.sel-flag    { font-size: 56px; margin-bottom: 8px; line-height: 1; animation: fadeUp .25s ease; }
.sel-country { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sel-srvname { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.sel-ep      { font-family: var(--mono); font-size: 11px; color: var(--text-muted); background: var(--surface2); padding: 4px 14px; border-radius: 999px; border: 1px solid var(--border); }

/* Device picker */
.device-picker { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.device-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.device-sel { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%234a5270' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* No profiles */
.no-profiles { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 28px 20px; text-align: center; }
.no-prof-icon  { font-size: 36px; margin-bottom: 10px; }
.no-prof-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.no-prof-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }

/* Action buttons */
.conn-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-download {
  flex: 1; min-width: 200px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--teal-btn); color: #fff; border: none; border-radius: var(--r-md);
  padding: 14px 24px; font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: background .18s, transform .12s; white-space: nowrap;
}
.btn-download:hover { background: var(--teal-hover); transform: translateY(-1px); text-decoration: none; }
.btn-download:active { transform: translateY(0); }
.btn-qr {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: transparent; color: var(--text-soft); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 22px; font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .18s, color .18s, background .18s; white-space: nowrap;
}
.btn-qr:hover { border-color: var(--teal-mid); color: var(--teal); background: var(--teal-dim); }

/* QR */
.qr-wrap { animation: fadeUp .2s ease; }
.qr-box {
  background: var(--surface); border: 1px solid var(--teal-mid); border-radius: var(--r-lg);
  padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 0 30px var(--teal-dim);
}
.qr-box-head { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 13px; font-weight: 600; color: var(--text); }
.qr-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 3px 6px; border-radius: 4px; transition: color .15s; }
.qr-x:hover { color: var(--text); }

/* User stats */
.u-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.u-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; text-align: center; }
.u-stat-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 6px; }
.u-stat-val { font-size: 20px; font-weight: 700; color: var(--teal); }

/* Guide */
.guide-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; }
.guide-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 14px; }
.guide-step { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.guide-step:last-child { margin-bottom: 0; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--teal-dim); color: var(--teal); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* User account */
#uv-account.active { flex-direction: column; overflow-y: auto; }
.u-account-wrap { max-width: 700px; margin: 0 auto; padding: 32px 28px 80px; width: 100%; }

/* ════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */
@media(max-width:860px) {
  #uv-vpn.active { flex-direction: column; height: auto; overflow: visible; }
  .srv-sidebar   { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .srv-list      { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); padding: 8px; }
  .srv-check     { display: none; }
  .conn-panel    { padding: 16px; }
  .btn-download, .btn-qr { flex: 1 1 100%; }
  .u-stats       { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:700px) {
  .topbar, .user-bar { padding: 0 16px; }
  .topbar-nav        { display: none; }
  .admin-main        { padding: 20px 16px 60px; }
  .login-card        { padding: 32px 22px; }
  .modal             { padding: 22px 18px; }
  .u-account-wrap    { padding: 20px 16px 60px; }
  .panel-row         { grid-template-columns: 1fr; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
@media(max-width:480px) {
  .stat-grid  { grid-template-columns: repeat(2,1fr); }
  .u-stats    { grid-template-columns: 1fr 1fr; }
  .loc-grid   { grid-template-columns: 1fr 1fr; }
  .sel-flag   { font-size: 44px; }
  .sel-country { font-size: 20px; }
}
