/**
 * OptimaDrywall Flow — unified button dimensions (design system).
 * Matches Bootstrap 5.3 .form-control / .form-select height.
 * Colors and behavior unchanged — dimensions only.
 */

:root {
    --app-btn-height: calc(1.5em + 0.75rem + 2px);
    --app-btn-padding-y: 0.375rem;
    --app-btn-padding-x: 0.75rem;
    --app-btn-font-size: 1rem;
    --app-btn-line-height: 1.5;
    --app-btn-radius: 0.375rem;
    --app-btn-gap: 0.35rem;
    --app-btn-icon-size: 0.875rem;
}

/* Main application shell — excludes login and specialty field-work controls */
body.app-shell-active .btn:not(.btn-close):not(.btn-link):not(.btn-work-action) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--app-btn-gap);
    box-sizing: border-box;
    min-height: var(--app-btn-height);
    height: var(--app-btn-height);
    padding: var(--app-btn-padding-y) var(--app-btn-padding-x);
    font-size: var(--app-btn-font-size);
    font-weight: 500;
    line-height: var(--app-btn-line-height);
    border-radius: var(--app-btn-radius);
    white-space: nowrap;
}

body.app-shell-active .btn:not(.btn-close):not(.btn-link):not(.btn-work-action) i {
    font-size: var(--app-btn-icon-size);
    line-height: 1;
    width: 1em;
    text-align: center;
}

/* Normalize Bootstrap size variants to the same standard */
body.app-shell-active .btn-sm:not(.btn-close):not(.btn-link):not(.btn-work-action),
body.app-shell-active .btn-lg:not(.btn-close):not(.btn-link):not(.btn-work-action) {
    min-height: var(--app-btn-height);
    height: var(--app-btn-height);
    padding: var(--app-btn-padding-y) var(--app-btn-padding-x);
    font-size: var(--app-btn-font-size);
    line-height: var(--app-btn-line-height);
}

/* Grid / table icon actions — consistent square footprint */
body.app-shell-active .table .btn:not(.btn-close):not(.btn-link),
body.app-shell-active .table-responsive .btn:not(.btn-close):not(.btn-link) {
    min-width: var(--app-btn-height);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Buttons beside inputs, selects, and date fields */
body.app-shell-active .input-group > .btn,
body.app-shell-active .tool-form-group-row > .btn,
body.app-shell-active .btn-input-aligned,
body.app-shell-active .d-flex.align-items-stretch > .btn:not(.btn-work-action) {
    flex-shrink: 0;
    align-self: stretch;
    height: var(--app-btn-height);
    min-height: var(--app-btn-height);
}

body.app-shell-active form .row.g-3 > [class*="col-"].d-flex > .btn.w-100 {
    width: 100%;
    align-self: stretch;
}

/* Modal footers */
body.app-shell-active .modal-footer .btn:not(.btn-close):not(.btn-link) {
    margin: 0;
}

/* Flatpickr footer actions (not .btn — align to same height) */
.app-date-picker-action {
    min-height: var(--app-btn-height);
    height: var(--app-btn-height);
    padding: var(--app-btn-padding-y) var(--app-btn-padding-x);
    font-size: var(--app-btn-font-size);
    line-height: var(--app-btn-line-height);
    border-radius: var(--app-btn-radius);
    box-sizing: border-box;
}

@media (max-width: 767.98px) {
    body.app-shell-active .tool-form-group-row {
        flex-wrap: wrap;
    }

    body.app-shell-active .tool-form-group-row > .btn {
        width: 100%;
    }
}
