/* ====================================================
   CRM СТИЛИ – ПОЛНАЯ ВЕРСИЯ (структурированная)
   Включает: базовые стили, карточки, формы, таблицы,
   модальные окна, адаптив, а также стили для модулей:
   kamaz, reports, logs, zarplata, candidates (kanban, статусы).
   ==================================================== */

/* -------------------- ПЕРЕМЕННЫЕ -------------------- */
:root {
    --primary: #0b5e9e;
    --primary-hover: #084a7d;
    --primary-light: rgba(11, 94, 158, 0.1);
    --success: #28a745;
    --success-hover: #1e7e34;
    --danger: #dc3545;
    --danger-hover: #b02a37;
    --warning: #ffc107;
    --warning-hover: #e0a800;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --bg-page: #ffffff;
    --bg-card: #ffffff;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08);

    --transition: all 0.15s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.75rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --line-height-tight: 1.2;
    --line-height-base: 1.5;
}

/* -------------------- СБРОС -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-page);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: var(--space-4);
}

.app {
    width: 100%;
    max-width: 1900px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* -------------------- ТИПОГРАФИКА -------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    line-height: var(--line-height-tight);
}
h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); font-weight: 600; }

/* -------------------- КАРТОЧКИ -------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

/* -------------------- КНОПКИ -------------------- */
.btn,
.btn-outline,
.btn-success,
.btn-warning,
.btn-danger,
.reset-btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: 500;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    min-height: 44px;
    padding: 0 var(--space-4);
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.btn {
    background: #28a745;
    color: white;
    border-color: #28a745;
}
.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--gray-300);
}
.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover {
    background: var(--success-hover);
    border-color: var(--success-hover);
}
.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
    border-color: var(--warning);
}
.btn-warning:hover {
    background: var(--warning-hover);
    border-color: var(--warning-hover);
}
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}
.reset-btn {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.reset-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}
.icon-btn {
    font-size: 1.2rem;
    padding: 0 var(--space-2);
    min-width: 44px;
    min-height: 44px;
    color: var(--gray-500);
    border: 1px solid transparent;
}
.icon-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}
.edit-btn { color: var(--primary); }
.edit-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.delete-btn { color: var(--danger); }
.delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger);
}
.view-btn { color: var(--gray-700); }
.view-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* -------------------- ФОРМЫ -------------------- */
label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    display: block;
    margin-bottom: var(--space-1);
}
input, select, textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    background: white;
    transition: var(--transition);
    min-height: 44px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.form-row .form-group {
    margin-bottom: 0;
}
.form-group {
    margin-bottom: var(--space-4);
    width: 100%;
    min-width: 0;
}

/* -------------------- ФИЛЬТРЫ (исправлено: кнопки справа, поля не растягиваются) -------------------- */
.filter-form {
    margin-bottom: var(--space-3);
}
.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}
/* FIX: убираем принудительное растягивание полей */
.filter-item {
    flex: 0 1 auto;
    min-width: 160px;
}
.filter-item label {
    margin-bottom: 2px;
}
.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;      /* прижимаем кнопки к правому краю */
    align-items: center;
}
/* Адаптив для мобильных (ширина < 600px) */
@media (max-width: 599px) {
    .filter-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px;
    }
    .filter-item {
        width: 100%;
        min-width: auto;
    }
    .filter-actions {
        margin-left: 0;
        justify-content: flex-start;
    }
}
/* Планшеты и десктоп (≥600px) – оставляем строку */
@media (min-width: 600px) {
    .filter-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }
    .filter-item {
        flex: 0 1 auto;
        min-width: 160px;
    }
    .filter-actions {
        margin-left: auto;
    }
}

/* --- Разделитель в блоке фильтров --- */
.filter-divider {
    margin: var(--space-3) 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

/* -------------------- СОРТИРОВКА -------------------- */
.sort-form {
    width: 100%;
}
.sort-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.sort-group label {
    margin-bottom: 0;
    white-space: nowrap;
}
.sort-group select {
    min-width: 150px;
}
@media (min-width: 600px) {
    .sort-group {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
    }
}

/* -------------------- ТАБЛИЦЫ -------------------- */
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    margin-top: var(--space-4);
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-200);
    position: relative;
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.1);
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.table-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--gray-400);
    border-radius: 4px;
}
.table-wrapper::-webkit-scrollbar-track {
    background-color: var(--gray-200);
}

