/* ─────────────────────────────────────────────────────────────────────────────
   ApiXS — Main Stylesheet
   Цветовая схема: dark (#0d1117) + accent #37FAAB
───────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-primary:       #0d1117;
  --bg-secondary:     #161b22;
  --bg-glass:         rgba(18, 23, 32, 0.72);
  --bg-card:          rgba(14, 18, 26, 0.8);
  --accent-green:     #37FAAB;
  --accent-green-dark:#2dd68a;
  --accent-blue:      #58a6ff;
  --text-primary:     #e6edf3;
  --text-secondary:   #8b949e;
  --text-muted:       #6e7681;
  --border-color:     rgba(240, 246, 252, 0.08);
  --border-hover:     rgba(55, 250, 171, 0.22);
  --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md:        0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg:        0 8px 28px rgba(0, 0, 0, 0.55);
  --radius-card:      16px;
  --radius-btn:       10px;
  --radius-sm:        8px;
}

html {
  background: var(--bg-primary);
  scroll-behavior: smooth;
}

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-size: 15px;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── App loader ──────────────────────────────────────────────────────────── */

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, rgba(55, 250, 171, 0.08), transparent 55%),
              radial-gradient(circle at bottom right, rgba(55, 250, 171, 0.05), transparent 55%),
              var(--bg-primary);
  transition: opacity 0.4s ease;
}

.app-loader-hidden {
  opacity: 0;
  pointer-events: none;
}

.app-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.app-loader-logo {
  width: 48px;
  height: 48px;
  animation: pulse 2.4s ease-in-out infinite;
}

.app-loader-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.75; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.header {
  padding: 18px 40px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header a { text-decoration: none; }

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
}

.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

a.logo:hover { color: inherit; }

.logo-icon { color: var(--accent-green); }

.logo-accent {
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-badge {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0.01em;
}

.header-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.header-link {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.18s, background 0.18s;
}

.header-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.header-logout-form { display: inline; }
.header-logout-form .btn-ghost { margin: 0; }

/* Nav user pill */
.nav-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
  max-width: 180px;
}
.nav-user-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}
.nav-user-ava {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.nav-user-label {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 120px;
  transition: color 0.18s;
}
.nav-user-pill:hover .nav-user-label { color: var(--text-primary); }

/* Logout button */
#nav-logout-form { display: inline-flex; margin: 0; }
.nav-logout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  padding: 0;
}
.nav-logout-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.22);
}

/* Login button */
.nav-login-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary) !important;
  font-size: 13px; font-weight: 500;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.nav-login-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary) !important;
}

@media (max-width: 768px) {
  .nav-user-pill { padding: 3px; border-radius: 50%; max-width: none; gap: 0; }
  .nav-user-label { display: none; }
  .nav-logout-btn { display: none; }
}

/* ── Main content ────────────────────────────────────────────────────────── */

.content {
  flex: 1;
  padding: 40px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}

.animate-in { animation: fadeInUp 0.5s ease-out; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero { margin-bottom: 40px; }
.hero-text { max-width: 680px; }

.hero-kicker {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--text-muted);
  margin-bottom: 14px; display: block;
}

.hero-title {
  font-size: 40px; line-height: 1.1;
  font-weight: 800; letter-spacing: -0.04em;
  margin-bottom: 16px;
  background: linear-gradient(140deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 15.5px; color: var(--text-secondary);
  margin-bottom: 28px; line-height: 1.65;
}
.hero-subtitle a { color: var(--accent-green); text-decoration: none; }
.hero-subtitle a:hover { text-decoration: underline; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Banners ─────────────────────────────────────────────────────────────── */

.banner {
  margin-bottom: 24px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 14px;
  display: flex; align-items: center; gap: 12px;
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.banner svg { flex-shrink: 0; }
.banner.success {
  background: rgba(55, 250, 171, 0.08);
  border: 1px solid rgba(55, 250, 171, 0.28);
  color: var(--accent-green);
}
.banner.error {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.28);
  color: #f85149;
}
.banner code {
  background: rgba(255, 255, 255, 0.09);
  padding: 2px 6px; border-radius: 4px;
  font-family: "JetBrains Mono", "SF Mono", monospace; font-size: 12.5px;
}

/* ── Dashboard grid ──────────────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

/* ── Cards & Glass ───────────────────────────────────────────────────────── */

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(55, 250, 171, 0.25), transparent);
  opacity: 0; transition: opacity 0.22s;
}
.glass:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(55, 250, 171, 0.06);
}
.glass:hover::before { opacity: 1; }

