/* Betoniks admin overrides (Jazzmin 3 / AdminLTE 4 / Bootstrap 5) */

.app-main {
    min-width: 0;
}

/* Avoid post-load width animation on change forms */
.change-form .app-main {
    transition: none !important;
}

.change-form .app-content > .container-fluid > .row {
    margin-left: 0;
    margin-right: 0;
}

.change-form #content-main {
    width: 100%;
    max-width: 100%;
}

/*
 * Stable two-column layout: main area + action sidebar.
 * CSS grid avoids Bootstrap flex recalculation when Select2 / maps init after load.
 */
.change-form #content-main > form > .betoniks-change-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
    margin: 0;
}

@media (min-width: 992px) {
    .change-form #content-main > form > .betoniks-change-form-layout {
        grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
        align-items: start;
    }
}

.change-form #content-main > form > .betoniks-change-form-layout > .col-lg-9,
.change-form #content-main > form > .betoniks-change-form-layout > .betoniks-admin-dashboard {
    grid-column: 1;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    min-width: 0;
}

.change-form #content-main > form > .betoniks-change-form-layout > .col-lg-3 {
    grid-column: 1;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

@media (min-width: 992px) {
    .change-form #content-main > form > .betoniks-change-form-layout > .col-lg-3 {
        grid-column: 2;
        grid-row: 1;
    }

    .change-form #content-main > form > .betoniks-change-form-layout > .col-lg-9,
    .change-form #content-main > form > .betoniks-change-form-layout > .betoniks-admin-dashboard {
        grid-row: 1;
    }
}

.change-form #jazzy-actions {
    position: sticky;
    top: 1rem;
    align-self: start;
}

#jazzy-actions .d-flex {
    align-items: stretch !important;
}

#jazzy-actions .d-flex > .form-group,
#jazzy-actions .d-flex > .cast-submit-line-actions,
#jazzy-actions .d-flex .cast-submit-line-actions > .form-group,
#jazzy-actions .d-flex .dropdown {
    width: 100%;
}

#jazzy-actions .d-flex .btn,
#jazzy-actions .d-flex input[type="submit"],
#jazzy-actions .d-flex a.btn,
#jazzy-actions .d-flex .dropdown .dropdown-toggle {
    width: 100%;
    min-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#jazzy-actions .d-flex .dropdown .dropdown-menu {
    width: 100%;
    z-index: 1050;
}

/* Hidden tab panes must not affect horizontal layout */
.change-form .tab-content > .tab-pane:not(.active) {
    display: none !important;
}

/* Select2 in hidden tabs used to expand the row after init */
.change-form .tab-pane:not(.active) .select2-container {
    display: none !important;
}

.betoniks-admin-dashboard table[class*="col-"] {
    display: table;
    width: 100%;
}

.betoniks-admin-dashboard table th[class*="col-"],
.betoniks-admin-dashboard table td[class*="col-"] {
    display: table-cell !important;
    width: auto !important;
    max-width: none !important;
    flex: none !important;
}

.betoniks-admin-dashboard table.tablet {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.betoniks-admin-dashboard table.tablet thead th {
    color: #fff;
    text-align: center;
    vertical-align: middle;
}

.betoniks-admin-dashboard table.tablet th,
.betoniks-admin-dashboard table.tablet td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
}

.betoniks-admin-dashboard .blue-header,
.betoniks-admin-dashboard tr.blue-header th {
    background-color: #007bff;
    color: #fff;
}

.betoniks-admin-dashboard .cast-chart,
.betoniks-admin-dashboard [id$="Chart"],
.betoniks-admin-dashboard #aging,
.betoniks-admin-dashboard #strength,
.betoniks-admin-dashboard #speedChart {
    width: 100%;
    min-height: 400px;
}

.betoniks-admin-dashboard .project-overview-cast {
    width: 100%;
}

.betoniks-admin-dashboard .project-map-widget {
    width: 100%;
}

.betoniks-admin-dashboard .project-map-widget .leaflet-container {
    width: 100% !important;
    z-index: 1;
}

.betoniks-admin-dashboard #map-container,
.betoniks-admin-dashboard #map {
    width: 100% !important;
    max-width: 100%;
}

.betoniks-admin-dashboard .right-buttons {
    position: static;
    transform: none;
    margin-top: 0.75rem;
}

.cast-submit-line-actions .form-group .btn,
.cast-submit-line-actions > .btn {
    min-height: 38px;
}

.project-overview-cast {
    overflow-x: auto;
}

.bg-light-green {
    background-color: #d4edda;
}
