/* =========================================================
   «Тёплая витрина» — Flowers Reprice & Write-off System
   Токены light/dark · Quicksand + Nunito Sans · Bootstrap 5.3
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&family=Quicksand:wght@500;600;700&display=swap');

:root {
    /* Палитра «Тёплая витрина» (light) */
    --surface-bg: #FFF9F5;
    --surface-bg-accent: #FFF1E8;
    --surface-card: #FFFFFF;
    --text-body: #3B2A26;
    --text-muted: #8A7A72;
    --border-soft: #F0E2D8;

    --primary-color: #F43F5E;
    --primary-soft: #FB7185;
    --primary-grad: linear-gradient(135deg, #F43F5E, #FB7185);

    --secondary-color: #EA580C;

    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #E11D48;
    --info-color: #8B5CF6;

    --muted: #8A7A72;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 4px rgba(59, 42, 38, 0.06);
    --shadow-md: 0 4px 18px rgba(244, 63, 94, 0.08);
    --shadow-lg: 0 10px 32px rgba(244, 63, 94, 0.14);

    --focus-ring: 0 0 0 0.2rem rgba(244, 63, 94, 0.22);

    --font-heading: 'Quicksand', 'Segoe UI', sans-serif;
    --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

/* Back-compat переменные старого кода */
    --light-bg: var(--surface-bg);
    --secondary-grad-a: #F43F5E;
    --secondary-grad-b: #FB7185;

    /* Z-index шкала */
    --z-bottom-nav: 1000;
    --z-backdrop: 1029;
    --z-sidebar: 1030;
    --z-loading: 9000;
    --z-toast: 9100;
    --z-skip-link: 9200;
}

/* Тёмная тема */
[data-bs-theme="dark"] {
    --surface-bg: #211614;
    --surface-bg-accent: #241A17;
    --surface-card: #2B1D1A;
    --text-body: #F5EDE8;
    --muted: #B3A39B;
    --border-soft: #3D2C28;

    --primary-color: #FB7185;
    --primary-soft: #FDA4AF;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.5);

    --focus-ring: 0 0 0 0.2rem rgba(251, 113, 133, 0.3);
}

/* ============ База ============ */

body {
    font-family: var(--font-body);
    background-color: var(--surface-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(251, 113, 133, 0.07), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(234, 88, 12, 0.06), transparent);
    background-attachment: fixed;
    color: var(--text-body);
}

h1, h2, h3, h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

/* ============ Navbar ============ */

.navbar {
    backdrop-filter: blur(10px);
}

.navbar-light.bg-white {
    background-color: var(--surface-card) !important;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
}

.navbar-brand i {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Тёмная тема navbar */
[data-bs-theme="dark"] .navbar-custom-user {
    background-color: var(--surface-card) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-brand,
[data-bs-theme="dark"] .navbar-light .nav-link {
    color: var(--text-body);
}

/* Переключатель темы */
.theme-toggle {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    padding: 8px 10px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 50%;
    color: inherit;
    transition: background-color 0.2s, transform 0.3s;
}

.theme-toggle:hover {
    background: rgba(244, 63, 94, 0.1);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(25deg) scale(1.1);
}

.theme-toggle .theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ============ Карточки ============ */

.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: var(--surface-card);
    color: var(--text-body);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
}

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

/* Кнопки карточек действий (главная) */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: white;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.015);
    box-shadow: var(--shadow-lg);
    color: white;
}

.action-btn i {
    font-size: 32px;
    margin-bottom: 10px;
    transition: transform 0.25s ease;
}

.action-btn:hover i {
    transform: scale(1.12);
}

.action-btn span {
    font-weight: 600;
    text-align: center;
    font-family: var(--font-heading);
}

