/* ===== DIGANIGA — дизайн-система ===== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0d17;
  --bg-2: #0e1220;
  --bg-elevated: #131728;
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.06);
  --text: #eef1fb;
  --text-dim: #9aa3c0;
  --text-faint: #6b7290;
  --accent: #4d8dff;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #4d8dff 0%, #8b5cf6 100%);
  --accent-glow: 0 0 0 1px rgba(77, 141, 255, 0.35), 0 8px 24px rgba(77, 141, 255, 0.25);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 800px at 15% -10%, rgba(77, 141, 255, 0.08), transparent 60%),
              radial-gradient(1000px 700px at 100% 0%, rgba(139, 92, 246, 0.07), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 800; letter-spacing: -0.01em; }
p { color: var(--text-dim); line-height: 1.6; margin: 0 0 12px; }
ul { padding: 0; margin: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77,141,255,0.15);
}
label { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; display: block; font-weight: 600; }
.field { margin-bottom: 16px; }

/* ===== App shell ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(19,23,40,0.9), rgba(10,13,23,0.9));
  border-right: 1px solid var(--card-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 40;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }

.nav-group { margin-bottom: 18px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); padding: 0 12px 8px; font-weight: 700; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--card-hover); color: var(--text); }
.nav-item.active {
  background: rgba(77,141,255,0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(77,141,255,0.3);
}
.nav-item.active svg { opacity: 1; filter: drop-shadow(0 0 6px rgba(77,141,255,0.7)); }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--card-border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0;
}
.user-meta { overflow: hidden; }
.user-meta .name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .email { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  gap: 16px;
}
.topbar h1 { font-size: 22px; margin: 0; }
.content { padding: 0 32px 48px; flex: 1; }
.mobile-toggle { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(77,141,255,0.5), 0 10px 28px rgba(77,141,255,0.35); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--card-border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); }
.btn-danger { background: rgba(248,113,113,0.12); color: #fca5a5; border-color: rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(6px);
}
.card-hover { transition: transform .18s, border-color .18s, background .18s; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(77,141,255,0.35); background: var(--card-hover); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .value { font-size: 28px; font-weight: 800; }
.stat-card .label { font-size: 13px; color: var(--text-faint); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge-success { background: rgba(52,211,153,0.12); color: var(--success); }
.badge-warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.badge-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-muted { background: rgba(255,255,255,0.07); color: var(--text-dim); }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.alert-success { background: rgba(52,211,153,0.1); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.alert-error { background: rgba(248,113,113,0.1); color: #fca5a5; border: 1px solid rgba(248,113,113,0.25); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--card-border); font-size: 14px; }
th { color: var(--text-faint); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.table-wrap { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); overflow: hidden; }
.table-wrap table { margin: 0; }
.table-wrap .card-head { padding: 20px 20px 0; }

code.key { font-family: 'SFMono-Regular', Consolas, monospace; background: rgba(255,255,255,0.06); padding: 3px 8px; border-radius: 6px; font-size: 13px; letter-spacing: .02em; }

/* ===== Auth pages ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; padding-bottom: 28px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-dim); }

/* ===== Home / marketing ===== */
.hero { padding: 72px 0 40px; text-align: center; max-width: 720px; margin: 0 auto; }
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.hero h1 { font-size: 42px; line-height: 1.15; margin-bottom: 16px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.section { padding: 48px 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 36px; }

.pricing-card { display: flex; flex-direction: column; }
.pricing-card .price { font-size: 34px; font-weight: 800; margin: 14px 0 4px; }
.pricing-card .price small { font-size: 14px; color: var(--text-faint); font-weight: 600; }
.pricing-card ul { margin: 18px 0 22px; display: flex; flex-direction: column; gap: 10px; }
.pricing-card li { display: flex; gap: 10px; font-size: 14px; color: var(--text-dim); align-items: flex-start; }
.pricing-card li svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; margin-top: 2px; }
.pricing-card.featured { border-color: rgba(77,141,255,0.4); box-shadow: var(--accent-glow); }

.car-card img { border-radius: var(--radius-md); margin-bottom: 14px; aspect-ratio: 16/10; object-fit: cover; background: var(--bg-elevated); }
.car-card .head-unit { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }

.news-card img { border-radius: var(--radius-md); margin-bottom: 14px; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-elevated); }
.news-date { font-size: 12px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }

.search-bar { display: flex; gap: 10px; margin-bottom: 28px; max-width: 420px; }

.chat-thread { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.chat-msg { max-width: 72%; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--accent-grad); color: #fff; }
.chat-msg.admin { align-self: flex-start; background: var(--card); border: 1px solid var(--card-border); }
.chat-msg .meta { font-size: 11px; opacity: .7; margin-top: 6px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }

.tabs { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--card-border); }
.tabs a { padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--text-dim); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

footer.site-footer { text-align: center; padding: 32px; color: var(--text-faint); font-size: 13px; }

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 264px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-toggle { display: inline-flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .hero h1 { font-size: 32px; }
}

/* Юридические страницы (/contacts, /terms) */
.legal-card h3 { margin-top: 0; }
.legal-doc h3 { margin-top: 28px; }
.legal-doc h3:first-of-type { margin-top: 8px; }
.legal-doc p { max-width: 820px; }
.legal-note { color: var(--text-faint); font-size: 13px; }
.legal-table th { width: 38%; text-align: left; color: var(--text-dim); font-weight: 600; padding: 8px 12px 8px 0; vertical-align: top; }
.legal-table td { padding: 8px 0; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }
