:root {
    --text-color: #6b7280;
    --default-color: #3B7D8C;
    --primary-background-color: #fff;
    --primary-background: var(--primary-background-color);
    --secondary-background-color: #FAFCFF;
    --background-hover: #EBF2F3;
    --primary-color: #3F5A76;
    --text-secondary: #4b5563;
    --admin-header-height: 56px;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    color: #3e4b64;
    background-color: #fafcff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap 4 media object compatibility */
.media {
    display: flex;
    align-items: flex-start;
}

.media-body {
    flex: 1;
}

.user-wizard {
    padding-top: 0.75rem;
    padding-bottom: 1rem;
}

/* Form spacing to match legacy layout */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    margin-bottom: 0.4rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-control,
.form-select,
select.form-control {
    min-height: 1.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

select.form-control,
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239aa5b1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2 6l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 12px;
    padding-right: 2rem;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.title-default {
    color: var(--default-color);
}

.title-block {
    background-color: var(--primary-background, var(--primary-background-color));
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: #313131 !important;
}

a.text-secondary:focus,
a.text-secondary:hover {
    color: #313131 !important;
}

a.text-primary:focus,
a.text-primary:hover {
    color: var(--primary-color) !important;
}

.c-main {
    background-color: var(--secondary-background-color);
    padding: 0.75rem 0;
}

.c-main .container,
.c-main .container-fluid,
.c-main .container-xl,
.c-main .container-xxl {
    padding-top: 0.25rem;
}

.c-header {
    background-color: var(--default-color);
}

.c-header i {
    color: var(--primary-background-color);
}

/* Match legacy CoreUI navbar tone */
.admin-navbar {
    background-color: var(--default-color);
}

.admin-navbar .c-header-nav-link,
.admin-navbar .c-header-nav-link:hover,
.admin-navbar .c-header-nav-link:focus {
    color: #ffffff;
}

.navbar-dark.bg-secondary {
    background-color: var(--default-color) !important;
}

.navbar-dark.bg-secondary .nav-link,
.navbar-dark.bg-secondary .navbar-brand {
    color: #ffffff;
}

.navbar-dark.bg-secondary .nav-link:hover,
.navbar-dark.bg-secondary .nav-link:focus {
    color: rgba(255, 255, 255, 0.85);
}

.c-sidebar {
    background-color: var(--primary-background-color);
}

/* CoreUI v3 sidebar class compatibility for CoreUI v5 */
.c-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 256px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.4s ease;
}

.c-sidebar-nav {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.c-sidebar-nav-item,
.c-sidebar-nav-dropdown {
    display: block;
}

.c-sidebar-nav-link,
.c-sidebar-nav-dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 0.8445rem 1rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.9rem;
    font-weight: 400;
    color: #4f5d73;
    background: transparent;
}

.c-sidebar-nav-title {
    padding: 0.65rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9da5b1;
    font-weight: 700;

}

.c-sidebar-nav-dropdown-items {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: none;
}

.c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-items {
    display: block;
}

.c-wrapper {
    min-height: 100vh;
    padding-left: 256px;
}

@media (max-width: 991.98px) {
    .c-sidebar {
        margin-left: -256px;
    }

    .c-sidebar.c-sidebar-show {
        margin-left: 0;
    }

    .c-wrapper {
        padding-left: 0;
    }
}

@media (min-width: 992px) {
    .c-sidebar {
        margin-left: -256px;
    }

    .c-sidebar.c-sidebar-lg-show {
        margin-left: 0;
    }

    .c-sidebar:not(.c-sidebar-lg-show) ~ .c-wrapper {
        padding-left: 0;
    }
}

.c-sidebar .c-sidebar-nav .c-sidebar-nav-item .c-sidebar-nav-link {
    color: #4f5d73;
}

.lucide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}

a.c-sidebar-nav-link:hover {
    background-color: #eef2f5 !important;
    color: #4f5d73 !important;
}

a.c-sidebar-nav-link.c-active,
a.c-sidebar-nav-link:active {
    background-color: #eef2f5 !important;
    color: #4f5d73 !important;
}

.admin-sidebar-nav :is(.c-sidebar-nav-link, .c-sidebar-nav-dropdown-toggle) [data-lucide],
.admin-sidebar-nav :is(.c-sidebar-nav-link, .c-sidebar-nav-dropdown-toggle) .lucide {
    height: 20px;
    margin-right: 0.65rem;
    flex-shrink: 0;
    color: #4f5d73;
}

.c-sidebar-nav-dropdown .c-sidebar-nav-dropdown-toggle {
    color: #4f5d73;
    position: relative;
    padding-right: 2rem;
}

a.c-sidebar-nav-dropdown-toggle:hover {
    background-color: #eef2f5 !important;
    color: #4f5d73 !important;
}

a.c-sidebar-nav-dropdown-toggle:hover i.fa-fw.fas.c-sidebar-nav-icon {
    color: #4f5d73
}

a.c-sidebar-nav-dropdown-toggle:hover i.fa-fw.far.c-sidebar-nav-icon {
    color: #4f5d73
}

.c-sidebar-nav-dropdown .c-sidebar-nav-dropdown-toggle .c-sidebar-nav-icon {
    color: #4f5d73;
}

.c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle {
    background-color: #eef2f5 !important;
    color: #4f5d73 !important;
}

.c-sidebar .c-sidebar-nav-dropdown .c-sidebar-nav-dropdown-items {
    background-color: var(--primary-background-color);
    padding-left: 0;
    margin-left: 0;
}

.c-sidebar .c-sidebar-nav-dropdown .c-sidebar-nav-dropdown-items .c-sidebar-nav-link {
    background-color: var(--primary-background-color);
    padding-left: 1.4rem;
}

.c-sidebar-nav-dropdown .c-sidebar-nav-dropdown-toggle::after {
    content: "";
    position: absolute;
    right: 0.875rem;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.2s ease;
}

.c-sidebar-nav-dropdown.c-show > .c-sidebar-nav-dropdown-toggle::after,
.c-sidebar-nav-dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(-135deg);
}

.c-sidebar-nav .c-sidebar-nav-title {
    color: #9da5b1;
    margin-top: 0px;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
}

.admin-sidebar .admin-sidebar-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-sidebar-logout {
    margin-top: auto;
    border-top: 1px solid #f1f3f5;
}

.admin-sidebar-logout .c-sidebar-nav-link {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.admin-sidebar-nav .badge {
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
    background-color: #636f83;
    color: #ffffff;
}

.admin-sidebar-nav .c-sidebar-nav-link .badge,
.admin-sidebar-nav .c-sidebar-nav-dropdown-toggle .badge {
    margin-left: auto;
}

.ck-editor__editable,
textarea {
    min-height: 150px;
}

.datatable {
    width: 100% !important;
}

.dataTables_length,
.dataTables_filter,
.dataTables_filter {
    margin-right: .2rem;
}

.table.datatable {
    box-sizing: border-box;
    border-collapse: collapse;
}

.table {
    --table-border-color: #d8dbe0;
    color: #4f5d73;
}

.table > :not(caption) > * > * {
    border-color: var(--table-border-color);
}

.table thead th {
    background-color: #f0f3f5;
    color: #4f5d73;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f9fafb;
}

.table-hover > tbody > tr:hover {
    background-color: #f1f5f9;
}

table.dataTable thead th {
    border-bottom: 2px solid #c8ced3;
}

.dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom: 1px solid #c8ced3;
}

.select2 {
    max-width: 100%;
    width: 100% !important;
}

#relatorioPlantaoWrapper.relatorio-plantao-page {
    padding: 1.5rem 1.75rem 2.5rem;
    background: #f5f7fb;
    border-radius: 14px;
}

#relatorioPlantaoWrapper .report-toolbar {
    gap: 1rem;
}

#relatorioPlantaoWrapper .report-back-button {
    border-color: #9aa9bd;
    color: #5b6c82;
    font-weight: 600;
}

#relatorioPlantaoWrapper .report-download-button {
    background: #3f556f;
    border-color: #3f556f;
    font-weight: 600;
}

#relatorioPlantaoWrapper .report-card {
    border-radius: 14px;
    border: 0;
    box-shadow: 0 10px 24px rgba(27, 39, 55, 0.08);
}

#relatorioPlantaoWrapper .report-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #3b3b3b;
    margin-bottom: 1.25rem;
}

#relatorioPlantaoWrapper .report-summary {
    background: #f7f9fb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

#relatorioPlantaoWrapper .report-logo img {
    width: 210px;
    max-width: 100%;
}

#relatorioPlantaoWrapper .report-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left: 1px solid #e3e8ee;
    padding-left: 1.5rem;
}

#relatorioPlantaoWrapper .report-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#relatorioPlantaoWrapper .report-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #5f6b7c;
    font-weight: 500;
}

#relatorioPlantaoWrapper .report-status .status-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--status-color);
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

#relatorioPlantaoWrapper .report-meta-item strong {
    color: #3a3a3a;
    font-weight: 700;
}

#relatorioPlantaoWrapper .report-table .table {
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

#relatorioPlantaoWrapper .report-table thead th {
    background: #f4f6f8;
    color: #5a6574;
    font-weight: 700;
    border-bottom: 1px solid #e3e8ee;
}

#relatorioPlantaoWrapper .report-table td {
    border-top: 1px solid #e3e8ee;
    color: #3f3f3f;
}

#relatorioPlantaoWrapper .report-table .table tbody tr:hover {
    background: #f9fbfd;
}

#relatorioPlantaoWrapper .escala-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    margin-right: 0.35rem;
    margin-bottom: 0.2rem;
    border-radius: 6px;
    border: 1px solid #a9c0d2;
    background: #f1f6fa;
    color: #4b7a95;
    font-size: 0.75rem;
    font-weight: 600;
}

#relatorioPlantaoWrapper .report-totals {
    margin-top: 2rem;
}

#relatorioPlantaoWrapper .report-total-card {
    background: #f7f9fb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-align: center;
    color: #4f4f4f;
    font-weight: 600;
}

#relatorioPlantaoWrapper .report-total-card strong {
    margin-left: 0.4rem;
    color: #2d2d2d;
}

.status-aberto {
    --status-color: #f6d710;
    --status-color-hover: #d1b60f;
    --status-color-rgb: 246, 215, 16;
    color: var(--status-color);
}

.status-aprovado-medico {
    --status-color: #0F766E;
    --status-color-hover: #0b5e57;
    --status-color-rgb: 15, 118, 110;
    color: var(--status-color);
}

.status-aprovado-gestao {
    --status-color: #166534;
    --status-color-hover: #11512a;
    --status-color-rgb: 22, 101, 52;
    color: var(--status-color);
}

.status-aprovado {
    --status-color: #14532D;
    --status-color-hover: #0f4022;
    --status-color-rgb: 20, 83, 45;
    color: var(--status-color);
}

.status-contestado {
    --status-color: #92400E;
    --status-color-hover: #7a350c;
    --status-color-rgb: 146, 64, 14;
    color: var(--status-color);
}

.status-cancelado {
    --status-color: #991B1B;
    --status-color-hover: #7f1515;
    --status-color-rgb: 153, 27, 27;
    color: var(--status-color);
}

.status-pago {
    --status-color: #1D4ED8;
    --status-color-hover: #1e40af;
    --status-color-rgb: 29, 78, 216;
    color: var(--status-color);
}

.btn.status-aberto,
.btn.status-aprovado-medico,
.btn.status-aprovado-gestao,
.btn.status-aprovado,
.btn.status-contestado,
.btn.status-cancelado,
.btn.status-pago {
    background-color: transparent;
    border-color: var(--status-color);
    color: var(--status-color);
}

.btn.status-aberto:hover,
.btn.status-aprovado-medico:hover,
.btn.status-aprovado-gestao:hover,
.btn.status-aprovado:hover,
.btn.status-contestado:hover,
.btn.status-cancelado:hover,
.btn.status-pago:hover {
    background-color: var(--status-color);
    border-color: var(--status-color);
    color: #fff;
}

