@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/web/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/web/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/web/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/web/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/web/Inter-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ===== БАЗА ===== */
* { box-sizing: border-box; }
body { 
    padding: 0; margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; 
    background: #f5f7fa; line-height: 1.6; color: #1a1a1a; -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: #0a58ca; }
a:hover { color: #084298; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== ШАПКА ===== */
.nav-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.nav {
    position: relative; background: white; padding: 10px 20px; border-radius: 8px;
    margin: 20px auto; max-width: 1200px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex;
    justify-content: space-between; align-items: center; flex-wrap: nowrap;
}
.nav .logo, .logo { font-size: 24px; font-weight: 800; color: #1a1a1a !important; letter-spacing: 0.5px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; overflow: visible; position: relative; z-index: 1; }
.nav-actions { position: relative; z-index: 2; }
.nav .logo img, .logo img { height: 32px; display: block; vertical-align: middle; flex-shrink: 0; transform: scaleX(1.7); transform-origin: left center; margin-right: 8px; }

.nav-links { display: none; flex-direction: column; width: 100%; }
.nav-links.show { display: flex !important; flex-direction: column; align-items: flex-start; text-align: left; position: absolute; top: 100%; left: 0; right: 0; background: white; padding: 15px; z-index: 100; box-shadow: 0 4px 10px rgba(0,0,0,0.2); border-radius: 8px; }
.nav-links a { color: #1a1a1a; font-weight: 500; text-align: left; width: 100%; padding: 8px 16px; border-bottom: 1px solid #f5f5f5; }
.nav-links a:last-child { border-bottom: none; }
.nav-links a:hover { color: #0a58ca; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.burger { display: flex !important; cursor: pointer; padding: 5px; background: none; border: none; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 25px; height: 3px; background: #1a1a1a; border-radius: 2px; }
.user-name { font-weight: 600; color: #1a1a1a; }
.logout-link { color: #dc3545; font-weight: 600; }
.mobile-only { display: none !important; }
.upload-btn { background: #dc3545; color: white !important; border-radius: 6px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.profile-icon { color: #1a1a1a; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }

/* ===== MAIN ===== */
main { max-width: 1200px; margin: 0 auto; padding: 20px 40px 60px 40px; }
main h1 { font-size: 36px; font-weight: 700; margin-bottom: 30px; }
main ul, main ol { padding-left: 24px; margin: 16px 0; }
main li { margin-bottom: 6px; font-size: 16px; }

/* ===== КНОПКИ ===== */
.btn, button.btn, a.btn {
    padding: 10px 20px; background: #0a58ca; color: white !important;
    border: none; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 15px; font-weight: 600; white-space: nowrap;
    transition: 0.2s; text-align: center; text-decoration: none; font-family: inherit;
}
.btn:hover { background: #084298; }
.btn-header-register:hover, .btn-header-login:hover { color: #fff !important; }
.btn-danger, .btn-red { background: #dc3545 !important; }
.btn-danger:hover, .btn-red:hover { background: #bb2d3b !important; }
.btn-secondary { background: #95a5a6; }
.btn-secondary:hover { background: #7f8c8d; }
.btn-outline { background: #6c757d !important; color: white !important; border: 1px solid transparent !important; }
.btn-outline:hover { background: #5a6268 !important; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-header { display: inline-block; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px; border: 1px solid transparent; white-space: nowrap; cursor: pointer; }
.btn-header-login { color: #0a58ca; border-color: #0a58ca; background: transparent; }
.btn-header-login:hover { background: #0a58ca; color: #fff; }
.btn-header-register { color: #fff; background: #dc3545; border-color: #dc3545; }
.btn-header-register:hover { background: #bb2d3b; }

/* ===== ФОРМЫ ===== */
input, select, textarea { padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #0a58ca; }
.form-group { margin-bottom: 12px; }
.form-group label { font-weight: 600; display: block; margin-bottom: 4px; color: #555; }
.form-control { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #ddd; font-size: 14px; }

/* ===== ТАБЛИЦЫ ===== */
.table-wrap { overflow-x: auto; margin: 20px auto; }
table { border-collapse: collapse; width: 100%; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-radius: 8px; }
th, td { border: 1px solid #eee; padding: 12px 14px; text-align: left; font-size: 14px; }
th { background: #f8f9fa; font-weight: 600; color: #555; }
tr:hover { background: #fafafa; }

/* ===== ФУТЕР ===== */
footer { background: #111; color: #888; padding: 30px 0; text-align: center; font-size: 13px; width: 100%; margin: 0; border-radius: 0; }
footer a { color: #7f8c8d; margin: 0 10px; }
footer a:hover { color: #0a58ca; }

/* ===== ЛЕНДИНГ ===== */
.hero { text-align: center; padding: 60px 20px; background: linear-gradient(135deg, #0a58ca, #084298); color: white; border-radius: 12px; margin-bottom: 40px; }
.hero h1 { font-size: 40px; font-weight: 800; margin-bottom: 24px; line-height: 1.15; letter-spacing: -0.5px; }
.hero h1 .highlight { color: #0a58ca; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }
.landing-form { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); max-width: 400px; margin: 0 auto; }
.landing-content h1 { font-size: 36px; font-weight: 700; margin-bottom: 30px; }

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs { font-size: 13px; color: #555; overflow-x: auto; white-space: nowrap; padding: 5px 0; margin-bottom: 15px; }
.breadcrumbs a { color: #0a58ca; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ===== АЛЕРТЫ ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 15px; font-size: 14px; }

/* ===== ЧЕКБОКСЫ ===== */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }

/* ===== МОБИЛЬНЫЕ ===== */
@media (max-width: 768px) {
    main { padding: 0px 40px 60px 40px; }
    .filter-item { min-width: 100% !important; flex: none !important; }
    .filter-item input, .filter-item select { width: 100% !important; }
    .filter-actions { flex-direction: column; }
    .filter-actions .btn { width: 100%; text-align: center; }
    main h1 { font-size: 28px; }
    main ul, main ol { padding-left: 18px; }
    main li { font-size: 15px; }
    .mobile-only { display: flex !important; }
    .nav-actions .btn-danger, .nav-actions .user-name, .nav-actions .logout-link { display: none !important; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 16px; }
    .landing-content h1 { font-size: 24px; }
    
    /* Таблица на мобилке */
    table thead { display: none; }
    table, tbody, tr, td { display: block; }
    tr { padding: 10px 4px; border-bottom: 1px solid #eee; }
    td { border: none; padding: 3px 0 3px 10px; text-align: left !important; }
    td:first-child { display: inline-block; width: auto; }
    td:nth-child(2) { display: block !important; }
    td:nth-child(2) a { display: block !important; color: #0a58ca !important; font-weight: 500; font-size: 15px; word-break: break-word; }
    td:nth-child(3), td:nth-child(4), td:nth-child(5) { display: block !important; font-size: 13px; color: #888; }
}

/* ===== ПРОЧЕЕ ===== */
.scroll-top { position: fixed; bottom: 30px; right: 30px; width: 44px; height: 44px; background: #0a58ca; color: white !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); z-index: 50; text-decoration: none; }

/* ===== ДАШБОРД ===== */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px; }
.dash-card { background: white; padding: 24px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-decoration: none; color: #1a1a1a; display: block; transition: 0.2s; }
.dash-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.dash-card h3 { font-size: 16px; color: #555; margin: 0 0 8px 0; }
.dash-card .value { font-size: 32px; font-weight: 700; color: #0a58ca; margin-bottom: 8px; }
.dash-card .doc-stats { font-size: 14px; color: #888; }
.dash-card .doc-stats div { margin: 2px 0; }

/* ===== ФИЛЬТР ===== */
.filter-wrapper { margin-bottom: 20px; }
.filter-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 16px; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: 600; }
.filter-toggle .filter-arrow { transition: 0.2s; }
.filter-body { display: none; background: white; padding: 16px; border-radius: 8px; margin-top: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.filter-body.open { display: block; }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-item { flex: 1; min-width: 150px; }
.filter-item label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.filter-item input, .filter-item select { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid #ddd; font-size: 13px; }
.filter-actions { display: flex; gap: 8px; margin-top: 20px; align-items: flex-end; }
.filter-item input, .filter-item select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #ddd; font-size: 14px; background: #fff; transition: border-color 0.2s; }
.filter-item input:focus, .filter-item select:focus { border-color: #0a58ca; outline: none; box-shadow: 0 0 0 2px rgba(10,88,202,0.1); }

.filter-actions { display: flex; gap: 8px; margin-top: 8px; }
.filter-actions .btn, .filter-actions .btn-outline,
.filter-item .btn, .filter-item .btn-outline,
#ocrFilter .btn, #ocrFilter .btn-outline {
    border: 1px solid transparent !important;
}
    flex: 1; text-align: center; padding: 10px 16px; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    height: 42px; box-sizing: border-box;
    border-radius: 8px; font-weight: 600; text-decoration: none;
}

/* ===== БЛОГ ===== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin: 30px 0; }

@media (max-width: 480px) {
    .blog-grid { grid-template-columns: 1fr; gap: 16px; margin: 20px 0; }
    .nav { padding: 8px 10px; gap: 2px; }
    .nav .logo img, .logo img { height: 24px; transform: scaleX(1.7); transform-origin: left center; margin-right: 4px; }
    .nav-actions { gap: 2px; }
    .nav-actions .action-icon, .nav-actions .profile-icon { padding: 4px; }
}
.blog-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: 0.2s; margin-bottom: 8px; border: 1px solid #e8e8e8; }
.blog-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.blog-card time { font-size: 13px; color: #888; }
.blog-card h2 { font-size: 20px; margin: 8px 0; line-height: 1.3; }
.blog-card h2 a { color: #1a1a1a; }
.blog-card h2 a:hover { color: #0a58ca; }
.blog-card p { color: #666; font-size: 14px; line-height: 1.5; }

/* ===== ПАГИНАЦИЯ ===== */
.pagination select { width: auto; min-width: 60px; padding: 6px 8px; }

.pagination { text-align: center; margin: 24px 0; }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pagination-info { font-size: 13px; color: #888; }
.pagination-info select { display: inline-block; width: auto; min-width: 50px; padding: 4px 6px; font-size: 12px; }

.pagination { text-align: center; margin: 24px 0; }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.pag-link { padding: 6px 12px; color: #0a58ca; text-decoration: none; border-radius: 4px; font-size: 14px; }
.pag-link:hover { background: #e8f0fe; }
.pag-current { padding: 6px 12px; font-weight: 700; color: #1a1a1a; font-size: 14px; }
.pag-dots { padding: 6px 4px; color: #888; }
.pagination-info { font-size: 13px; color: #888; }
.pagination-info select { display: inline-block; width: auto; min-width: 50px; padding: 4px 6px; font-size: 12px; border: 1px solid #ddd; border-radius: 4px; }

.btn-blue-on-white { background: #0a58ca !important; color: #fff !important; border: 2px solid rgba(255,255,255,0.4) !important; }
.btn-blue-on-white:hover { background: #084298 !important; }
.btn-giant { font-size: 22px; padding: 22px 36px; }

.filter-toggle { display: flex; justify-content: space-between; align-items: center; }

/* ===== COOKIE БАННЕР ===== */
#cookie-banner button { font-family: inherit; }
#cookie-modal input[type="checkbox"] { width: 18px; height: 18px; accent-color: #0a58ca; }
#cookie-modal label { cursor: pointer; }

.filter-toggle { display: none !important; }

a[data-folder-color]::before {
    content: "";
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    background: var(--folder-color);
}

.folder-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* Фикс ширины формы загрузки */
main form input[type="text"],
main form input[type="date"],
main form input[type="number"],
main form textarea,
main form select {
    max-width: 100% !important;
    box-sizing: border-box;
}
main form .form-group {
    width: 100%;
    box-sizing: border-box;
}
