/* ═══════════════════════════════════════════════════════════════
   Ankor — общие стили для лендинга и админки.
   Тёмная Discord-style тема с медным акцентом (как в лаунчере).
═══════════════════════════════════════════════════════════════ */

:root {
  --bg-base:       #0a0a0d;
  --bg-floor:      #14141a;
  --bg-panel:      #1a1a22;
  --bg-card:       #22222c;
  --bg-elev:       #2a2a36;
  --bg-hover:      #32323e;
  --border:        #2c2c38;
  --border-strong: #3a3a48;
  --text:          #e8e8ee;
  --text-muted:    #a0a0aa;
  --text-dim:      #6a6a76;
  --accent:        #cc7a2e;
  --accent-bright: #e8983e;
  --accent-dim:    #8a4f1a;
  --accent-glow:   rgba(204,122,46,0.25);
  --green:  #4ec97a;
  --red:    #e54848;
  --yellow: #e8b22a;
  --blue:   #5b8def;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

button { cursor: pointer; border: none; background: transparent; color: inherit; }
a { color: var(--accent-bright); text-decoration: none; }
svg { display: block; }

/* ═══════════════════════════════════════════════════════════════
   LANDING
═══════════════════════════════════════════════════════════════ */

.page-landing { background: var(--bg-base); }
.landing { max-width: 960px; margin: 0 auto; padding: 32px 24px; }

/* Hero */
.hero-section {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  overflow: hidden;
  padding: 48px 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.hero-bg-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 30%, rgba(204,122,46,0.22), transparent 60%),
    radial-gradient(ellipse 50% 70% at 80% 80%, rgba(91,141,239,0.12), transparent 60%);
}

.hero-bg-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.05) 1px, transparent 1px),
    radial-gradient(circle at 60% 70%, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 28px 28px, 22px 22px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  border-radius: var(--radius);
  color: var(--bg-base);
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-primary svg { width: 22px; height: 22px; }
.btn-line-1 { display: block; font-size: 15px; line-height: 1.2; }
.btn-line-2 { display: block; font-size: 11px; opacity: 0.75; font-weight: 600; }

.ip-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.ip-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent-dim);
}
.ip-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ip-value {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

/* Status */
.status-section { margin-bottom: 32px; }

.status-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.status-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.status-card.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 2s infinite;
}
.status-card.offline .status-dot { background: var(--red); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-card-title { flex: 1; }
.status-card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-card-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.status-card.online .status-card-value { color: var(--green); }
.status-card.offline .status-card-value { color: var(--red); }

.status-card-meta {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.status-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
}

.stat-item {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Steps */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.steps-section { margin-bottom: 40px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.step-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}

.step-num {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: var(--bg-base);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent-bright);
}
.step-icon svg { width: 22px; height: 22px; }

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.landing-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-bright);
}

.footer-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN
═══════════════════════════════════════════════════════════════ */

.page-admin {
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Login screen */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-screen.hidden { display: none; }

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 40%, rgba(204,122,46,0.15), transparent 70%),
    radial-gradient(ellipse 80% 60% at 70% 70%, rgba(91,141,239,0.08), transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 380px;
  padding: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.login-card .login-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input[type="text"],
.field input[type="password"] {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  transition: border-color 0.15s;
}
.field input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-base);
  transition: all 0.15s;
  margin-top: 8px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.error-text {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  margin-bottom: 4px;
}

/* Admin layout */
.admin-app {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-floor);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-brand {
  padding: 0 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--bg-base);
}
.admin-brand-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  transition: all 0.15s;
}
.admin-nav-item svg { width: 18px; height: 18px; }
.admin-nav-item:hover { background: var(--bg-panel); color: var(--text); }
.admin-nav-item.active { background: var(--bg-elev); color: var(--accent-bright); }

.admin-sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-me-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--bg-base);
  text-transform: uppercase;
}
.admin-me-name { flex: 1; font-size: 12px; font-weight: 600; }
.btn-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: all 0.15s;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.btn-icon:hover { background: rgba(255,255,255,0.06); color: var(--text); }
#btn-logout:hover { background: rgba(229,72,72,0.15); color: var(--red); }
.btn-icon svg { width: 14px; height: 14px; }

.admin-main {
  flex: 1;
  overflow-y: auto;
}

.admin-view {
  display: none;
  padding: 24px 32px;
}
.admin-view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.view-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  background: var(--bg-floor);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-card); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge.admin  { background: rgba(204,122,46,0.15); color: var(--accent-bright); }
.badge.online { background: rgba(78,201,122,0.15); color: var(--green); }
.badge.offline{ background: rgba(229,72,72,0.15); color: var(--red); }

.row-actions {
  display: flex;
  gap: 6px;
}
.row-actions button {
  padding: 4px 10px;
  background: var(--bg-elev);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}
