/* ────────────────────────────────────────────────────────────────
   AutoShiro — базовая стилизация.
   Тёмная тема, акцент #E5FF50 (жёлтый), фон #0A0B0F.
   ──────────────────────────────────────────────────────────────── */

:root {
  --bg:        #0A0B0F;
  --surface:   #0F1117;
  --surface2:  #161824;
  --border:    #1F2230;
  --border2:   #2A2F45;
  --text:      #E5E7EB;
  --text-dim:  #9CA3AF;
  --muted:     #6B7280;
  --accent:    #E5FF50;
  --accent-2:  #D9F048;
  --danger:    #EF1530;
  --ok:        #2DD4A4;
  --warning:   #F59E0B;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9em;
  padding: 1px 6px;
  background: var(--surface2);
  border-radius: 4px;
  color: var(--text);
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ════════════════════════════════════════════════════════════════ AUTH ═════ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; padding: 36px 32px; }
.auth-card-wide { max-width: 540px; text-align: center; }
.auth-brand { font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.auth-card-wide .auth-brand { margin-bottom: 22px; }
.auth-h1 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 8px;
  letter-spacing: -0.3px; }
.auth-card-wide .auth-h1 { font-size: 30px; }
.auth-sub { color: var(--text-dim); margin-bottom: 28px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; }
.auth-label > span:first-child { font-size: 11px; }
.auth-label input, .auth-label select, .auth-label textarea {
  font-size: 14px; font-weight: 500; padding: 11px 14px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 9px; color: var(--text);
  outline: none; text-transform: none; letter-spacing: 0;
  transition: border-color 0.15s; }
.auth-label input:focus, .auth-label select:focus, .auth-label textarea:focus {
  border-color: var(--accent); }
.auth-hint { font-size: 11px; color: var(--muted); text-transform: none;
  letter-spacing: 0; font-weight: 400; }
.auth-hint b { color: var(--accent); font-weight: 600; }
.auth-divider { height: 1px; background: var(--border); margin: 8px 0 4px; }
.auth-error { margin-top: 4px; padding: 10px 14px;
  background: rgba(239, 21, 48, 0.08); border: 1px solid rgba(239, 21, 48, 0.3);
  border-radius: 8px; color: #ff8a98; font-size: 13px; }
.auth-meta { margin-top: 22px; text-align: center; font-size: 13px;
  color: var(--text-dim); }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* Чекбокс согласия с офертой и политикой при регистрации */
.auth-consent {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 18px 0 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px; color: var(--text-dim);
  line-height: 1.5;
}
.auth-consent input[type="checkbox"] {
  margin-top: 1px;
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.auth-consent a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-consent a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════ BUTTONS ═════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; font-size: 14px; font-weight: 700; border-radius: 10px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; font-weight: 600; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-2); text-decoration: none; }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border2); }
.btn-ghost:hover { background: var(--surface2); text-decoration: none; }
.btn-danger { background: transparent; color: #ff8a98;
  border-color: rgba(239, 21, 48, 0.3); }
.btn-danger:hover { background: rgba(239, 21, 48, 0.1);
  border-color: rgba(239, 21, 48, 0.6); text-decoration: none; }
.btn-icon { width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-dim); font-size: 14px; }
.btn-icon:hover { background: var(--surface2); color: var(--text); }

/* ════════════════════════════════════════════════════════════════ APP LAYOUT ═════ */
.app-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; margin-bottom: 22px; }
.sidebar-brand-mark { width: 32px; height: 32px; background: var(--accent);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #000; font-size: 16px; flex-shrink: 0; }
.sidebar-brand-name { font-weight: 800; letter-spacing: -0.02em; color: #fff;
  white-space: nowrap; overflow: hidden; }
.sidebar-section-label { font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; padding: 14px 12px 6px;
  white-space: nowrap; overflow: hidden; }
.sidebar-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text-dim);
  border-radius: 9px; transition: background 0.12s, color 0.12s;
  white-space: nowrap; overflow: hidden; }
.sidebar-link:hover { background: rgba(255,255,255,0.03); color: var(--text);
  text-decoration: none; }
.sidebar-link.is-active { background: rgba(229,255,80,0.08); color: var(--accent); }
.sidebar-link.is-disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.sidebar-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; }
.sidebar-user-card { padding: 10px 12px; background: var(--surface2);
  border-radius: 9px; margin-bottom: 6px; }
.sidebar-user-name { font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Виджет биллинга в сайдбаре ── */
.sidebar-billing {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 16px;
  margin-bottom: 8px;
}
.sidebar-billing.is-warn {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.3);
}
.sidebar-billing.is-expired {
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.3);
}
.sb-billing-label {
  font-size: 10px; font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 2px;
}
.sb-billing-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.sb-billing-status {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.sidebar-billing.is-warn .sb-billing-status { color: #fbbf24; font-weight: 700; }
.sidebar-billing.is-expired .sb-billing-status { color: #f87171; font-weight: 700; }
.sb-billing-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 10px;
  background: var(--accent);
  color: #000;
  border-radius: 8px;
  font-size: 12px; font-weight: 800;
  text-decoration: none;
  font-family: 'Unbounded', sans-serif;
  letter-spacing: -0.2px;
  transition: all 0.12s;
}
.sb-billing-btn:hover {
  background: #d6f53e;
  transform: translateY(-1px);
}
.sidebar-billing.is-warn .sb-billing-btn,
.sidebar-billing.is-expired .sb-billing-btn {
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(229, 255, 80, 0.2);
}

.app-content { padding: 32px 36px 40px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* Footer кабинета — лёгкая полоска с легальными ссылками */
.app-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 36px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
}
.app-footer-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.app-footer-row:last-child { margin-bottom: 0; }
.app-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.12s;
}
.app-footer a:hover { color: var(--accent); }
.app-footer-dot { opacity: 0.4; }
.app-footer-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Публичный футер (на login/register/home/biz_not_found) — минимальный */
.public-footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.public-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.12s;
}
.public-footer a:hover { color: var(--accent); }

