/* 24DirectAI — Личный кабинет */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:      #0A0B0F;
  --bg2:     #111318;
  --bg3:     #16191F;
  --border:  #1E2229;
  --border2: #252B35;
  --text:    #F0F2F7;
  --text2:   #8B92A5;
  --text3:   #555D6E;
  --accent:  #4F6EF7;
  --accent2: #7B5CF0;
  --accent3: #00D4AA;
  --red:     #F74F6E;
  --amber:   #F7A84F;
  --radius:  12px;
  --radius2: 20px;
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 800; color: var(--text); }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar-nav:hover { scrollbar-color: var(--border2) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background 0.3s; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--border2); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--text2); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active { color: var(--accent); background: rgba(79,110,247,0.1); }
.nav-item .nav-ico { width: 18px; flex-shrink: 0; text-align: center; font-size: 15px; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent);
  color: #fff; border-radius: 100px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
}
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-email { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* ── TOPBAR ── */
.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── MAIN CONTENT ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 28px; flex: 1; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text3); }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.page-sub { color: var(--text2); font-size: 14px; margin-top: 4px; }

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 24px;
}
.card-sm { padding: 18px; border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 20px;
}
.stat-label { font-size: 12px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--accent3); }

/* ── PROJECT CARDS ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 20px;
  transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
}
.project-card:hover { border-color: rgba(79,110,247,0.4); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.project-card-name { font-size: 16px; font-weight: 700; }
.project-card-url { font-size: 12px; color: var(--text2); }
.project-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 600;
}
.badge-ok { background: rgba(0,212,170,0.12); color: var(--accent3); border: 1px solid rgba(0,212,170,0.25); }
.badge-err { background: rgba(247,79,110,0.1); color: var(--red); border: 1px solid rgba(247,79,110,0.2); }
.badge-warn { background: rgba(247,168,79,0.1); color: var(--amber); border: 1px solid rgba(247,168,79,0.2); }
.badge-info { background: rgba(79,110,247,0.1); color: var(--accent); border: 1px solid rgba(79,110,247,0.2); }
.project-card-actions { display: flex; gap: 6px; margin-top: auto; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 80px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.empty-icon { font-size: 48px; opacity: 0.4; }
.empty-title { font-size: 20px; font-weight: 700; }
.empty-sub { color: var(--text2); font-size: 14px; max-width: 360px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 4px 16px rgba(79,110,247,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(79,110,247,0.45); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(247,79,110,0.1); color: var(--red); border: 1px solid rgba(247,79,110,0.2); }
.btn-danger:hover { background: rgba(247,79,110,0.2); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; font-family: 'Manrope', sans-serif;
  transition: border-color 0.15s; outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 28px;
  width: 100%; max-width: 480px;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(8px); } }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-close { position: absolute; top: 12px; right: 12px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; font-size: 13.5px; }
th { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13.5px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-err { background: rgba(247,79,110,0.08); border: 1px solid rgba(247,79,110,0.2); color: var(--red); }
.alert-ok { background: rgba(0,212,170,0.08); border: 1px solid rgba(0,212,170,0.2); color: var(--accent3); }
.alert-info { background: rgba(79,110,247,0.08); border: 1px solid rgba(79,110,247,0.2); color: var(--accent); }
.alert-warn { background: rgba(247,168,79,0.1); border: 1px solid rgba(247,168,79,0.25); color: var(--amber); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── STATUS DOTS ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--accent3); box-shadow: 0 0 6px var(--accent3); }
.dot-red { background: var(--red); }
.dot-gray { background: var(--text3); }
.dot-amber { background: var(--amber); }

/* ── CONNECTIONS PAGE ── */
.connections-section { margin-bottom: 32px; }
.connections-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.connections-title { font-size: 16px; font-weight: 700; }
.account-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px;
}
.account-row-info { flex: 1; }
.account-row-login { font-size: 14px; font-weight: 600; }
.account-row-meta { font-size: 12px; color: var(--text2); }
.account-row-actions { display: flex; gap: 6px; }

/* ── HELP PAGE ── */
.help-section { margin-bottom: 40px; }
.help-step { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.help-step:last-child { border-bottom: none; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(79,110,247,0.15); border: 1px solid rgba(79,110,247,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.step-content h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.step-content p { font-size: 13px; color: var(--text2); }
code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--bg3); padding: 2px 6px; border-radius: 4px; color: var(--accent3); }

/* ── TARIFF BADGE ── */
.tariff-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.tariff-start { background: rgba(139,146,165,0.1); color: var(--text2); border: 1px solid var(--border2); }
.tariff-business { background: rgba(79,110,247,0.12); color: var(--accent); border: 1px solid rgba(79,110,247,0.25); }
.tariff-agency { background: rgba(0,212,170,0.1); color: var(--accent3); border: 1px solid rgba(0,212,170,0.25); }

/* ── COMING SOON ── */
.coming-soon {
  text-align: center; padding: 60px 20px;
  color: var(--text3); font-size: 14px;
}
.coming-soon .icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }

/* ── TOGGLE ── */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  width: 38px; height: 22px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 100px;
  transition: all 0.2s; position: relative;
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text3); top: 2px; left: 2px; transition: all 0.2s;
}
.toggle input:checked + .toggle-track { background: rgba(79,110,247,0.2); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { background: var(--accent); transform: translateX(16px); }

/* ── SPINNER ── */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 240px; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── AUTH PAGES ── */
.auth-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(79,110,247,0.08) 0%, transparent 60%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius2); padding: 40px;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 32px;
  text-decoration: none;
}
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: 13.5px; color: var(--text2); text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text2); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