.btn.status-aberto:focus,
.btn.status-aberto.focus,
.btn.status-aprovado-medico:focus,
.btn.status-aprovado-medico.focus,
.btn.status-aprovado-gestao:focus,
.btn.status-aprovado-gestao.focus,
.btn.status-aprovado:focus,
.btn.status-aprovado.focus,
.btn.status-contestado:focus,
.btn.status-contestado.focus,
.btn.status-cancelado:focus,
.btn.status-cancelado.focus,
.btn.status-pago:focus,
.btn.status-pago.focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--status-color-rgb), 0.5);
}

.btn.status-aberto:not(:disabled):not(.disabled).active,
.btn.status-aberto:not(:disabled):not(.disabled):active,
.show > .btn.status-aberto.dropdown-toggle,
.btn.status-aprovado-medico:not(:disabled):not(.disabled).active,
.btn.status-aprovado-medico:not(:disabled):not(.disabled):active,
.show > .btn.status-aprovado-medico.dropdown-toggle,
.btn.status-aprovado-gestao:not(:disabled):not(.disabled).active,
.btn.status-aprovado-gestao:not(:disabled):not(.disabled):active,
.show > .btn.status-aprovado-gestao.dropdown-toggle,
.btn.status-aprovado:not(:disabled):not(.disabled).active,
.btn.status-aprovado:not(:disabled):not(.disabled):active,
.show > .btn.status-aprovado.dropdown-toggle,
.btn.status-contestado:not(:disabled):not(.disabled).active,
.btn.status-contestado:not(:disabled):not(.disabled):active,
.show > .btn.status-contestado.dropdown-toggle,
.btn.status-cancelado:not(:disabled):not(.disabled).active,
.btn.status-cancelado:not(:disabled):not(.disabled):active,
.show > .btn.status-cancelado.dropdown-toggle,
.btn.status-pago:not(:disabled):not(.disabled).active,
.btn.status-pago:not(:disabled):not(.disabled):active,
.show > .btn.status-pago.dropdown-toggle {
    background-color: var(--status-color);
    border-color: var(--status-color);
    color: #fff;
}

.btn.status-aberto:not(:disabled):not(.disabled).active:focus,
.btn.status-aberto:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-aberto.dropdown-toggle:focus,
.btn.status-aprovado-medico:not(:disabled):not(.disabled).active:focus,
.btn.status-aprovado-medico:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-aprovado-medico.dropdown-toggle:focus,
.btn.status-aprovado-gestao:not(:disabled):not(.disabled).active:focus,
.btn.status-aprovado-gestao:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-aprovado-gestao.dropdown-toggle:focus,
.btn.status-aprovado:not(:disabled):not(.disabled).active:focus,
.btn.status-aprovado:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-aprovado.dropdown-toggle:focus,
.btn.status-contestado:not(:disabled):not(.disabled).active:focus,
.btn.status-contestado:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-contestado.dropdown-toggle:focus,
.btn.status-cancelado:not(:disabled):not(.disabled).active:focus,
.btn.status-cancelado:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-cancelado.dropdown-toggle:focus,
.btn.status-pago:not(:disabled):not(.disabled).active:focus,
.btn.status-pago:not(:disabled):not(.disabled):active:focus,
.show > .btn.status-pago.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--status-color-rgb), 0.5);
}

@media (max-width: 991.98px) {
    #relatorioPlantaoWrapper.relatorio-plantao-page {
        padding: 1.25rem;
    }

    #relatorioPlantaoWrapper .report-summary {
        padding: 1.25rem;
    }

    #relatorioPlantaoWrapper .report-meta {
        border-left: 0;
        padding-left: 0;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    #relatorioPlantaoWrapper .report-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #relatorioPlantaoWrapper .report-back-button,
    #relatorioPlantaoWrapper .report-download-button {
        width: 100%;
        justify-content: center;
    }

    #relatorioPlantaoWrapper .report-meta-row {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.select2-selection__rendered {
    padding-bottom: 5px !important;
}

.select2-multicheck-selection .select2-selection__rendered {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
}

.select2-multicheck-selection .select2-selection__choice,
.select2-multicheck-selection .select2-selection__choice__remove {
    display: none;
}

.select2-multicheck-selection .select2-selection__rendered > li:not(.select2-search) {
    display: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    display: none !important;
}

