/* ============================================================
   Всё на виду — flat.css  (ФИНАЛЬНЫЙ, по макетам)

   Единая дизайн-система из двух референсов:
     · Главная.html   — лендинг
     · Админка.html   — панель управления

   Никакого стекла, зерна, градиентов. Только плоские поверхности.
   ============================================================ */

/* ============================================================
   БАЗА
   ============================================================ */
html {
  background-color: #0D0D0D;
  overflow-x: hidden;
}

body {
  background-color: #0D0D0D;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Убираем всё старое */
.noise::before,
.noise::after,
.grain,
.grain-fine,
.ambient {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================================================
   ТИПОГРАФИКА
   ============================================================ */
h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.5px;
}

h1 {
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.1;
}

/* ============================================================
   ФОНОВЫЕ ПЯТНА (только главная)
   ============================================================ */
.bg-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: #C6F54A;
  top: 40%;
  left: -10%;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: #7B61FF;
  top: 50%;
  right: -5%;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #00E5FF;
  bottom: 5%;
  left: 40%;
  opacity: 0.10;
}

@media (max-width: 767px) {
  .bg-blobs {
    display: none;
  }
}

/* ============================================================
   КОНТЕЙНЕР
   ============================================================ */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* ============================================================
   ЛОГОТИП
   ============================================================ */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: #FFFFFF;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-eye {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

.brand-eye::before,
.brand-eye::after {
  display: none !important;
}

.brand-eye-pupil {
  width: 10px;
  height: 10px;
  background: #C6F54A;
  border-radius: 50%;
  box-shadow: none;
}

.brand-name {
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
  font-family: 'Inter', sans-serif;
}

.btn-accent,
.btn-primary {
  background: #C6F54A;
  color: #000000;
  padding: 12px 24px;
}

.btn-accent:hover,
.btn-primary:hover {
  background: #B5E636;
  transform: translateY(-1px);
}

