:root {
    --office-table-blue: #1E3F6E;
    --office-table-border: #ddd;
    --office-table-soft: #f5f7fb;
    --office-table-zebra: #fbfcfe;
    --office-control-border: #d7dee8;
    --office-control-focus: #2b6cb0;}


.config-page-header {
    gap: 0.75rem;
    margin-bottom: 0.35rem !important;
    padding: 0;
    background: #fff;
}

.config-page-header h4 {
    color: var(--office-table-blue);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0;
}

.data-grid-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 8px;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.data-grid-title {
    color: var(--office-table-blue);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
}
.data-grid-title-block {
    min-width: 0;
}

.data-grid-selection-summary {
    display: none;
    max-width: 100%;
    margin-top: 0.1rem;
    color: #4b5563;
    font-size: 0.72rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-grid-title-row .pagination-wrapper {
    justify-content: flex-end;
    margin-left: auto;
}
.config-page-header .btn {
    font-size: 0.78rem;
}

.theoffice-location-marker {
    background: transparent;
    border: 0;
}

.theoffice-place-marker {
    background: transparent;
    border: 0;
}

.theoffice-location-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--pin-color, #198754);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.theoffice-place-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--pin-color, #0d6efd);
    color: #fff;
    font-size: 0.92rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.theoffice-location-popup {
    min-width: 11rem;
    color: #1f2937;
    font-size: 0.78rem;
    line-height: 1.45;
}

.theoffice-location-popup strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--office-table-blue);
}

.theoffice-place-visit-popup {
    max-width: 20rem;
}

.theoffice-place-visit-detail {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid #e2e8f0;
}

.location-page {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.location-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.78rem;
}

.location-map-shell {
    position: relative;
    min-height: 28rem;
    height: calc(100vh - 16rem);
    border: 1px solid #cbd5e1;
    overflow: hidden;
    background: #eef2f7;
}

.location-map {
    width: 100%;
    height: 100%;
}

.location-map-loading,
.location-map-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    font-size: 0.82rem;
    transform: translate(-50%, -50%);
}

.location-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.78rem;
}

.location-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
}

.legend-dot.active {
    background: #198754;
}

.legend-dot.stale {
    background: #ffc107;
}

.legend-dot.inactive {
    background: #6c757d;
}

.legend-dot.place {
    background: #0d6efd;
}

.mobile-place-editor-map-shell {
    min-height: 24rem;
    height: 24rem;
}

.config-page-header .btn,
.config-table-toolbar .btn,
.config-pagination-controls .btn,
.table-transfer-toolbar .btn,
.table-transfer-import-button,
.data-grid-back-button,
.data-grid-title-actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 1.8rem !important;
    min-height: 1.8rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
}

/* Tabla fluida */
.table-config .category-description-cell {
    width: 4.75rem !important;
    min-width: 4.75rem !important;
    max-width: 4.75rem !important;
    text-align: center;
}

.config-categories-table col.col-description { width: 4.75rem; }

.table-config {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    table-layout: fixed;
}

    /* Columnas fijas */
    .table-config col.fixed-col {
        width: 80px;
    }

    .table-config col.col-action {
        width: 80px;
    }

    /* Columnas autoexpandibles con ancho minimo */
    .table-config col.autoexpand-col {
        min-width: 120px;
    }

    /* Columnas seleccionables con ancho fijo */
    .table-config col.select-col {
        width: 180px;
        min-width: 120px;
    }

    .table-config td.select-col {
        min-width: 120px;
    }