/* Mobile top-bar с бургером — скрыт на десктопе */
.mobile-topbar { display: none; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 50; }
.burger-btn { width: 38px; height: 38px; background: transparent;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 18px; display: flex; align-items: center; justify-content: center; }
.sidebar-backdrop { display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 190; }

/* ─── ПЛАНШЕТ (768-1024px): sidebar сужается до 64px, только иконки ─── */
@media (max-width: 1024px) and (min-width: 769px) {
  .app-layout { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 18px 8px; }
  .sidebar-brand-name,
  .sidebar-section-label,
  .sidebar-user-card,
  .sidebar-link span:not(.sidebar-icon) {
    display: none;
  }
  .sidebar-link { justify-content: center; padding: 12px 0; }
  .sidebar-brand { justify-content: center; }
  .app-content { padding: 28px 22px 30px; }
}

/* ─── МОБИЛЬНЫЙ (≤768px): sidebar скрыт, бургер сверху ─── */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open { display: block; }
  .mobile-topbar { display: flex; }
  .app-content { padding: 20px 16px 30px; }
}

/* ════════════════════════════════════════════════════════════════ DASHBOARD ═════ */
.page-h1 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 6px;
  letter-spacing: -0.3px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.banner { margin-top: 16px; padding: 14px 18px; border-radius: 12px;
  font-size: 14px; line-height: 1.6; }
.banner-info { background: rgba(229,255,80,0.06);
  border: 1px solid rgba(229,255,80,0.2); color: #f0ffa0; }
.banner-info b { color: var(--accent); }
.banner-warn { background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2); color: #fcd34d; }

.welcome-card { margin-top: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: 18px; padding: 34px 32px; }
.welcome-card h2 { font-size: 22px; font-weight: 800; color: #fff;
  margin-bottom: 10px; letter-spacing: -0.2px; }
.welcome-card-emoji { font-size: 32px; margin-bottom: 8px; }
.welcome-card p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 8px; }
.welcome-card p b { color: var(--text); }
.welcome-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.cards-grid { margin-top: 28px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.quick-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; display: flex; flex-direction: column;
  text-decoration: none; transition: border-color 0.15s; }
.quick-card:hover { border-color: var(--accent); text-decoration: none; }
.quick-card-icon { font-size: 24px; margin-bottom: 10px; }
.quick-card-title { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.quick-card-sub { font-size: 13px; color: var(--text-dim); }

/* ════════════════════════════════════════════════════════════════ SERVICES ═════ */
.page-header { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-header .page-h1 { margin-bottom: 0; }

.cat-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
.cat-head { padding: 18px 22px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border); background: var(--surface2); }
.cat-icon { width: 42px; height: 42px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; }
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -0.1px; }
.cat-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.cat-actions { display: flex; gap: 6px; flex-shrink: 0; }

.cat-body { padding: 16px 22px 20px; }
.cat-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin: 12px 0 8px; }
.cat-section-title:first-child { margin-top: 0; }

.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-icon { width: 28px; text-align: center; font-size: 16px; flex-shrink: 0; }
.item-name { flex: 1; font-size: 14px; color: var(--text); min-width: 0; }
.item-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-dim);
  flex-shrink: 0; }
.item-meta span { white-space: nowrap; }
.item-meta .price { color: var(--accent); font-weight: 700; }
.item-actions { display: flex; gap: 4px; margin-left: 8px; flex-shrink: 0; }

.cat-empty { font-size: 13px; color: var(--muted); font-style: italic;
  padding: 6px 0; }

.cat-footer { padding: 14px 22px; background: rgba(255,255,255,0.015);
  border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 60px 30px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: 18px; }
.empty-state-emoji { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); max-width: 460px; margin: 0 auto 18px; }

/* ════════════════════════════════════════════════════════════════ MODAL ═════ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: flex-start; justify-content: center; z-index: 300;
  padding: 60px 16px 24px; overflow-y: auto; }
.modal-backdrop.is-open { display: flex; }
.modal { width: 100%; max-width: 480px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 28px 28px 24px; }
.modal-wide { max-width: 640px; }
.modal-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 18px;
  letter-spacing: -0.2px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ════════════════════════════════════════════════════════════════ TOAST ═════ */
.toast { position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  color: var(--text); transition: transform 0.25s ease; z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast.is-show { transform: translateX(-50%) translateY(0); }
.toast.is-ok { border-color: rgba(45,212,164,0.3); color: #5edab9; }
.toast.is-err { border-color: rgba(239,21,48,0.4); color: #ff8a98; }