.table-wrapper thead th {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    z-index: 15;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    min-width: 100%;
}

th {
    text-align: left;
    padding: var(--space-3) var(--space-2);
    color: var(--gray-700);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--gray-300);
    background: var(--gray-50);
}

td {
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

td, th {
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.table-wrapper tbody tr:hover td {
    background: var(--gray-100);
}

.table-wrapper td:not(.comment-cell),
.table-wrapper th {
    white-space: nowrap;
}
.table-wrapper td.comment-cell {
    white-space: normal;
    word-break: break-word;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ТАБЛИЦ ===== */
@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: visible;
        overflow-y: visible;
        max-height: none;
        border: none;
        background: transparent;
        position: static;
        box-shadow: none;
    }
    .table-wrapper table,
    .table-wrapper thead,
    .table-wrapper tbody,
    .table-wrapper th,
    .table-wrapper td,
    .table-wrapper tr {
        display: block;
    }
    .table-wrapper thead {
        display: none;
    }
    .table-wrapper tbody tr {
        margin-bottom: var(--space-4);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-lg);
        background: var(--bg-card);
        padding: var(--space-3);
        box-shadow: var(--shadow-sm);
    }
    .table-wrapper td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: var(--space-2) 0;
        border: none;
        border-bottom: 1px dashed var(--gray-200);
        white-space: normal;
        text-align: right;
        user-select: text;
        -webkit-touch-callout: default;
    }
    .table-wrapper td:last-child {
        border-bottom: none;
    }
    .table-wrapper td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        text-align: left;
        margin-right: var(--space-3);
        flex-shrink: 0;
        min-width: 120px;
    }
    .table-wrapper.has-checkbox td:first-child,
    .table-wrapper.has-checkbox th:first-child {
        display: none;
    }
}

/* -------------------- ИТОГИ -------------------- */
.totals-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin: var(--space-4) 0;
}
@media (min-width: 768px) {
    .totals-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-5);
    }
}
.totals-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.totals-section h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 var(--space-3) 0;
    text-transform: uppercase;
}
.totals-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.total-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--gray-300);
    padding-bottom: var(--space-2);
}
.total-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.total-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
}
.total-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
}

/* -------------------- ПАГИНАЦИЯ -------------------- */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.pagination button {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    min-height: 44px;
    width: 100%;
}
.pagination button:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--primary);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination select {
    width: 100%;
    min-width: 120px;
    min-height: 44px;
}
.pagination span {
    font-weight: 500;
    color: var(--gray-600);
}
@media (min-width: 600px) {
    .pagination {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-4);
    }
    .pagination button {
        width: auto;
    }
    .pagination select {
        width: auto;
    }
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    padding: var(--space-4);
    box-sizing: border-box;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    margin: auto;
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateY(10px);
    transition: transform 0.2s;
    box-sizing: border-box;
}

.modal-wide {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-500);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    padding: 0;
}
.modal-close:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.modal input,
.modal select,
.modal textarea {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}
.modal input[type="date"] {
    padding-right: 30px;
}
.modal .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.modal .form-group {
    flex: 1;
    min-width: 120px;
}
.modal input[readonly],
.modal textarea[readonly],
.modal select[disabled] {
    background-color: #f9f9f9;
    border-color: #e0e0e0;
    color: #666;
    cursor: default;
    pointer-events: none;
}
.modal select[disabled] {
    opacity: 0.7;
    -webkit-appearance: none;
    appearance: none;
}

/* Дополнительное выравнивание для динамических строк с кнопкой "Удалить" */
.product-row .form-row,
.participant-row .form-row,
.item-row .form-row:last-child {
    align-items: center;
}

/* Кнопки действий в модалке */
.modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-4);
}