.row-actions button:hover { background: var(--bg-hover); }
.row-actions button.danger { color: var(--red); }
.row-actions button.danger:hover { background: rgba(229,72,72,0.15); }

/* Cards */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.card-row:first-of-type { border-top: none; }
.card-key { font-size: 12px; color: var(--text-muted); }
.card-val { font-size: 13px; color: var(--text); font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* RCON */
.rcon-output {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
  white-space: pre-wrap;
  user-select: text;
}

.rcon-form {
  display: flex;
  gap: 8px;
}

.rcon-input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.rcon-input:focus { border-color: var(--accent); }

.rcon-send {
  padding: 0 18px;
  background: var(--accent);
  color: var(--bg-base);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
}
.rcon-send:hover { background: var(--accent-bright); }

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.quick-btn {
  padding: 6px 12px;
  background: var(--bg-elev);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}
.quick-btn:hover { background: var(--bg-hover); color: var(--accent-bright); }
.quick-btn.danger:hover { background: rgba(229,72,72,0.15); color: var(--red); }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-bg.active { display: flex; }

.modal {
  width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 16px; margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
  padding: 8px 16px;
  background: var(--red);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

/* Services */
.service-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.service-card.active .service-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.service-card.failed .service-dot { background: var(--red); }
.service-name { flex: 1; font-size: 14px; font-weight: 700; }
.service-meta { font-size: 11px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

.log-view {
  background: #050507;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  user-select: text;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s;
}
.toast.ok    { border-left: 3px solid var(--green); }
.toast.err   { border-left: 3px solid var(--red); }
.toast.info  { border-left: 3px solid var(--blue); }
.toast.fade-out { animation: toast-out 0.3s forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 720px) {
  .hero-title { font-size: 28px; }
  .hero-section { padding: 32px 20px; }
  .status-card-stats { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .steps-grid { grid-template-columns: 1fr; }

  /* ─── Admin: hide sidebar, show bottom nav + top bar ─── */
  .admin-sidebar { display: none; }
  .admin-main {
    padding-top: 52px;      /* оставляем место для sticky top bar */
    padding-bottom: 68px;   /* и для bottom nav */
  }
  .admin-view {
    padding: 16px 14px;     /* меньше отступ на мобилке */
  }
  .view-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }
  .view-header h2 {
    font-size: 20px;
    line-height: 1.2;
    min-width: 0;            /* чтобы длинный заголовок не обрезался слева */
  }

  /* Показать мобильный top bar */
  .mobile-topbar { display: flex !important; }
  .mobile-bottom-nav { display: flex !important; }

  /* Таблицы — горизонтальный скролл вместо обрезки */
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .table th, .table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Дашборд карточки в одну колонку */
  .health-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .card {
    padding: 16px 14px;
  }

  /* Кнопки крупнее для тач-таргетов */
  .btn, .btn-primary, .btn-secondary {
    min-height: 40px;
  }

  /* Модалки — учитываем viewport */
  .cc-card, .auth-modal-card, .acc-modal-card {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

/* ─── Mobile top bar (скрыто на десктопе) ────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  padding: 0 14px;
  background: var(--bg-floor);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mobile-topbar-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-topbar-brand-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--bg-base);
}
.mobile-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mobile-topbar .btn-icon {
  width: 34px; height: 34px;
}
.mobile-topbar .btn-icon svg {
  width: 16px; height: 16px;
}

/* ─── Mobile bottom navigation ────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-floor);
  border-top: 1px solid var(--border);
  z-index: 40;
  padding: 0;
  justify-content: space-around;
  align-items: stretch;
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  min-width: 0;
  transition: color 0.15s;
}
.mobile-nav-item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.mobile-nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.mobile-nav-item.active {
  color: var(--accent-bright);
}
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent-bright);
  border-radius: 0 0 2px 2px;
}
.mobile-nav-badge {
  position: absolute;
  top: 4px;
  right: 12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Health card ─────────────────────────────────────────────── */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.health-badge.ok   { background: rgba(78,201,122,0.15); color: var(--green); }
.health-badge.warn { background: rgba(232,178,42,0.15); color: var(--yellow); }
.health-badge.bad  { background: rgba(229,72,72,0.15);  color: var(--red); }
.health-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.health-stat {
  padding: 12px 14px;
  background: var(--bg-floor);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.health-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.health-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.health-stat-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Полоса памяти */
.health-bar-wrap {
  margin-top: 16px;
}

.health-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}

.health-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 4px;
  transition: width 0.3s;
}
.health-bar-fill.warn { background: linear-gradient(90deg, var(--yellow), #ffd966); }
.health-bar-fill.bad  { background: linear-gradient(90deg, var(--red), #ff7a7a); }

/* Маркер MemoryHigh лимита */
.health-bar-high {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 12px;
  background: var(--text-muted);
  opacity: 0.6;
}

.health-bar-legend {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 800px) {
  .health-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Whitelist toggle in table ─────────────────────────────── */
.wl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.wl-toggle.on {
  background: rgba(78,201,122,0.12);
  color: var(--green);
  border-color: rgba(78,201,122,0.3);
}
.wl-toggle.on:hover {
  background: rgba(78,201,122,0.2);
}
.wl-toggle.off {
  background: rgba(229,72,72,0.10);
  color: var(--red);
  border-color: rgba(229,72,72,0.25);
}
.wl-toggle.off:hover {
  background: rgba(229,72,72,0.18);
}
.wl-toggle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.wl-toggle:disabled { opacity: 0.6; cursor: wait; }

/* ─── Backup view ──────────────────────────────────────────── */
.backup-create-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.backup-create-row .btn-secondary {
  padding: 14px 18px;
  text-align: left;
  line-height: 1.3;
}
.backup-create-row .btn-secondary b {
  font-size: 13px;
}

.upload-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-base);
  transition: all 0.15s;
}
.upload-drop:hover,
.upload-drop.drag {
  border-color: var(--accent);
  background: rgba(204,122,46,0.05);
}
.upload-drop-text {
  font-size: 13px;
  color: var(--text-muted);
}

.spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}


/* ─── Pending badge in sidebar ─────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── Chart polish ─────────────────────────────────────────── */
#dash-chart {
  background: var(--bg-floor);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

#dash-chart .chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  opacity: 0.4;
}

/* ─── Public landing — players card ────────────────────────── */
.landing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.landing-stat {
  padding: 14px 16px;
  background: var(--bg-floor, rgba(0,0,0,0.2));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 8px;
  text-align: center;
}
.landing-stat-val {
  font-size: 22px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-bright, #e09451);
  line-height: 1.1;
}
.landing-stat-label {
  font-size: 11px;
  color: var(--text-dim, #8b8b8b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.landing-online-list {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(78,201,122,0.08);
  border: 1px solid rgba(78,201,122,0.2);
  border-radius: 8px;
  font-size: 13px;
}
.landing-online-list strong { color: var(--green); }

/* ─── Landing topbar ───────────────────────────────────────── */
.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: rgba(20,17,15,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.landing-topbar-brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #ddd);
  text-decoration: none;
}
.landing-topbar-nav {
  display: flex;
  gap: 14px;
  align-items: center;
}
.landing-topbar-link {
  color: var(--accent-bright, #e09451);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  transition: all 0.15s;
}
.landing-topbar-link:hover {
  border-color: var(--accent, #cc7a2e);
  background: rgba(204,122,46,0.05);
}
.landing-topbar-user {
  color: var(--text-dim, #999);
  font-size: 13px;
}
@media (max-width: 600px) {
  .landing-topbar { padding: 10px 16px; }
  .landing-topbar-link { font-size: 12px; padding: 6px 10px; }
}

/* ─── Custom confirm dialog ───────────────────────────────── */
.cc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.cc-card {
  background: var(--bg-floor);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.cc-card h3 { margin: 0 0 16px; font-size: 16px; }
.cc-body { font-size: 13px; color: var(--text); }
.cc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.cc-cancel, .cc-ok {
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: none;
}
.cc-cancel { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.cc-ok     { background: linear-gradient(135deg, var(--accent), var(--accent-bright)); color: white; }

/* ─── Auth modal on landing ────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadein 0.15s;
}
.auth-modal.hidden { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-floor);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  width: 32px; height: 32px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
}
.auth-modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.auth-modal-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.auth-modal-brand-mark {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.auth-modal-brand-name { font-size: 18px; font-weight: 700; }
.auth-modal-brand-sub { font-size: 12px; color: var(--text-dim); }

.auth-modal-tabs {
  display: flex; gap: 4px;
  background: var(--bg-base);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.auth-modal-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.auth-modal-tab.active {
  background: var(--bg-floor);
  color: var(--text);
}

.auth-modal-form { display: none; flex-direction: column; gap: 12px; }
.auth-modal-form.active { display: flex; }

.auth-modal-field { display: flex; flex-direction: column; gap: 6px; }
.auth-modal-field > span {
  font-size: 11px; color: var(--text-dim);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.auth-modal-field input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.auth-modal-field input:focus { border-color: var(--accent); }
.auth-modal-hint {
  color: var(--text-dim); font-size: 11px;
  font-weight: normal; text-transform: none; letter-spacing: 0;
}

.auth-modal-error {
  color: var(--red);
  font-size: 12px;
  min-height: 14px;
  font-weight: 500;
}

.auth-modal-submit {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s;
}
.auth-modal-submit:hover { transform: translateY(-1px); }
.auth-modal-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
