/* ============================================================================
   nv.css — локальная система стилей NeuroVision AI (v3.4.0)

   Заменяет внешние CDN (Tailwind CDN, FontAwesome, Google Fonts).
   Раньше каждая из трёх страниц тянула их из интернета:
     * блокирующий <script src="cdn.tailwindcss.com"> на login/register мог
       держать «белый экран» десятки секунд, если браузер без интернета;
     * JIT-скрипт Tailwind перекомпилировал стили при КАЖДОМ изменении DOM
       (опрос /stat, превью) — лишняя нагрузка на процессор, заметная в RDP;
     * шрифты и иконки просили сеть при каждом входе.

   Теперь всё локально: страница полностью автономна, работает в закрытой
   LAN без интернета и не тратит CPU на JIT. Стили подобраны 1:1 к прежнему
   виду (та же палитра Tailwind, те же размеры отступов).
   ============================================================================ */

/* ── Шрифты: локальные (без Google Fonts) ─────────────────────────────────── */
:root {
    --nv-font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto,
               'Helvetica Neue', Arial, sans-serif;
    --nv-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas,
               'Courier New', monospace;
    --nv-display: 'Orbitron', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

body {
    font-family: var(--nv-font);
    -webkit-font-smoothing: antialiased;
}

/* ── display ──────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.grid { display: grid; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }   /* !important: перекрывает display:flex
                                           кастомных классов (оверлеи и т.п.) */

/* ── flex ─────────────────────────────────────────────────────────────────── */
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ── grid ─────────────────────────────────────────────────────────────────── */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-3 { grid-column: span 3 / span 3; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* ── позиционирование ─────────────────────────────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.z-10 { z-index: 10; }
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── размеры ──────────────────────────────────────────────────────────────── */
.w-2 { width: 0.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-32 { width: 8rem; }
.w-full { width: 100%; }
.h-1 { height: 0.25rem; }
.h-2 { height: 0.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.max-w-md { max-width: 28rem; }
.min-h-screen { min-height: 100vh; }

/* ── отступы ──────────────────────────────────────────────────────────────── */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-12 { padding-left: 3rem; }
.pr-3 { padding-right: 0.75rem; }
.pr-4 { padding-right: 1rem; }
.pr-12 { padding-right: 3rem; }
.pt-2 { padding-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ── типографика ──────────────────────────────────────────────────────────── */
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-light { font-weight: 300; }
.font-mono { font-family: var(--nv-mono); }
.text-center { text-align: center; }
.tracking-wider { letter-spacing: 0.05em; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* ── текст: палитра Tailwind ──────────────────────────────────────────────── */
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-blue-300 { color: #93c5fd; }
.text-blue-400 { color: #60a5fa; }
.text-cyan-300 { color: #67e8f9; }
.text-cyan-400 { color: #22d3ee; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-yellow-400 { color: #facc15; }
.text-transparent { color: transparent; }

/* ── фон ──────────────────────────────────────────────────────────────────── */
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-green-500 { background-color: #22c55e; }
.bg-red-500 { background-color: #ef4444; }

/* ── градиенты (через переменные, как в Tailwind) ────────────────────────── */
.bg-gradient-to-r {
    --g1: transparent; --g2: transparent;
    background-image: linear-gradient(to right, var(--g1), var(--g2));
}
.bg-gradient-to-br {
    --g1: transparent; --g2: transparent;
    background-image: linear-gradient(to bottom right, var(--g1), var(--g2));
}
.from-blue-400 { --g1: #60a5fa; }
.from-blue-500 { --g1: #3b82f6; }
.from-blue-500\/20 { --g1: rgba(59, 130, 246, 0.2); }
.to-cyan-300 { --g2: #67e8f9; }
.to-cyan-400 { --g2: #22d3ee; }
.to-blue-600\/20 { --g2: rgba(37, 99, 235, 0.2); }
.bg-clip-text { -webkit-background-clip: text; background-clip: text; }

/* ── рамки и скругления ───────────────────────────────────────────────────── */
.border { border-width: 1px; border-style: solid; border-color: #374151; }
.border-t-2 { border-top-width: 2px; border-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-style: solid; }
.border-blue-500 { border-color: #3b82f6; }
.border-blue-500\/30 { border-color: rgba(59, 130, 246, 0.3); }
.border-blue-400\/30 { border-color: rgba(96, 165, 250, 0.3); }
.border-red-400\/30 { border-color: rgba(248, 113, 113, 0.3); }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ── тени ─────────────────────────────────────────────────────────────────── */
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.15), 0 2px 4px -2px rgba(0,0,0,.15); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35); }
.shadow-blue-500\/30 { box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.35); }

/* ── переходы (только дешёвые свойства — RDP) ────────────────────────────── */
.transition-all { transition: border-color .25s ease, background-color .25s ease,
                             box-shadow .25s ease, color .25s ease, opacity .25s ease,
                             transform .25s ease; }
.transition-colors { transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.duration-300 { transition-duration: 0.3s; }

/* ── hover ────────────────────────────────────────────────────────────────── */
.hover\:border-blue-400:hover { border-color: #60a5fa; }
.hover\:border-blue-500:hover { border-color: #3b82f6; }
.hover\:border-red-400:hover { border-color: #f87171; }
.hover\:text-blue-300:hover { color: #93c5fd; }
.hover\:text-red-300:hover { color: #fca5a5; }
.hover\:text-blue-400:hover { color: #60a5fa; }
.hover\:shadow-blue-500\/20:hover { box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2); }

/* ── контейнер ────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1400px; }

/* ── адаптив (брейкпоинты Tailwind: md=768px, lg=1024px) ─────────────────── */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:mb-0 { margin-bottom: 0; }
    .md\:p-6 { padding: 1.5rem; }
    .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:col-span-6 { grid-column: span 6 / span 6; }
}

/* ── иконки (замена FontAwesome): инлайн-SVG, цвет — currentColor ────────── */
.icon { display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }

/* Маленькая нагрузка на RDP: крутится только крошечный значок загрузки
   (16×16px, грязная область минимальна) и только во время запроса. */
@keyframes nv-spin { to { transform: rotate(360deg); } }
.icon-spin { animation: nv-spin 1s linear infinite; }
