/* ========================================
   Портал нормативных правовых актов
   Корпоративный стиль
   ======================================== */

:root {
    --color-primary: #3e4b59;
    --color-primary-dark: #3d4f5e;
    --color-primary-light: #6d7e8e;
    --color-secondary: #5f6f80;
    --color-secondary-dark: #357a8a;
    --color-accent: #e74c3c;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-error: #c0392b;

    --color-bg: #f0f2f5;
    --color-bg-white: #ffffff;
    --color-border: #d8dde3;
    --color-text: #3a4a5a;
    --color-text-light: #7f8c8d;
    --color-text-muted: #a0aab4;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.08);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.6;
    --header-h: 80px;
}

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

html {
    font-size: var(--font-size-base);
    overflow-y: scroll;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    width: 100%;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-secondary-dark);
}

select {
    padding-right: 30px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* ========================================
   Layout
   ======================================== */

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */

.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header .container {
    max-width: 100%;
}

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

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-link:hover {
    opacity: 0.9;
}

.site-logo {
    max-height: 64px;
    width: auto;
    display: block;
}

.site-title {
    text-transform: uppercase;
}

.site-title a {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.site-title-line1 {
    display: block;
    font-weight: 600;
}

.site-title-line2 {
    display: block;
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.6;
}

.site-title-line3 {
    display: block;
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.6;
}

.header-nav {
    display: flex;
    gap: 20px;
}

.header-nav a {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    display: flex;
    flex: 1;
    gap: 30px;
    padding: 30px 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   Public Layout (sidebar flush to edge)
   ======================================== */

.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 140px);
    padding-left: 300px;
}

.sidebar-left {
    width: 300px;
    flex-shrink: 0;
    background: var(--color-primary);
    padding: 20px 0;
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    box-shadow: 1px 0px 2px 0 rgba(0, 0, 0, .29);
    z-index: 50;
}

.sidebar-left-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-left-menu li {
    margin-bottom: 5px;
}

.sidebar-left-menu a,
.sidebar-left-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1.15rem;
}

.sidebar-left-menu a:hover,
.sidebar-left-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-left-menu a.active,
.sidebar-left-item.active {
    background: var(--color-secondary);
    color: #fff;
}

.sidebar-left-menu a.active:hover,
.sidebar-left-item.active:hover {
    background: var(--color-secondary);
}

.sidebar-left-menu a.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sidebar-left-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

.app-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    flex: 1;
    padding: 30px;
    background: var(--color-bg-white);
    font-size: 1.15rem;
}

.public-content {
    flex: 1;
    padding: 30px;
    background: var(--color-bg-white);
    min-width: 0;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
}

/* ========================================
   Search Form
   ======================================== */

.search-form .form-group {
    margin-bottom: 15px;
}

