/* Flat application workspaces -------------------------------------------------
   Forms and workflow sections share one page canvas. Purpose-specific overlays,
   navigation, dashboards, authentication and printed output keep their surfaces. */
@media screen {
    .application-workspace .workspace-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #e4e8ef;
    }

    .application-workspace .workspace-table {
        width: 100%;
        border-bottom: 1px solid #e4e8ef;
    }

    .application-workspace .workspace-table thead th {
        white-space: nowrap;
        color: #5a6a85;
        font-weight: 600;
        border-top: 0;
    }

    .application-workspace .modal fieldset:last-child {
        border-bottom: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .body-wrapper [data-module] .card:not(.metric-card):not(.summary-card),
    .body-wrapper .card:has(> form),
    .body-wrapper .card:has(> .table-responsive),
    .body-wrapper .card:has(> table) {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none !important;
        margin-bottom: 1.5rem;
    }

    .body-wrapper [data-module] .card > .card-header,
    .body-wrapper .card:has(> form) > .card-header,
    .body-wrapper .card:has(> .table-responsive) > .card-header,
    .body-wrapper .card:has(> table) > .card-header {
        background: transparent;
        border: 0;
        border-bottom: 1px solid #e4e8ef;
        border-radius: 0;
        padding: .75rem 0;
    }

    .body-wrapper [data-module] .card > .card-body,
    .body-wrapper [data-module] .card > .card-footer,
    .body-wrapper .card:has(> form) > .card-body,
    .body-wrapper .card:has(> .table-responsive) > .card-body,
    .body-wrapper .card:has(> table) > .card-body {
        background: transparent;
        border: 0;
        padding: 1rem 0;
    }

    .body-wrapper [data-module] .card .card {
        border-top: 1px solid #e4e8ef;
        padding-top: 1rem;
    }

    .modal .card,
    .dropdown-menu .card,
    .swal2-container .card {
        background: var(--bs-card-bg, #fff);
    }

    @media (max-width: 767.98px) {
        .application-workspace .workspace-toolbar,
        .application-workspace .workspace-toolbar > div,
        .application-workspace .workspace-toolbar > form {
            width: 100%;
        }

        .application-workspace .workspace-toolbar .btn {
            flex: 1 1 auto;
        }
    }
}

/* Keep Select2 multi-select choices readable even though the vendor stylesheet is loaded later. */
.modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #e9f0ff !important;
  border-color: #9ab4f8 !important;
  color: #172033 !important;
}

.modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  border-color: #9ab4f8 !important;
  color: #334155 !important;
}

.modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
  background-color: #dbe7ff !important;
  color: #0f172a !important;
}

.left-sidebar .nav-icon-tile {
    width: 36px !important;
    min-width: 36px;
    height: 36px !important;
    border-radius: 10px;
    font-size: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.left-sidebar .sidebar-link:hover .nav-icon-tile,
.left-sidebar .sidebar-link.active .nav-icon-tile {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgb(15 23 42 / 12%);
}

.nav-icon-clinic { color: #0f766e; background: #ccfbf1; }
.nav-icon-cost { color: #c2410c; background: #ffedd5; }
.nav-icon-inventory { color: #047857; background: #d1fae5; }
.nav-icon-materials { color: #1d4ed8; background: #dbeafe; }
.nav-icon-lab { color: #6d28d9; background: #ede9fe; }
.nav-icon-governance { color: #be123c; background: #ffe4e6; }
.nav-icon-accounting { color: #4338ca; background: #e0e7ff; }
.nav-icon-reports { color: #0e7490; background: #cffafe; }
.nav-icon-operations { color: #15803d; background: #dcfce7; }
.nav-icon-templates { color: #7e22ce; background: #f3e8ff; }
.nav-icon-dental { color: #b45309; background: #fef3c7; }
.nav-icon-aesthetic { color: #be185d; background: #fce7f3; }
.nav-icon-packages { color: #a16207; background: #fef9c3; }

[dir="rtl"] .left-sidebar .nav-icon-tile { margin-left: .25rem; margin-right: 0; }

/* Keep every label and icon readable on the primary blue surface. */
.bg-primary,
.bg-primary *,
.btn-primary,
.btn-primary *,
.nav-pills .nav-link.active,
.nav-pills .nav-link.active *,
table thead.bg-primary th {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.bg-primary a:hover,
.bg-primary a:focus,
.bg-primary button:hover,
.bg-primary button:focus {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.bg-primary svg {
    color: #fff !important;
    fill: currentColor;
}

.modal .modal-header.bg-primary .modal-title,
.modal .modal-header.bg-primary h1,
.modal .modal-header.bg-primary h2,
.modal .modal-header.bg-primary h3,
.modal .modal-header.bg-primary h4,
.modal .modal-header.bg-primary h5,
.modal .modal-header.bg-primary h6,
.modal .modal-header.bg-primary i {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.modal .modal-header.bg-primary {
    --bs-heading-color: #fff;
    color: #fff !important;
}

.modal .modal-header.bg-primary .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 1;
}

.application-workspace table.table thead.bg-primary > tr > th,
table.table thead.bg-primary > tr > th {
    color: #fff !important;
    background-color: var(--bs-primary, #5d87ff) !important;
}

.modal .select2-container { width: 100% !important; }
.modal .select2-container--default .select2-selection--multiple {
    min-height: 42px;
    border: 1px solid #dfe5ef;
    border-radius: .375rem;
    padding: .2rem .35rem;
}
.modal .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #8eabff;
    box-shadow: 0 0 0 .2rem rgb(93 135 255 / 18%);
}
.input-group > .select2-container {
    flex: 1 1 auto;
    min-width: 0;
    width: 1% !important;
}

.input-group > .select2-container .select2-selection {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

body.embedded-page .left-sidebar,
body.embedded-page .app-header,
body.embedded-page .fixed-profile {
    display: none !important;
}

body.embedded-page .body-wrapper {
    margin-left: 0 !important;
    padding-top: 0 !important;
    background: #fff !important;
}

body.embedded-page {
    background: #fff !important;
}

.app-single-option-source {
    display: none !important;
}

.app-single-option-display {
    display: flex;
    min-height: 42px;
    align-items: center;
    background: #f8fafc;
    color: #28364a;
    font-weight: 600;
    cursor: default;
    white-space: normal;
}

body.embedded-page .body-wrapper > .container-fluid {
    max-width: none !important;
    padding: 1rem !important;
}

body.embedded-page .body-wrapper .card {
    margin-bottom: 0;
    box-shadow: none;
}