@media (max-width: 480px) {
    .modal-content {
        padding: var(--space-4);
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    .modal {
        padding: 0;
    }
    .modal .form-row {
        flex-direction: column;
        gap: var(--space-3);
    }
    .modal .form-group {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .modal input[type="date"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        padding: var(--space-2) !important;
        padding-right: 30px !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        position: relative;
    }
    .modal input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        padding: 0;
        margin: 0;
        cursor: pointer;
        background-color: transparent;
    }
    .modal input[type="date"]::-webkit-inner-spin-button,
    .modal input[type="date"]::-webkit-clear-button {
        display: none;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: var(--space-3);
    }
    .modal input[type="date"] {
        font-size: 14px !important;
        padding-right: 28px !important;
    }
}

/* -------------------- ВКЛАДКИ (TABS) И КНОПКА "ДОБАВИТЬ" -------------------- */
.tabs-container {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    border-bottom: 2px solid var(--gray-200);
    min-width: 0;
}

.tab {
    padding: var(--space-2) var(--space-5);
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    background: none;
    margin-bottom: -2px;
    white-space: nowrap;
    text-decoration: none;
}
.tab:hover {
    color: var(--gray-700);
    background: rgba(0,0,0,0.02);
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.add-button {
    white-space: nowrap;
}

@media (max-width: 599px) {
    .tabs-container {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-1);
        scrollbar-width: thin;
        border-bottom: none;
    }
    .tabs::-webkit-scrollbar {
        height: 4px;
    }
    .tabs::-webkit-scrollbar-thumb {
        background-color: var(--gray-400);
        border-radius: 4px;
    }
    .tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .add-button {
        width: 100%;
    }
}

/* -------------------- ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ -------------------- */
.flex-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
}
@media (min-width: 600px) {
    .flex-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-4);
    }
}

.badge, .category-badge {
    background: var(--gray-100);
    padding: var(--space-1) var(--space-3);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    display: inline-block;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--gray-400);
    font-style: italic;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
}

/* -------------------- ДОПОЛНИТЕЛЬНЫЕ КЛАССЫ ДЛЯ МОДУЛЕЙ -------------------- */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-weight: 500;
}
.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}
.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}
.btn-block {
    width: 100%;
}
.sort-indicator {
    font-size: 0.8em;
    margin-left: 4px;
}
.date-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-end;
    margin-bottom: var(--space-4);
}
.date-filter > div {
    flex: 1 1 200px;
    min-width: 150px;
}
.date-filter .btn,
.date-filter .reset-btn {
    flex: 0 0 auto;
}

/* ===== МОБИЛЬНЫЕ КАРТОЧКИ (общие) ===== */
.mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.mobile-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-card__date {
    font-weight: 600;
    font-size: var(--font-size-xs);
    color: var(--primary);
    background: var(--primary-light);
    padding: var(--space-1) var(--space-2);
    border-radius: 20px;
}

.mobile-card__id {
    font-weight: 500;
    color: var(--gray-600);
    margin-left: auto;
}

.mobile-card__body {
    display: grid;
    grid-template-columns: minmax(100px, auto) 1fr;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.mobile-card__row {
    display: contents;
}

.mobile-card__label {
    grid-column: 1;
    color: var(--gray-600);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.mobile-card__value {
    grid-column: 2;
    font-size: var(--font-size-sm);
    word-break: break-word;
}

.mobile-card__actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-3);
}

/* ===== СТАТУСЫ КАНДИДАТОВ (цветные бейджи) ===== */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.status-badge.new {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid #007bff;
}
.status-badge.review,
.status-badge.\x6e\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}
.status-badge.interview,
.status-badge.\u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}
.status-badge.accepted,
.status-badge.\u043f\u0440\u0438\u043d\u044f\u0442 {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid #28a745;
}
.status-badge.rejected,
.status-badge.\u043e\u0442\u043a\u043b\u043e\u043d\u0451\u043d {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}
.status-badge.reserve,
.status-badge.\u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435 {
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
    border: 1px solid #6f42c1;
}