.search-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.search-form input[type="text"],
.search-form input[type="date"],
.search-form select,
.search-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus,
.search-form select:focus,
.search-form textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-form textarea {
    resize: vertical;
    min-height: 80px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range input {
    flex: 1;
}

.date-range span {
    color: var(--color-text-muted);
}

/* ========================================
   Sidebar Navigation (Tabs)
   ======================================== */

.nav-text {
}

.content-full {
    flex: 1;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    min-width: 0;
}

/* ========================================
   Search Form (Horizontal in content)
   ======================================== */

.search-form-container {
    background: var(--color-bg);
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.search-form-horizontal .form-row-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.search-form-horizontal .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.search-form-horizontal > .form-group {
    margin-bottom: 20px;
}

.search-form-horizontal label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.search-form-horizontal input,
.search-form-horizontal select,
.search-form-horizontal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    min-width: 0;
}

.search-form-horizontal textarea {
    resize: vertical;
    min-height: 70px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range input {
    flex: 1;
    min-width: 0;
}

.date-range span {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.form-actions-horizontal {
    display: flex;
    gap: 10px;
    align-items: center;
    grid-column: 1 / -1;
    padding-top: 10px;
}

.form-actions-horizontal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    min-width: 120px;
    height: 42px;
}

.search-results {
    margin-top: 30px;
}

.no-results-hint {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ========================================
   Category List
   ======================================== */

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.category-list a:hover {
    background: var(--color-bg);
    color: var(--color-secondary);
    padding-left: 16px;
}

/* ========================================
   Content Area
   ======================================== */

.content {
    flex: 1;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    min-width: 0;
}

/* ========================================
   Page Header
   ======================================== */

.page-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.total-count {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ========================================
   Acts List
   ======================================== */

.acts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.act-item {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease;
}

.act-item:hover {
    box-shadow: var(--shadow-md);
}

.act-header {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.act-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.act-published {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.act-type {
    background: var(--color-primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.act-number {
    color: var(--color-text-light);
    font-weight: 500;
}

.act-date {
    color: var(--color-text-muted);
}

.act-title {
    font-size: 1.1rem;
    font-weight: normal;
    margin-bottom: 10px;
}

.act-title a {
    color: var(--color-primary);
}

.act-title a:hover {
    color: var(--color-secondary);
}

.act-preview {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.act-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    box-sizing: border-box;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--color-bg);
    color: var(--color-text);
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn-primary {
    background: var(--color-secondary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-secondary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--color-primary-light);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-danger {
    background: var(--color-error);
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
    color: #fff;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.85rem;
    height: 32px;
}

.btn-icon {
    margin-right: 6px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   No Results
   ======================================== */

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.page-info {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* ========================================
   Year Filter
   ======================================== */

.year-filter {
    margin: 16px 0 24px;
}

.year-filter select {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1.3rem;
    color: var(--color-text);
    background: #fff;
    cursor: pointer;
}

/* ========================================
   Act Full View
   ======================================== */

.act-full {
    max-width: 100%;
}

.act-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.act-breadcrumb a {
    color: var(--color-secondary);
}

.act-breadcrumb .separator {
    margin: 0 8px;
    color: var(--color-text-muted);
}

.act-full-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.act-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.act-type-badge {
    background: var(--color-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.act-full-header .act-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.act-full-header .act-date {
    color: var(--color-text-light);
}

.act-full-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.4;
}

.act-full-content {
    background: var(--color-bg);
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.act-full-files h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.files-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.file-link:hover {
    border-color: var(--color-secondary);
    background: var(--color-bg);
}

.file-link.pdf:hover {
    border-color: #e74c3c;
}

.file-link.doc:hover {
    border-color: var(--color-secondary);
}

/* ========================================
   Act Attachments
   ======================================== */

.act-attachments {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--color-border);
}

.act-attachments h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.attachment-link:hover {
    border-color: var(--color-secondary);
    background: #e8f4fc;
}

.attachment-icon {
    font-size: 1.3rem;
}

.attachment-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.attachment-size {
    font-size: 0.85rem;
    color: var(--color-text-light);
    background: var(--color-bg-white);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    font-size: 0.9rem;
    color: var(--color-text);
}

.no-files {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* ========================================
   Login Page
   ======================================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.login-box {
    background: var(--color-bg-white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 25px;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.login-back {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ========================================
   Admin Styles
   ======================================== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.admin-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-primary);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    padding: 25px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
}

/* ========================================
   Admin Table
   ======================================== */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: var(--color-bg);
}

.admin-table .title-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table .actions-cell {
    white-space: nowrap;
}

.file-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 5px;
}

.file-badge.pdf {
    background: #fdeaea;
    color: #e74c3c;
}

.file-badge.doc {
    background: #e8f4fc;
    color: var(--color-secondary);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.published {
    background: #e8f8f0;
    color: var(--color-success);
}

.status-badge.draft {
    background: #fef9e7;
    color: var(--color-warning);
}

/* ========================================
   Forms
   ======================================== */

.act-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.act-form .form-group {
    margin-bottom: 20px;
}

.act-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
}

.act-form input[type="text"],
.act-form input[type="date"],
.act-form input[type="number"],
.act-form select,
.act-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
}

.act-form input:focus,
.act-form select:focus,
.act-form textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.act-form textarea {
    resize: vertical;
}

.act-form small {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.file-current {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

/* ========================================
   Inline Form (Types)
   ======================================== */

.inline-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    margin-bottom: 0;
}

.inline-form .form-actions-inline {
    padding-bottom: 0;
}

.inline-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.inline-form input {
    padding: 10px 12px;
}

/* ========================================
   Types Section
   ======================================== */

.types-section {
    background: var(--color-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.types-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

/* ========================================
   Alerts
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert ul {
    margin-left: 20px;
}

.alert-error {
    background: #fdeaea;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #e8f8f0;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    /*background: var(--color-primary-dark);*/
    color: rgba(255,255,255,0.7);
    padding: 20px 0;
    margin-top: auto;
}

.footer p {
    text-align: left;
    font-size: 0.85rem;
}

.footer-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    margin-top: 5px;
}

.footer-content {
    color: rgb(55 55 55);
    line-height: 1.6;
}

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

.footer-dev {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-dev a {
    color: var(--color-text-light);
}

.footer-dev a:hover {
    color: var(--color-text);
}

.footer-content h3 {
    color: #fff;
    font-size: 1rem;
    margin: 15px 0 10px;
}

.footer-content h3:first-child {
    margin-top: 0;
}

.footer-content p {
    margin: 5px 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-section {
        display: inline-block;
        width: calc(50% - 15px);
        vertical-align: top;
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .admin-actions {
        justify-content: stretch;
    }
    
    .admin-actions .btn {
        flex: 1;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }
    
    .sidebar-section {
        width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .act-header {
        flex-direction: column;
        gap: 5px;
    }
    
    .act-footer {
        flex-direction: column;
    }

    .act-footer .btn {
        width: 100%;
    }
}

/* ========================================
   Home Page
   ======================================== */

.home-page {
    max-width: 100%;
}

.home-stats {
    margin-bottom: 40px;
}

.home-search-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.home-search-row .home-stats {
    margin-bottom: 0;
    flex-shrink: 0;
}

.home-search-row .home-search {
    flex: 1;
    margin: 0;
}

.home-search-row .stat-card {
    padding: 23px 23px;
    text-align: center;
    white-space: nowrap;
}

.home-search-row .stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
}

.home-search-row .stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .home-search-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.stat-card.large {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: #fff;
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    display: block;
}

.stat-card.large .stat-value {
    font-size: 4rem;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.stat-card.large .stat-label {
    font-size: 1.1rem;
    opacity: 0.95;
}

.home-types {
    margin-bottom: 40px;
}

.home-types h3 {
    font-size: 2.3rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.type-card:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.type-card-icon {
    font-size: 3rem;
    line-height: 1;
}

.type-card-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.type-count {
    font-size: 0.85rem;
    color: var(--color-text-light);
    background: var(--color-bg);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.home-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 25px 30px;
    font-size: 1rem;
}

/* ========================================
   Categories Page
   ======================================== */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.category-card-icon {
    font-size: 3rem;
    line-height: 1;
}

.category-card-info {
    flex: 1;
}

.category-card-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.category-count {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

.category-arrow {
    font-size: 1.5rem;
    color: var(--color-secondary);
    transition: transform 0.2s ease;
}

.category-card:hover .category-arrow {
    transform: translateX(5px);
}

/* ========================================
   Info Page
   ======================================== */

.info-page {
    max-width: 100%;
}

.info-content {
    background: var(--color-bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    line-height: 1.8;
}

.info-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
}

.info-content h3:first-child {
    margin-top: 0;
}

.info-content dl {
    margin: 15px 0;
}

.info-content dt {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 15px;
}

.info-content dd {
    color: var(--color-text);
    font-size: 0.95rem;
    margin: 5px 0 15px 0;
    padding-left: 15px;
    border-left: 3px solid var(--color-secondary);
}

.info-section {
    background: var(--color-bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 25px;
}

.info-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
}

.info-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 15px;
    align-items: baseline;
}

.info-list dt {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 1rem;
}

.info-list dd {
    color: var(--color-text);
    font-size: 1.05rem;
    margin: 0;
}

.info-hint {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .info-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .info-list dt {
        font-weight: 600;
        color: var(--color-primary);
    }
    
    .types-grid,
    .home-actions {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Полнотекстовый поиск на главной
   ======================================== */

.home-search {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.home-search-form {
    width: 100%;
}

.home-search-input {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.home-search-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-search-input input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.home-search-input button {
    white-space: nowrap;
}

/* Подсветка найденных слов */
mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .home-search {
        padding: 20px;
        margin: 20px 0;
    }

    .home-search-input {
        flex-direction: column;
    }

    .home-search-input button {
        width: 100%;
    }
}

.form-collapsible {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-collapsible-header {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: #fbfbfb;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.form-collapsible-header::-webkit-details-marker {
    display: none;
}

.form-collapsible-header::before,
.form-collapsible-header::after {
    display: none;
}

.form-collapsible-toggle {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--color-text-muted);
}

.form-collapsible-toggle::before {
    content: 'Свернуть';
}

.form-collapsible-toggle::after {
    content: ' ▲';
    font-size: 0.75rem;
}

.form-collapsible:not([open]) .form-collapsible-toggle::before {
    content: 'Развернуть';
}

.form-collapsible:not([open]) .form-collapsible-toggle::after {
    content: ' ▼';
}

.form-collapsible[open] .form-collapsible-header {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #ecf0f1;
}

/* ========================================
   Role badges
   ======================================== */

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.role-badge.admin {
    background: #e74c3c;
    color: #fff;
}

.role-badge.editor {
    background: var(--color-secondary);
    color: #fff;
}

/* ========================================
   Admin page header
   ======================================== */

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-page-header h2 {
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* ========================================
   Responsive app-layout
   ======================================== */

@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar-left {
        width: 100%;
        height: auto;
        position: static;
    }

    .sidebar-left-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .sidebar-left-menu li {
        margin-bottom: 0;
    }
}

/* ========================================
   Admin form (act-form)
   ======================================== */

.act-form-body {
    background: #fbfbfb;
    padding: 25px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.act-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.act-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.act-form-group {
    margin-bottom: 20px;
}

.act-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.act-form-group input[type="text"],
.act-form-group input[type="date"],
.act-form-group input[type="datetime-local"],
.act-form-group input[type="file"],
.act-form-group select,
.act-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dcdde1;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
}

.act-form-group input[type="file"] {
    width: auto;
}

.act-form-hint {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    display: block;
}

.act-form-hint-sm {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.act-form-check label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.act-form-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.act-attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f6fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.act-attachment-item span {
    font-size: 0.9rem;
    flex: 1;
}

/* ========================================
   Admin acts table
   ======================================== */

.admin-card {
    background: #fbfbfb;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.admin-card h3 {
    color: var(--color-primary);
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead tr {
    background: #f5f6fa;
}

.admin-table th {
    padding: 12px;
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

.admin-table td.nowrap {
    white-space: nowrap;
}

.badge-published {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #e8f8f0;
    color: #27ae60;
}

.badge-draft {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #fef9e7;
    color: #f39c12;
}

.admin-pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.admin-pagination span {
    color: #7f8c8d;
}

.alert-error {
    background: #fdeaea;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error ul {
    margin-left: 20px;
}