.select2-multicheck-selection .select2-selection__rendered {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.select2-multicheck-selection .select2-selection__rendered > span {
    display: none;
}

.select2-container--default .select2-selection--single,
.select2-multicheck-selection.select2-selection--multiple {
    position: relative;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding-right: 2.25rem;
    overflow: visible;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
    height: 100%;
    right: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #636f83 transparent transparent transparent;
    border-width: 5px 4px 0 4px;
}

.select2-container--default .select2-selection--single::after,
.select2-multicheck-selection.select2-selection--multiple::after,
.select2-container--default .select2-selection--multiple::after {
    content: "" !important;
    display: block;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23636f83' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 10px 6px !important;
    pointer-events: none;
    z-index: 2;
}

.select2-container--default .select2-selection--single .select2-selection__clear,
.select2-multicheck-selection.select2-selection--multiple .select2-selection__clear,
.select2-container--default .select2-selection--multiple .select2-selection__clear {
    margin-right: 1.25rem;
    right: 1.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0.75rem;
    padding-right: 2.25rem;
    line-height: 1.6;
}

.select2-multicheck-selection .select2-selection__rendered {
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 38px;
    width: 100%;
    padding-right: 2.25rem;
    gap: 0.5rem;
}

.select2-multicheck-selection .select2-search--inline {
    flex: 0 0 auto;
    margin: 0;
}

.select2-multicheck-selection .select2-search__field {
    width: auto !important;
    margin: 0;
    padding: 0;
    min-height: 24px;
}

.select2-multicheck-selection .select2-search__field {
    width: 100% !important;
    min-width: 100% !important;
}

.select2-multicheck-dropdown .select2-search--dropdown {
    padding: 0.4rem 0.75rem;
}

.select2-multicheck-dropdown .select2-search__field {
    width: 100% !important;
    margin: 0;
    padding: 0.35rem 0.5rem;
}

.select2-multicheck-dropdown .select2-results__option {
    padding: 0.4rem 0.75rem;
}



.medicos-filters .form-control {
    height: 38px;
}

.medicos-filters .filter-actions .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.medicos-clear-btn {
    height: 38px;
    padding: 0 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.medico-pessoal-table th,
.medico-profissional-table th,
.medico-endereco-table th,
.medico-forma-pagamento-table th,
.medico-vinculos-table th,
.medico-documentos-table th {
    width: 200px;
}

.medicos-filters .medicos-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: flex-end;
}

.medicos-filters .medicos-filter-row > [class^="col-"] {
    width: auto;
    padding-left: 0;
    padding-right: 0;
}

.medicos-filters {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.medicos-clear-btn {
    min-width: 120px;
}

@media (max-width: 991.98px) {
    .medicos-filters .medicos-filter-row {
        grid-template-columns: 1fr;
    }
}

.btn-info,
.badge-info {
    color: white;
}

.badge.bg-success,
.badge.bg-danger,
.badge.text-bg-success,
.badge.text-bg-danger {
    color: #fff;
}

.btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.2;
}

.btn-sm,
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.btn-lg,
.btn-group-lg > .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    line-height: 1.2;
}

.btn-primary {
    color: var(--primary-background-color);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    color: var(--primary-background-color);
    background-color: #354b63;
    border-color: #354b63;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none;
}

.btn-default {
    color: #23282c;
    background-color: #f0f3f5;
    border-color: #f0f3f5;
}

.btn-default.focus,
.btn-default:focus {
    box-shadow: 0 0 0 .2rem rgba(209, 213, 215, .5);
}

.btn-default:hover {
    color: #23282c;
    background-color: #d9e1e6;
    border-color: #d1dbe1;
}

.btn-group-xs > .btn,
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.searchable-title {
    font-weight: bold;
}

.admin-dropdown-item {
    color: var(--text-color);
}

.admin-dropdown-item:hover,
.admin-dropdown-item:focus {
    background-color: var(--background-hover);
    color: var(--text-color);
}

.admin-dropdown-item i {
    color: var(--text-color);
}

.searchable-fields {
    padding-left: 5px;
}

.searchable-link {
    padding: 0 5px 0 5px;
}