.action-btn.reprice {
    background: linear-gradient(135deg, #F43F5E, #FB7185);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.28);
}

.action-btn.writeoff {
    background: linear-gradient(135deg, #EA580C, #F59E0B);
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25);
}

.action-btn.documents {
    background: linear-gradient(135deg, #8B5CF6, #C4B5FD);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.25);
}

.action-btn.settings {
    background: linear-gradient(135deg, #10B981, #6EE7B7);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

/* Статистика */
.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--muted);
    font-size: 14px;
}

/* ============ Товары ============ */

.product-item {
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    color: var(--text-body);
}

.product-item .product-name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    color: var(--text-body);
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.product-item .product-code {
    color: var(--muted);
    font-size: 14px;
}

.product-item .product-price {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-color);
    white-space: nowrap;
    margin-left: 10px;
}

.product-item .price-history {
    font-size: 14px;
    color: var(--muted);
}

.product-item .line-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    font-size: 15px;
}

.product-item .line-details .detail-item {
    display: flex;
    flex-direction: column;
}

.product-item .line-details .detail-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.product-item .line-details .detail-value {
    font-weight: 700;
    font-size: 15px;
}

/* Кнопка удаления — тач 44px */
.product-item .btn-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Выбор товара */
.product-select {
    cursor: pointer;
    transition: background-color 0.18s, transform 0.18s, border-color 0.18s;
    min-height: 48px;
}

.product-select:hover {
    background-color: rgba(244, 63, 94, 0.05);
    border-color: var(--primary-soft);
    transform: translateX(2px);
}

.product-select:active {
    background-color: rgba(244, 63, 94, 0.1);
}

/* Переоценённые позиции — заметно выделены (срок жизни 7 дней) */
.product-item.revalued-lot {
    border: 1px solid var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
    background:
        linear-gradient(135deg, rgba(234, 88, 12, 0.07), transparent 60%),
        var(--surface-card);
}

[data-bs-theme="dark"] .product-item.revalued-lot {
    background:
        linear-gradient(135deg, rgba(234, 88, 12, 0.14), transparent 60%),
        var(--surface-card);
}

.product-item.revalued-lot:hover,
.product-item.revalued-lot:active {
    background:
        linear-gradient(135deg, rgba(234, 88, 12, 0.12), transparent 60%),
        var(--surface-card);
}

/* Подпись блока переоценённых */
.product-list-section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Фото */
.photo-upload {
    border: 2px dashed var(--border-soft);
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 80px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    color: var(--muted);
}

.photo-upload:hover {
    border-color: var(--primary-color);
    background: rgba(244, 63, 94, 0.03);
}

.photo-upload.has-photo {
    border-style: solid;
    border-color: var(--success-color);
}

.photo-upload img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-sm);
}

/* Статусы документов */
.status-draft {
    background-color: var(--warning-color);
    color: #3B2A26;
}

.status-sent {
    background-color: var(--success-color);
    color: white;
}

.status-locked {
    background-color: var(--muted);
    color: #fff;
}

/* Предупреждение цены */
.price-warning {
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: 10px 15px;
    margin-top: 10px;
}

[data-bs-theme="dark"] .price-warning {
    background-color: rgba(245, 158, 11, 0.15);
}

/* ============ Bottom nav (мобильный) ============ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -2px 12px rgba(59, 42, 38, 0.06);
    display: none;
    z-index: var(--z-bottom-nav);
}

[data-bs-theme="dark"] .bottom-nav {
    background: rgba(43, 29, 26, 0.92);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 70px;
    }
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    min-height: 56px;
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}

.bottom-nav a.active {
    color: var(--primary-color);
}

.bottom-nav a i {
    font-size: 22px;
    margin-bottom: 3px;
    transition: transform 0.2s;
}

.bottom-nav a.active i {
    transform: translateY(-2px) scale(1.1);
}

/* Поиск */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

/* Состояние «ничего не найдено» */
.search-empty {
    text-align: center;
    color: var(--muted);
    padding: 24px 12px;
    font-size: 14px;
    display: none;
}

.search-empty-visible .search-empty {
    display: block;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 249, 245, 0.9);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    flex-direction: column;
}

[data-bs-theme="dark"] .loading-overlay {
    background: rgba(33, 22, 20, 0.9);
}

.loading-overlay .spinner-border {
    color: var(--primary-color);
    width: 3rem;
    height: 3rem;
}

.loading-message {
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
    color: var(--text-body);
}

/* Тач-таргеты */
.btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.2s, background-color 0.2s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge {
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.45em 0.8em;
}

