/* ===== Базова тема ===== */
body {
  background: #0c0c0e;
  color: #f2f2f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 24px;
  background: #1c1c1e;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

/* ===== Заголовки ===== */
h1, h2, h3 {
  color: #64d2ff;
  margin-bottom: 20px;
}

/* ===== Форми ===== */
form input[type="text"],
form input[type="password"] {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #2c2c2e;
  background: #2c2c2e;
  color: #f2f2f7;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.25s ease;
}

form input:focus {
  border-color: #0a84ff;
  outline: none;
}

form button {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: #0a84ff;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.25s ease, transform .08s ease;
}

form button:hover {
  background: #64d2ff;
  transform: translateY(-1px);
}

/* Дрібна підказка під полем */
.help-text {
  font-size: 13px;
  color: #a1a1aa;
  margin-top: -6px;
  margin-bottom: 8px;
}

/* ===== Повідомлення ===== */
.message {
  margin-bottom: 15px;
  font-weight: bold;
}
.message.success { color: #30d158; }
.message.error   { color: #ff453a; }
.message.info    { color: #ffd60a; }

/* ===== Поле пароля з “глазком” ===== */
.password-field {
  position: relative;
  padding-right: 40px; /* щоб іконка не перекривала текст на мобільних */
}
.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #a1a1aa;
  font-size: 20px;
  padding: 6px;
  z-index: 2;
  touch-action: manipulation;
}

/* ===== Індикатор складності пароля ===== */
#pass-info {
  font-size: 14px;
  margin-top: 6px;
  color: #a1a1aa;
}
.strength-bar {
  height: 6px;
  background: #2c2c2e;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
  display: block;
  width: 100%;
}
.strength-bar div {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  background-color: #ff453a; /* стартовий колір */
}

/* ===== Посилання на клієнти (оригінальні) =====
   Примітка: .links вже визначено для простих текстових посилань.
   Нові "пілюлі" додаються окремими класами нижче. */
.links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.links a {
  color: #64d2ff;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  background-color: rgba(100, 210, 255, 0.12);
  transition: background 0.25s ease, color 0.25s ease;
}
.links a:hover {
  background-color: rgba(100, 210, 255, 0.28);
  color: #0a84ff;
}
.links-sep {
  color: #a1a1aa;
  user-select: none;
}

/* ===== Таблиці ===== */
table.compact {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #1c1c1e;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
}

table.compact thead { background: #2c2c2e; }

table.compact th,
table.compact td {
  padding: 10px;
  border-bottom: 1px solid #2c2c2e;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: break-word;
  line-height: 1.4;
  color: #f2f2f7;
}

table.compact th {
  font-weight: bold;
  color: #64d2ff;
}

table.compact td code {
  background: transparent;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  color: #f2f2f7;
}

table.compact tr:hover { background: #2c2c2e; }

/* ===== Кнопки дій ===== */
.copy-btn, .delete-btn {
  font-size: 14px;
  padding: 6px 10px;
  margin: 0 2px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: #2c2c2e;
  color: #f2f2f7;
  transition: background 0.25s ease;
}

.copy-btn:hover  { background: #30d158; color: #fff; }
.delete-btn:hover{ background: #ff453a; color: #fff; }

/* ===== Inline форми ===== */
.inline { display: inline-block; }

/* ===== Пілюлі-кнопки з іконками (нове, не ламає старі .links) ===== */
.links-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;          /* форма "пілюлі" */
  background: #2c2c2e;
  color: #f2f2f7;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .12s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
}

.pill-ic {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 18px;
  color: currentColor;
}

/* hover та акценти */
.link-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
}
.link-pill.gp:hover { border-color: #00e676; background: rgba(0,230,118,.12); }
.link-pill.as:hover { border-color: #0a84ff; background: rgba(10,132,255,.12); }
.link-pill.el:hover { border-color: #30d158; background: rgba(48,209,88,.12); }

.link-pill:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(100,210,255,.28);
}

/* ===== Кнопки-пілюлі компактні на мобільних ===== */
@media (max-width: 480px) {
  .link-pill { flex: 1 1 auto; justify-content: center; }
}

/* ===== Мобільна адаптація ===== */
@media screen and (max-width: 600px) {
  .container {
    padding: 16px;
  }

  table.compact, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }

  table.compact tr {
    margin-bottom: 15px;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    padding: 10px;
    background: #1c1c1e;
  }

  table.compact td {
    padding: 8px;
    border: none;
    display: flex;
    justify-content: space-between;
    font-size: 15px;
  }

  table.compact td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #a1a1aa;
    margin-right: 10px;
    flex-shrink: 0;
  }

  table.compact th { display: none; }

  .copy-btn, .delete-btn {
    font-size: 15px;
    padding: 8px 12px;
    margin: 4px 2px;
    flex: 1 1 auto;
  }

  td.actions { flex-wrap: wrap; gap: 6px; }

  form input[type="text"],
  form input[type="password"],
  form button {
    width: 100%;
    margin-top: 8px;
  }

  .toggle-pass {
    font-size: 22px;
    right: 8px;
  }

  #pass-info {
    font-size: 14px;
    margin-top: 4px;
  }

  .strength-bar {
    margin-top: 4px;
    height: 8px;
  }
}

/* ===== Навігаційні посилання (адмінка) ===== */
.nav-links a {
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  color: #64d2ff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all 0.25s ease;
}
.nav-links a:hover {
  background-color: rgba(100, 210, 255, 0.15);
  color: #0a84ff;
  box-shadow: 0 0 6px rgba(100, 210, 255, 0.4);
}
.nav-links a:active {
  background-color: rgba(100, 210, 255, 0.25);
  transform: scale(0.97);
}

/* ===== Індикатори ресурсів ===== */
.bar-wrap {
  background: #2c2c2e;
  border-radius: 6px;
  height: 10px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 4px;
}
.bar-fill {
  height: 100%;
  background: #30d158;
  transition: width 0.3s ease;
}
.bar-fill.warn { background: #ffd60a; }
.bar-fill.crit { background: #ff453a; }
.bar-label { font-size: 13px; color: #a1a1aa; }
/* VPN Admin Table & Buttons */
table.compact {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
table.compact th,
table.compact td {
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #444;
}

td.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

td.actions form.inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.btn-sm {
    padding: 4px 6px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    height: 28px; /* вирівняти висоту всіх кнопок */
    min-width: 28px;
}

.btn-conf { background: #34c759; color: #fff; }
.btn-conf:hover { background: #28b44c; }

.btn-edit { background: #ff9f0a; color: #fff; }
.btn-edit:hover { background: #ffb340; }

.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #d73027; }

.btn-qr { background: #5ac8fa; color: #fff; }
.btn-qr:hover { background: #399ce3; }

.inline input[type=text] {
    padding: 3px 5px;
    border-radius: 6px;
    border: 1px solid #555;
    width: 70px; /* компактніше */
    margin-right: 2px;
    height: 24px;
    box-sizing: border-box;
}

/* Повідомлення */
.message {
    padding: 8px;
    border-radius: 8px;
    margin: 8px 0;
}
.message.info { background: #222; color: #fff; }
.message.error { background: #ff3b30; color: #fff; }

/* Вирівнювання кнопок в одному рядку */
td.actions button {
    display: flex;
    align-items: center;
    justify-content: center;
}