.card { display: flex; flex-direction: column; }

.card-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.card-icon { color: var(--accent-green); opacity: 0.75; }

/* ── Status dots ─────────────────────────────────────────────────────────── */

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%; background: var(--text-muted);
}
.status-dot-live {
  background: var(--accent-green);
  box-shadow: 0 0 10px rgba(55, 250, 171, 0.55);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.65; }
}
.card[data-status="ok"] .status-dot {
  background: var(--accent-green);
  box-shadow: 0 0 7px rgba(55, 250, 171, 0.4);
}
.card[data-status="err"] .status-dot {
  background: #f85149;
  box-shadow: 0 0 7px rgba(248, 81, 73, 0.4);
}

/* ── Card values ─────────────────────────────────────────────────────────── */

.card-value-large {
  font-size: 30px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.card-value-status { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.sparkline { margin-top: 12px; width: 100%; height: 28px; opacity: 0.55; }
.card-uptime { grid-column: span 1; }

/* ── User layout ─────────────────────────────────────────────────────────── */

.user-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.75fr);
  gap: 22px;
}
@media (max-width: 900px) {
  .user-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ── Uptime bar ──────────────────────────────────────────────────────────── */

.uptime-bar {
  width: 100%; height: 6px;
  background: rgba(240, 246, 252, 0.08);
  border-radius: 3px; overflow: hidden; margin: 18px 0 8px;
}
.uptime-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
  border-radius: 3px; transition: width 0.5s ease;
}
.uptime-pct { font-size: 13.5px; color: var(--accent-green); font-weight: 600; }

/* ── Changelog / Posts ───────────────────────────────────────────────────── */

.changelog-section { margin-bottom: 28px; }
.changelog-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.changelog-content { font-size: 14px; color: var(--text-secondary); line-height: 1.75; }

.status-posts-list { display: flex; flex-direction: column; gap: 14px; }

