/* Групповые действия с актами: галочки в секциях + меню операций */

/* --- Галочка выбора акта ------------------------------------------------- */

.contract-section.bulk-selectable {
    position: relative;
}

.bulk-select-box {
    position: absolute;
    top: 6px;
    left: 4px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    cursor: pointer;
}

.bulk-select-box:hover {
    border-color: #1976d2;
}

.bulk-select-box input {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #1976d2;
}

/* Выбранный акт подсвечиваем рамкой — видно и при прокрутке длинного отчёта */
.contract-section.bulk-selected {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Пилюли панели ------------------------------------------------------- */

/* Размеры/шрифт — здесь, чтобы JS менял только цвета: раньше он писал весь
   cssText и затирал выставленный display:none — кнопка «Все» показывалась
   до включения режима выбора. */
.bulk-pill {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}

/* --- Меню групповых действий -------------------------------------------- */

.bulk-actions-menu {
    position: relative;
    display: inline-block;
}

.bulk-actions-btn {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    background: #1976d2;
    color: #fff;
    border: 1px solid #1976d2;
    cursor: pointer;
    font-family: inherit;
}

.bulk-actions-btn:disabled {
    background: #b0bec5;
    border-color: #b0bec5;
}

.bulk-actions-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    min-width: 260px;
}

.bulk-actions-dropdown.show {
    display: block;
}

.bulk-action-item {
    padding: 10px 16px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.bulk-action-item:last-child {
    border-bottom: none;
}

.bulk-action-item:hover {
    background-color: #f5f5f5;
}

.bulk-action-suboptions {
    display: none;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.bulk-action-suboptions.open {
    display: block;
}

.bulk-action-item.sub {
    padding-left: 32px;
    font-size: 11px;
    border-bottom: 1px solid #f0f0f0;
}

.bulk-action-item.separated {
    border-top: 2px solid #e0e0e0;
}

.bulk-action-item.danger {
    color: #d32f2f;
}

.bulk-action-item.disabled {
    color: #bdbdbd;
    cursor: default;
    background: none;
}

/* --- Фильтр по дате договора --------------------------------------------- */

.contract-date-filter {
    position: relative;
    display: inline-block;
}

.contract-date-filter-panel {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    padding: 10px 12px;
    min-width: 230px;
}

.contract-date-filter-panel.show {
    display: block;
}

.contract-date-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #444;
}

.contract-date-filter-row:last-child {
    margin-bottom: 0;
}

.contract-date-filter-row label {
    width: 74px;
    flex-shrink: 0;
}

.contract-date-filter-row select,
.contract-date-filter-row input {
    flex: 1;
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
}

.contract-date-filter-reset {
    margin-top: 8px;
    font-size: 11px;
    color: #1976d2;
    cursor: pointer;
    text-align: right;
}

/* Печать отчёта не должна тащить служебные элементы выбора */
body.print-mode .bulk-select-box,
body.print-mode .bulk-actions-bar,
body.print-mode .contract-date-filter {
    display: none !important;
}

body.print-mode .contract-section.bulk-selected {
    outline: none;
}
