/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(79, 195, 247, 0.05);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Journal table grid + centered headers.
   1.10.194: плотность данных 13px (не трогает body). Откат → 1.10.193. */
.table.journal-table {
    border-collapse: collapse;
    font-size: var(--font-size-data);
    line-height: var(--line-height-data);
}

.table.journal-table thead th {
    text-align: center;
    vertical-align: middle;
    padding: 8px 10px;
    font-size: var(--font-size-data);
    font-weight: 600;
    line-height: var(--line-height-data);
}

.table.journal-table th,
.table.journal-table td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    vertical-align: middle;
}

.table.journal-table th,
.table.journal-table td {
    padding: 6px 8px;
}

/* Mixed alignment for specific journal columns */
.table.journal-table.journal-table--briefings th:nth-child(4),
.table.journal-table.journal-table--briefings th:nth-child(5),
.table.journal-table.journal-table--briefings th:nth-child(6),
.table.journal-table.journal-table--briefings th:nth-child(7),
.table.journal-table.journal-table--briefings td:nth-child(4),
.table.journal-table.journal-table--briefings td:nth-child(5),
.table.journal-table.journal-table--briefings td:nth-child(6),
.table.journal-table.journal-table--briefings td:nth-child(7),
.table.journal-table.journal-table--fire-briefings th:nth-child(4),
.table.journal-table.journal-table--fire-briefings th:nth-child(5),
.table.journal-table.journal-table--fire-briefings th:nth-child(6),
.table.journal-table.journal-table--fire-briefings th:nth-child(7),
.table.journal-table.journal-table--fire-briefings td:nth-child(4),
.table.journal-table.journal-table--fire-briefings td:nth-child(5),
.table.journal-table.journal-table--fire-briefings td:nth-child(6),
.table.journal-table.journal-table--fire-briefings td:nth-child(7),
.table.journal-table.journal-table--electrical-briefings th:nth-child(4),
.table.journal-table.journal-table--electrical-briefings th:nth-child(5),
.table.journal-table.journal-table--electrical-briefings th:nth-child(6),
.table.journal-table.journal-table--electrical-briefings th:nth-child(7),
.table.journal-table.journal-table--electrical-briefings td:nth-child(4),
.table.journal-table.journal-table--electrical-briefings td:nth-child(5),
.table.journal-table.journal-table--electrical-briefings td:nth-child(6),
.table.journal-table.journal-table--electrical-briefings td:nth-child(7),
.table.journal-table.journal-table--med-briefings th:nth-child(3),
.table.journal-table.journal-table--med-briefings th:nth-child(4),
.table.journal-table.journal-table--med-briefings th:nth-child(5),
.table.journal-table.journal-table--med-briefings th:nth-child(6),
.table.journal-table.journal-table--med-briefings td:nth-child(3),
.table.journal-table.journal-table--med-briefings td:nth-child(4),
.table.journal-table.journal-table--med-briefings td:nth-child(5),
.table.journal-table.journal-table--med-briefings td:nth-child(6),
.table.journal-table.journal-table--work-permits th:nth-child(4),
.table.journal-table.journal-table--work-permits th:nth-child(5),
.table.journal-table.journal-table--work-permits th:nth-child(6),
.table.journal-table.journal-table--work-permits th:nth-child(7),
.table.journal-table.journal-table--work-permits th:nth-child(8),
.table.journal-table.journal-table--work-permits td:nth-child(4),
.table.journal-table.journal-table--work-permits td:nth-child(5),
.table.journal-table.journal-table--work-permits td:nth-child(6),
.table.journal-table.journal-table--work-permits td:nth-child(7),
.table.journal-table.journal-table--work-permits td:nth-child(8),
.table.journal-table.journal-table--manager-work-permits th:nth-child(2),
.table.journal-table.journal-table--manager-work-permits th:nth-child(3),
.table.journal-table.journal-table--manager-work-permits th:nth-child(4),
.table.journal-table.journal-table--manager-work-permits th:nth-child(5),
.table.journal-table.journal-table--manager-work-permits td:nth-child(2),
.table.journal-table.journal-table--manager-work-permits td:nth-child(3),
.table.journal-table.journal-table--manager-work-permits td:nth-child(4),
.table.journal-table.journal-table--manager-work-permits td:nth-child(5),
.table.journal-table.journal-table--safety-orders th:nth-child(1),
.table.journal-table.journal-table--safety-orders th:nth-child(3),
.table.journal-table.journal-table--safety-orders th:nth-child(5),
.table.journal-table.journal-table--safety-orders th:nth-child(6),
.table.journal-table.journal-table--safety-orders td:nth-child(1),
.table.journal-table.journal-table--safety-orders td:nth-child(3),
.table.journal-table.journal-table--safety-orders td:nth-child(5),
.table.journal-table.journal-table--safety-orders td:nth-child(6),
.table.journal-table.journal-table--siz-journal th:nth-child(1),
.table.journal-table.journal-table--siz-journal th:nth-child(5),
.table.journal-table.journal-table--siz-journal th:nth-child(6),
.table.journal-table.journal-table--siz-journal th:nth-child(7),
.table.journal-table.journal-table--siz-journal th:nth-child(8),
.table.journal-table.journal-table--siz-journal th:nth-child(9),
.table.journal-table.journal-table--siz-journal td:nth-child(1),
.table.journal-table.journal-table--siz-journal td:nth-child(5),
.table.journal-table.journal-table--siz-journal td:nth-child(6),
.table.journal-table.journal-table--siz-journal td:nth-child(7),
.table.journal-table.journal-table--siz-journal td:nth-child(8),
.table.journal-table.journal-table--siz-journal td:nth-child(9) {
    text-align: center;
    vertical-align: middle;
}

