/* ============================================================
   Норматика AI — site.css (v2.0 modern)
   Современная дизайн-система: градиенты, тени, скругления
   ============================================================ */
:root {
    /* Палитра */
    --normatika-primary:   #4f46e5;   /* indigo-600 */
    --normatika-primary-2: #7c3aed;   /* violet-600 */
    --normatika-primary-3: #2563eb;   /* blue-600 */
    --normatika-dark:      #0f172a;   /* slate-900 */
    --normatika-dark-2:    #1e293b;   /* slate-800 */
    --normatika-muted:     #64748b;   /* slate-500 */
    --normatika-bg:        #f1f5f9;   /* slate-100 */
    --normatika-card:      #ffffff;
    --normatika-border:    #e2e8f0;   /* slate-200 */
    --normatika-success:   #10b981;
    --normatika-warning:   #f59e0b;
    --normatika-danger:    #ef4444;

    /* Градиенты */
    --normatika-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
    --normatika-gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);

    /* Тени */
    --normatika-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --normatika-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.10);
    --normatika-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
    --normatika-shadow-glow: 0 4px 20px rgba(79, 70, 229, 0.35);

    /* Радиусы */
    --normatika-radius-sm: 8px;
    --normatika-radius-md: 12px;
    --normatika-radius-lg: 20px;
    --normatika-radius-full: 9999px;

    /* Шрифт */
    --normatika-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- База ---------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 68px;
    background-color: var(--normatika-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(37, 99, 235, 0.06), transparent);
    background-attachment: fixed;
    color: #1e293b;
    font-family: var(--normatika-font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { color: var(--normatika-dark); font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--normatika-primary); }
hr { border-color: var(--normatika-border); }

/* ---------- Хедер / Navbar ---------- */
.normatika-navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 60px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.18);
}
.normatika-navbar .navbar-brand {
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    font-size: 1.15rem;
    gap: 8px;
}
.normatika-navbar .navbar-brand img { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.normatika-navbar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--normatika-radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
    margin: 0 2px;
}
.normatika-navbar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.normatika-navbar .nav-link.active {
    color: #fff;
    background: rgba(124, 58, 237, 0.35);
}

/* Пользователь в хедере — аватар с инициалами */
.normatika-avatar {
    width: 36px; height: 36px;
    border-radius: var(--normatika-radius-full);
    background: var(--normatika-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--normatika-shadow-glow);
    flex-shrink: 0;
}
.normatika-user-info { line-height: 1.15; text-align: right; }
.normatika-user-name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.normatika-org-name { font-size: 0.72rem; color: rgba(255, 255, 255, 0.6); }
#logoutBtn, .normatika-navbar .btn-outline-light {
    font-size: 0.8rem; padding: 0.3rem 0.85rem;
    border-radius: var(--normatika-radius-full);
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.9);
    transition: all 0.15s ease;
}
#logoutBtn:hover, .normatika-navbar .btn-outline-light:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: transparent;
    color: #fff;
}

/* ---------- Контент ---------- */
.normatika-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

/* Карточки */
.card {
    border: 1px solid var(--normatika-border);
    border-radius: var(--normatika-radius-md);
    box-shadow: var(--normatika-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--normatika-shadow-md);
}
.card-title { font-weight: 700; }
.card-text { color: var(--normatika-muted); font-size: 0.92rem; }

/* Кнопки */
.btn {
    border-radius: var(--normatika-radius-sm);
    font-weight: 600;
    transition: all 0.15s ease;
}
.btn-primary {
    background: var(--normatika-gradient);
    border: none;
    box-shadow: var(--normatika-shadow-glow);
}
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.45);
}
.btn-outline-primary {
    border: 2px solid var(--normatika-primary);
    color: var(--normatika-primary);
}
.btn-outline-primary:hover {
    background: var(--normatika-primary);
    color: #fff;
}