.searchable-link:hover {
    cursor: pointer;
    background: #eaeaea;
}

.select2-results__option {
    padding-left: 12px;
    padding-right: 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3b7d8c;
    color: #fff;
}

.form-group .required::after {
    content: " *";
    color: red;
}

.form-check.is-invalid ~ .invalid-feedback {
    display: block;
}

.custom-select.form-control-sm {
    padding: 0.25rem 1.5rem;
}

.dt-buttons {
    display: none;
}

table.dataTable tfoot th, table.dataTable tfoot td {
    border-top: inherit;
    padding-right: 10px;
}

table.dataTable td,
table.dataTable th {
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: #2f3640;
    background-color: #fff;
    border: 1px solid #d8dbe0;
    border-radius: 0;
    box-shadow: none;
}

.page-link:not(:disabled):not(.disabled) {
    cursor: pointer;
}

html:not([dir="rtl"]) .page-link {
    margin-left: -1px;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    color: #3e4b64;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    color: #9da5b1;
}

.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
    background-color: #ffffff;
    border-color: #c4c9d0 #c4c9d0 #ffffff;
}

.has-admin-navbar .admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    width: 100%;
}

.has-admin-navbar .admin-wrapper {
    padding-top: var(--admin-header-height);
}

.has-admin-navbar .admin-sidebar {
    top: var(--admin-header-height);
    height: calc(100vh - var(--admin-header-height));
}

/* Admin header layout (Sou Médico style) */
.admin-navbar {
    height: var(--admin-header-height);
    display: flex;
    align-items: center;
    /* CoreUI already does justify-content: space-between,
       we just make sure children behave like left + right blocks */
}

/* Left block: burger + logo */
.admin-navbar .admin-nav-left {
    display: flex;
    align-items: center;
}

/* Toggler buttons – clean, no borders, matching screenshot */
.admin-navbar .c-header-toggler {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none !important;
}

.admin-navbar .c-header-toggler i {
    font-size: 1.25rem;
}

/* Logo sizing */
.admin-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-left: 0.75rem;
}

.admin-logo-img {
    width: auto;
    display: block;
}

/* Right side: nav items spaced like the design */
.admin-navbar .c-header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.admin-navbar .c-header-nav > .c-header-nav-item + .c-header-nav-item {
    margin-left: 0;
}

.admin-navbar .c-header-nav-item {
    list-style: none;
}

.navbar .navbar-nav {
    padding-left: 1rem;
}

.navbar.rounded-sm {
    border-radius: 0.5rem;
}

/* Keep action buttons aligned side-by-side in medico/unidade modals */
#userModalPrincipal .modal-footer .row,
#unidadeModalPrincipal .modal-footer .row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
}

#userModalPrincipal .modal-footer .col-md-6,
#unidadeModalPrincipal .modal-footer .col-md-6 {
    flex: 0 0 auto;
    max-width: none;
    padding: 0;
    display: flex;
    justify-content: center;
}

#userModalPrincipal .modal-footer .btn,
#unidadeModalPrincipal .modal-footer .btn {
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.c-header .c-header-nav-link {
    color: #ffffff;
}

.c-header .c-header-nav-link:hover,
.c-header .c-header-nav-link:focus {
    color: #ffffff;
    opacity: .85;
    text-decoration: none;
}

.avatar {
    --avatar-size: 48px;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-tabs {
    border-bottom: 1px solid #dbe3ec;
    margin-bottom: 0;
}

.profile-tabs .nav-link {
    border: 0;
    color: var(--text-color);
    padding: 0.9rem 1.4rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.profile-tabs .nav-link.active {
    color: var(--text-secondary);
    border-bottom: 3px solid var(--default-color);
    background-color: transparent;
}

.page-link {
    color: black !important;
}

.c-sidebar .c-sidebar-nav-title {
    color: rgb(86 84 84 / 60%) !important;
}

/* Keep admin search modals contained when pages have vertical scroll */
#userModalPrincipal .modal-content,
#unidadeModalPrincipal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#userModalPrincipal .modal-body,
#unidadeModalPrincipal .modal-body {
    flex: 1 1 auto;
    overflow: hidden;
}

#userModalPrincipal .modal-list,
#unidadeModalPrincipal .modal-list {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #d8dbe0;
    border-radius: 0.25rem;
}