a.status-post {
  display: block; padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(16, 21, 30, 0.55);
  color: inherit; text-decoration: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
a.status-post, a.status-post:hover, a.status-post * { text-decoration: none !important; color: inherit; }
a.status-post .status-post-title  { color: var(--text-primary); }
a.status-post .status-post-meta   { color: var(--text-muted); }
a.status-post .status-post-excerpt{ color: var(--text-secondary); }
a.status-post .status-post-excerpt * { color: inherit; }
a.status-post .status-post-excerpt code { color: var(--text-secondary); }
a.status-post:hover {
  border-color: rgba(240, 246, 252, 0.13);
  background: rgba(22, 28, 40, 0.65);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

.status-post-title { font-size: 1.05em; font-weight: 600; color: var(--text-primary); margin: 0 0 7px; line-height: 1.35; }
.status-post-meta  { font-size: 11.5px; color: var(--text-muted); margin: 0 0 11px; }
.status-post-excerpt { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; margin: 0; }

.status-posts-list .status-post-excerpt h1,
.status-posts-list .status-post-excerpt h2,
.status-posts-list .status-post-excerpt h3 {
  font-size: 0.95em; font-weight: 600; margin: 0.4em 0;
  padding: 0; background: none !important; border: none !important;
  border-radius: 0; border-left: none !important;
  color: var(--text-primary); display: block;
}
.status-posts-list .status-post-excerpt p { margin: 0 0 0.5em; }
.status-posts-list .status-post-excerpt p:last-child { margin-bottom: 0; }
.status-posts-list .status-post-excerpt code {
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.changelog-content h1 {
  font-size: 1.25em; font-weight: 700; color: var(--text-primary);
  margin: 0 0 1em; display: flex; align-items: center; gap: 8px;
}
.changelog-content h1::before { content: "📋"; font-size: 1.1em; }

.changelog-content h2 {
  font-size: 1.05em; font-weight: 600; color: var(--accent-green);
  margin-top: 1.5em; margin-bottom: 0.55em;
  padding: 9px 14px;
  background: rgba(55, 250, 171, 0.07);
  border-left: 3px solid var(--accent-green);
  border-radius: 0 8px 8px 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.changelog-content h2:first-of-type { margin-top: 0; }

.changelog-content h3 {
  font-size: 0.98em; font-weight: 600; color: var(--text-primary);
  margin-top: 1.2em; margin-bottom: 0.45em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.changelog-badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 0.73em; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.3; margin-left: 4px;
}
.changelog-badge-new      { background: rgba(55,250,171,0.15); color: var(--accent-green); border: 1px solid rgba(55,250,171,0.3); }
.changelog-badge-fixed    { background: rgba(88,166,255,0.15); color: var(--accent-blue);  border: 1px solid rgba(88,166,255,0.3); }
.changelog-badge-improved { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.changelog-badge-changed  { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }

.changelog-content ul { margin: 0.35em 0 1em; padding-left: 1.4em; list-style: none; }
.changelog-content ul li { position: relative; margin-bottom: 0.55em; padding-left: 0.6em; }
.changelog-content ul li:hover { color: var(--text-primary); transition: color 0.18s; }
.changelog-content ul li::before { content: "—"; position: absolute; left: -1.2em; color: var(--accent-green); opacity: 0.55; }
.changelog-content hr { border: none; border-top: 1px solid var(--border-color); margin: 2em 0; opacity: 0.5; }
.changelog-content code {
  font-family: "JetBrains Mono", "SF Mono", monospace; font-size: 0.88em;
  background: rgba(55,250,171,0.09); color: var(--accent-green);
  padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(55,250,171,0.18);
}
.changelog-content a { color: var(--accent-green); text-decoration: none; }
.changelog-content a:hover { text-decoration: underline; }
.changelog-content strong { color: var(--text-primary); font-weight: 600; }
.changelog-content em { color: var(--text-primary); font-style: italic; opacity: 0.9; }
.changelog-version { display: inline-block; font-size: 0.88em; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.changelog-date    { display: inline-block; font-size: 0.83em; color: var(--text-muted); font-weight: 400; margin-left: 4px; }

/* ── Charts ──────────────────────────────────────────────────────────────── */

.charts-section {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 18px; margin-bottom: 28px;
}
.card.wide { grid-column: span 1; }
.card-donut { display: flex; flex-direction: column; }
.chart-title { font-size: 15.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 18px; }
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 14px;
}
.chart-period-tabs {
  display: flex; gap: 3px;
  background: rgba(240,246,252,0.04);
  padding: 4px; border-radius: var(--radius-sm);
}
.period-tab {
  padding: 5px 12px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.18s, color 0.18s; font-family: inherit;
}
.period-tab:hover { background: rgba(240,246,252,0.07); color: var(--text-secondary); }
.period-tab.active { background: rgba(55,250,171,0.12); color: var(--accent-green); }
.chart-container { position: relative; height: 300px; margin-top: 8px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
#donutChart { max-width: 200px; max-height: 200px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── CTA ─────────────────────────────────────────────────────────────────── */

.cta-section { margin-bottom: 28px; }
.cta-card {
  background: linear-gradient(135deg, rgba(55,250,171,0.07) 0%, rgba(55,250,171,0.03) 100%);
  border-color: rgba(55,250,171,0.18);
}
.cta-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 7px; }
.cta-badge { font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
.cta-description {
  font-size: 13.5px; color: var(--text-secondary);
  margin-bottom: 22px; line-height: 1.65;
}
.cta-description.mb    { margin-bottom: 18px; }
.cta-description.mb-sm { margin-bottom: 12px; }
.cta-description-muted { font-size: 13px; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  padding: 11px 22px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(55,250,171,0.35);
  background: rgba(55,250,171,0.12);
  color: var(--accent-green);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-family: inherit;
}
.btn-primary:hover {
  background: rgba(55,250,171,0.2);
  border-color: rgba(55,250,171,0.55);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(55,250,171,0.18);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  padding: 11px 22px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-family: inherit;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(240,246,252,0.18);
  color: var(--text-primary);
}

.btn-icon { transition: transform 0.2s; }
.btn-icon-spin { animation: spin 0.9s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  padding: 22px 40px;
  border-top: 1px solid var(--border-color);
  background: rgba(10,14,20,0.55);
  margin-top: auto;
}
.footer-content {
  max-width: 1320px; margin: 0 auto;
  font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.footer-sep { opacity: 0.4; }
.footer-content a { color: var(--text-muted); text-decoration: none; transition: color 0.18s; }
.footer-content a:hover { color: var(--accent-green); }

/* ── Mobile nav (legacy, replaced by burger) ─────────────────────────────── */

.mobile-nav {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 120; display: none; padding: 8px; border-radius: 999px;
  background: rgba(10,14,20,0.96); backdrop-filter: blur(20px);
  border: 1px solid var(--border-color); box-shadow: var(--shadow-lg);
}
.mobile-nav-item {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 16px; border-radius: 999px;
  font-size: 12px; color: var(--text-secondary); text-decoration: none; transition: all 0.2s;
}
.mobile-nav-item span { display: none; }
.mobile-nav-item svg { width: 18px; height: 18px; }
.mobile-nav-item-active { background: rgba(55,250,171,0.12); color: var(--accent-green); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) { .charts-section { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  .header, .content, .footer { padding-left: 18px; padding-right: 18px; }
  .hero-title { font-size: 26px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-value-large { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .mobile-nav { display: flex; gap: 4px; }
  .mobile-nav-item span { display: inline; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 22px; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
}

/* ── Toggle switch (GREEN) ───────────────────────────────────────────────── */

.settings-row {
  display: flex; align-items: center;
  justify-content: space-between; padding: 12px 0; gap: 16px;
}
.settings-row .toggle-switch { flex-shrink: 0; }

.settings-text { display: flex; flex-direction: column; gap: 3px; }
.settings-title   { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.settings-subtitle{ font-size: 12px; color: var(--text-muted); }

.toggle-switch {
  position: relative; width: 44px; height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  cursor: pointer; padding: 0; outline: none;
  display: inline-flex; align-items: center; flex-shrink: 0;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.toggle-switch:hover { border-color: rgba(255,255,255,0.2); }

.toggle-switch-on {
  background: rgba(55,250,171,0.18);
  border-color: rgba(55,250,171,0.5);
}

.toggle-knob {
  position: absolute; width: 18px; height: 18px;
  border-radius: 999px;
  background: #6e7681;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  left: 2px;
  transition: transform 0.22s ease, background 0.22s ease;
}
.toggle-switch-on .toggle-knob {
  transform: translateX(20px);
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(55,250,171,0.4);
}

/* ── Toast notifications ─────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 130;
  min-width: 180px; max-width: 300px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,16,24,0.97);
  border: 1px solid rgba(148,163,184,0.3);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.toast-success { border-color: rgba(55,250,171,0.45); color: var(--accent-green); }
.toast-error   { border-color: rgba(248,81,73,0.5);   color: #fca5a5; }

/* ── Form fields ─────────────────────────────────────────────────────────── */

.connect-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.01em; text-transform: uppercase;
}
.field input {
  padding: 11px 14px; border-radius: var(--radius-btn);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(8,12,18,0.6);
  color: var(--text-primary); font-size: 14px;
  transition: all 0.2s; outline: none; font-family: inherit;
}
.field input::placeholder { color: var(--text-muted); }
.field input:hover { border-color: rgba(255,255,255,0.18); }
.field input:focus {
  border-color: rgba(55,250,171,0.45);
  background: rgba(10,14,20,0.85);
  box-shadow: 0 0 0 3px rgba(55,250,171,0.09);
}
.field input:disabled { opacity: 0.45; cursor: not-allowed; }

.field-hint { font-size: 11.5px; color: var(--text-muted); }
.connect-form.mb { margin-bottom: 20px; }
.connect-form.mt { margin-top: 14px; }
.field.max-w { max-width: 280px; }

/* ── Maintenance ─────────────────────────────────────────────────────────── */

.maintenance-card {
  background: rgba(10,12,16,0.88) !important;
  border: 1px solid rgba(55,250,171,0.18) !important;
  padding: 44px !important;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  max-width: 580px; position: relative; overflow: hidden;
}
.maintenance-card::after {
  content: ""; position: absolute; top: -100%; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(55,250,171,0.04), transparent);
}
.corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent-green); opacity: 0.45; }
.top-left    { top: 14px;    left: 14px;    border-right: 0; border-bottom: 0; }
.bottom-right{ bottom: 14px; right: 14px;   border-left: 0;  border-top: 0; }

.content-center { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 200px); }
.maintenance-inner { text-align: left; position: relative; z-index: 2; }
.maintenance-title { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing: -0.03em; }
.maintenance-accent { color: var(--accent-green); opacity: 0.85; }
.maintenance-line { width: 36px; height: 2px; background: var(--accent-green); margin-bottom: 24px; border-radius: 2px; }
.maintenance-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.65; margin: 0; }
.maintenance-footer { display: flex; justify-content: space-between; align-items: flex-end; opacity: 0.55; }
.maintenance-build { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--text-muted); }
.maintenance-build span { color: var(--text-primary); }

/* ── Login (user_unauthed) ───────────────────────────────────────────────── */

.login-steps { list-style: decimal; padding-left: 20px; color: var(--text-secondary); line-height: 1.85; }
.login-steps li { margin-bottom: 8px; }
.login-steps strong { color: var(--text-primary); }
.login-actions { margin-top: 22px; }
.login-token-box {
  margin-top: 22px; padding: 18px;
  background: rgba(10,14,20,0.7);
  border: 1px solid var(--border-color); border-radius: 14px;
}
.login-token-step { margin-bottom: 12px; color: var(--text-secondary); }
.login-bot-link { color: var(--accent-green); text-decoration: none; }
.login-bot-link:hover { text-decoration: underline; }
.start-command-code {
  background: rgba(55,250,171,0.09); color: var(--accent-green);
  padding: 3px 8px; border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
}
.login-token-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.login-hint { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.login-primary-btn {
  background: linear-gradient(135deg, rgba(99,179,237,0.15) 0%, rgba(56,189,248,0.06) 100%);
  border-color: rgba(99,179,237,0.4); color: #bfdbfe;
}
.login-secondary-btn { padding: 8px 14px; font-size: 13px; background: rgba(12,16,24,0.9); border-color: rgba(148,163,184,0.35); color: #e5e7eb; }
.token-code {
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  background: rgba(12,16,24,0.9); padding: 4px 8px; border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.35);
}
.login-steps.login-steps li { margin-bottom: 0; }

/* ── Connect / QR ────────────────────────────────────────────────────────── */

.settings-row-no-pad { padding: 0; margin-bottom: 16px; }

.qr-btn-inner { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.qr-btn-inner .qr-label { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.qr-btn-dots { display: inline-flex; gap: 2px; }
.qr-btn-dots span { width: 4px; height: 4px; border-radius: 999px; background: var(--accent-green); }

#qr-login-panel { display: none; margin-bottom: 20px; }

.qr-outer {
  width: 300px; height: 300px; margin: 0 auto 12px;
  border-radius: 22px; padding: 18px; background: #fff;
  box-shadow: 0 18px 44px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
}
.qr-frame-wrap { position: relative; width: 320px; margin: 0 auto 16px; }
.qr-corner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--accent-green); border-radius: 8px; }
.qr-corner-tl { top: -8px; left: -8px;  border-right: none; border-bottom: none; }
.qr-corner-tr { top: -8px; right: -8px; border-left: none;  border-bottom: none; }
.qr-corner-bl { bottom: -8px; left: -8px;  border-right: none; border-top: none; }
.qr-corner-br { bottom: -8px; right: -8px; border-left: none;  border-top: none; }

.qr-inner {
  width: 300px; height: 300px; border-radius: 20px; padding: 18px; background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(55,250,171,0.12);
  display: flex; align-items: center; justify-content: center;
}

#qr-code { position: relative; width: 264px; height: 264px; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; }

/* Steps instruction */
.qr-steps { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 4px; text-align: left; max-width: 320px; }
.qr-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary, #adbac7); }
.qr-step-num { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; background: rgba(55,250,171,.15); color: var(--accent-green); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.qr-step strong { color: var(--text-primary, #e6edf3); }
.qr-fallback-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); text-decoration: none; transition: color .2s; }
.qr-fallback-link:hover { color: var(--accent-green); }

#qr-loading {
  position: absolute; inset: 0; background: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; border-radius: 4px; overflow: hidden; transition: opacity 0.45s ease;
}
#qr-loading.qr-ready { opacity: 0; pointer-events: none; }
.qr-skel-svg { display: block; width: 200px; height: 200px; }
.qs { fill: #dedede; } .qd { fill: #e8e8e8; }
#qr-loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,0.72) 50%, transparent 75%);
  background-size: 300% 100%; animation: qr-skel-shimmer 1.9s ease-in-out infinite;
}
@keyframes qr-skel-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -100% 0; } }
.qr-scan-line {
  position: absolute; left: 6px; right: 6px; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-green) 50%, transparent 100%);
  box-shadow: 0 0 8px rgba(55,250,171,0.75), 0 0 4px rgba(55,250,171,0.45);
  border-radius: 999px; animation: qr-scan 2.2s ease-in-out infinite; z-index: 3;
}
@keyframes qr-scan {
  0%   { transform: translateY(-2px); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(220px); opacity: 0; }
}

.qr-hint { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.connect-intro { margin-bottom: 20px; }
.connect-qr-actions { margin-bottom: 24px; }
.connect-qr-btn { display: inline-flex; align-items: center; gap: 10px; }

.connect-tabs { display: flex; gap: 6px; margin-bottom: 24px; justify-content: center; }

.phone-auth-wrap { max-width: 380px; margin: 0 auto; width: 100%; }
.phone-auth-hero { text-align: center; margin-bottom: 28px; }
.phone-auth-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.22);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: #a5b4fc;
}
.phone-auth-title { font-size: 20px; font-weight: 700; color: #f3f4f6; margin: 0 0 6px; }
.phone-auth-sub   { font-size: 14px; color: #9ca3af; margin: 0; line-height: 1.55; }

.connect-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: var(--radius-btn);
  border: 1px solid rgba(255,255,255,0.09);
  background: transparent; color: var(--text-muted);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.connect-tab:hover { background: rgba(255,255,255,0.05); color: #e5e7eb; }
.connect-tab.active { background: rgba(99,102,241,0.12); color: #a5b4fc; border-color: rgba(99,102,241,0.35); }

.connect-tab-panel { animation: fadeIn 0.2s ease; }
.phone-section { overflow: hidden; }
.phone-section-hidden { max-height: 0; opacity: 0; pointer-events: none; transition: max-height 0.4s ease, opacity 0.35s ease; }
.phone-section-visible { max-height: 400px; opacity: 1; pointer-events: auto; transition: max-height 0.4s ease, opacity 0.35s ease; }

.phone-field-label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #6b7280; margin-bottom: 8px; }
.phone-input-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.phone-input-row input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09); background: rgba(255,255,255,0.04);
  color: #f3f4f6; font-size: 16px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; letter-spacing: 0.02em; box-sizing: border-box;
}
.phone-input-row input:focus { border-color: rgba(99,102,241,0.55); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.phone-input-row .btn-primary { width: 100%; justify-content: center; }
@media (min-width: 480px) {
  .phone-input-row { flex-direction: row; align-items: stretch; }
  .phone-input-row input { flex: 1; width: auto; }
  .phone-input-row .btn-primary { width: auto; flex-shrink: 0; }
}

.phone-status-text { font-size: 13px; color: #9ca3af; margin-top: 8px; min-height: 18px; text-align: center; }
.phone-delivery-hint { font-size: 13px; color: #6ee7b7; margin-bottom: 16px; line-height: 1.55; text-align: center; }
.phone-confirm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.phone-confirm-number { font-size: 18px; font-weight: 700; color: #e5e7eb; letter-spacing: 0.04em; }
.phone-change-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: #9ca3af; font-size: 12px; padding: 4px 10px; border-radius: 8px;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.phone-change-btn:hover { color: #e5e7eb; border-color: rgba(255,255,255,0.22); }

/* OTP boxes */
.otp-boxes { display: flex; gap: 10px; margin-bottom: 12px; justify-content: center; }
.otp-box {
  width: 52px; height: 60px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: #f3f4f6; font-size: 26px; font-weight: 700;
  text-align: center; outline: none; caret-color: transparent;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.otp-box:focus { border-color: rgba(99,102,241,0.65); box-shadow: 0 0 0 4px rgba(99,102,241,0.12); background: rgba(99,102,241,0.05); }
.otp-box.filled { border-color: rgba(99,102,241,0.45); background: rgba(99,102,241,0.07); }
.otp-box.otp-error { border-color: rgba(239,68,68,0.65) !important; background: rgba(239,68,68,0.07) !important; animation: otp-shake 0.4s ease; }
@keyframes otp-shake {
  0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-6px); }
  40%{ transform:translateX(6px); } 60%{ transform:translateX(-4px); } 80%{ transform:translateX(4px); }
}
@media (max-width: 480px) { .otp-boxes { gap: 7px; } .otp-box { width: 44px; height: 54px; font-size: 22px; border-radius: 12px; } }

.btn-ghost {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; padding: 4px 0; margin-top: 6px; text-decoration: underline;
}
.btn-ghost:hover { color: #9ca3af; }

/* SW update toast */
#sw-update-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: rgba(16,20,30,0.97);
  border: 1px solid rgba(55,250,171,0.3);
  border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  color: #e5e7eb; font-size: 14px; font-weight: 500; z-index: 9999;
  opacity: 0; transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
  white-space: nowrap;
}
#sw-update-toast.sw-toast-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
#sw-update-btn {
  padding: 6px 14px; border-radius: 8px; border: none;
  background: var(--accent-green); color: #0d1117;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
#sw-update-btn:hover { opacity: 0.88; }
#sw-dismiss-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; transition: color 0.15s;
}
#sw-dismiss-btn:hover { color: var(--text-primary); }

/* Telegram deeplink */
.tg-deeplink-btn {
  display: none; align-items: center; justify-content: center; gap: 8px;
  margin: 14px auto 0; padding: 12px 28px; font-size: 15px; font-weight: 600;
  text-decoration: none; border-radius: 12px;
  background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff;
  box-shadow: 0 4px 18px rgba(42,171,238,0.3);
  transition: opacity 0.2s, transform 0.15s;
}
.tg-deeplink-btn:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }

/* QR status */
.qr-status-block { text-align: center; margin-top: 12px; min-height: 2.5em; }
.qr-timer-text   { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.qr-status-text  { font-size: 14px; color: var(--accent-green); font-weight: 500; }

#qr-2fa { margin-top: 12px; display: none; }
.qr-2fa-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.qr-2fa-row { display: flex; gap: 8px; }
.qr-2fa-row input {
  flex: 1; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(10,14,20,0.85); color: var(--text-primary); font-size: 14px;
}
.qr-2fa-row .btn-primary { white-space: nowrap; }
#qr-2fa-error { margin-top: 4px; font-size: 12px; color: #f85149; }

/* ── License ─────────────────────────────────────────────────────────────── */

.license-inner { width: 100%; max-width: 1320px; }
.license-sidebar .card.glass { padding: 20px; }
.license-sidebar .card-head { margin-bottom: 12px; }
.license-card .card-head.license-card-head {
  border: none; padding-bottom: 0; margin-bottom: 20px;
  flex-direction: column; align-items: flex-start; gap: 6px;
}
.license-hero-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 0; }

/* ── Help ────────────────────────────────────────────────────────────────── */

.help-footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.help-footer-col { flex: 1; min-width: 280px; }
.help-footer-col.right { text-align: right; }
.help-footer-title { margin-top: 0; color: var(--text-primary); font-size: 1rem; }
.help-footer-link { color: var(--accent-green); text-decoration: none; }
.help-footer-link:hover { text-decoration: underline; }

/* ── User profile ────────────────────────────────────────────────────────── */

.user-card-desktop {
  background: rgba(14,18,26,0.82) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  padding: 26px !important;
}
.user-card-desktop:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.32);
  border-color: rgba(55,250,171,0.22) !important;
}

.avatar-container {
  width: 68px; height: 68px; border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(55,250,171,0.18);
  box-shadow: 0 4px 14px rgba(0,0,0,0.22); flex-shrink: 0;
}
.avatar-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1c4428, #37FAAB);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #062010;
}
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }

.user-info-list { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 11px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px; border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s;
}
.info-row:hover { background: rgba(255,255,255,0.04); border-color: var(--border-color); }

.label-text { color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.value-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px; color: var(--accent-green) !important; letter-spacing: -0.2px;
}

.user-profile-row { display: flex; gap: 20px; align-items: flex-start; }
.user-activity { margin-top: 6px; padding-left: 11px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.user-activity span:last-child { color: var(--text-secondary); }
.user-card-head-lg .card-head { margin-bottom: 20px; }
.user-card-label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.card-icon.accent { color: var(--accent-green); }

/* ── Aliases ─────────────────────────────────────────────────────────────── */

.aliases-block { margin-top: 4px; }
.aliases-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px; font-weight: 700; }

.aliases-table-wrap {
  max-height: 260px; overflow: auto; border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(10,14,20,0.75);
}
.aliases-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aliases-table thead tr { background: rgba(8,12,18,0.85); }
.aliases-table th {
  text-align: left; padding: 9px 12px;
  color: var(--text-muted); font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-color);
}
.aliases-table td {
  padding: 8px 12px;
  border-top: 1px solid rgba(240,246,252,0.05);
}
.aliases-table tr:hover td { background: rgba(255,255,255,0.025); }
.aliases-table .alias-name { color: var(--text-primary); font-weight: 500; }
.aliases-table .alias-cmd  { color: var(--text-secondary); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.aliases-table .alias-actions { padding: 4px 8px; text-align: right; }
.aliases-th-actions { width: 70px; }
.alias-delete-btn { background: none; border: none; color: rgba(248,113,113,0.75); font-size: 12px; cursor: pointer; transition: color 0.15s; }
.alias-delete-btn:hover { color: #f87171; text-decoration: underline; }
.aliases-empty { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* ── Integrations ────────────────────────────────────────────────────────── */

.integrations-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

.integration-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.2s;
}
.integration-block:hover { border-color: rgba(255,255,255,0.12); }

.integration-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.integration-badge-wrap { margin-left: auto; flex-shrink: 0; }

.integration-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #fc0, #f60);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.integration-title { font-weight: 600; font-size: 14.5px; color: var(--text-primary); }
.integration-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.integration-desc code { background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 4px; }

.integration-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.04em;
}
.integration-badge.active  { background: rgba(55,250,171,0.1); color: var(--accent-green); border: 1px solid rgba(55,250,171,0.25); }
.integration-badge.inactive{ background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-color); }