/* ===== КАНБАН-ДОСКА (для модуля кандидатов) ===== */
.kanban-board {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: var(--space-3);
    min-height: 500px;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.kanban-column {
    min-width: 300px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
.kanban-column:hover {
    box-shadow: var(--shadow-md);
}
.kanban-header {
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-card);
    border-bottom: 2px solid var(--gray-200);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    backdrop-filter: blur(2px);
}
/* На десктопе шапку можно перетаскивать (для Sortable) */
@media (min-width: 769px) {
    .kanban-header {
        cursor: grab;
        user-select: none;
    }
    .kanban-header:active {
        cursor: grabbing;
    }
}
.kanban-header .counter {
    background: var(--gray-200);
    padding: 0 var(--space-2);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    color: var(--gray-700);
    margin-left: var(--space-2);
}
.kanban-cards {
    flex: 1;
    min-height: 200px;
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    transition: var(--transition);
    position: relative;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
/* Десктоп: перетаскивание активно */
@media (min-width: 769px) {
    .kanban-card {
        cursor: grab;
        box-shadow: var(--shadow-sm);
    }
    .kanban-card:active {
        cursor: grabbing;
    }
    .kanban-card:hover {
        border-color: var(--gray-300);
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }
    /* Стили для Sortable (только на десктопе) */
    .sortable-ghost {
        opacity: 0.3;
        background: #e9ecef;
        border: 1px dashed #6c757d;
    }
    .sortable-drag {
        opacity: 0.7;
        transform: scale(1.02);
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
}
/* Мобильные: карточка кликабельна, перетаскивание отключено, следы удалены */
@media (max-width: 768px) {
    .kanban-card {
        cursor: pointer;
        touch-action: auto;
    }
    .kanban-card:active {
        background: var(--gray-100);
        transform: scale(0.99);
    }
    /* Полностью скрываем классы, связанные с перетаскиванием */
    .sortable-ghost, .sortable-drag, .sortable-fallback {
        display: none !important;
    }
    .kanban-card.sortable-drag {
        display: none;
    }
    .kanban-header {
        cursor: default;
    }
    .kanban-header:active {
        cursor: default;
    }
}
.kanban-card .card-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}
.kanban-card .card-position {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}
.kanban-card .card-details {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--space-2);
    border-top: 1px dashed var(--gray-200);
    padding-top: var(--space-2);
}
.kanban-card .skill-tag {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    color: var(--gray-700);
    margin-right: 4px;
    display: inline-block;
    margin-bottom: 4px;
}
.card-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Тонкая полоса прокрутки внутри колонок */
.kanban-column::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
}
.kanban-column::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-column::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
.kanban-column::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
/* Цветные шапки колонок */
.kanban-header.status-new {
    background-color: #e3f2fd;
    border-bottom-color: #90caf9;
    color: #0d3c61;
}
.kanban-header.status-review {
    background-color: #fff3e0;
    border-bottom-color: #ffcc80;
    color: #5d3a1a;
}
.kanban-header.status-interview {
    background-color: #e8eaf6;
    border-bottom-color: #9fa8da;
    color: #1a237e;
}
.kanban-header.status-rejected {
    background-color: #ffebee;
    border-bottom-color: #ef9a9a;
    color: #8b3c3c;
}
.kanban-header.status-accepted {
    background-color: #e8f5e9;
    border-bottom-color: #a5d6a7;
    color: #1e3a1e;
}
.kanban-header.status-reserve {
    background-color: #f3e5f5;
    border-bottom-color: #ce93d8;
    color: #4a2c5e;
}
/* Адаптация канбана на мобильных */
@media (max-width: 768px) {
    .kanban-board {
        gap: 12px;
    }
    .kanban-column {
        min-width: 280px;
        max-height: calc(100vh - 150px);
    }
    .kanban-card {
        padding: 10px;
    }
    .kanban-header {
        padding: 14px 16px;
        font-size: 1rem;
    }
    .kanban-board {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

/* ===== АВАТАР-ЗАГЛУШКА (квадратные, цветные по статусу) ===== */
.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    background: #e0e0e0;
    color: #555;
    transition: var(--transition);
}
.avatar-placeholder.status-new {
    background: #e3f2fd !important;
    color: #0d3c61 !important;
}
.avatar-placeholder.status-review {
    background: #fff3e0 !important;
    color: #5d3a1a !important;
}
.avatar-placeholder.status-interview {
    background: #e8eaf6 !important;
    color: #1a237e !important;
}
.avatar-placeholder.status-rejected {
    background: #ffebee !important;
    color: #8b3c3c !important;
}
.avatar-placeholder.status-accepted {
    background: #e8f5e9 !important;
    color: #1e3a1e !important;
}
.avatar-placeholder.status-reserve {
    background: #f3e5f5 !important;
    color: #4a2c5e !important;
}
.avatar-placeholder.status-default {
    background: #e0e0e0 !important;
    color: #555 !important;
}
.mobile-card-photo .avatar-placeholder {
    width: 48px !important;
    height: 48px !important;
    font-size: 16px;
}
.kanban-card .avatar-placeholder {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px;
}

/* ===== ФОТО-ПРЕВЬЮ В МОДАЛЬНОМ ОКНЕ ===== */
.photo-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}
#photo-preview {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}
#photo-preview > div {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}
#photo-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
}
.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
    transition: all 0.2s;
}
.photo-remove-btn:hover {
    background-color: var(--danger-hover);
    transform: scale(1.1);
}
.existing-photo {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}
.existing-photo img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
}
.photos-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}
.photos-container a {
    display: block;
    flex-shrink: 0;
}
.photos-container img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    transition: transform 0.2s;
}
.photos-container img:hover {
    transform: scale(1.1);
}
.mobile-photos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mobile-photo-item {
    display: block;
    flex-shrink: 0;
}
.mobile-photo-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
}

