
:root {
    /* Цветовая палитра */
    --primary-blue: #428CDC;
    --primary-dark-blue: #0052B4;
    --primary-orange: #fb4d00;
    --primary-orange-hover: #e04500;
    --primary-green: #59FF8A;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-main: #2A2D30;
    --text-secondary: #7e8590;
    --text-white: #ffffff;
    
    /* Градиенты */
    --grad-blue: linear-gradient(135deg, #428CDC 0%, #0052B4 100%);
    --grad-orange: linear-gradient(135deg, #fb4d00 0%, #F79311 100%);
    
    /* Размеры и отступы */
    --container-width: 1200px;
    --radius-sm: 0.5rem;   /* 8px */
    --radius-md: 0.75rem;  /* 12px */
    --radius-lg: 1.25rem;  /* 20px */
    --gap-sm: 0.625rem;    /* 10px */
    --gap-md: 1.25rem;     /* 20px */
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 10px 20px rgba(0, 82, 180, 0.15);
    
    /* Анимации */
    --trans-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Сброс и Базовые стили --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: --bg-body;
    color: var(--text-main);
    line-height: 1.6;
    background: var(--bg-body);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--trans-fast);
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* --- Утилиты (на основе классов из HTML) --- */
.wrap {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.flx { display: flex; }
.jcsb { justify-content: space-between; }
.aic { align-items: center; }
.fxg { flex-grow: 1; }
.b10 { margin-bottom: 0.625rem; }
.b20 { margin-bottom: 1.25rem; }
.r10 { margin-right: 0.625rem; }
.r20 { margin-right: 1.25rem; }
.radius20 { border-radius: 1.25rem; }
.h30 { height: 1.875rem; } /* 30px */
.f12 { font-size: 0.75rem; }
.w500 { font-weight: 500; }
.center { text-align: center; }

/* --- Header --- */
header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.head-top {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.download {
    background: rgba(66, 140, 220, 0.1);
    padding: 0 1rem;
    color: var(--primary-dark-blue);
    font-weight: 600;
    font-size: 0.85rem;
    gap: 0.5rem;
    display: flex;
    align-items: center;
}

.btn-icon svg {
    transition: var(--trans-fast);
}

.btn-icon:hover svg {
    transform: scale(1.2);
    fill: var(--primary-dark-blue);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all var(--trans-fast);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    gap: 0.5rem;
    height: 2.2rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

.fon-blu, .fon-blu2 {
    background: var(--grad-blue);
    color: var(--text-white);
}

.fon-orang {
    background: var(--grad-orange);
    color: var(--text-white);
}

.shadow-white {
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.shadow-dark {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Dropdowns & Options in Header */
.drop {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--primary-dark-blue);
    padding: 0 0.5rem;
    font-size: 0.875rem;
}

.time {
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

/* Логотип */
.logo svg {
    height: 2.5rem;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo path[fill="#fff"] {
    fill: var(--primary-dark-blue); /* Инвертируем белый на синий для белого фона */
}
.logo circle[fill="#fb4d00"] {
    fill: var(--primary-orange);
}

/* Главное меню навигации (header) */
.main-menu ul {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.main-menu a {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: var(--trans-smooth);
}

.main-menu a:hover {
    color: var(--primary-dark-blue);
}

.main-menu a:hover::after {
    width: 100%;
}

/* --- Layout Grid --- */
.content-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
    padding-bottom: 3rem;
}

/* --- Sidebar Menu --- */
.col-left {
    position: sticky;
    top: 6rem;
}

.menu-category {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    padding: 0.5rem 0;
}

.menu-category ul li {
    position: relative;
}

.menu-category > ul > li > a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    border-left: 3px solid transparent;
    transition: var(--trans-fast);
    gap: 0.8rem;
}

.menu-category > ul > li > a svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform var(--trans-fast);
}

.menu-category > ul > li > a:hover {
    background-color: rgba(66, 140, 220, 0.05);
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
}

.menu-category > ul > li > a:hover svg {
    transform: translateX(3px) scale(1.1);
}

/* Подменю в сайдбаре */
.menu-category ul ul {
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.menu-category ul ul li a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem 0.6rem 2.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--trans-fast);
    gap: 0.8rem;
}

.menu-category ul ul li a svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.8;
}

.menu-category ul ul li a:hover {
    color: var(--primary-dark-blue);
    background: #fff;
    padding-left: 2.8rem; /* Микроанимация отступа */
}

/* --- Content Area --- */
.content {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    min-height: 500px;
}

.box.text h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: var(--grad-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    width: 100%;
}

.refka {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.refka a {
    background: var(--grad-orange);
    color: white;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(251, 77, 0, 0.4);
    transition: var(--trans-smooth);
    position: relative;
    overflow: hidden;
}

.refka a:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(251, 77, 0, 0.5);
}

.refka a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

.refka a:hover::before {
    left: 100%;
}

/* Типографика статьи */
.entry-content {
    color: #4a4a4a;
}

.entry-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
}

.entry-content h2 {
    font-size: 1.6rem;
    color: var(--primary-dark-blue);
    margin: 2.5rem 0 1rem;
    position: relative;
    padding-left: 1rem;
}

.entry-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background: var(--primary-orange);
    border-radius: 2px;
}

/* Оглавление */
nav ol {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 1.5rem 1.5rem 1.5rem 3rem;
    margin: 1.5rem 0;
}

nav ol li {
    margin-bottom: 0.5rem;
}

nav ol li a {
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: var(--trans-fast);
}

nav ol li a:hover {
    color: var(--primary-orange);
    text-decoration-color: var(--primary-orange);
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 0.95rem;
}

table tr td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

table tr:first-child td {
    font-weight: 600;
    background-color: var(--primary-blue);
    color: white;
}

/* Делаем таблицу полосатой, но пропускаем шапку, если она не thead */
table tr:not(:first-child):nth-child(even) {
    background-color: #fcfcfc;
}

table tr:not(:first-child):hover {
    background-color: #f1f7ff;
}

table td:first-child {
    font-weight: 600;
    color: var(--primary-dark-blue);
    width: 35%;
    border-right: 1px solid #f0f0f0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
 
::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue); 
}

/* --- Media Queries --- */

/* Tablet & Mobile adjustment for nav toggle */
@media (max-width: 992px) {
    .hide_992 {
        display: none !important;
    }
    
    .content-row {
        grid-template-columns: 1fr;
    }
    
    .col-left {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .head-top {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .content-row {
        gap: 1rem;
    }

    .content {
        padding: 1.5rem 1rem;
    }
    
    .head-top, .head-bottom {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .logo {
        margin-bottom: 0.5rem;
    }
    
    .flx {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .r20, .r10 {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* Адаптация таблицы для мобильных */
    table td:first-child {
        width: auto;
        display: block;
        border-right: none;
        border-bottom: none;
        background: #f8f9fa;
        color: var(--text-main);
    }
    
    table td {
        display: block;
        width: 100%;
        padding: 0.8rem;
    }
    
    .refka a {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
}