.integration-token-block {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 14px; display: flex; flex-direction: column; gap: 10px;
}
.integration-token-label { font-size: 11px; color: var(--text-muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.integration-token-row { display: flex; gap: 8px; }
.integration-token-input-wrap { position: relative; flex: 1; }
.integration-token-input-wrap input {
  width: 100%; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.09); border-radius: 10px;
  padding: 10px 44px 10px 14px; color: var(--text-primary);
  font-size: 13px; font-family: "JetBrains Mono", monospace;
  outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.integration-token-input-wrap input:focus { border-color: rgba(55,250,171,0.4); }
.integration-toggle-visibility {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; line-height: 1;
}

.ym-actions { display: flex; gap: 8px; }
.ym-save-btn { flex: 1; padding: 9px 16px; font-size: 13px; }
.ym-delete-btn {
  background: rgba(252,165,165,0.07); border: 1px solid rgba(252,165,165,0.18);
  color: #fca5a5; border-radius: var(--radius-btn); padding: 9px 16px;
  font-size: 13px; cursor: pointer; transition: background 0.2s;
}
.ym-delete-btn:hover { background: rgba(252,165,165,0.14); }
#ym-status { font-size: 12px; }
#ym-status.ym-status-set { color: var(--accent-green); }
#ym-status:not(.ym-status-set) { color: var(--text-muted); }
.ym-hint {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.65;
  border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px;
}
.ym-hint a { color: var(--accent-green); }

/* ── Settings ────────────────────────────────────────────────────────────── */

.settings-row.bordered {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

.seen-format-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seen-format-btn {
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color); font-size: 13px;
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.seen-format-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.seen-format-btn.active {
  background: rgba(55,250,171,0.1);
  border-color: rgba(55,250,171,0.4);
  color: var(--accent-green); font-weight: 600;
}

/* ── Sessions ────────────────────────────────────────────────────────────── */

.sessions-box {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(10,14,20,0.65);
  padding: 10px 14px;
}
.sessions-list { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.sessions-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sessions-item:last-child { border-bottom: none; }
.sessions-item-title { color: var(--text-primary); font-weight: 500; }
.sessions-item-meta  { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.sessions-badge { font-size: 11px; }

/* ── Admin badges (used in user pages too) ───────────────────────────────── */

.admin-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
}
.badge-new       { background: rgba(55,250,171,0.12); color: var(--accent-green); border: 1px solid rgba(55,250,171,0.25); }
.badge-progress  { background: rgba(88,166,255,0.12); color: var(--accent-blue);  border: 1px solid rgba(88,166,255,0.25); }
.badge-completed { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