.table-config th {
        background: var(--office-table-blue);
        color: #fff;
        font-weight: 600;
        padding: 3px 5px;
        border: 0;
        border-bottom: 1px solid var(--office-table-border);
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-config td {
        padding: 2px 5px;
        border: 0;
        border-bottom: 1px solid var(--office-table-border);
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-config tbody tr:nth-child(even) {
        background-color: var(--office-table-zebra);
    }

    .table-config tbody tr:hover {
        background-color: var(--office-table-soft);
    }

    /* Inputs y selects compactos */
    .table-config input:not([type="checkbox"]),
    .table-config select,
    .table-config textarea {
        width: 100%;
        min-width: 0;
        min-height: 1.35rem;
        box-sizing: border-box;
        padding: 1px 4px;
        font-size: 0.78rem;
        line-height: 1.2;
        color: inherit;
        background-color: #fff;
        border: 1px solid var(--office-control-border);
        border-radius: 0.2rem;
        box-shadow: none;
    }

    .table-config input:not([type="checkbox"]):hover,
    .table-config select:hover,
    .table-config textarea:hover {
        border-color: #b9c7d8;
    }

    .table-config input:not([type="checkbox"]):focus,
    .table-config select:focus,
    .table-config textarea:focus {
        border-color: var(--office-control-focus);
        outline: 0;
        box-shadow: 0 0 0 1px rgba(43, 108, 176, 0.18);
    }

    .table-config input[readonly],
    .table-config input:disabled,
    .table-config select:disabled,
    .table-config textarea:disabled {
        color: #6c757d;
        background-color: #f3f6fa;
    }

    .table-config textarea {
        resize: vertical;
        white-space: normal;
    }

    /* Checkbox */
    .table-config .form-check-input {
        margin: 0;
        padding: 0;
        width: 0.85rem;
        height: 0.85rem;
        min-height: 0;
        vertical-align: middle;
        cursor: pointer;
        display: inline-block;
    }

/* Celdas numericas */
.numeric-col {
    text-align: center;
}

.table-config .numeric-col input {
    text-align: right;
}

/* Celda de acciones */
.table-config th.action-cell {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
    border-bottom: 1px solid var(--office-table-border) !important;
}

.table-config td.action-cell,
.table-config td.action-cell.d-flex {
    display: table-cell !important;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 2px 5px;
    border-bottom: 1px solid var(--office-table-border) !important;
    background-color: transparent !important;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    position: relative;
}

.table-config td.action-cell .btn-icon + .btn-icon {
    margin-left: 0.2rem;
}

/* Botones icono sin bordes */
.btn-icon {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    line-height: 1;
}

.btn-icon:disabled,
.btn-icon.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon:disabled i,
.btn-icon.disabled i {
    color: #9aa3af !important;
}
/* Iconos */
.table-config td.action-cell i.bi-check-lg {
    color: #198754;
}

    .table-config td.action-cell i.bi-check-lg:hover {
        color: #157347;
    }

.table-config td.action-cell i.bi-trash-fill {
    color: #dc3545;
}

    .table-config td.action-cell i.bi-trash-fill:hover {
        color: #bb2d3b;
    }

.config-table-toolbar {
    width: 100%;
    margin-bottom: 0.35rem !important;
    padding: 0;
    overflow: visible;
    background: #fff;
}

.config-table-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.config-table-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.config-table-toolbar-actions .btn {
    font-size: 0.78rem;
    min-height: 1.8rem;
}

.config-table-toolbar-actions .pagination-wrapper {
    justify-content: flex-end;
}
.config-table-toolbar label,
.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input,
.config-table-toolbar select {
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
}

.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input:not([type="checkbox"]),
.config-table-toolbar select {
    height: 1.8rem !important;
    min-height: 1.8rem !important;
    padding: 0.2rem 0.45rem !important;
}

.config-pagination-controls {
    align-items: center;
    gap: 0.4rem;
}

.config-pagination-controls .pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.config-pagination-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Paginacion */
.pagination-wrapper {
    display: flex;
    justify-content: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-header-cell {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 2px 0;
}

.calendar-cell {
    padding: 6px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

    .calendar-cell.empty {
        background: transparent;
        cursor: default;
    }

.day-laborable {
    background: #e8f5e9;
}

.day-capsetmana {
    background: #eeeeee;
}

.day-festiu {
    background: #ff1f1f;
}

.day-nolaborable {
    background: #ff8a65;
}

.calendar-cell:hover {
    outline: 2px solid #007bff;
}

.legend-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid #ccc;
}

.legend-number {
    font-weight: 600;
}

.legend-text {
    opacity: 0.85;
}

/* Colors coherents amb el calendari */
.legend-color.festiu {
    background: #ff1f1f;
}

.legend-color.nolaborable {
    background: #ff8a65;
}

.legend-color.laborable {
    background: #e8f5e9;
}

.legend-color.capsetmana {
    background: #eeeeee;
}

/* Unified configuration surfaces */
.config-page {
    font-size: 0.78rem;
    color: #1f2937;
}

.config-page .form-label,
.config-page .form-select,
.config-page .form-control,
.config-page .btn,
.config-page .alert {
    font-size: 0.78rem;
}

.config-page .form-label {
    color: #334155;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.config-page .form-select,
.config-page .form-control {
    min-height: 1.45rem;
    padding: 0.2rem 0.45rem;
    line-height: 1.2;
    border-color: var(--office-control-border);
    border-radius: 0.2rem;
    box-shadow: none;
}

.config-page .form-select:focus,
.config-page .form-control:focus {
    border-color: var(--office-control-focus);
    box-shadow: 0 0 0 1px rgba(43, 108, 176, 0.18);
}

.config-page .form-check-input {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0;
}

.config-page .badge {
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.mobile-required-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 18rem;
}

.mobile-required-setting {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 10.5rem;
    padding: 0.24rem 0.42rem;
    line-height: 1.15;
}

.mobile-required-setting i {
    flex: 0 0 auto;
    font-size: 0.72rem;
}

.mobile-required-setting span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-device-id-cell {
    min-width: 18rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.mobile-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-required-history-button {
    width: 1.75rem;
    height: 1.35rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-permission-history-table {
    width: 100%;
}

.mobile-devices-table .badge {
    white-space: nowrap;
}

.config-section-title,
.config-subsection-title {
    color: var(--office-table-blue);
    font-weight: 600;
    line-height: 1.25;
}

.config-section-title {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.config-subsection-title {
    font-size: 0.82rem;
    margin: 0.75rem 0 0.35rem;
}

.config-action-button,
.config-inline-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.2;
}

.config-action-button {
    padding: 0.28rem 0.65rem;
}

.config-inline-button {
    padding: 0.2rem 0.45rem;
}

.config-alert {
    padding: 0.35rem 0.55rem;
    margin-bottom: 0.65rem;
}

.config-empty-state {
    margin: 0.4rem 0;
    color: #64748b;
}

.config-form-panel {
    max-width: 560px;
    border: 1px solid var(--office-table-border);
    border-radius: 0.35rem;
    background: #fff;
    padding: 0.75rem;
}

.config-field-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.selector-config-page .form-select {
    max-width: 360px;
}

.config-two-column {
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
}

.config-split-column {
    padding-top: 0.15rem;
}

.config-split-column-left {
    border-right: 1px solid var(--office-table-border);
    padding-right: 1rem;
}

.user-management-page .col-md-7.config-split-column {
    padding-left: 1rem;
}

.user-management-table th:last-child,
.user-management-table td:last-child {
    width: 70px;
}

.user-management-table .user-active-checkbox:disabled {
    opacity: 1;
    cursor: not-allowed;
}
.user-management-table td {
    white-space: normal;
}

.user-management-table td:first-child,
.user-management-table td:nth-child(2),
.user-management-table td.action-cell {
    white-space: nowrap;
}

.config-assignment-row {
    border: 1px solid var(--office-table-border);
    border-radius: 0.35rem;
    background: #fbfcfe;
    padding: 0.55rem;
    margin-bottom: 0.45rem;
}

.config-assignment-row .d-flex.mt-2 {
    gap: 0.35rem;
}

@media (max-width: 767.98px) {
    .config-field-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .config-form-panel {
        max-width: none;
    }

    .config-split-column-left {
        border-right: 0;
        border-bottom: 1px solid var(--office-table-border);
        padding-right: 0;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .user-management-page .col-md-7.config-split-column {
        padding-left: 0;
    }
}


/* Scheduler diagnostics */
.scheduler-message,
.scheduler-error-details {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.scheduler-error-details summary {
    cursor: pointer;
    font-weight: 600;
}

.scheduler-error-details pre,
.scheduler-error-modal-panel pre {
    margin: 0.45rem 0 0;
    padding: 0.55rem;
    max-height: 55vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.74rem;
    line-height: 1.35;
    color: #111827;
    background: #fff;
    border: 1px solid #f1b7b7;
    border-radius: 0.25rem;
}

.table-config td.scheduler-error-cell {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.scheduler-error-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 1.55rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.74rem;
    line-height: 1.2;
}

.scheduler-error-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.42);
}

.scheduler-error-modal-panel {
    width: min(980px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 0.4rem;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.28);
}

.scheduler-error-modal-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #d7dee8;
    color: var(--office-table-blue);
}

.scheduler-error-modal-panel h5 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
}

.scheduler-error-modal-panel pre {
    margin: 0;
    max-height: none;
    flex: 1 1 auto;
    border: 0;
    border-radius: 0;
}

.scheduler-running {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: normal !important;
}


.scheduler-page {
    overflow-x: hidden;
}

.scheduler-table {
    width: 100%;
    table-layout: fixed;
}

.scheduler-table col.scheduler-col-enabled {
    width: 76px;
}

.scheduler-table col.scheduler-col-servers {
    width: 96px;
}

.scheduler-table col.scheduler-col-date {
    width: 126px;
}

.scheduler-table col.scheduler-col-duration {
    width: 78px;
}

.scheduler-table col.scheduler-col-result {
    width: 104px;
}

.scheduler-table col.scheduler-col-actions {
    width: 92px;
}

.scheduler-table col.scheduler-col-name,
.scheduler-table col.scheduler-col-schedule {
    width: auto;
}

.scheduler-table td.action-cell,
.scheduler-table th.action-cell {
    width: 92px;
}

.scheduler-table td,
.scheduler-table th {
    min-width: 0;
}

.scheduler-table th {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
}
.table-config tbody tr.scheduler-row-running {
    background: #eaf4ff !important;
    box-shadow: inset 3px 0 0 #2b6cb0;
}

.btn-icon .spinner-border-sm {
    width: 0.8rem;
    height: 0.8rem;
    border-width: 0.12em;
}
.table-config .category-color-cell {
    min-width: 105px;
}

.table-config .category-color-picker {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.table-config .category-color-picker .form-control-color {
    width: 1.7rem;
    min-width: 1.7rem;
    height: 1.35rem;
    padding: 1px;
}

.table-config .category-color-value {
    min-width: 3.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.72rem;
}

.table-config .category-color-clear {
    width: 1.25rem;
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.68rem;
}

.table-config .category-color-clear:disabled {
    opacity: 0.25;
    cursor: default;
}

.config-rules-transfer-toolbar,
.table-transfer-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.config-rules-transfer-toolbar .btn,
.table-transfer-toolbar .btn,
.config-rules-import-button {
    margin: 0 !important;
}

.config-rules-import-button.disabled,
.table-transfer-import-button.disabled {
    pointer-events: none;
    opacity: 0.65;
}

@media print {
    canvas {
        object-fit: contain;
    }

    .sidebar,
    .top-row,
    .navbar,
    .site-footer,
    #cookieConsent,
    .cookie-modal-overlay,
    .selection-grid,
    .config-page-header button,
    .config-table-toolbar,
    .config-table-toolbar-actions,
    .data-grid-title-actions,
    .activity-detail-header-actions,
    .table-transfer-toolbar,
    .pagination-wrapper,
    .btn,
    button,
    button.btn,
    a.btn,
    label.btn,
    .btn.d-flex,
    .btn.d-inline-flex,
    .config-page-header .btn,
    .config-page-header button,
    .config-page-header a.btn,
    .data-grid-back-button,
    .detail-back-button,
    .btn-icon,
    .action-cell,
    .grid-loading-overlay,
    .activity-detail-loading-overlay {
        display: none !important;
        visibility: hidden !important;
    }
    body,
    .page,
    .content,
    main,
    article.content,
    .scroll-zone {
        background: #fff !important;
        color: #000 !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: none !important;
    }

    .config-page-header {
        margin-bottom: 0.35rem !important;
    }

    .data-grid-title-row,
    .activity-detail-header {
        display: block !important;
        margin: 0 0 0.35rem 0 !important;
    }

    .data-grid-selection-summary {
        display: block !important;
        color: #333 !important;
        font-size: 7pt !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .grid-container,
    .time-attendance-grid-container,
    .activity-detail-shell,
    .activity-detail-table-wrap {
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }

    .table-config,
    .activity-grid,
    .time-attendance-grid,
    .activity-detail-table,
    .rule-table {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        table-layout: auto !important;
        border-collapse: collapse !important;
        font-size: 6.5pt !important;
    }

    .table-config th,
    .table-config td,
    .activity-grid th,
    .activity-grid td,
    .time-attendance-grid th,
    .time-attendance-grid td,
    .activity-detail-table th,
    .activity-detail-table td,
    .rule-table th,
    .rule-table td {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: break-word !important;
        padding: 1.5pt 2pt !important;
    }

    .table-config input:not([type="checkbox"]),
    .table-config select,
    .table-config textarea {
        border: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .table-size-scroll-wrap > table thead {
        display: table-header-group;
    }

    .table-size-scroll-wrap > table thead .sortable-header-button {
        display: flex !important;
        visibility: visible !important;
    }

    .table-size-scroll-wrap > table thead .sortable-header-glyph,
    .table-size-scroll-wrap > table thead .column-resize-handle {
        display: none !important;
    }
}
.config-calendar-summary-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.config-calendar-year-select {
    width: 120px;
    min-height: 34px;
}

.config-calendar-user-select {
    width: 240px;
    min-height: 34px;
}

.config-calendar-legend {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.config-calendar-summary-row .legend-box {
    min-height: 34px;
}

.config-calendar-day-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.config-calendar-day-footer-left {
    justify-self: start;
}

.config-calendar-day-footer-center {
    justify-self: center;
}

.config-calendar-day-footer-right {
    justify-self: end;
}

@media (max-width: 767.98px) {
    .config-page-header {
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .config-page-header h4 {
        flex: 1 1 100%;
    }

    .config-table-toolbar {
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .config-table-toolbar > .form-control,
    .config-table-toolbar > .form-select,
    .config-table-toolbar > input:not([type="checkbox"]),
    .config-table-toolbar > select {
        width: 100% !important;
        max-width: none !important;
    }

    .config-table-toolbar-actions {
        width: 100%;
        margin-left: 0 !important;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.45rem;
    }

    .config-table-toolbar-actions > .btn,
    .config-table-toolbar-actions > .pagination-wrapper {
        flex: 1 1 9rem;
        min-width: 0;
    }

    .config-rules-transfer-toolbar,
    .table-transfer-toolbar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
        width: 100%;
        gap: 0.4rem;
    }

    .config-rules-transfer-toolbar .btn,
    .table-transfer-toolbar .btn,
    .config-rules-import-button,
    .table-transfer-import-button,
    .config-table-toolbar-actions > .btn,
    .data-grid-title-actions .btn {
        width: 100%;
        height: auto !important;
        min-height: 2rem !important;
        white-space: normal !important;
        text-align: center;
    }

    .config-pagination-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .config-pagination-controls .pagination-controls {
        margin-left: auto;
    }

    .config-table-toolbar + form,
    .config-table-toolbar ~ form {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .table-config,
    .rule-table {
        min-width: 760px;
        table-layout: auto;
    }

    .table-config th,
    .table-config td,
    .rule-table th,
    .rule-table td {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        vertical-align: top;
    }

    .table-config input:not([type="checkbox"]),
    .table-config select,
    .table-config textarea {
        min-width: 6.5rem;
    }

    .table-config th.action-cell,
    .table-config td.action-cell,
    .table-config td.action-cell.d-flex {
        width: 76px;
        min-width: 76px;
        max-width: 76px;
        white-space: nowrap;
        vertical-align: middle;
    }
}

/* Unified toolbar layout */
.config-table-toolbar,
.data-grid-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.config-table-toolbar {
    justify-content: space-between;
}

.config-table-toolbar-filters {
    flex: 1 1 18rem;
    min-width: 0;
}

.config-table-toolbar-actions,
.data-grid-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.config-rules-transfer-toolbar,
.table-transfer-toolbar,
.config-pagination-controls,
.config-pagination-controls .pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.config-page-header .btn,
.config-table-toolbar .btn,
.config-pagination-controls .btn,
.table-transfer-toolbar .btn,
.table-transfer-import-button,
.config-rules-transfer-toolbar .btn,
.config-rules-import-button,
.data-grid-back-button,
.data-grid-title-actions .btn {
    min-width: 0;
    height: 1.9rem !important;
    min-height: 1.9rem !important;
    padding: 0.25rem 0.55rem !important;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
    gap: 0.35rem !important;
    margin: 0 !important;
}

.config-table-toolbar .mb-3,
.data-grid-title-actions .mb-3 {
    margin-bottom: 0 !important;
}

.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input:not([type="checkbox"]),
.config-table-toolbar select {
    height: 1.9rem !important;
    min-height: 1.9rem !important;
}

.config-table-toolbar ~ .table-config,
.config-table-toolbar ~ .rule-table {
    max-width: 100%;
}

/* Unified mobile toolbar and table behavior */
@media (max-width: 767.98px) {
    .config-table-toolbar,
    .data-grid-title-row {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .config-table-toolbar-filters,
    .config-table-toolbar-actions,
    .data-grid-title-block,
    .data-grid-title-actions {
        width: 100%;
        margin-left: 0 !important;
    }

    .config-table-toolbar-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .config-table-toolbar-actions,
    .data-grid-title-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        justify-content: stretch;
        gap: 0.45rem;
    }

    .config-table-toolbar-actions > .config-rules-transfer-toolbar,
    .config-table-toolbar-actions > .table-transfer-toolbar,
    .data-grid-title-actions > .table-transfer-toolbar {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 0.45rem;
    }

    .config-table-toolbar-actions > .pagination-wrapper,
    .data-grid-title-actions > .pagination-wrapper {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
    }

    .config-pagination-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .config-pagination-controls .pagination-controls {
        margin-left: auto;
    }

    .config-page-header .btn,
    .config-table-toolbar .btn,
    .config-pagination-controls .btn,
    .table-transfer-toolbar .btn,
    .table-transfer-import-button,
    .config-rules-transfer-toolbar .btn,
    .config-rules-import-button,
    .data-grid-back-button,
    .data-grid-title-actions .btn {
        width: 100%;
        height: auto !important;
        min-height: 2rem !important;
        white-space: normal !important;
        text-align: center;
    }

    .config-table-toolbar > .form-control,
    .config-table-toolbar > .form-select,
    .config-table-toolbar > input:not([type="checkbox"]),
    .config-table-toolbar > select,
    .config-table-toolbar-filters > .form-control,
    .config-table-toolbar-filters > .form-select,
    .config-table-toolbar-filters > input:not([type="checkbox"]),
    .config-table-toolbar-filters > select {
        width: 100% !important;
        max-width: none !important;
    }

    .config-table-toolbar + form,
    .config-table-toolbar ~ form,
    .config-table-toolbar ~ .table-config,
    .config-table-toolbar ~ .rule-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .table-config,
    .rule-table {
        min-width: 760px;
        table-layout: auto;
    }

    .table-config th,
    .table-config td,
    .rule-table th,
    .rule-table td {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        vertical-align: top;
    }

    .table-config th.action-cell,
    .table-config td.action-cell,
    .table-config td.action-cell.d-flex,
    .rule-table th.action-cell,
    .rule-table td.action-cell {
        position: sticky;
        right: 0;
        width: 76px;
        min-width: 76px;
        max-width: 76px;
        white-space: nowrap;
        vertical-align: middle;
        z-index: 2;
        box-shadow: -1px 0 0 var(--office-table-border);
    }

    .table-config th.action-cell,
    .rule-table th.action-cell {
        z-index: 3;
        background: var(--office-table-blue);
    }

    .table-config td.action-cell,
    .table-config td.action-cell.d-flex,
    .rule-table td.action-cell {
        background: inherit !important;
    }
}

.config-table-scroll-wrap {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .config-table-scroll-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
}

/* Final unified responsive toolbar/action-column overrides */
.config-page-header {
    margin-bottom: 0.25rem !important;
}

.config-page-header .btn {
    margin-bottom: 0 !important;
}

.config-table-toolbar,
.data-grid-title-row {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    width: 100%;
    min-width: 0;
    margin-bottom: 0.35rem !important;
}

.config-table-toolbar-filters {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.45rem !important;
    flex: 1 1 auto;
    min-width: 0;
}

.config-table-toolbar-actions,
.data-grid-title-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
    margin-left: auto !important;
    min-width: 0;
    max-width: 100%;
}

.config-rules-transfer-toolbar,
.table-transfer-toolbar,
.config-pagination-controls,
.config-pagination-controls .pagination-controls {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
    width: auto !important;
}

.config-page-header .btn,
.config-table-toolbar .btn,
.config-pagination-controls .btn,
.table-transfer-toolbar .btn,
.table-transfer-import-button,
.config-rules-transfer-toolbar .btn,
.config-rules-import-button,
.data-grid-back-button,
.data-grid-title-actions .btn {
    flex: 0 0 auto !important;
    width: auto !important;
    height: 1.9rem !important;
    min-height: 1.9rem !important;
    padding: 0.25rem 0.55rem !important;
    white-space: nowrap !important;
}

.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input:not([type="checkbox"]),
.config-table-toolbar select {
    flex: 0 1 15rem;
    width: auto !important;
    max-width: 15rem !important;
    margin-bottom: 0 !important;
}

.config-table-scroll-wrap,
.config-table-toolbar + form,
.config-table-toolbar ~ form {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .config-table-toolbar,
    .data-grid-title-row {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.15rem;
    }

    .config-table-toolbar-filters,
    .config-table-toolbar-actions,
    .data-grid-title-actions {
        flex: 0 0 auto;
        width: auto !important;
    }

    .config-table-toolbar .form-control,
    .config-table-toolbar .form-select,
    .config-table-toolbar input:not([type="checkbox"]),
    .config-table-toolbar select {
        flex: 0 0 12rem;
        width: 12rem !important;
        max-width: 12rem !important;
    }

    .data-grid-title-block,
    .data-grid-title {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .table-config,
    .rule-table {
        min-width: 760px;
        table-layout: auto;
    }

    .table-config th,
    .table-config td,
    .rule-table th,
    .rule-table td {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        vertical-align: top;
    }

    .table-config th.action-cell,
    .table-config td.action-cell,
    .table-config td.action-cell.d-flex,
    .rule-table th.action-cell,
    .rule-table td.action-cell {
        position: sticky !important;
        right: 0 !important;
        min-width: 74px !important;
        width: 74px !important;
        max-width: 74px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        z-index: 5 !important;
        box-shadow: -1px 0 0 var(--office-table-border), -8px 0 10px rgba(255,255,255,0.92) !important;
    }

    .table-config td.action-cell.d-flex,
    .rule-table td.action-cell.d-flex {
        min-width: 132px !important;
        width: 132px !important;
        max-width: 132px !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.12rem !important;
    }

    .table-config th.action-cell,
    .rule-table th.action-cell {
        color: #fff !important;
        background: var(--office-table-blue) !important;
        z-index: 6 !important;
    }

    .table-config tbody tr td.action-cell,
    .rule-table tbody tr td.action-cell {
        background: #fff !important;
    }

    .table-config tbody tr:nth-child(even) td.action-cell,
    .rule-table tbody tr:nth-child(even) td.action-cell {
        background: var(--office-table-zebra) !important;
    }

    .table-config tbody tr:hover td.action-cell,
    .rule-table tbody tr:hover td.action-cell {
        background: var(--office-table-soft) !important;
    }
}

/* Action headers are visual spacers only */
.table-config th.action-cell,
.rule-table th.action-cell,
.scheduler-table th.action-cell {
    color: transparent !important;
    font-size: 0 !important;
}

.table-config th.action-cell *,
.rule-table th.action-cell *,
.scheduler-table th.action-cell * {
    visibility: hidden !important;
}

/* Hide action-column header completely */
.table-config th.action-cell,
.rule-table th.action-cell,
.scheduler-table th.action-cell {
    color: transparent !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 767.98px) {
    .table-config th.action-cell,
    .rule-table th.action-cell,
    .scheduler-table th.action-cell {
        background: transparent !important;
        box-shadow: none !important;
    }
}

/* Publication-ready toolbar and sticky action cleanup */
:root {
    --office-toolbar-button-width: 8.25rem;
    --office-action-cell-width: 4.8rem;
    --office-rule-action-cell-width: 8.6rem;
}

.config-page-header {
    align-items: center !important;
    margin-bottom: 0.25rem !important;
}

.config-page-header > button,
.config-page-header > .btn,
.data-grid-back-button,
.detail-back-button {
    display: none !important;
}

.config-table-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}

.config-table-toolbar-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.1rem;
}

.config-table-toolbar-actions,
.data-grid-title-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.4rem !important;
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.1rem;
}

.config-rules-transfer-toolbar,
.table-transfer-toolbar,
.config-pagination-controls,
.config-pagination-controls .pagination-controls {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

.config-table-toolbar .btn,
.config-pagination-controls .btn,
.table-transfer-toolbar .btn,
.table-transfer-import-button,
.config-rules-transfer-toolbar .btn,
.config-rules-import-button,
.data-grid-title-actions .btn {
    flex: 0 0 var(--office-toolbar-button-width) !important;
    width: var(--office-toolbar-button-width) !important;
    min-width: var(--office-toolbar-button-width) !important;
    max-width: var(--office-toolbar-button-width) !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    padding: 0.25rem 0.45rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.config-table-toolbar-actions > .btn-primary {
    flex-basis: 100% !important;
    width: var(--office-toolbar-button-width) !important;
    max-width: var(--office-toolbar-button-width) !important;
}

.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input:not([type="checkbox"]),
.config-table-toolbar select {
    flex: 0 0 14rem !important;
    width: 14rem !important;
    max-width: 14rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    margin: 0 !important;
}

.data-grid-title-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}

.data-grid-title-block,
.data-grid-title {
    width: 100%;
    min-width: 0;
}

.config-table-scroll-wrap,
.config-table-toolbar + form,
.config-table-toolbar ~ form {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .config-table-toolbar-actions,
    .data-grid-title-actions {
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
    }

    .config-table-toolbar-actions > .btn-primary {
        flex: 0 0 var(--office-toolbar-button-width) !important;
    }
}

@media (max-width: 767.98px) {
    .table-config,
    .rule-table {
        min-width: 760px;
        table-layout: auto;
    }

    .table-config th,
    .table-config td,
    .rule-table th,
    .rule-table td {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        vertical-align: top;
    }

    .table-config th.action-cell,
    .table-config td.action-cell,
    .table-config td.action-cell.d-flex,
    .rule-table th.action-cell,
    .rule-table td.action-cell,
    .rule-table td.action-cell.d-flex {
        position: sticky !important;
        right: 0 !important;
        display: table-cell !important;
        width: var(--office-action-cell-width) !important;
        min-width: var(--office-action-cell-width) !important;
        max-width: var(--office-action-cell-width) !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        z-index: 20 !important;
        box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
    }

    .table-config td.action-cell.d-flex,
    .rule-table td.action-cell.d-flex {
        width: var(--office-rule-action-cell-width) !important;
        min-width: var(--office-rule-action-cell-width) !important;
        max-width: var(--office-rule-action-cell-width) !important;
    }

    .table-config th.action-cell,
    .rule-table th.action-cell,
    .scheduler-table th.action-cell {
        color: transparent !important;
        font-size: 0 !important;
        background: #fff !important;
        border: 0 !important;
        z-index: 30 !important;
        box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
    }

    .table-config tbody tr td.action-cell,
    .rule-table tbody tr td.action-cell {
        background: #fff !important;
    }

    .table-config tbody tr:nth-child(even) td.action-cell,
    .rule-table tbody tr:nth-child(even) td.action-cell {
        background: var(--office-table-zebra) !important;
    }

    .table-config tbody tr:hover td.action-cell,
    .rule-table tbody tr:hover td.action-cell {
        background: var(--office-table-soft) !important;
    }
}

/* Scheduler table layout */
.scheduler-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 0.35rem 0;
    padding-bottom: 0.1rem;
}

.scheduler-table-toolbar .btn {
    flex: 0 0 var(--office-toolbar-button-width) !important;
    width: var(--office-toolbar-button-width) !important;
    min-width: var(--office-toolbar-button-width) !important;
    max-width: var(--office-toolbar-button-width) !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    padding: 0.25rem 0.45rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.scheduler-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.scheduler-table {
    min-width: 900px;
}

.scheduler-table col.scheduler-col-actions {
    width: 104px;
}

.scheduler-table td.action-cell,
.scheduler-table th.action-cell {
    position: sticky !important;
    right: 0 !important;
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    z-index: 20 !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
}

.scheduler-table th.action-cell {
    color: transparent !important;
    font-size: 0 !important;
    background: #fff !important;
    border: 0 !important;
    z-index: 30 !important;
}

.scheduler-table tbody tr td.action-cell {
    background: #fff !important;
}

.scheduler-table tbody tr:nth-child(even) td.action-cell {
    background: var(--office-table-zebra) !important;
}

.scheduler-table tbody tr:hover td.action-cell,
.scheduler-table tbody tr.scheduler-row-running td.action-cell {
    background: var(--office-table-soft) !important;
}

@media (max-width: 767.98px) {
    .scheduler-table-toolbar {
        justify-content: flex-start;
    }
}

/* Final requested grid/config corrections */
.config-table-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    margin-bottom: 0.35rem !important;
}

.config-table-toolbar-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 1.95rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 0.1rem !important;
}

.config-table-toolbar-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.4rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 0.1rem !important;
}

.config-table-toolbar label {
    flex: 0 0 auto !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.config-table-toolbar .form-control,
.config-table-toolbar .form-select,
.config-table-toolbar input:not([type="checkbox"]),
.config-table-toolbar select {
    flex: 0 0 14rem !important;
    width: 14rem !important;
    max-width: 14rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    margin: 0 !important;
    padding: 0.2rem 0.45rem !important;
    line-height: 1.2 !important;
}

.config-table-toolbar-actions > .btn-primary {
    order: -10 !important;
    flex: 0 0 var(--office-toolbar-button-width) !important;
    width: var(--office-toolbar-button-width) !important;
    max-width: var(--office-toolbar-button-width) !important;
}

.table-config th.action-cell,
.rule-table th.action-cell,
.scheduler-table th.action-cell {
    color: transparent !important;
    font-size: 0 !important;
    background: var(--office-table-blue) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--office-table-border) !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(30,63,110,0.35) !important;
    z-index: 30 !important;
}

.table-config th.action-cell *,
.rule-table th.action-cell *,
.scheduler-table th.action-cell * {
    visibility: hidden !important;
}

.table-config td.action-cell,
.table-config td.action-cell.d-flex,
.rule-table td.action-cell,
.rule-table td.action-cell.d-flex,
.scheduler-table td.action-cell {
    position: sticky !important;
    right: 0 !important;
    display: table-cell !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    background: #fff !important;
    z-index: 20 !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
}

.table-config td.action-cell.d-flex,
.rule-table td.action-cell.d-flex {
    width: var(--office-rule-action-cell-width) !important;
    min-width: var(--office-rule-action-cell-width) !important;
    max-width: var(--office-rule-action-cell-width) !important;
}

.table-config td.action-cell:not(.d-flex),
.rule-table td.action-cell:not(.d-flex) {
    width: var(--office-action-cell-width) !important;
    min-width: var(--office-action-cell-width) !important;
    max-width: var(--office-action-cell-width) !important;
}

.table-config tbody tr:nth-child(even) td.action-cell,
.rule-table tbody tr:nth-child(even) td.action-cell,
.scheduler-table tbody tr:nth-child(even) td.action-cell {
    background: var(--office-table-zebra) !important;
}

.table-config tbody tr:hover td.action-cell,
.rule-table tbody tr:hover td.action-cell,
.scheduler-table tbody tr:hover td.action-cell,
.scheduler-table tbody tr.scheduler-row-running td.action-cell {
    background: var(--office-table-soft) !important;
}

/* Final action-column width and separator correction */
:root {
    --office-action-cell-width: 3.75rem;
    --office-rule-action-cell-width: 8.2rem;
    --office-scheduler-action-cell-width: 6.5rem;
}

.table-config th.action-cell,
.rule-table th.action-cell {
    width: var(--office-action-cell-width) !important;
    min-width: var(--office-action-cell-width) !important;
    max-width: var(--office-action-cell-width) !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
    box-shadow: none !important;
}

.table-config td.action-cell,
.table-config td.action-cell.d-flex,
.rule-table td.action-cell,
.rule-table td.action-cell.d-flex {
    width: var(--office-action-cell-width) !important;
    min-width: var(--office-action-cell-width) !important;
    max-width: var(--office-action-cell-width) !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
    text-align: center !important;
    box-shadow: none !important;
}

.table-config:has(td.action-cell button:nth-of-type(5)) th.action-cell,
.table-config td.action-cell:has(button:nth-of-type(5)),
.table-config td.action-cell.d-flex:has(button:nth-of-type(5)),
.rule-table:has(td.action-cell button:nth-of-type(5)) th.action-cell,
.rule-table td.action-cell:has(button:nth-of-type(5)),
.rule-table td.action-cell.d-flex:has(button:nth-of-type(5)) {
    width: var(--office-rule-action-cell-width) !important;
    min-width: var(--office-rule-action-cell-width) !important;
    max-width: var(--office-rule-action-cell-width) !important;
}

.scheduler-table col.scheduler-col-actions {
    width: var(--office-scheduler-action-cell-width) !important;
}

.scheduler-table th.action-cell,
.scheduler-table td.action-cell {
    width: var(--office-scheduler-action-cell-width) !important;
    min-width: var(--office-scheduler-action-cell-width) !important;
    max-width: var(--office-scheduler-action-cell-width) !important;
    box-shadow: none !important;
}

/* Final desktop corrections: requests sticky, scheduler width, config toolbar split */
@media (min-width: 768px) {
    .config-table-toolbar-actions {
        justify-content: flex-end !important;
    }

    .config-table-toolbar-actions > .btn-primary {
        margin-right: auto !important;
    }

    .scheduler-table-wrap {
        overflow-x: hidden !important;
    }

    .scheduler-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .scheduler-table col.scheduler-col-enabled {
        width: 4.8rem !important;
    }

    .scheduler-table col.scheduler-col-date {
        width: 7.4rem !important;
    }

    .scheduler-table col.scheduler-col-duration {
        width: 5.1rem !important;
    }

    .scheduler-table col.scheduler-col-result {
        width: 10rem !important;
    }

    .scheduler-table col.scheduler-col-actions {
        width: var(--office-scheduler-action-cell-width) !important;
    }

    .scheduler-table th.action-cell,
    .scheduler-table td.action-cell,
    .table-config th.action-cell,
    .table-config td.action-cell,
    .table-config td.action-cell.d-flex,
    .rule-table th.action-cell,
    .rule-table td.action-cell,
    .rule-table td.action-cell.d-flex {
        border-left: 0 !important;
        box-shadow: none !important;
    }
}

@media (max-width: 767.98px) {
    .config-table-toolbar-actions > .btn-primary {
        margin-right: 0 !important;
    }
}

/* Final config filter row correction */
.config-table-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.config-table-toolbar > .form-control,
.config-table-toolbar > .form-select,
.config-table-toolbar > input:not([type="checkbox"]),
.config-table-toolbar > select,
.config-table-toolbar > label,
.config-table-toolbar > .form-check,
.config-table-toolbar-filters {
    flex: 0 0 auto !important;
}

.config-table-toolbar-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    width: auto !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
}

.config-table-toolbar > .form-check,
.config-table-toolbar-filters > .form-check {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.4rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.config-table-toolbar > .form-control,
.config-table-toolbar > .form-select,
.config-table-toolbar > input:not([type="checkbox"]),
.config-table-toolbar > select,
.config-table-toolbar-filters > .form-control,
.config-table-toolbar-filters > .form-select,
.config-table-toolbar-filters > input:not([type="checkbox"]),
.config-table-toolbar-filters > select {
    flex: 0 0 14rem !important;
    width: 14rem !important;
    max-width: 14rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    margin: 0 !important;
}

.config-table-toolbar-actions {
    flex: 1 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
}

@media (max-width: 767.98px) {
    .config-table-toolbar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.1rem !important;
    }

    .config-table-toolbar-actions {
        flex: 0 0 100% !important;
        min-width: 100% !important;
    }
}

/* Final config toolbar grouping correction */
.config-table-toolbar {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.config-table-toolbar-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem !important;
    white-space: nowrap !important;
}

.config-table-toolbar-filters > .form-control,
.config-table-toolbar-filters > .form-select,
.config-table-toolbar-filters > input:not([type="checkbox"]),
.config-table-toolbar-filters > select {
    flex: 0 0 14rem !important;
    width: 14rem !important;
    max-width: 14rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    margin: 0 !important;
}

.config-table-toolbar-filters > label,
.config-table-toolbar-filters > .form-check {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.4rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.config-table-toolbar-actions {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* Final year load button correction */
.config-table-toolbar:has(> .config-year-load-button) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
}

.config-table-toolbar:has(> .config-year-load-button) > label {
    flex: 0 0 auto !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

.config-table-toolbar:has(> .config-year-load-button) > .form-control,
.config-table-toolbar:has(> .config-year-load-button) > input:not([type="checkbox"]) {
    flex: 0 0 7.5rem !important;
    width: 7.5rem !important;
    min-width: 7.5rem !important;
    max-width: 7.5rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    margin: 0 !important;
}

.config-table-toolbar > .config-year-load-button {
    flex: 0 0 8.25rem !important;
    width: 8.25rem !important;
    min-width: 8.25rem !important;
    max-width: 8.25rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    padding: 0.25rem 0.45rem !important;
    margin: 0 !important;
    align-self: center !important;
    white-space: nowrap !important;
}

.config-table-toolbar:has(> .config-year-load-button) > .config-table-toolbar-actions {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
}
.config-year-toolbar-filters {
    justify-content: flex-start !important;
}

.config-year-toolbar-filters > .form-control,
.config-year-toolbar-filters > input:not([type="checkbox"]) {
    flex: 0 0 7.5rem !important;
    width: 7.5rem !important;
    min-width: 7.5rem !important;
    max-width: 7.5rem !important;
}

.config-year-toolbar-filters > .config-year-load-button {
    flex: 0 0 8.25rem !important;
    width: 8.25rem !important;
    min-width: 8.25rem !important;
    max-width: 8.25rem !important;
    height: 1.95rem !important;
    min-height: 1.95rem !important;
    max-height: 1.95rem !important;
    padding: 0.25rem 0.45rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
}
.config-page-header-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.4rem !important;
    margin-left: auto !important;
    min-width: 0 !important;
}

.config-page-header-actions .table-transfer-toolbar {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem !important;
    width: auto !important;
}

.config-page-header-actions .table-transfer-toolbar .btn {
    flex: 0 0 7.1rem !important;
    width: 7.1rem !important;
    min-width: 7.1rem !important;
    max-width: 7.1rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
}

.config-page-header-actions > button,
.config-page-header-actions > .btn {
    display: none !important;
}

.config-page-header-actions > button.show-header-action,
.config-page-header-actions > .btn.show-header-action {
    display: inline-flex !important;
    flex: 0 0 7.1rem !important;
    width: 7.1rem !important;
    min-width: 7.1rem !important;
    max-width: 7.1rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
}

@media (max-width: 767.98px) {
    .config-page-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .config-page-header-actions {
        width: 100% !important;
        margin-left: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding-bottom: 0.1rem !important;
    }

    .config-page-header-actions .table-transfer-toolbar {
        flex: 0 0 auto !important;
        width: auto !important;
    }
}
.config-page-header-actions .config-pagination-controls {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem !important;
    width: auto !important;
    margin: 0 !important;
}

.config-page-header-actions .config-pagination-controls .pagination-controls {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    white-space: nowrap !important;
}

.config-page-header-actions .config-pagination-controls .btn {
    flex: 0 0 7.1rem !important;
    width: 7.1rem !important;
    min-width: 7.1rem !important;
    max-width: 7.1rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
}

.config-page-header-actions .config-pagination-controls .pagination-controls .btn {
    flex: 0 0 1.75rem !important;
    width: 1.75rem !important;
    max-width: 1.75rem !important;
    min-width: 1.75rem !important;
}
.config-page-header-actions .table-transfer-toolbar .btn:focus,
.config-page-header-actions .table-transfer-toolbar .btn:active,
.config-page-header-actions .table-transfer-toolbar .btn:focus-visible,
.config-page-header-actions .config-pagination-controls .btn:focus,
.config-page-header-actions .config-pagination-controls .btn:active,
.config-page-header-actions .config-pagination-controls .btn:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 767.98px) {
    .config-page-header-actions .config-pagination-controls {
        flex: 0 0 auto !important;
    }
}



/* Shared sortable/resizable table headers */
.resizable-columns-table th.resizable-column-header {
    position: relative;
}

.column-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    z-index: 4;
}

.column-resize-handle::after {
    content: "";
    position: absolute;
    top: 20%;
    right: 2px;
    width: 1px;
    height: 60%;
    background: rgba(255,255,255,0.45);
}

.column-resize-active {
    cursor: col-resize !important;
    user-select: none !important;
}

.sortable-header-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
}

.sortable-header-button:hover,
.sortable-header-button:focus-visible {
    color: inherit;
    text-decoration: underline;
    outline: none;
}

.sortable-header-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sortable-header-glyph {
    flex: 0 0 auto;
    min-width: 0.65rem;
    font-size: 0.68rem;
    line-height: 1;
    opacity: 0.95;
}

/* Final table sizing pass: fill available width, but allow horizontal scroll when columns need more space. */
.table-size-scroll-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.grid-container,
.time-attendance-grid-container,
.requests-grid-container,
.activity-detail-shell,
.activity-detail-table-wrap {
    max-width: 100% !important;
    overflow-x: visible !important;
}

.table-size-scroll-wrap > .activity-grid,
.table-size-scroll-wrap > .activity-detail-table,
.table-size-scroll-wrap > .time-attendance-grid,
.table-size-scroll-wrap > .requests-grid,
.table-size-scroll-wrap > .table-config {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
}

.table-size-scroll-wrap > .activity-grid th,
.table-size-scroll-wrap > .activity-detail-table th,
.table-size-scroll-wrap > .time-attendance-grid th,
.table-size-scroll-wrap > .requests-grid th,
.table-size-scroll-wrap > .table-config th {
    min-width: 5.75rem;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.table-size-scroll-wrap > .activity-grid td,
.table-size-scroll-wrap > .activity-detail-table td,
.table-size-scroll-wrap > .time-attendance-grid td,
.table-size-scroll-wrap > .requests-grid td,
.table-size-scroll-wrap > .table-config td {
    max-width: 28rem;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.table-size-scroll-wrap > .activity-grid.resized-columns-table,
.table-size-scroll-wrap > .activity-detail-table.resized-columns-table,
.table-size-scroll-wrap > .time-attendance-grid.resized-columns-table,
.table-size-scroll-wrap > .requests-grid.resized-columns-table,
.table-size-scroll-wrap > .table-config.resized-columns-table {
    min-width: max-content !important;
}

.table-size-scroll-wrap > .requests-grid th.actions-col,
.table-size-scroll-wrap > .requests-grid td.actions-cell,
.table-size-scroll-wrap > .table-config th.action-cell,
.table-size-scroll-wrap > .table-config td.action-cell,
.table-size-scroll-wrap > .table-config td.action-cell.d-flex {
    min-width: 4.8rem !important;
    width: 4.8rem !important;
    max-width: 4.8rem !important;
}

.table-size-scroll-wrap > .table-config input:not([type="checkbox"]),
.table-size-scroll-wrap > .table-config select,
.table-size-scroll-wrap > .table-config textarea {
    min-width: 6.5rem;
}

@media (max-width: 767.98px) {
    .table-size-scroll-wrap {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .table-size-scroll-wrap > .activity-grid,
    .table-size-scroll-wrap > .activity-detail-table,
    .table-size-scroll-wrap > .time-attendance-grid,
    .table-size-scroll-wrap > .requests-grid,
    .table-size-scroll-wrap > .table-config {
        min-width: max(100%, 760px) !important;
    }

    .table-size-scroll-wrap > .activity-grid th,
    .table-size-scroll-wrap > .activity-grid td,
    .table-size-scroll-wrap > .activity-detail-table th,
    .table-size-scroll-wrap > .activity-detail-table td,
    .table-size-scroll-wrap > .time-attendance-grid th,
    .table-size-scroll-wrap > .time-attendance-grid td,
    .table-size-scroll-wrap > .requests-grid th,
    .table-size-scroll-wrap > .requests-grid td,
    .table-size-scroll-wrap > .table-config th,
    .table-size-scroll-wrap > .table-config td {
        min-width: 5.75rem !important;
    }
}

/* Final horizontal-scroll action columns: keep commands visible when the table scrolls. */
.table-size-scroll-wrap > .requests-grid th.actions-col,
.table-size-scroll-wrap > .requests-grid td.actions-cell,
.table-size-scroll-wrap > .table-config th.action-cell,
.table-size-scroll-wrap > .table-config td.action-cell,
.table-size-scroll-wrap > .table-config td.action-cell.d-flex {
    position: sticky !important;
    right: 0 !important;
    z-index: 24 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.table-size-scroll-wrap > .requests-grid th.actions-col,
.table-size-scroll-wrap > .table-config th.action-cell {
    background: var(--office-table-blue) !important;
    color: transparent !important;
    font-size: 0 !important;
    z-index: 34 !important;
    border-bottom: 1px solid var(--office-table-border) !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(30,63,110,0.32) !important;
}

.table-size-scroll-wrap > .requests-grid td.actions-cell,
.table-size-scroll-wrap > .table-config td.action-cell,
.table-size-scroll-wrap > .table-config td.action-cell.d-flex {
    background: #fff !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
}

.table-size-scroll-wrap > .requests-grid tbody tr:nth-child(even) td.actions-cell,
.table-size-scroll-wrap > .table-config tbody tr:nth-child(even) td.action-cell {
    background: var(--office-table-zebra) !important;
}

.table-size-scroll-wrap > .requests-grid tbody tr:hover td.actions-cell,
.table-size-scroll-wrap > .table-config tbody tr:hover td.action-cell,
.table-size-scroll-wrap > .scheduler-table tbody tr.scheduler-row-running td.action-cell {
    background: var(--office-table-soft) !important;
}

.table-size-scroll-wrap > .scheduler-table th.action-cell,
.table-size-scroll-wrap > .scheduler-table td.action-cell {
    width: var(--office-scheduler-action-cell-width) !important;
    min-width: var(--office-scheduler-action-cell-width) !important;
    max-width: var(--office-scheduler-action-cell-width) !important;
    text-align: center !important;
}

.table-size-scroll-wrap > .scheduler-table col.scheduler-col-actions {
    width: var(--office-scheduler-action-cell-width) !important;
}

.table-size-scroll-wrap > .scheduler-table td.action-cell .btn-icon {
    flex: 0 0 auto !important;
    width: 1.35rem !important;
    min-width: 1.35rem !important;
}

.table-size-scroll-wrap > .scheduler-table td.action-cell,
.table-size-scroll-wrap > .requests-grid td.actions-cell {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

/* Configuration tables: keep action buttons visible when horizontal table scroll is active. */
.config-page .table-size-scroll-wrap > .table-config th.action-cell,
.config-page .table-size-scroll-wrap > .table-config td.action-cell,
.config-page .table-size-scroll-wrap > .table-config td.action-cell.d-flex,
.config-page .table-size-scroll-wrap > .rule-table th.action-cell,
.config-page .table-size-scroll-wrap > .rule-table td.action-cell,
.config-page .table-size-scroll-wrap > .rule-table td.action-cell.d-flex {
    position: sticky !important;
    right: 0 !important;
    width: var(--office-action-cell-width) !important;
    min-width: var(--office-action-cell-width) !important;
    max-width: var(--office-action-cell-width) !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: center !important;
    vertical-align: middle !important;
    z-index: 24 !important;
}

.config-page .table-size-scroll-wrap > .table-config:has(td.action-cell .btn-icon:nth-child(4)) th.action-cell,
.config-page .table-size-scroll-wrap > .table-config td.action-cell:has(.btn-icon:nth-child(4)),
.config-page .table-size-scroll-wrap > .table-config td.action-cell.d-flex:has(.btn-icon:nth-child(4)),
.config-page .table-size-scroll-wrap > .rule-table:has(td.action-cell .btn-icon:nth-child(4)) th.action-cell,
.config-page .table-size-scroll-wrap > .rule-table td.action-cell:has(.btn-icon:nth-child(4)),
.config-page .table-size-scroll-wrap > .rule-table td.action-cell.d-flex:has(.btn-icon:nth-child(4)) {
    width: var(--office-rule-action-cell-width) !important;
    min-width: var(--office-rule-action-cell-width) !important;
    max-width: var(--office-rule-action-cell-width) !important;
}

.config-page .table-size-scroll-wrap > .table-config th.action-cell,
.config-page .table-size-scroll-wrap > .rule-table th.action-cell {
    background: var(--office-table-blue) !important;
    color: transparent !important;
    font-size: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--office-table-border) !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(30,63,110,0.32) !important;
    z-index: 34 !important;
}

.config-page .table-size-scroll-wrap > .table-config td.action-cell,
.config-page .table-size-scroll-wrap > .table-config td.action-cell.d-flex,
.config-page .table-size-scroll-wrap > .rule-table td.action-cell,
.config-page .table-size-scroll-wrap > .rule-table td.action-cell.d-flex {
    background: #fff !important;
    box-shadow: -1px 0 0 var(--office-table-border), -10px 0 12px rgba(255,255,255,0.96) !important;
}

.config-page .table-size-scroll-wrap > .table-config tbody tr:nth-child(even) td.action-cell,
.config-page .table-size-scroll-wrap > .rule-table tbody tr:nth-child(even) td.action-cell {
    background: var(--office-table-zebra) !important;
}

.config-page .table-size-scroll-wrap > .table-config tbody tr:hover td.action-cell,
.config-page .table-size-scroll-wrap > .rule-table tbody tr:hover td.action-cell {
    background: var(--office-table-soft) !important;
}

/* Manual column resize must override default readable minimums, including mobile and form controls. */
.table-size-scroll-wrap th.manual-column-width,
.table-size-scroll-wrap td.manual-column-width {
    min-width: var(--manual-column-width, inherit);
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.table-size-scroll-wrap td.manual-column-width input:not([type="checkbox"]),
.table-size-scroll-wrap td.manual-column-width select,
.table-size-scroll-wrap td.manual-column-width textarea {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Final adaptive table sizing: default tables fit the viewport; overflow is shown only when content or manual resize requires it. */
.table-top-scrollbar {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    height: 12px !important;
    margin: 0 0 0.15rem 0 !important;
}

.table-top-scrollbar[hidden] {
    display: none !important;
}

.table-top-scrollbar-inner {
    height: 1px !important;
}

.table-size-scroll-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.table-size-scroll-wrap > .activity-grid,
.table-size-scroll-wrap > .activity-detail-table,
.table-size-scroll-wrap > .time-attendance-grid,
.table-size-scroll-wrap > .requests-grid,
.table-size-scroll-wrap > .table-config {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

.table-size-scroll-wrap.has-horizontal-scroll > .activity-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .activity-detail-table,
.table-size-scroll-wrap.has-horizontal-scroll > .time-attendance-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .requests-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .table-config,
.table-size-scroll-wrap > .activity-grid.resized-columns-table,
.table-size-scroll-wrap > .activity-detail-table.resized-columns-table,
.table-size-scroll-wrap > .time-attendance-grid.resized-columns-table,
.table-size-scroll-wrap > .requests-grid.resized-columns-table,
.table-size-scroll-wrap > .table-config.resized-columns-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
}

.table-size-scroll-wrap th.data-col-time,
.table-size-scroll-wrap td.data-col-time {
    width: 5.35rem !important;
    min-width: 5rem !important;
    max-width: 5.75rem !important;
}

.table-size-scroll-wrap th.data-col-percent,
.table-size-scroll-wrap td.data-col-percent {
    width: 4.75rem !important;
    min-width: 4.35rem !important;
    max-width: 5.1rem !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap th.data-col-time .sortable-header-button {
    justify-content: flex-end !important;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-1 {
    --activity-key-col-1: 10rem;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-2 {
    --activity-key-col-1: 8.75rem;
    --activity-key-col-2: 8.75rem;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-3 {
    --activity-key-col-1: 7.75rem;
    --activity-key-col-2: 7.75rem;
    --activity-key-col-3: 7.75rem;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-1 th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-1 td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    width: var(--activity-key-col-1) !important;
    min-width: var(--activity-key-col-1) !important;
    max-width: var(--activity-key-col-1) !important;
    z-index: 18 !important;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-2 th:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 th:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 td:nth-child(2) {
    position: sticky !important;
    left: var(--activity-key-col-1) !important;
    width: var(--activity-key-col-2) !important;
    min-width: var(--activity-key-col-2) !important;
    max-width: var(--activity-key-col-2) !important;
    z-index: 18 !important;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-3 th:nth-child(3),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 td:nth-child(3) {
    position: sticky !important;
    left: calc(var(--activity-key-col-1) + var(--activity-key-col-2)) !important;
    width: var(--activity-key-col-3) !important;
    min-width: var(--activity-key-col-3) !important;
    max-width: var(--activity-key-col-3) !important;
    z-index: 18 !important;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-1 thead th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 thead th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 thead th:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 thead th:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 thead th:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 thead th:nth-child(3) {
    background: var(--office-table-blue) !important;
    color: #fff !important;
    z-index: 38 !important;
}

.table-size-scroll-wrap > .activity-grid.activity-sticky-1 tbody td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 tbody td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 tbody td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody td:nth-child(3) {
    background: #fff !important;
    box-shadow: 1px 0 0 var(--office-table-border) !important;
}

.table-size-scroll-wrap > .activity-grid tbody tr:nth-child(even) td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 tbody tr:nth-child(even) td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody tr:nth-child(even) td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody tr:nth-child(even) td:nth-child(3) {
    background: var(--office-table-zebra) !important;
}

.table-size-scroll-wrap > .activity-grid tbody tr:hover td:nth-child(1),
.table-size-scroll-wrap > .activity-grid.activity-sticky-2 tbody tr:hover td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody tr:hover td:nth-child(2),
.table-size-scroll-wrap > .activity-grid.activity-sticky-3 tbody tr:hover td:nth-child(3) {
    background: var(--office-table-soft) !important;
}

@media (max-width: 767.98px) {
    .table-size-scroll-wrap > .activity-grid,
    .table-size-scroll-wrap > .activity-detail-table,
    .table-size-scroll-wrap > .time-attendance-grid,
    .table-size-scroll-wrap > .requests-grid,
    .table-size-scroll-wrap > .table-config {
        min-width: max(100%, 720px) !important;
        max-width: none !important;
    }

    .table-size-scroll-wrap > .activity-grid.activity-sticky-1 {
        --activity-key-col-1: 8.5rem;
    }

    .table-size-scroll-wrap > .activity-grid.activity-sticky-2 {
        --activity-key-col-1: 7.5rem;
        --activity-key-col-2: 7.5rem;
    }

    .table-size-scroll-wrap > .activity-grid.activity-sticky-3 {
        --activity-key-col-1: 6.75rem;
        --activity-key-col-2: 6.75rem;
        --activity-key-col-3: 6.75rem;
    }
}

/* Strong compact column overrides after legacy minimum-width table rules. */
.table-size-scroll-wrap > .activity-grid th.data-col-time,
.table-size-scroll-wrap > .activity-grid td.data-col-time,
.table-size-scroll-wrap > .activity-detail-table th.data-col-time,
.table-size-scroll-wrap > .activity-detail-table td.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-time,
.table-size-scroll-wrap > .requests-grid th.data-col-time,
.table-size-scroll-wrap > .requests-grid td.data-col-time,
.table-size-scroll-wrap > .table-config th.data-col-time,
.table-size-scroll-wrap > .table-config td.data-col-time {
    width: 5.35rem !important;
    min-width: 5rem !important;
    max-width: 5.75rem !important;
}

.table-size-scroll-wrap > .activity-grid th.data-col-percent,
.table-size-scroll-wrap > .activity-grid td.data-col-percent,
.table-size-scroll-wrap > .activity-detail-table th.data-col-percent,
.table-size-scroll-wrap > .activity-detail-table td.data-col-percent,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-percent,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-percent,
.table-size-scroll-wrap > .requests-grid th.data-col-percent,
.table-size-scroll-wrap > .requests-grid td.data-col-percent,
.table-size-scroll-wrap > .table-config th.data-col-percent,
.table-size-scroll-wrap > .table-config td.data-col-percent {
    width: 4.75rem !important;
    min-width: 4.35rem !important;
    max-width: 5.1rem !important;
    text-align: right !important;
}

/* Generic sticky grid columns. Components decide which columns receive sticky-col-N; CSS is reusable across report types. */
.table-size-scroll-wrap > table th.grid-sticky-column,
.table-size-scroll-wrap > table td.grid-sticky-column {
    position: sticky !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.table-size-scroll-wrap > table th.grid-sticky-column.sticky-col-1,
.table-size-scroll-wrap > table td.grid-sticky-column.sticky-col-1 {
    left: 0 !important;
    width: var(--grid-sticky-col-1-width, 9rem) !important;
    min-width: var(--grid-sticky-col-1-width, 9rem) !important;
    max-width: var(--grid-sticky-col-1-width, 9rem) !important;
}

.table-size-scroll-wrap > table th.grid-sticky-column.sticky-col-2,
.table-size-scroll-wrap > table td.grid-sticky-column.sticky-col-2 {
    left: var(--grid-sticky-col-1-width, 9rem) !important;
    width: var(--grid-sticky-col-2-width, 9rem) !important;
    min-width: var(--grid-sticky-col-2-width, 9rem) !important;
    max-width: var(--grid-sticky-col-2-width, 9rem) !important;
}

.table-size-scroll-wrap > table th.grid-sticky-column.sticky-col-3,
.table-size-scroll-wrap > table td.grid-sticky-column.sticky-col-3 {
    left: calc(var(--grid-sticky-col-1-width, 9rem) + var(--grid-sticky-col-2-width, 9rem)) !important;
    width: var(--grid-sticky-col-3-width, 9rem) !important;
    min-width: var(--grid-sticky-col-3-width, 9rem) !important;
    max-width: var(--grid-sticky-col-3-width, 9rem) !important;
}

.table-size-scroll-wrap > table thead th.grid-sticky-column {
    background: var(--office-table-blue) !important;
    color: #fff !important;
    z-index: 45 !important;
}

.table-size-scroll-wrap > table tbody td.grid-sticky-column {
    background: #fff !important;
    box-shadow: 1px 0 0 var(--office-table-border) !important;
    z-index: 22 !important;
}

.table-size-scroll-wrap > table tbody tr:nth-child(even) td.grid-sticky-column {
    background: var(--office-table-zebra) !important;
}

.table-size-scroll-wrap > table tbody tr:hover td.grid-sticky-column {
    background: var(--office-table-soft) !important;
}

@media (max-width: 767.98px) {
    .table-size-scroll-wrap > .activity-grid.activity-grid-usergroup-and-project,
    .table-size-scroll-wrap > .activity-grid.activity-grid-project-and-userid {
        --grid-sticky-col-1-width:7.5rem !important;
        --grid-sticky-col-2-width:7.5rem !important;
    }

    .table-size-scroll-wrap > .activity-grid.activity-grid-company-and-userid {
        --grid-sticky-col-1-width:6.75rem !important;
        --grid-sticky-col-2-width:6.75rem !important;
        --grid-sticky-col-3-width:6.75rem !important;
    }

    .table-size-scroll-wrap > .activity-grid.has-grid-sticky-columns:not(.activity-grid-usergroup-and-project):not(.activity-grid-project-and-userid):not(.activity-grid-company-and-userid) {
        --grid-sticky-col-1-width:8.5rem !important;
    }
}

/* Undo top synchronized scrollbar: it was too visually noisy near the report toolbar. */
.table-top-scrollbar {
    display: none !important;
}

.table-size-scroll-wrap.has-horizontal-scroll > .activity-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .activity-detail-table,
.table-size-scroll-wrap.has-horizontal-scroll > .time-attendance-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .requests-grid,
.table-size-scroll-wrap.has-horizontal-scroll > .table-config {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

.table-size-scroll-wrap > .activity-grid.resized-columns-table,
.table-size-scroll-wrap > .activity-detail-table.resized-columns-table,
.table-size-scroll-wrap > .time-attendance-grid.resized-columns-table,
.table-size-scroll-wrap > .requests-grid.resized-columns-table,
.table-size-scroll-wrap > .table-config.resized-columns-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
}

.table-size-scroll-wrap th.data-col-time,
.table-size-scroll-wrap td.data-col-time,
.table-size-scroll-wrap > .activity-grid th.data-col-time,
.table-size-scroll-wrap > .activity-grid td.data-col-time,
.table-size-scroll-wrap > .activity-detail-table th.data-col-time,
.table-size-scroll-wrap > .activity-detail-table td.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-time,
.table-size-scroll-wrap > .requests-grid th.data-col-time,
.table-size-scroll-wrap > .requests-grid td.data-col-time,
.table-size-scroll-wrap > .table-config th.data-col-time,
.table-size-scroll-wrap > .table-config td.data-col-time {
    text-align: left !important;
}

.table-size-scroll-wrap th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .activity-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .activity-detail-table th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .requests-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .table-config th.data-col-time .sortable-header-button {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* Time formats share one set of metric columns; remaining width belongs to identifying text. */
.table-size-scroll-wrap > table.time-format-grid {
    table-layout: fixed !important;
    min-width: var(--time-format-min-width, 100%) !important;
}

table.time-format-grid col.grid-time-column { width: 6rem; }
table.time-format-grid col.grid-number-column { width: 5rem; }

.table-size-scroll-wrap > table.time-format-grid .grid-time-format-column {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    max-width: 2.25rem !important;
    padding: 0 !important;
    text-align: center;
}

.grid-time-format-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 15px;
    cursor: pointer;
}

.grid-time-format-toggle:hover { background: rgba(255, 255, 255, 0.15); }
.grid-time-format-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: -2px; }

.table-size-scroll-wrap.report-grid-frame > table.time-format-grid thead th.grid-time-format-column {
    right: 0;
    z-index: 120 !important;
}

@media print {
    .time-format-grid .grid-time-format-column { display: none !important; }
    .table-size-scroll-wrap > table.time-format-grid {
        min-width: 0 !important;
        table-layout: auto !important;
    }
    .time-format-grid col.grid-time-column,
    .time-format-grid col.grid-number-column { width: auto; }
}

/* Grid frames only: the surrounding page retains its existing scrolling layout. */
.table-size-scroll-wrap.report-grid-frame {
    height: var(--report-grid-height, 65vh);
    max-height: var(--report-grid-height, 65vh);
    min-height: 0;
    box-sizing: border-box;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    overflow: auto !important;
    padding: 0 !important;
}

.table-size-scroll-wrap.report-grid-frame > table thead th {
    position: sticky !important;
    top: 0;
    background: var(--office-table-blue) !important;
}

.table-size-scroll-wrap.report-grid-frame > table thead th:not(.grid-sticky-column) {
    z-index: 100 !important;
}

.table-size-scroll-wrap.report-grid-frame > table thead th.grid-sticky-column {
    z-index: 120 !important;
}

.table-size-scroll-wrap.report-grid-frame > table.table-config.config-sticky-first thead th:first-child,
.table-size-scroll-wrap.report-grid-frame > table.table-config thead th.action-cell,
.table-size-scroll-wrap.report-grid-frame > table.table-config thead th.actions-col,
.table-size-scroll-wrap.report-grid-frame > table.requests-grid thead th.actions-col {
    z-index: 120 !important;
}

@media print {
    .table-size-scroll-wrap.report-grid-frame {
        height: auto;
        max-height: none;
        overflow: visible !important;
        border: 0;
        border-radius: 0;
    }

    .table-size-scroll-wrap.report-grid-frame > table thead th {
        position: static !important;
    }

}

/* Inner top scrollbar for long overflowing grids: belongs to the table, not to the toolbar. */
.table-inner-top-scrollbar {
    position: sticky !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 0 0 0.2rem 0 !important;
    background: #fff !important;
    z-index: 50 !important;
}

.table-inner-top-scrollbar[hidden] {
    display: none !important;
}

.table-inner-top-scrollbar-content {
    height: 1px !important;
}

/* Column alignment policy: numeric-like columns right, date/text columns keep the default left alignment. */
.table-size-scroll-wrap th.data-col-time,
.table-size-scroll-wrap td.data-col-time,
.table-size-scroll-wrap th.data-col-percent,
.table-size-scroll-wrap td.data-col-percent,
.table-size-scroll-wrap th.data-col-number,
.table-size-scroll-wrap td.data-col-number,
.table-size-scroll-wrap > .activity-grid th.data-col-time,
.table-size-scroll-wrap > .activity-grid td.data-col-time,
.table-size-scroll-wrap > .activity-grid th.data-col-percent,
.table-size-scroll-wrap > .activity-grid td.data-col-percent,
.table-size-scroll-wrap > .activity-grid th.data-col-number,
.table-size-scroll-wrap > .activity-grid td.data-col-number,
.table-size-scroll-wrap > .activity-detail-table th.data-col-time,
.table-size-scroll-wrap > .activity-detail-table td.data-col-time,
.table-size-scroll-wrap > .activity-detail-table th.data-col-percent,
.table-size-scroll-wrap > .activity-detail-table td.data-col-percent,
.table-size-scroll-wrap > .activity-detail-table th.data-col-number,
.table-size-scroll-wrap > .activity-detail-table td.data-col-number,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-time,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-percent,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-percent,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-number,
.table-size-scroll-wrap > .time-attendance-grid td.data-col-number,
.table-size-scroll-wrap > .requests-grid th.data-col-time,
.table-size-scroll-wrap > .requests-grid td.data-col-time,
.table-size-scroll-wrap > .requests-grid th.data-col-percent,
.table-size-scroll-wrap > .requests-grid td.data-col-percent,
.table-size-scroll-wrap > .requests-grid th.data-col-number,
.table-size-scroll-wrap > .requests-grid td.data-col-number,
.table-size-scroll-wrap > .table-config th.data-col-time,
.table-size-scroll-wrap > .table-config td.data-col-time,
.table-size-scroll-wrap > .table-config th.data-col-percent,
.table-size-scroll-wrap > .table-config td.data-col-percent,
.table-size-scroll-wrap > .table-config th.data-col-number,
.table-size-scroll-wrap > .table-config td.data-col-number {
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-time .sortable-header-button,
.table-size-scroll-wrap th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap th.data-col-number .sortable-header-button,
.table-size-scroll-wrap > .activity-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .activity-grid th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap > .activity-grid th.data-col-number .sortable-header-button,
.table-size-scroll-wrap > .activity-detail-table th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .activity-detail-table th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap > .activity-detail-table th.data-col-number .sortable-header-button,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap > .time-attendance-grid th.data-col-number .sortable-header-button,
.table-size-scroll-wrap > .requests-grid th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .requests-grid th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap > .requests-grid th.data-col-number .sortable-header-button,
.table-size-scroll-wrap > .table-config th.data-col-time .sortable-header-button,
.table-size-scroll-wrap > .table-config th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap > .table-config th.data-col-number .sortable-header-button {
    justify-content: flex-end !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-number,
.table-size-scroll-wrap td.data-col-number {
    min-width: 4.5rem !important;
}

/* Header text follows numeric/time alignment too. */
.table-size-scroll-wrap th.data-col-time .sortable-header-text,
.table-size-scroll-wrap th.data-col-percent .sortable-header-text,
.table-size-scroll-wrap th.data-col-number .sortable-header-text {
    text-align: right !important;
}

/* Strong header alignment: numeric/time header text must line up with right-aligned cell values. */
.table-size-scroll-wrap th.data-col-time,
.table-size-scroll-wrap th.data-col-percent,
.table-size-scroll-wrap th.data-col-number {
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-time .sortable-header-button,
.table-size-scroll-wrap th.data-col-percent .sortable-header-button,
.table-size-scroll-wrap th.data-col-number .sortable-header-button {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-time .sortable-header-text,
.table-size-scroll-wrap th.data-col-percent .sortable-header-text,
.table-size-scroll-wrap th.data-col-number .sortable-header-text {
    flex: 0 1 auto !important;
    margin-left: auto !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.data-col-time .sortable-header-glyph,
.table-size-scroll-wrap th.data-col-percent .sortable-header-glyph,
.table-size-scroll-wrap th.data-col-number .sortable-header-glyph {
    flex: 0 0 auto !important;
}

/* Razor-defined alignment: header and values share this class from render time. */
.table-size-scroll-wrap th.grid-align-right,
.table-size-scroll-wrap td.grid-align-right {
    text-align: right !important;
}

.table-size-scroll-wrap th.grid-align-right .sortable-header-button {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.grid-align-right .sortable-header-text {
    flex: 0 1 auto !important;
    margin-left: auto !important;
    text-align: right !important;
}

.table-size-scroll-wrap th.grid-align-right .sortable-header-glyph {
    flex: 0 0 auto !important;
}

/* Align right headers to the same visual edge as right-aligned cell values; resize handle must not reserve text space. */
.table-size-scroll-wrap th.grid-align-right {
    padding-right: 0.35rem !important;
}

.table-size-scroll-wrap td.grid-align-right {
    padding-right: 0.35rem !important;
}

.table-size-scroll-wrap th.grid-align-right .sortable-header-button {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

.table-size-scroll-wrap th.grid-align-right .sortable-header-text {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

.table-size-scroll-wrap th.grid-align-right .column-resize-handle {
    right: -3px !important;
    width: 7px !important;
}

/* Empty sort glyph must not leave an invisible right margin in sortable headers. */
.sortable-header-glyph:empty {
    display: none !important;
}

/* Keep column resize usable after right-aligned header fixes. */
.resizable-columns-table th.resizable-column-header .column-resize-handle,
.table-size-scroll-wrap th.grid-align-right .column-resize-handle {
    right: 0 !important;
    width: 12px !important;
    min-width: 12px !important;
    z-index: 100 !important;
    pointer-events: auto !important;
}

.resizable-columns-table th.resizable-column-header .column-resize-handle::after,
.table-size-scroll-wrap th.grid-align-right .column-resize-handle::after {
    right: 3px !important;
}

/* Time & Attendance detail: no invisible header spacing on right-aligned sortable headers. */
.time-attendance-grid th.grid-align-right .sortable-header-button {
    gap: 0 !important;
}

.time-attendance-grid th.grid-align-right .sortable-header-glyph:empty {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    flex-basis: 0 !important;
}

/* Time & Attendance weekly summary: sticky first columns and compact metric columns. */
.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(1),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(1),
.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(2),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(2) {
    width: 8rem !important;
    min-width: 8rem !important;
    max-width: 8rem !important;
}

.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(3),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(3) {
    width: 3.75rem !important;
    min-width: 3.75rem !important;
    max-width: 3.75rem !important;
}

.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(n+4),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(n+4) {
    width: 4.65rem !important;
    min-width: 4.35rem !important;
    max-width: 4.85rem !important;
}

/* Time & Attendance weekly summary: slightly denser title and columns only for this report. */
.time-attendance-week-summary-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
}

.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(1),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(1),
.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(2),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(2) {
    width: 7.25rem !important;
    min-width: 7.25rem !important;
    max-width: 7.25rem !important;
}

.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(3),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(3) {
    width: 3.25rem !important;
    min-width: 3.25rem !important;
    max-width: 3.25rem !important;
}

.table-size-scroll-wrap > .time-attendance-week-summary th:nth-child(n+4),
.table-size-scroll-wrap > .time-attendance-week-summary td:nth-child(n+4) {
    width: 4.15rem !important;
    min-width: 4rem !important;
    max-width: 4.35rem !important;
}

/* Activity grouped report column sizing. */
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(1),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(1),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(2),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(2),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(3),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(3),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(5),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(5),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(1),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(1),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(2),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(2),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(4),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(4),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(5),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(5) {
    width: 8.75rem !important;
    min-width: 8.75rem !important;
    max-width: 8.75rem !important;
}

.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(4),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(4),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(3),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(3) {
    width: 17.5rem !important;
    min-width: 14rem !important;
    max-width: 17.5rem !important;
}

.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(1),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(1),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(2),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(2),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(3),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(3) {
    width: 7.75rem !important;
    min-width: 7.75rem !important;
    max-width: 7.75rem !important;
}

.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(6),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(6),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(7),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(7),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(8),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(8),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(6),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(6),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(7),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(7),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(8),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(8),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(4),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(4),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(5),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(5),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(6),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(6) {
    width: 5.75rem !important;
    min-width: 5.25rem !important;
    max-width: 6.25rem !important;
}

.table-size-scroll-wrap > .activity-grid-usergroup-and-project th:nth-child(n+9),
.table-size-scroll-wrap > .activity-grid-usergroup-and-project td:nth-child(n+9),
.table-size-scroll-wrap > .activity-grid-project-and-userid th:nth-child(n+9),
.table-size-scroll-wrap > .activity-grid-project-and-userid td:nth-child(n+9),
.table-size-scroll-wrap > .activity-grid-company-and-userid th:nth-child(n+7),
.table-size-scroll-wrap > .activity-grid-company-and-userid td:nth-child(n+7) {
    width: 4.75rem !important;
    min-width: 4.35rem !important;
    max-width: 5.1rem !important;
}

/* Activity and Time & Attendance sticky columns must be fully opaque over horizontally scrolling cells. */
.table-size-scroll-wrap > .activity-grid thead th:not(.grid-sticky-column),
.table-size-scroll-wrap > .time-attendance-grid thead th:not(.grid-sticky-column) {
    z-index: 0 !important;
}

.table-size-scroll-wrap > .activity-grid thead th.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid thead th.grid-sticky-column {
    background: var(--office-table-blue) !important;
    background-color: var(--office-table-blue) !important;
    color: #fff !important;
    z-index: 70 !important;
    background-clip: padding-box !important;
}

.table-size-scroll-wrap > .activity-grid tbody td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody td.grid-sticky-column {
    background: #fff !important;
    background-color: #fff !important;
    z-index: 55 !important;
    background-clip: padding-box !important;
    box-shadow: 1px 0 0 var(--office-table-border) !important;
}

.table-size-scroll-wrap > .activity-grid tbody tr:nth-child(even) td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr:nth-child(even) td.grid-sticky-column {
    background: var(--office-table-zebra) !important;
    background-color: var(--office-table-zebra) !important;
}

.table-size-scroll-wrap > .activity-grid tbody tr:hover td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr:hover td.grid-sticky-column,
.table-size-scroll-wrap > .activity-grid tbody tr.row-selected td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr.row-selected td.grid-sticky-column {
    background: var(--office-table-soft) !important;
    background-color: var(--office-table-soft) !important;
}

.table-size-scroll-wrap > .activity-grid tbody tr.row-bold td.grid-sticky-column,
.table-size-scroll-wrap > .activity-grid tbody tr.row-group td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr.row-bold td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr.row-comment td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid tbody tr.row-blank td.grid-sticky-column {
    background: #fff !important;
    background-color: #fff !important;
}

/* Resize separators should not draw over sticky columns while horizontally scrolling. */
.table-size-scroll-wrap > .activity-grid .column-resize-handle,
.table-size-scroll-wrap > .time-attendance-grid .column-resize-handle {
    z-index: 35 !important;
}

.table-size-scroll-wrap > .activity-grid th.grid-sticky-column,
.table-size-scroll-wrap > .activity-grid td.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid th.grid-sticky-column,
.table-size-scroll-wrap > .time-attendance-grid td.grid-sticky-column {
    z-index: 80 !important;
}

.table-size-scroll-wrap > .activity-grid th.grid-sticky-column .column-resize-handle,
.table-size-scroll-wrap > .time-attendance-grid th.grid-sticky-column .column-resize-handle {
    z-index: 90 !important;
}

/* Scheduler: keep task name visible while horizontally scrolling. */
.scheduler-table th:first-child,
.scheduler-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 42 !important;
    background: #fff !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    box-shadow: 1px 0 0 var(--office-table-border) !important;
}

.scheduler-table thead th:first-child {
    background: var(--office-table-blue) !important;
    background-color: var(--office-table-blue) !important;
    color: #fff !important;
    z-index: 62 !important;
}

.scheduler-table tbody tr:nth-child(even) td:first-child {
    background: var(--office-table-zebra) !important;
    background-color: var(--office-table-zebra) !important;
}

.scheduler-table tbody tr:hover td:first-child,
.scheduler-table tbody tr.scheduler-row-running td:first-child {
    background: var(--office-table-soft) !important;
    background-color: var(--office-table-soft) !important;
}

/* Selected configuration tables: keep the first key column visible. */
.table-config.config-sticky-first th:first-child,
.table-config.config-sticky-first td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 42 !important;
    background: #fff !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    box-shadow: 1px 0 0 var(--office-table-border) !important;
}

.table-config.config-sticky-first thead th:first-child {
    background: var(--office-table-blue) !important;
    background-color: var(--office-table-blue) !important;
    color: #fff !important;
    z-index: 62 !important;
}

.table-config.config-sticky-first tbody tr:nth-child(even) td:first-child {
    background: var(--office-table-zebra) !important;
    background-color: var(--office-table-zebra) !important;
}

.table-config.config-sticky-first tbody tr:hover td:first-child {
    background: var(--office-table-soft) !important;
    background-color: var(--office-table-soft) !important;
}



/* Rule configuration pages: keep standard visual formatting, only reduce column width. */
.table-config.config-rule-compact th:not(.action-cell),
.table-config.config-rule-compact td:not(.action-cell) {
    min-width: 5.2rem !important;
    max-width: 9.5rem !important;
}

.table-config.config-rule-compact th.autoexpand-col,
.table-config.config-rule-compact td.autoexpand-col {
    min-width: 5.2rem !important;
    max-width: 8.75rem !important;
}

.table-config.config-rule-compact input:not([type="checkbox"]),
.table-config.config-rule-compact select,
.table-config.config-rule-compact textarea,
.table-config.config-rule-compact .form-control,
.table-config.config-rule-compact .form-select {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.table-config.config-rule-compact th.rule-action-cell,
.table-config.config-rule-compact td.rule-action-cell,
.table-config.config-rule-compact td.rule-action-cell.d-flex {
    width: var(--office-rule-action-cell-width) !important;
    min-width: var(--office-rule-action-cell-width) !important;
    max-width: var(--office-rule-action-cell-width) !important;
}

@media (min-width: 768px) {
    .config-table-scroll-wrap > .table-config.config-rule-compact {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    .table-config.config-rule-compact th:not(.action-cell),
    .table-config.config-rule-compact td:not(.action-cell) {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }
}

/* Requests grid final desktop fit: keep the table inside the page unless the user manually resizes columns wider. */
@media (min-width: 768px) {
.requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-status-col { width: 5.5rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-user-col { width: 6.35rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-date-col { width: 4.45rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-type-col { width: 8rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-param-date-col { width: 7.75rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-approver-col { width: 6rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-approval-col { width: 4.45rem !important; }
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) col.request-actions-col { width: 3.8rem !important; }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) th.request-date-header,
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) td.request-date-cell,
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) th.request-approval-header,
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) td.request-approval-cell {
        width: 4.45rem !important;
        min-width: 4.45rem !important;
        max-width: 4.45rem !important;
    }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) th,
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) td {
        min-width: 0 !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) td.text-cell {
        max-width: 18rem !important;
    }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) th.actions-col,
    .requests-grid-container .table-size-scroll-wrap > table.requests-grid:not(.resized-columns-table) td.actions-cell {
        width: 3.8rem !important;
        min-width: 3.8rem !important;
        max-width: 3.8rem !important;
    }

    .requests-grid-container .table-size-scroll-wrap > table.requests-grid th.actions-col {
        padding: 3px 3px !important;
        line-height: 1.2 !important;
        height: auto !important;
        min-height: 0 !important;
        vertical-align: middle !important;
        background: #1E3F6E !important;
        border: 0 !important;
        border-bottom: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
/* Category color input: keep the swatch visible inside compact configuration grids. */
.table-config input.category-color-input,
.table-size-scroll-wrap > .table-config input.category-color-input {
    width: 3.2rem !important;
    min-width: 3.2rem !important;
    max-width: 3.2rem !important;
    height: 1.45rem !important;
    min-height: 1.45rem !important;
    padding: 1px !important;
    border: 1px solid var(--office-table-border) !important;
    overflow: visible !important;
}
/* Rule configuration header actions */
.config-page-header-actions .config-rules-transfer-toolbar {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

.config-page-header-actions .config-rules-transfer-toolbar .btn,
.config-page-header-actions .config-rules-transfer-toolbar .config-rules-import-button,
.config-page-header-actions > .config-rule-add-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 7.1rem !important;
    width: 7.1rem !important;
    min-width: 7.1rem !important;
    max-width: 7.1rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.config-page-header-actions .config-rules-transfer-toolbar .btn:focus,
.config-page-header-actions .config-rules-transfer-toolbar .btn:active,
.config-page-header-actions .config-rules-transfer-toolbar .btn:focus-visible,
.config-page-header-actions > .config-rule-add-button:focus,
.config-page-header-actions > .config-rule-add-button:active,
.config-page-header-actions > .config-rule-add-button:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 767.98px) {
    .config-page-header-actions .config-rules-transfer-toolbar {
        flex: 0 0 auto !important;
        width: auto !important;
    }
}

.table-config.agent-settings-table .agent-visible-column {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: 4.25rem;
}

.table-config.agent-settings-table .agent-meeting-column {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}

.agent-meeting-controls {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.table-config.agent-settings-table input.agent-meeting-duration:not([type="checkbox"]) {
    flex: 0 0 3.25rem;
    width: 3.25rem;
    min-width: 3.25rem;
    max-width: 3.25rem;
}

.agent-meeting-unit {
    flex: 0 0 auto;
    color: inherit;
    opacity: 1;
}

/* Keep the sticky action border without fading the adjacent meeting unit. */
.table-size-scroll-wrap > .table-config.agent-settings-table th.action-cell,
.table-size-scroll-wrap > .table-config.agent-settings-table td.action-cell {
    box-shadow: -1px 0 0 var(--office-table-border) !important;
}

/* Agent filters: compact, wrapped, and consistent across config/agents and admin/agents */
.config-table-toolbar .config-table-toolbar-filters.agent-toolbar-filters {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    white-space: normal !important;
    align-items: center !important;
    gap: 0.35rem 0.5rem !important;
    padding-bottom: 0 !important;
}

.config-table-toolbar .config-table-toolbar-filters.agent-toolbar-filters > .agent-filter-text.form-control {
    flex: 0 1 12rem !important;
    width: 12rem !important;
    min-width: 9rem !important;
    max-width: 12rem !important;
}

.config-table-toolbar .config-table-toolbar-filters.agent-toolbar-filters > .agent-filter-version.form-control,
.config-table-toolbar .config-table-toolbar-filters.agent-toolbar-filters > .agent-filter-company.form-control {
    flex: 0 1 12rem !important;
    width: 12rem !important;
    min-width: 9rem !important;
    max-width: 12rem !important;
}

.config-table-toolbar .config-table-toolbar-filters.agent-toolbar-filters > .agent-visible-filter {
    height: 1.8rem !important;
    min-height: 1.8rem !important;
    font-size: 0.78rem !important;
}

.config-table-toolbar .agent-date-filter {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.3rem !important;
    min-height: 1.8rem !important;
    margin-left: auto !important;
    white-space: nowrap !important;
}

.config-table-toolbar .agent-date-filter-label {
    flex: 0 0 auto !important;
    color: #5f6b7a !important;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
}

.config-table-toolbar .agent-date-filter .agent-date-select.form-select {
    flex: 0 0 8.8rem !important;
    width: 8.8rem !important;
    min-width: 8.8rem !important;
    max-width: 8.8rem !important;
}

.config-table-toolbar .agent-date-filter .agent-date-input.form-control {
    flex: 0 0 8rem !important;
    width: 8rem !important;
    min-width: 8rem !important;
    max-width: 8rem !important;
}

@media (max-width: 700px) {
    .config-table-toolbar .agent-date-filter {
        flex-wrap: wrap !important;
        white-space: normal !important;
        row-gap: 0.25rem !important;
    }
}

/* Annual forms keep year and actions on the same toolbar, also inside owner dialogs. */
.config-table-toolbar.annual-config-toolbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center !important;
}
.config-table-toolbar.annual-config-toolbar > .config-year-toolbar-filters {
    width: auto !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
}
.config-table-toolbar.annual-config-toolbar > .config-table-toolbar-actions {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: end;
    justify-content: flex-end !important;
    align-items: center !important;
}
.config-table-toolbar.annual-config-toolbar > .config-table-toolbar-actions > .btn {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: nowrap !important;
}

/* General config/admin toolbar polish: keep header actions in-place, add breathing room below */
.config-page-header {
    margin-bottom: 0.65rem !important;
    row-gap: 0.4rem !important;
}

.config-page-header h4 {
    margin-bottom: 0 !important;
}

.config-page-header-actions {
    align-items: center !important;
    row-gap: 0.3rem !important;
}

.config-page-header-actions .table-transfer-toolbar,
.config-page-header-actions .config-pagination-controls,
.config-page-header-actions .config-rules-transfer-toolbar {
    align-items: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.config-page-header-actions .table-transfer-toolbar .btn,
.config-page-header-actions .config-pagination-controls .btn,
.config-page-header-actions .config-rules-transfer-toolbar .btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.config-table-toolbar {
    margin-top: 0.15rem !important;
    margin-bottom: 0.55rem !important;
    gap: 0.5rem !important;
}

.config-table-toolbar-filters,
.config-table-toolbar-actions {
    row-gap: 0.35rem !important;
}

.config-table-toolbar-filters + .config-table-toolbar-actions {
    margin-top: 0.25rem !important;
}

.config-table-toolbar + form,
.config-table-toolbar ~ form,
.config-table-toolbar ~ .config-table-scroll-wrap {
    margin-top: 0.1rem !important;
}

/* Datagrid header toolbars: same sizing as configuration/admin pages */
.config-page-header-actions.data-grid-page-header-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
    margin-left: auto !important;
    min-width: 0 !important;
}

.config-page-header-actions.data-grid-page-header-actions .table-transfer-toolbar,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .pagination-controls {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.config-page-header-actions.data-grid-page-header-actions .table-transfer-toolbar .btn,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .config-pagination-toggle,
.config-page-header-actions.data-grid-page-header-actions .data-grid-header-back-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    flex: 0 0 7.1rem !important;
    width: 7.1rem !important;
    min-width: 7.1rem !important;
    max-width: 7.1rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .pagination-controls .btn {
    flex: 0 0 1.75rem !important;
    width: 1.75rem !important;
    min-width: 1.75rem !important;
    max-width: 1.75rem !important;
    height: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0 !important;
    font-size: 0.7rem !important;
    margin: 0 !important;
}

.config-page-header-actions.data-grid-page-header-actions .table-transfer-toolbar .btn:focus,
.config-page-header-actions.data-grid-page-header-actions .table-transfer-toolbar .btn:active,
.config-page-header-actions.data-grid-page-header-actions .table-transfer-toolbar .btn:focus-visible,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .btn:focus,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .btn:active,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls .btn:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

body .data-grid-title-row.data-grid-print-summary-row {
    display: none !important;
}

/* Users and groups share compact data columns and a separate, non-destructive shortcut group. */
.table-size-scroll-wrap > .table-config.config-owner-table:not(.resized-columns-table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.table-size-scroll-wrap > .table-config.config-owner-table th:not(.manual-column-width),
.table-size-scroll-wrap > .table-config.config-owner-table td:not(.manual-column-width) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 3px;
    padding-right: 3px;
}

.config-page .table-size-scroll-wrap > .table-config.config-owner-table thead th:not(.action-cell) {
    white-space: normal !important;
    overflow-wrap: normal !important;
    text-overflow: clip !important;
    height: auto !important;
    padding: 3px !important;
    font-size: 0.72rem;
    line-height: 1.2;
}

.table-size-scroll-wrap > .table-config.config-owner-table input:not([type="checkbox"]),
.table-size-scroll-wrap > .table-config.config-owner-table select {
    min-width: 0 !important;
    max-width: 100%;
}

.config-owner-table col.owner-name-col { width: 8%; }
.config-owner-table col.owner-group-col { width: 7%; }
.config-owner-table col.owner-date-col { width: 8.5%; }
.config-owner-table col.owner-check-col { width: 3.5%; }
.config-owner-table col.owner-mail-check-col { width: 6%; }
.config-owner-table col.owner-number-col { width: 5%; }
.config-owner-table col.owner-hours-col { width: 76px; }
.config-owner-table col.owner-time-col { width: 7%; }
.config-owner-table col.owner-person-col { width: 8%; }
.config-owner-table col.owner-holidays-col { width: 76px; }
.config-owner-table col.owner-shortcuts-col { width: 34px; }
.config-owner-table col.owner-actions-col { width: 54px; }

.config-owner-personal col.owner-number-col { width: 7%; }
.config-owner-personal col.owner-hours-col { width: 76px; }
.config-owner-personal col.owner-time-col { width: 9%; }

.table-size-scroll-wrap > .table-config.config-owner-table th.action-cell,
.table-size-scroll-wrap > .table-config.config-owner-table td.action-cell {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
}

.table-size-scroll-wrap > .table-config.config-owner-table .owner-shortcuts-cell {
    width: 34px;
    padding-right: 3px;
    border-right: 1px solid var(--office-table-border);
    overflow: visible !important;
}

.config-owner-table .owner-shortcuts {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.config-owner-table .owner-shortcuts .btn-icon {
    flex: 0 0 22px;
}

.config-owner-table .owner-config-button:not(:disabled),
.config-owner-table .owner-config-button:not(:disabled) i {
    color: #2865a5 !important;
}

.config-owner-table th[data-resizable="false"] .column-resize-handle {
    display: none !important;
    pointer-events: none !important;
}

.config-owner-table .owner-hours-value {
    display: flex;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.config-owner-table .owner-hours-value input.form-control {
    flex: 1 1 0;
    width: 0;
}

.config-owner-table .owner-hours-value .btn-icon,
.config-owner-table .owner-holiday-value .btn-icon {
    flex: 0 0 22px;
}

.table-size-scroll-wrap > .table-config.config-owner-table .owner-holidays-cell {
    border-left: 1px solid var(--office-table-border);
    border-right: 1px solid var(--office-table-border);
}

.config-owner-table .owner-holiday-value {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    width: 100%;
    min-width: 0;
}

.config-owner-table .owner-holiday-value input.form-control {
    flex: 1 1 0;
    width: 0;
    text-align: right;
}

.config-owner-users col.owner-name-col { width: 7%; }
.config-owner-users col.owner-group-col { width: 6%; }
.config-owner-users col.owner-time-col { width: 6.5%; }

@media (max-width: 767.98px) {
    .table-size-scroll-wrap > .table-config.config-owner-table:not(.resized-columns-table) {
        min-width: 1040px !important;
    }
    .table-size-scroll-wrap > .table-config.config-owner-personal:not(.resized-columns-table) {
        min-width: 760px !important;
    }
}

@media (max-width: 900px) {
    .config-page-header-actions.data-grid-page-header-actions {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

@media print {
    body .data-grid-title-row.data-grid-print-summary-row {
        display: block !important;
        margin: 0 0 0.35rem 0 !important;
    }
}

/* Configuration headers can wrap without increasing the height of data rows. */
.table-config thead th:not(.action-cell) {
    white-space: normal !important;
    max-width: 12rem;
    height: auto !important;
    line-height: 1.2;
    text-wrap: balance;
}

.table-config thead th .sortable-header-text {
    white-space: normal;
    text-wrap: balance;
}

.table-size-scroll-wrap > .table-config.company-mail-settings-table:not(.resized-columns-table) {
    width: 100% !important;
    min-width: 1040px !important;
    max-width: none !important;
    table-layout: fixed !important;
}
.table-size-scroll-wrap > .table-config.company-mail-settings-table:not(.resized-columns-table) col.company-mail-detail-col {
    width: 6.5rem;
}
.table-size-scroll-wrap > .table-config.company-mail-settings-table:not(.resized-columns-table) thead th:not(.action-cell) {
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: normal;
    line-height: 1.2;
}

.table-config.company-settings-table .company-project-settings-cell {
    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;
}

.table-config.company-settings-table .company-request-settings-cell {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.table-config.company-settings-table :is(.company-project-settings-cell, .company-request-settings-cell) input[type="number"].form-control {
    flex: 0 0 54px;
    width: 54px !important;
    min-width: 0 !important;
    max-width: 54px !important;
    padding-left: 4px;
    padding-right: 2px;
}

.table-config.company-settings-table :is(.company-project-settings-cell, .company-request-settings-cell) [role="status"] {
    white-space: normal !important;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Fit company administration to the page; keep the existing manual resize option. */
.config-table-scroll-wrap .table-config.company-settings-table:not(.resized-columns-table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.table-config.company-settings-table:not(.resized-columns-table) :is(th, td) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 3px;
    padding-right: 3px;
}

.table-config.company-settings-table col.company-name-col { width: 5%; }
.table-config.company-settings-table col.company-sector-col { width: 11%; }
.table-config.company-settings-table col.company-language-col { width: 5%; }
.table-config.company-settings-table col.company-logo-col { width: 8%; }
.table-config.company-settings-table col.company-connection-col { width: 6%; }
.table-config.company-settings-table col.company-mobile-col { width: 5%; }
.table-config.company-settings-table col.company-office-col { width: 5%; }
.table-config.company-settings-table col.company-project-col { width: 168px; }
.table-config.company-settings-table col.company-reminder-col { width: 104px; }
.table-config.company-settings-table col.company-actions-col { width: 56px; }
.table-config.company-settings-table col.company-ai-col { width: 48px; }

.config-table-scroll-wrap .table-config.company-settings-table :is(th.action-cell, td.action-cell) {
    width: 56px !important;
    min-width: 0 !important;
    max-width: 56px !important;
}

.table-config.company-settings-table td.action-cell.d-flex {
    display: table-cell !important;
}

.table-config.company-settings-table .company-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.table-config.company-settings-table .company-row-actions > span,
.table-config.company-settings-table .company-row-actions .btn-icon {
    flex: 0 0 1.35rem;
}

.table-config.company-settings-table .company-row-actions > span {
    display: inline-flex;
}

.table-config.company-settings-table .company-sector-editor {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.table-config.company-settings-table .company-sector-editor > .form-select {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}

.table-config.company-settings-table .company-sector-editor > .btn-icon {
    flex: 0 0 1.35rem;
}

.table-config.company-settings-table .company-logo-editor {
    min-width: 0;
    max-width: 100%;
}

.table-config.company-settings-table thead th:not(.action-cell) {
    font-size: 0.72rem;
    overflow-wrap: normal;
    word-break: normal;
}

.table-config.company-settings-table thead th.company-flag-heading {
    text-align: center;
    font-size: 0.72rem;
}

.table-config.company-settings-table .company-flag-heading > span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.table-config.company-settings-table .company-project-heading {
    display: block;
    max-width: 112px;
}

.table-config.company-settings-table .logo-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-config.company-settings-table :is(.company-project-settings-cell, .company-request-settings-cell) input[type="number"].form-control {
    flex: 1 1 0;
    width: 0 !important;
    max-width: 54px !important;
}

@media (max-width: 1100px) {
    .table-config.company-settings-table col.company-name-col { width: 5%; }
    .table-config.company-settings-table col.company-sector-col { width: 12%; }
    .table-config.company-settings-table col.company-language-col { width: 5%; }
    .table-config.company-settings-table col.company-logo-col { width: 9%; }
    .table-config.company-settings-table col.company-connection-col { width: 6%; }
    .table-config.company-settings-table col.company-mobile-col { width: 4%; }
    .table-config.company-settings-table col.company-office-col { width: 4%; }
    .table-config.company-settings-table col.company-project-col { width: 154px; }
    .table-config.company-settings-table col.company-reminder-col { width: 68px; }
    .table-config.company-settings-table col.company-ai-col { width: 28px; }
}

/* Header navigation stays separate from export and paging actions. */
button.toolbar-refresh.toolbar-refresh,
.config-page-header-actions > .toolbar-refresh,
.config-page-header > .toolbar-refresh,
.toolbar-actions > .toolbar-refresh {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 28px;
    padding: 0;
    margin-right: 10px;
    color: #245b91;
    background: #eef5fc;
    border: 1px solid #7b9bbb;
    border-radius: 4px;
}
.toolbar-refresh:hover:not(:disabled) { background: #dcecfb; }
.config-page-header-actions .config-pagination-controls,
.config-page-header-actions.data-grid-page-header-actions .config-pagination-controls { margin-left: 10px !important; }
.activity-detail-header-actions .config-pagination-controls,
.mobile-activity-detail-header-actions .config-pagination-controls { margin-left: 10px !important; }
button.toolbar-back.toolbar-back,
a.toolbar-back.toolbar-back,
.config-page-header-actions > button.show-header-action.toolbar-back,
.config-page-header-actions > .toolbar-back,
.config-page-header-actions.data-grid-page-header-actions > .data-grid-header-back-button.toolbar-back,
.config-page-header > .toolbar-back,
.embedded-activity-grid-toolbar > .toolbar-back,
.guide-toolbar > .toolbar-back,
.toolbar-actions > .toolbar-back,
.activity-detail-header-actions > button.detail-back-button.toolbar-back,
.mobile-activity-detail-header-actions > button.detail-back-button.toolbar-back,
.activity-detail-header-actions > .toolbar-back,
.mobile-activity-detail-header-actions > .toolbar-back {
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 0 0 12px !important;
    color: #24466e !important;
    background: #f7f9fc !important;
    border: 1px solid #8a9bb0 !important;
    border-radius: 4px !important;
    font-size: 0 !important;
}
.toolbar-back > i { font-size: 14px !important; margin: 0 !important; }
.toolbar-back > span { display: none !important; }
.config-page-header > .toolbar-back,
.config-page-header > div:not(.config-page-header-actions) > .toolbar-back,
.guide-toolbar > .toolbar-back,
.toolbar-actions > .toolbar-back,
.activity-detail-header-actions > .toolbar-back,
.mobile-activity-detail-header-actions > .toolbar-back { display: inline-flex !important; }
.toolbar-back.toolbar-back:hover:not(:disabled),
.toolbar-back.toolbar-back:focus-visible,
.config-page-header-actions.data-grid-page-header-actions > .data-grid-header-back-button.toolbar-back:hover:not(:disabled),
.config-page-header-actions.data-grid-page-header-actions > .data-grid-header-back-button.toolbar-back:focus-visible,
.activity-detail-header-actions > button.detail-back-button.toolbar-back:hover:not(:disabled),
.activity-detail-header-actions > button.detail-back-button.toolbar-back:focus-visible,
.mobile-activity-detail-header-actions > button.detail-back-button.toolbar-back:hover:not(:disabled),
.mobile-activity-detail-header-actions > button.detail-back-button.toolbar-back:focus-visible,
.toolbar-refresh.toolbar-refresh:hover:not(:disabled),
.toolbar-refresh.toolbar-refresh:focus-visible {
    background: #eef2f6 !important;
    color: #26354a !important;
}
.toolbar-back.toolbar-back:focus-visible,
.toolbar-refresh.toolbar-refresh:focus-visible {
    outline: 2px solid #386a9c !important;
    outline-offset: 2px;
}
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.config-page-header-actions { flex-wrap: nowrap !important; justify-content: flex-end !important; }