/* Мобильные тач-оверрайды */
@media (max-width: 768px) {
    .user-page .btn-sm {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }
    .user-page .form-control,
    .user-page .form-select {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Формы */
.form-control,
.form-select {
    background-color: var(--surface-card);
    border-color: var(--border-soft);
    color: var(--text-body);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #332220;
    border-color: var(--border-soft);
    color: var(--text-body);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--muted);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, #F43F5E, #FB7185);
    border: none;
    box-shadow: 0 3px 10px rgba(244, 63, 94, 0.25);
    transition: box-shadow 0.2s, transform 0.15s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #E11D48, #F43F5E);
    box-shadow: 0 5px 16px rgba(244, 63, 94, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #E11D48, #F43F5E);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10B981);
    border: none;
}

/* Алерты */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

/* Таблицы */
.table {
    background: var(--surface-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    color: var(--text-body);
    --bs-table-bg: var(--surface-card);
    --bs-table-color: var(--text-body);
    --bs-table-striped-color: var(--text-body);
    --bs-table-hover-color: var(--text-body);
    --bs-table-hover-bg: rgba(244, 63, 94, 0.04);
}

/* Числовые колонки: табличные цифры не «прыгают» */
.table td.num,
.table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table th {
    background: var(--surface-bg-accent);
    font-weight: 700;
    border-bottom: 2px solid var(--border-soft);
    color: var(--text-body);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--surface-card);
    --bs-table-color: var(--text-body);
}

[data-bs-theme="dark"] .table th {
    background: #241A17;
}

/* Сводка документа */
.doc-summary {
    background: linear-gradient(135deg, #F43F5E, #EA580C);
    color: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.doc-summary .total-label {
    font-size: 14px;
    opacity: 0.9;
}

.doc-summary .total-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
}

/* Теплый терракотовый вариант для сумм списания */
.doc-summary-terracotta {
    background: linear-gradient(135deg, #EA580C, #F59E0B);
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25);
}

/* Причина списания */
.reason-select {
    min-width: 120px;
}

/* Skip-link (доступность с клавиатуры) */
.skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    z-index: var(--z-skip-link);
    background: var(--primary-color);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 8px;
    color: #fff;
}

/* Тёплые утилитарные классы (замена холодных Bootstrap) */
.text-warm { color: var(--primary-color) !important; }
.text-violet { color: var(--info-color) !important; }

.bg-violet {
    background-color: var(--info-color) !important;
    color: #fff;
}

.table-summary {
    background-color: rgba(244, 63, 94, 0.08);
    color: var(--text-body);
    --bs-table-bg: rgba(244, 63, 94, 0.08);
    --bs-table-color: var(--text-body);
}

[data-bs-theme="dark"] .table-summary {
    --bs-table-bg: rgba(251, 113, 133, 0.14);
}

.input-group-text {
    background-color: var(--surface-bg-accent);
    border-color: var(--border-soft);
    color: var(--text-body);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 48px 16px;
}

.empty-state-icon {
    font-size: 48px;
    color: var(--primary-soft);
    opacity: 0.85;
}

/* Фотографии документов */
.doc-photo {
    max-height: 200px;
}

.doc-photo-contain {
    object-fit: contain;
}

/* ============ Тёмная тема: кастомные компоненты ============ */

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .product-item {
    background-color: var(--surface-card);
    border-color: var(--border-soft);
}

[data-bs-theme="dark"] .navbar.bg-white {
    background-color: var(--surface-card) !important;
}

[data-bs-theme="dark"] .card-header {
    background: transparent;
    color: var(--text-body);
}

/* ============ Админ-панель ============ */

.admin-sidebar {
    background: var(--surface-card);
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    box-shadow: 2px 0 10px rgba(59, 42, 38, 0.05);
    padding-top: 0;
    border-right: 1px solid var(--border-soft);
}

.admin-sidebar .nav-link {
    color: var(--text-body);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 2px 8px 2px 0;
    transition: background-color 0.15s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(244, 63, 94, 0.07);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.admin-sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    font-size: 16px;
}

[data-bs-theme="dark"] .admin-sidebar {
    background: var(--surface-card);
}

/* Затемнение позади мобильного меню — по умолчанию скрыто на всех ширинах.
   Без этого на десктопе div занимает всю строку .row и выталкивает
   рабочую область под список меню. */
.admin-backdrop {
    display: none;
}

@media (max-width: 767.98px) {
    .admin-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        z-index: var(--z-sidebar);
        min-height: auto;
        max-height: calc(100vh - 56px);
        max-height: calc(100dvh - 56px);
        overflow-y: auto;
        border-bottom: 1px solid var(--border-soft);
        box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.show {
        display: block !important;
    }

    /* Затемнение позади мобильного меню — тап по нему закрывает меню */
    .admin-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        top: 56px;
        background: rgba(33, 22, 20, 0.45);
        z-index: var(--z-backdrop);
    }

    .admin-backdrop.show {
        display: block;
    }
    .admin-sidebar:not(.show) {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .admin-sidebar {
        display: block !important;
    }
}

/* ============ Toast-уведомления (замена alert()) ============ */

.toast-container-inline {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: var(--z-toast);
    max-width: 360px;
    width: calc(100% - 32px);
    pointer-events: none;
}

.toast-inline {
    background: var(--surface-card);
    color: var(--text-body);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    pointer-events: auto;
    animation: toastIn 0.3s ease;
}

.toast-inline-success { border-left-color: var(--success-color); }
.toast-inline-danger { border-left-color: var(--danger-color); }
.toast-inline-warning { border-left-color: var(--warning-color); }
.toast-inline-info { border-left-color: var(--info-color); }

.toast-inline-success i { color: var(--success-color); }
.toast-inline-danger i { color: var(--danger-color); }
.toast-inline-warning i { color: var(--warning-color); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-inline.is-hiding {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(24px); }
}

/* ============ Документы: карточки на узких экранах ============ */

@media (max-width: 575.98px) {
    .table-cards thead {
        display: none;
    }
    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td {
        display: block;
        width: 100%;
    }
    .table-cards tr {
        background: var(--surface-card);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        padding: 8px;
    }
    .table-cards td {
        border: none;
        padding: 6px 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    .table-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
    }
    .table-cards td:last-child {
        justify-content: flex-end;
        padding-top: 10px;
        border-top: 1px dashed var(--border-soft);
        margin-top: 6px;
    }
    .table-cards td:last-child::before {
        display: none;
    }
}

/* ============ Мобильные оптимизации ============ */

@media (max-width: 576px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    .action-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
    }
    .action-btn i {
        font-size: 24px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .doc-summary .total-value {
        font-size: 24px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Фокус-доступность */
a:focus-visible,
button:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.form-switch:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============ Устаревшие переопределения (совместимость) ============ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
}

.alert-warning {
    --bs-alert-color: #7C4A03;
    --bs-alert-bg: #FFF3E0;
    --bs-alert-border-color: rgba(245, 158, 11, 0.4);
}

[data-bs-theme="dark"] .alert-warning {
    --bs-alert-color: #FCD34D;
    --bs-alert-bg: rgba(245, 158, 11, 0.12);
    --bs-alert-border-color: rgba(245, 158, 11, 0.35);
}

.text-muted {
    color: var(--muted) !important;
}

hr {
    border-color: var(--border-soft);
}

.bg-light {
    background-color: var(--surface-bg-accent) !important;
}

/* Логин и публичные страницы */
.public-body {
    background:
        radial-gradient(ellipse 70% 60% at 15% 0%, rgba(251, 113, 133, 0.16), transparent),
        radial-gradient(ellipse 60% 50% at 90% 100%, rgba(234, 88, 12, 0.12), transparent),
        var(--surface-bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .public-body {
    background:
        radial-gradient(ellipse 70% 60% at 15% 0%, rgba(251, 113, 133, 0.12), transparent),
        radial-gradient(ellipse 60% 50% at 90% 100%, rgba(234, 88, 12, 0.08), transparent),
        #211614;
}

.public-card {
    max-width: 400px;
    width: 100%;
    margin: 20px;
    border-radius: var(--radius-lg);
    border: none;
}

.public-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(135deg, #F43F5E, #FB7185);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
}