/* ===== ЧЕКБОКСЫ (квадратные) ===== */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    cursor: pointer;
    outline: none;
    border: 1px solid var(--gray-400);
    border-radius: 0;
    background: white;
    transition: all 0.15s ease;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: inline-block;
    position: relative;
}
input[type="checkbox"]:checked {
    background-color: #28a745;
    border-color: #28a745;
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}
input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 2px var(--primary-light);
}
@media (max-width: 768px) {
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }
    input[type="checkbox"]:checked::after {
        width: 5px;
        height: 10px;
        border-width: 0 2px 2px 0;
    }
}

/* ===== СВОРАЧИВАЕМЫЕ КАРТОЧКИ ===== */
.collapsible {
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease, border 0.3s ease;
    max-height: 2000px;
}
.collapsible.collapsed {
    max-height: 60px;
    padding: 0;
    margin-bottom: var(--space-2);
    border: none;
    background: transparent;
    box-shadow: none;
}
.collapsible.collapsed .card-title {
    margin-bottom: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}
.collapsible .card-title {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}
.collapsible .card-title::after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--gray-500);
    transition: transform 0.2s;
}
.collapsible.collapsed .card-title::after {
    transform: translateY(-50%) rotate(-90deg);
}
.collapsible.collapsed > *:not(.card-title) {
    display: none;
}

/* ===== КНОПКИ МАССОВЫХ ОПЕРАЦИЙ, ЭКСПОРТ ===== */
.mass-delete-btn, .excel-link, .counter-badge, .action-btn {
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.mass-delete-btn:hover, .excel-link:hover, .action-btn:hover {
    background-color: #f1f3f5;
    border-color: #adb5bd;
    color: #333;
}
.counter-badge {
    background-color: #f0f0f0;
    cursor: default;
}
.action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: 8px;
}
.bulk-actions-bar {
    background: #f1f3f5;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .action-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        justify-content: flex-start;
    }
    .action-bar__buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .mass-delete-btn, .action-btn, .excel-link {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 4px 10px;
        font-size: 0.75rem;
        gap: 4px;
        min-height: 32px;
    }
    .counter-badge {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    .bulk-actions-bar {
        flex-wrap: wrap;
    }
}

/* -------------------- ОСТАЛЬНЫЕ МОДУЛИ (kamaz, reports, logs, zarplata, prikhody и т.д.) -------------------- */
/* Здесь сохранены ваши оригинальные стили без изменений */
.prikhody-module .desktop-view { display: block; }
.prikhody-module .mobile-view { display: none; }
@media (max-width: 768px) {
    .prikhody-module .desktop-view { display: none; }
    .prikhody-module .mobile-view { display: block; }
}
.raskhody-module .desktop-view { display: block; }
.raskhody-module .mobile-view { display: none; }
@media (max-width: 768px) {
    .raskhody-module .desktop-view { display: none; }
    .raskhody-module .mobile-view { display: block; }
}
.prikhody-module .col-description,
.prikhody-module .col-comment {
    white-space: normal !important;
    word-break: break-word;
    max-width: 600px;
}
.raskhody-module td[data-label="Описание"],
.raskhody-module td[data-label="Комментарий"],
.raskhody-module td[data-label="Источник"] {
    white-space: normal !important;
    word-break: break-word;
    max-width: 600px;
}
@media (max-width: 768px) {
    #employeeDetailsModal .table-wrapper {
        display: block !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        max-height: none !important;
        border: 1px solid var(--gray-200) !important;
        background: white !important;
        position: static !important;
        box-shadow: none !important;
    }
    #employeeDetailsModal .table-wrapper table {
        display: table !important;
        width: 100% !important;
    }
    #employeeDetailsModal .table-wrapper thead {
        display: table-header-group !important;
    }
    #employeeDetailsModal .table-wrapper tbody {
        display: table-row-group !important;
    }
    #employeeDetailsModal .table-wrapper tr {
        display: table-row !important;
    }
    #employeeDetailsModal .table-wrapper th,
    #employeeDetailsModal .table-wrapper td {
        display: table-cell !important;
        text-align: left !important;
        padding: var(--space-2) var(--space-3) !important;
        border-bottom: 1px solid var(--gray-200) !important;
        white-space: nowrap !important;
        flex: none !important;
    }
    #employeeDetailsModal .table-wrapper td::before {
        content: none !important;
    }
}
.prikhody-module td.col-description,
.prikhody-module td.col-comment {
    white-space: normal !important;
    word-break: break-word;
    max-width: 600px;
}
.prikhody-module td.col-amount,
.prikhody-module td.col-spent,
.prikhody-module td.col-remaining,
.prikhody-module td.col-id,
.prikhody-module td.col-date,
.prikhody-module td.col-source_type,
.prikhody-module td.col-payment_form,
.prikhody-module td.col-purpose {
    white-space: nowrap;
}
.otgruzka-filters-card .filter-group {
    gap: 15px;
}
.otgruzka-filters-card .filter-actions {
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}
@media (max-width: 768px) {
    .otgruzka-filters-card .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .otgruzka-filters-card .filter-actions {
        justify-content: stretch;
        margin-left: 0;
    }
    .otgruzka-filters-card .filter-actions button,
    .otgruzka-filters-card .filter-actions a {
        flex: 1;
        text-align: center;
    }
}
#prikhody-table td.col-description,
#prikhody-table td.col-comment {
    min-width: 200px;
    max-width: 400px;
    width: auto;
    white-space: normal !important;
    word-break: break-word;
}
.prikhody-module .mobile-card__value {
    word-break: break-word;
}