#userModalPrincipal .modal-list-row,
#unidadeModalPrincipal .modal-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid #d8dbe0;
}

#userModalPrincipal .modal-list-row:nth-child(odd),
#unidadeModalPrincipal .modal-list-row:nth-child(odd) {
    background-color: #f3f4f6;
}

#userModalPrincipal .modal-list-row:last-child,
#unidadeModalPrincipal .modal-list-row:last-child {
    border-bottom: 0;
}

#userModalPrincipal .modal-list-name,
#unidadeModalPrincipal .modal-list-name {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

#userModalPrincipal .modal-list-actions,
#unidadeModalPrincipal .modal-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    flex: 0 0 auto;
}

#userModalPrincipal .modal-footer-actions,
#unidadeModalPrincipal .modal-footer-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#userModalPrincipal .modal-list-actions .btn,
#unidadeModalPrincipal .modal-list-actions .btn {
    padding: 0.25rem 0.5rem;
}

@media only screen and (max-width: 600px) {
    .card-header {
        padding: 0.75rem;
    }

    .card-body {
        padding: 1.25rem 0.75rem;
    }
}

/* DataTables v2 pagination layout to match legacy v1.13 Bootstrap look */
div.dt-container div.dt-paging {
    margin: 0;
    white-space: nowrap;
    text-align: right;
}

div.dt-container div.dt-paging ul.pagination {
    margin: 2px 0;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

div.dt-container div.dt-length select {
    margin-right: 0;
}

div.dt-container div.dt-info {
    padding-top: 0.85em;
}

/* DataTables search + pagination styling to match the provided layout */
div.dt-container div.dt-search {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    text-align: right;
}

div.dt-container div.dt-search label {
    font-weight: 500;
    color: #3e4b64;
    margin: 0;
}

div.dt-container div.dt-search input {
    border: 1px solid #d8dbe0;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    min-width: 200px;
    background-color: #fff;
    margin-bottom: 20px;
}

div.dt-container div.dt-paging ul.pagination {
    border: 1px solid #d8dbe0;
    border-radius: 0.375rem;
    overflow: hidden;
    margin: 0;
    gap: 0;
    align-items: stretch;
    width: auto;
    display: inline-flex;
    flex: 0 0 auto;
}

div.dt-container .dt-paging .dt-paging-button + .dt-paging-button {
    border-left: 1px solid #d8dbe0;
}

div.dt-container .dt-paging .dt-paging-button {
    background-color: #fff;
    display: flex;
    align-items: stretch;
    padding: 0;
    margin-left: 0;
}

div.dt-container div.dt-paging ul.pagination .page-link {
    border: 0;
    border-radius: 0;
    color: inherit;
    padding: 0.45rem 0.8rem;
    line-height: 1.3;
    font-size: 0.95rem;
    background-color: transparent;
    display: flex;
    align-items: center;
    height: 100%;
}

div.dt-container .dt-paging .dt-paging-button:hover {
    background-color: #3e4b64;
    color: #fff !important;
}

div.dt-container .dt-paging .dt-paging-button:hover .page-link {
     background-color: #3e4b64;
    color: #fff !important;
}

div.dt-container .dt-paging .dt-paging-button.active {
    background-color: #3e4b64;
    color: #fff !important;
}

div.dt-container .dt-paging .dt-paging-button.active .page-link {
    background-color: #3e4b64;
    color: #fff !important;
}

div.dt-container div.dt-paging ul.pagination .page-item.disabled .page-link {
    color: #9da5b1;
}

div.dt-container div.dt-paging ul.pagination .page-item.disabled {
    display: none;
}

/* DataTables v2 Buttons spacing to match legacy v1.13 layout */
div.dt-container div.dt-layout-row:first-child {
    margin: 0.5em 0;
}

div.dt-container div.dt-buttons {
    margin: 0;
}

@media screen and (max-width: 767px) {
    div.dt-container div.dt-paging {
        text-align: center;
    }

    div.dt-container div.dt-paging ul.pagination {
        justify-content: center !important;
    }
}