/* Unified "Actions" column width across OT journals */
.table.journal-table.journal-table--briefings th:nth-child(7),
.table.journal-table.journal-table--briefings td:nth-child(7),
.table.journal-table.journal-table--fire-briefings th:nth-child(7),
.table.journal-table.journal-table--fire-briefings td:nth-child(7),
.table.journal-table.journal-table--electrical-briefings th:nth-child(7),
.table.journal-table.journal-table--electrical-briefings td:nth-child(7),
.table.journal-table.journal-table--med-briefings th:nth-child(6),
.table.journal-table.journal-table--med-briefings td:nth-child(6),
.table.journal-table.journal-table--work-permits th:nth-child(8),
.table.journal-table.journal-table--work-permits td:nth-child(8),
.table.journal-table.journal-table--manager-work-permits th:nth-child(5),
.table.journal-table.journal-table--manager-work-permits td:nth-child(5),
.table.journal-table.journal-table--safety-orders th:nth-child(6),
.table.journal-table.journal-table--safety-orders td:nth-child(6),
.table.journal-table.journal-table--siz-journal th:nth-child(9),
.table.journal-table.journal-table--siz-journal td:nth-child(9) {
    width: 200px;
    min-width: 200px;
}

/* Employee list aligned like OT journals */
.table.journal-table.journal-table--employees th:nth-child(2),
.table.journal-table.journal-table--employees td:nth-child(2),
.table.journal-table.journal-table--employees th:nth-child(3),
.table.journal-table.journal-table--employees td:nth-child(3),
.table.journal-table.journal-table--employees th:nth-child(4),
.table.journal-table.journal-table--employees td:nth-child(4),
.table.journal-table.journal-table--employees th:nth-child(5),
.table.journal-table.journal-table--employees td:nth-child(5) {
    text-align: center;
    vertical-align: middle;
}

.table.journal-table.journal-table--employees th:nth-child(5),
.table.journal-table.journal-table--employees td:nth-child(5) {
    width: 200px;
    min-width: 200px;
}

/* Keep action buttons compact and aligned */
.table.journal-table .btn-group {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Фильтры списков. Bitrix main.ui.filter: строка 38px, текст 13px.
   ОТ (journal-filters), Работы и Договоры — те же размеры, все доп. поля. */
.row:has(> [class*="col"] > .card.journal-filters) {
    margin-bottom: 0.75rem !important;
}

.card.journal-filters > .card-body,
.works-shell .card:has(> .card-body > form[method="get"]) > .card-body {
    padding: 0.65rem 0.85rem;
}

.card.journal-filters > .card-body > .card-title {
    font-size: var(--font-size-meta);
    line-height: 1.2;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.45rem;
}

.card.journal-filters form.row,
form.journal-filters.row,
.works-shell form[method="get"].row,
.df-shell form[method="get"].row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.5rem;
}

.journal-filters .form-label,
.works-shell form[method="get"] .form-label,
.df-shell form[method="get"] .form-label {
    font-size: var(--font-size-meta);
    line-height: 1.2;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.journal-filters .form-control,
.journal-filters .form-select,
.works-shell form[method="get"] .form-control,
.works-shell form[method="get"] .form-select,
.df-shell form[method="get"] .form-control,
.df-shell form[method="get"] .form-select {
    height: var(--control-height, 38px);
    min-height: var(--control-height, 38px);
    padding: 0.2rem 0.6rem;
    font-size: var(--font-size-data);
    line-height: var(--line-height-data);
    border-radius: 6px;
}

body.app-cabinet .journal-filters .btn,
body.app-cabinet .works-shell form[method="get"] .btn {
    height: var(--control-height, 38px);
    min-height: var(--control-height, 38px);
    padding: 0 0.75rem;
    font-size: var(--font-size-data);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.app-cabinet .df-shell form[method="get"] .btn {
    height: var(--btn-height, 33px);
    min-height: var(--btn-height, 33px);
    padding: 0 12px;
    font-size: var(--font-size-data);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: auto;
}

.works-shell form[method="get"] .form-check.mt-4,
.df-shell form[method="get"] .form-check.mt-4 {
    margin-top: 0 !important;
}

.works-shell form[method="get"] .form-check,
.df-shell form[method="get"] .form-check {
    min-height: var(--control-height, 38px);
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.works-shell form[method="get"] .form-check + .form-check,
.df-shell form[method="get"] .form-check + .form-check {
    min-height: auto;
    margin-top: 0.2rem;
}

.works-shell form[method="get"] .form-check-label,
.df-shell form[method="get"] .form-check-label {
    font-size: var(--font-size-data);
    line-height: var(--line-height-data);
}