.btn-secondary,
.btn-ghost {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid #2A2A2A;
  padding: 12px 24px;
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: #1A1A1A;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 8px;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: 12px;
}

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.tile,
.stat,
.panel,
.section-card,
.card {
  background: #1A1A1A;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ============================================================
   ПОЛЯ ВВОДА
   ============================================================ */
.input,
.select,
textarea.input {
  background: #1A1A1A;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  box-shadow: none;
  transition: border-color 0.2s;
}

.input:focus,
.select:focus {
  border-color: #C6F54A;
  outline: none;
  box-shadow: none;
}

.input::placeholder {
  color: #888888;
}

/* ============================================================
   БЕЙДЖИ
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border: none;
}

.badge--ok {
  background: rgba(198, 245, 74, 0.1);
  color: #C6F54A;
}

.badge--warn {
  background: rgba(198, 245, 74, 0.08);
  color: #B5E636;
}

.badge--danger {
  background: rgba(255, 75, 75, 0.1);
  color: #FF4B4B;
}

.badge--muted {
  background: #2A2A2A;
  color: #888888;
}

.badge--violet {
  background: rgba(123, 97, 255, 0.15);
  color: #7B61FF;
}

/* ============================================================
   ТАБЫ / ЧИПЫ
   ============================================================ */
.chip,
.filter-chip {
  padding: 8px 16px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: #888888;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Inter', sans-serif;
}

.chip:hover,
.filter-chip:hover {
  color: #FFFFFF;
  background: #1A1A1A;
}

.chip[aria-pressed="true"],
.filter-chip[aria-pressed="true"] {
  background: #C6F54A;
  color: #000000;
  font-weight: 600;
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  text-align: left;
  padding: 16px 20px;
  font-size: 12px;
  color: #888888;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid #2A2A2A;
  background: transparent;
  letter-spacing: 0.5px;
}

.data-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid #2A2A2A;
  font-size: 14px;
  color: #FFFFFF;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   ПРОГРЕСС
   ============================================================ */
.progress {
  height: 6px;
  background: #2A2A2A;
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: #C6F54A;
}

/* ============================================================
   МОДАЛКИ
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  background: #1A1A1A;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.9);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #2A2A2A;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
}

.modal-subtitle {
  font-size: 13px;
  color: #888888;
  margin-top: 4px;
}

.modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #2A2A2A;
  color: #888888;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.modal-close:hover {
  background: #222222;
  color: #FFFFFF;
}

.modal-body {
  padding: 20px 24px;
}

.modal-foot {
  padding: 16px 24px 20px;
  border-top: 1px solid #2A2A2A;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================================
   ПОЛЯ ФОРМ
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-hint {
  font-size: 12px;
  color: #666666;
  line-height: 1.4;
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  background: transparent;
  border-top: 1px solid #2A2A2A;
  padding: 24px 0;
  margin-top: auto;
  position: relative;
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy,
.footer-copy span {
  font-size: 13px;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-copy-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C6F54A;
  box-shadow: none;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: #888888;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-status {
  font-size: 13px;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C6F54A;
  box-shadow: none;
}

@media (max-width: 768px) {
  .site-footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ============================================================
   КУРСОР
   ============================================================ */
.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #C6F54A;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  box-shadow: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(198, 245, 74, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: transparent;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.cursor-dot.is-visible,
.cursor-ring.is-visible {
  opacity: 1;
}

.cursor-ring.is-hover {
  width: 48px;
  height: 48px;
  background: rgba(198, 245, 74, 0.08);
  border-color: #C6F54A;
}

.cursor-ring.is-click {
  width: 22px;
  height: 22px;
}

/* ============================================================
   СКРОЛЛБАР
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0D0D0D;
}

::-webkit-scrollbar-thumb {
  background: #2A2A2A;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #333333;
}

/* ============================================================
   УТИЛИТЫ
   ============================================================ */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   ТОСТЫ
   ============================================================ */
.toast-region {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: #1A1A1A;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: #FFFFFF;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.2s ease;
}

.toast--ok {
  border-color: rgba(198, 245, 74, 0.3);
}

.toast--error {
  border-color: rgba(255, 75, 75, 0.3);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   БАЗОВЫЕ РАЗМЕРЫ SVG — критично для вёрстки
   ============================================================ */
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Иконки в навигации и кнопках — фиксированные */
.nav-item svg,
.sidebar-link svg,
.bottom-link svg,
.btn svg,
.icon-btn svg,
.btn-public-link svg,
.user-menu svg,
.badge svg,
.modal-close svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex-shrink: 0;
  display: inline-block;
}

.icon-btn svg,
.btn-public-link svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.modal-close svg,
.user-menu svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.bottom-link svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.badge svg,
.legend-color svg {
  width: 12px;
  height: 12px;
  min-width: 12px;
}

/* Скрытые SVG не показываем */
svg[aria-hidden="true"]:not([width]):not([height]) {
  max-width: none;
}

/* ============================================================
   ГЛОБАЛЬНЫЙ ФИКС SVG — все иконки 18px если не задано иное
   ============================================================ */
svg:not([width]):not([height]) {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* В больших контекстах — 20px */
.btn svg,
.icon-btn svg,
.bottom-link svg,
.btn-public-link svg {
  width: 18px;
  height: 18px;
}

/* Совсем мелкие */
.modal-close svg,
.user-menu svg,
.badge svg {
  width: 16px;
  height: 16px;
}

/* Логотип-кружок — отдельно */
.brand-eye svg {
  width: 18px;
  height: 18px;
}

/* Стат-иконки в панели */
.stat-icon svg,
.op-icon svg,
.empty-state-icon svg {
  width: 20px;
  height: 20px;
}

/* Не растягивать в таблицах */
.data-table svg,
.list-item svg,
.panel svg,
.stat-card svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Контейнеры иконок */
.stat-icon,
.op-icon,
.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   НАВИГАЦИЯ СТАРЫХ СТРАНИЦ (demo, legal)
   Классы site-nav-inner / nav-links / nav-actions
   ============================================================ */
.site-nav {
  padding: 16px 0;
  border-bottom: 1px solid #2A2A2A;
  position: relative;
  z-index: 10;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
  max-width: 100%;
}

.site-nav .nav-links {
  display: flex;
  gap: 24px;
  min-width: 0;
  overflow: hidden;
}

.site-nav .nav-links a {
  color: #888888;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}

.site-nav .nav-links a:hover {
  color: #FFFFFF;
}

.site-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.site-nav .nav-login {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Убираем обрезку на узких экранах */
@media (max-width: 900px) {
  .site-nav .nav-links,
  .site-nav .nav-links.show-desktop {
    display: none !important;
  }

  .site-nav .nav-login,
  .site-nav .hide-mobile {
    display: none !important;
  }

  .site-nav-inner {
    gap: 12px;
  }

  .site-nav .brand {
    min-width: 0;
    overflow: hidden;
  }

  .site-nav .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Кнопки в навигации — компактные */
.site-nav .btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* ============================================================
   ГЛОБАЛЬНАЯ ЗАЩИТА
   ============================================================ */
html,
body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

/* Контейнеры страниц */
.container {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 32px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    padding-inline: 20px;
  }
}

@media (max-width: 400px) {
  .container {
    padding-inline: 16px;
  }
}