/* Логи */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.logs-table th, .logs-table td {
    padding: 8px;
    border: 1px solid #ddd;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.logs-table th:nth-child(1) { width: 60px; }
.logs-table th:nth-child(2) { width: 120px; }
.logs-table th:nth-child(3) { width: 140px; }
.logs-table th:nth-child(4) { width: 100px; }
.logs-table th:nth-child(5) { width: 60px; }
.logs-table th:nth-child(6) { width: 300px; }
.logs-table th:nth-child(7) { width: 110px; }
.logs-table th:nth-child(8) { width: 150px; }
.log-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.log-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 500;
}
.log-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-card__row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.log-card__label {
    font-weight: 500;
    color: var(--gray-600);
    min-width: 90px;
    flex-shrink: 0;
}
.log-card__value {
    flex: 1;
    word-break: break-word;
}
@media (max-width: 400px) {
    .log-card__row {
        flex-direction: column;
    }
    .log-card__label {
        margin-bottom: 2px;
    }
}
@media (max-width: 767px) {
    .logs-table-wrapper {
        display: none;
    }
}
.filter-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.filter-actions-end {
    align-self: end;
}
.log-details-cell {
    word-break: break-word;
    white-space: normal;
}

/* Прочие стили для preview файлов, детализации зарплаты и т.д. */
.preview-item {
    position: relative;
    display: inline-block;
    margin: 0 5px 5px 0;
}
.preview-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-remove-btn:hover {
    background: #b02a37;
    transform: scale(1.05);
}
.doc-preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}
.doc-preview-icon {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
}
.file-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}
.file-thumb-mobile {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}
.file-icon-mobile {
    display: inline-block;
    font-size: 24px;
    text-decoration: none;
    margin-right: 5px;
}
.mobile-item-detail {
    background: #f0f0f0;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
input.readonly-bg,
input[readonly].readonly-bg {
    background-color: #f0f0f0 !important;
}
.mobile-card__header .row-selector {
    margin-right: 8px;
}
.details-table {
    width: 100%;
    background: #f9f9f9;
    border-collapse: collapse;
}
.details-table th,
.details-table td {
    border: 1px solid var(--gray-300);
    padding: var(--space-2);
    text-align: left;
}
.details-table th {
    background: var(--gray-100);
    font-weight: 600;
}
.details-mobile-item {
    background: #f0f0f0;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
}
.details-mobile-item div {
    margin-bottom: 4px;
}
.expand-btn {
    cursor: pointer;
}
.items-count-badge {
    font-weight: normal;
    color: #666;
    font-size: 0.9em;
}
.remove-item-btn {
    padding: 8px 12px;
}
.loading-placeholder {
    padding: 20px;
    text-align: center;
}
.error-placeholder {
    color: #dc3545;
    padding: 10px;
}
.clickable-amount {
    cursor: pointer;
    text-decoration: underline;
    color: #0b5e9e;
}
.clickable-amount:hover {
    color: #084a7d;
}
.advance-row {
    /* без фона */
}
.to-pay {
    color: var(--success);
    cursor: pointer;
    text-decoration: underline;
}
.to-pay:hover {
    color: var(--success-hover);
}
.debt {
    color: var(--danger);
    font-weight: bold;
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}
.text-muted {
    color: var(--gray-500);
}
.hidden {
    display: none !important;
}
.separator {
    margin: var(--space-3) 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}
.no-resize {
    resize: none;
    min-height: 44px;
}
.filter-form {
    margin-bottom: var(--space-3);
}
.add-item-btn {
    margin-bottom: 15px;
}
.document-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.th-checkbox {
    width: 30px;
}
.item-row {
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #f9f9f9;
}
.item-row .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.item-row .form-row:last-child {
    margin-bottom: 0;
}
.item-row .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.item-row .form-row:first-child .form-group:nth-child(1) {
    flex: 2;
}
.item-row .form-row:first-child .form-group:nth-child(2) {
    flex: 1.5;
}
.item-row .form-row:nth-child(2) {
    align-items: flex-end;
}
.item-row .form-row:nth-child(2) .form-group {
    flex: 1;
}
.item-row .form-row:nth-child(2) .form-group.delete-btn {
    flex: 0 0 auto;
}
.checkbox-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.checkbox-container input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin-right: 8px;
}
.checkbox-container label {
    margin-bottom: 0;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.total-value.negative {
    color: var(--danger);
}
.sub-tabs-container {
    margin-bottom: 20px;
}
.sub-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: thin;
}
.sub-tabs::-webkit-scrollbar {
    height: 4px;
}
.sub-tabs::-webkit-scrollbar-thumb {
    background-color: var(--gray-400);
    border-radius: 4px;
}
.sub-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--gray-600);
    display: inline-block;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
}
.sub-tab:hover {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}
.sub-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.mobile-cards {
    display: none;
}
@media (max-width: 767px) {
    .mobile-cards {
        display: block;
    }
    .table-wrapper {
        display: none;
    }
}
#prikhodSearch {
    margin-bottom: var(--space-4);
    padding-right: 48px;
    width: 100%;
    box-sizing: border-box;
}
.prikhod-selector-modal .modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10;
    background: var(--bg-card);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.prikhod-selector-modal .modal-close:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.prikhod-selector-wrapper {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-top: 0;
}
.prikhod-selector-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    min-width: 700px;
}
.prikhod-selector-table th,
.prikhod-selector-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.prikhod-selector-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--gray-300);
}
.prikhod-selector-table tbody tr:hover td {
    background: var(--gray-100);
}
.prikhod-selector-table td:first-child,
.prikhod-selector-table th:first-child {
    text-align: center;
}
.prikhod-selector-table th:nth-child(1),
.prikhod-selector-table td:nth-child(1) { width: 50px; }
.prikhod-selector-table th:nth-child(2),
.prikhod-selector-table td:nth-child(2) { width: 90px; }
.prikhod-selector-table th:nth-child(3),
.prikhod-selector-table td:nth-child(3) { width: 130px; }
.prikhod-selector-table th:nth-child(4),
.prikhod-selector-table td:nth-child(4) { width: auto; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prikhod-selector-table th:nth-child(5),
.prikhod-selector-table td:nth-child(5),
.prikhod-selector-table th:nth-child(6),
.prikhod-selector-table td:nth-child(6),
.prikhod-selector-table th:nth-child(7),
.prikhod-selector-table td:nth-child(7) { width: 90px; text-align: right; }
@media (max-width: 768px) {
    .prikhod-selector-modal .modal-content {
        overflow-x: auto;
        padding: var(--space-3);
    }
    .prikhod-selector-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-sm);
    }
    .prikhod-selector-table {
        min-width: 600px;
        width: auto;
    }
    .prikhod-selector-table thead {
        display: table-header-group;
    }
}
.prikhod-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.selected-info {
    color: var(--gray-700);
    font-size: 0.9rem;
}
.quick-create-btn {
    background-color: #e8f0fe;
}
.quick-create-btn:hover {
    background-color: #d4e4fc;
}
body.modal-open {
    overflow: hidden;
}
@media (max-width: 599px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
/* ===== КОНЕЦ ФАЙЛА ===== */