/* Таблицы */
.table {
    border-radius: var(--normatika-radius-md);
    overflow: hidden;
    font-size: 0.92rem;
}
.table thead th {
    background: var(--normatika-dark-2);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: none;
    padding: 12px 14px;
}
.table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-color: var(--normatika-border);
}
.table tbody tr:nth-child(even) { background: #f8fafc; }
.table tbody tr:hover { background: #eef2ff; }

/* Бейджи статусов/рисков */
.badge {
    border-radius: var(--normatika-radius-full);
    font-weight: 600;
    padding: 0.4em 0.75em;
}
.badge.bg-success, .badge.bg-danger, .badge.bg-warning, .badge.bg-info {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* Формы */
.form-control, .form-select {
    border-radius: var(--normatika-radius-sm);
    border: 1.5px solid var(--normatika-border);
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--normatika-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* ---------- Футер ---------- */
.normatika-footer {
    flex-shrink: 0;
    background: var(--normatika-dark);
    background-image:
        radial-gradient(ellipse 60% 100% at 20% 0%, rgba(124, 58, 237, 0.15), transparent),
        radial-gradient(ellipse 50% 100% at 90% 0%, rgba(37, 99, 235, 0.12), transparent);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    padding: 28px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.normatika-footer .footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}
.normatika-footer h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}
.normatika-footer ul { list-style: none; padding: 0; margin: 0; }
.normatika-footer ul li { margin-bottom: 8px; }
.normatika-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.15s ease;
}
.normatika-footer a:hover { color: #fff; }
.normatika-footer .footer-brand { font-weight: 800; color: #fff; font-size: 1.1rem; }
.normatika-footer .footer-desc { font-size: 0.82rem; margin-top: 8px; max-width: 320px; }
.normatika-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 24px;
    padding: 16px 24px 0;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
}
@media (max-width: 991.98px) {
    .normatika-footer .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575.98px) {
    .normatika-footer .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Логин ---------- */
.login-page {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.login-card {
    background: var(--normatika-card);
    border-radius: var(--normatika-radius-lg);
    box-shadow: var(--normatika-shadow-lg);
    padding: 40px 44px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--normatika-border);
    animation: normatikaFadeUp 0.4s ease;
}
.login-card .login-logo {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--normatika-gradient);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: var(--normatika-shadow-glow);
    font-size: 1.6rem;
}
.login-card h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 6px;
}
.login-card .login-subtitle {
    text-align: center;
    color: var(--normatika-muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}
.login-field {
    position: relative;
    margin-bottom: 18px;
}
.login-field .login-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--normatika-muted);
    display: flex;
    pointer-events: none;
}
.login-field .form-control {
    padding-left: 44px;
    padding-right: 44px;
    height: 48px;
    border-radius: var(--normatika-radius-md);
    border: 1.5px solid var(--normatika-border);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-field .form-control:focus {
    border-color: var(--normatika-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.login-field .password-toggle {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--normatika-muted);
    padding: 6px;
    cursor: pointer;
    display: flex;
    border-radius: 6px;
}
.login-field .password-toggle:hover { color: var(--normatika-primary); background: #f1f5f9; }
.login-card .btn-login {
    width: 100%;
    height: 48px;
    border-radius: var(--normatika-radius-md);
    font-size: 1rem;
    font-weight: 700;
    background: var(--normatika-gradient);
    border: none;
    color: #fff;
    box-shadow: var(--normatika-shadow-glow);
    transition: all 0.15s ease;
}
.login-card .btn-login:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.45);
}
.login-card .btn-login:disabled { opacity: 0.7; }
.login-card .login-error {
    border-radius: var(--normatika-radius-sm);
    font-size: 0.88rem;
}
.login-card .login-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--normatika-muted);
}

/* ---------- Анимации ---------- */
@keyframes normatikaFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.normatika-fade-up { animation: normatikaFadeUp 0.35s ease; }

/* ---------- Мелкие улучшения ---------- */
.text-muted { color: var(--normatika-muted) !important; }
.alert { border-radius: var(--normatika-radius-sm); }
.progress { border-radius: var(--normatika-radius-full); background: var(--normatika-border); }
.progress-bar { background: var(--normatika-gradient); }
.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--normatika-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
