/*
    Camada visual opcional para modernizar o SBAdmin2 sem alterar as views.
    Objetivo:
    - manter compatibilidade com a estrutura atual
    - permitir rollback simples removendo apenas o link no header
    - preservar leveza e dark mode
*/

:root {
    --sb2m-body-bg: #f4f7fb;
    --sb2m-surface: rgba(255, 255, 255, 0.9);
    --sb2m-surface-strong: #ffffff;
    --sb2m-border: rgba(148, 163, 184, 0.18);
    --sb2m-text: #334155;
    --sb2m-text-soft: #64748b;
    --sb2m-title: #0f172a;
    --sb2m-primary: #0f6cbd;
    --sb2m-primary-strong: #1d8cf0;
    --sb2m-primary-rgb: 15, 108, 189;
    --sb2m-primary-soft: rgba(15, 108, 189, 0.12);
    --sb2m-primary-soft-strong: rgba(14, 165, 233, 0.18);
    --sb2m-primary-soft-alt: rgba(59, 130, 246, 0.1);
    --sb2m-sidebar-start: #0f172a;
    --sb2m-sidebar-mid: #111827;
    --sb2m-sidebar-end: #172033;
    --sb2m-sidebar-icon: #7dd3fc;
    --sb2m-success: #15803d;
    --sb2m-warning: #b45309;
    --sb2m-danger: #b91c1c;
    --sb2m-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --sb2m-shadow-md: 0 18px 46px rgba(15, 23, 42, 0.1);
    --sb2m-radius-sm: 10px;
    --sb2m-radius-md: 16px;
    --sb2m-radius-lg: 22px;
}

html,
body {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 45%, #eef3f8 100%) !important;
    color: var(--sb2m-text) !important;
}

body {
    font-size: 0.84rem;
}

#content-wrapper:before,
#content-wrapper:after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(16px);
    opacity: 0.7;
    transition: background 0.2s ease;
}

#content-wrapper:before {
    top: -80px;
    right: -70px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(var(--sb2m-primary-rgb), 0.18) 0%, rgba(var(--sb2m-primary-rgb), 0) 70%);
}

#content-wrapper:after {
    bottom: -90px;
    left: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(var(--sb2m-primary-rgb), 0.1) 0%, rgba(var(--sb2m-primary-rgb), 0) 72%);
}

#wrapper,
#content-wrapper,
#content {
    position: relative;
    background: transparent !important;
}

.sidebar.bg-gradient-primary,
.sidebar.bg-gradient-primary ~ #content-wrapper {
    --sb2m-primary: #0f6cbd;
    --sb2m-primary-strong: #1d8cf0;
    --sb2m-primary-rgb: 15, 108, 189;
    --sb2m-primary-soft: rgba(15, 108, 189, 0.12);
    --sb2m-primary-soft-strong: rgba(14, 165, 233, 0.18);
    --sb2m-primary-soft-alt: rgba(59, 130, 246, 0.1);
    --sb2m-sidebar-start: #0f172a;
    --sb2m-sidebar-mid: #111827;
    --sb2m-sidebar-end: #172033;
    --sb2m-sidebar-icon: #7dd3fc;
}

.sidebar.bg-dark-menu,
.sidebar.bg-dark-menu ~ #content-wrapper,
.sidebar.bg-gray-900,
.sidebar.bg-gray-900 ~ #content-wrapper,
.sidebar.bg-gradient-dark,
.sidebar.bg-gradient-dark ~ #content-wrapper,
.sidebar.bg-gradient-secondary,
.sidebar.bg-gradient-secondary ~ #content-wrapper {
    --sb2m-primary: #334155;
    --sb2m-primary-strong: #475569;
    --sb2m-primary-rgb: 51, 65, 85;
    --sb2m-primary-soft: rgba(51, 65, 85, 0.12);
    --sb2m-primary-soft-strong: rgba(71, 85, 105, 0.2);
    --sb2m-primary-soft-alt: rgba(100, 116, 139, 0.12);
    --sb2m-sidebar-start: #020617;
    --sb2m-sidebar-mid: #0f172a;
    --sb2m-sidebar-end: #1e293b;
    --sb2m-sidebar-icon: #cbd5e1;
}

.sidebar.bg-gradient-danger,
.sidebar.bg-gradient-danger ~ #content-wrapper {
    --sb2m-primary: #b91c1c;
    --sb2m-primary-strong: #dc2626;
    --sb2m-primary-rgb: 185, 28, 28;
    --sb2m-primary-soft: rgba(185, 28, 28, 0.12);
    --sb2m-primary-soft-strong: rgba(220, 38, 38, 0.18);
    --sb2m-primary-soft-alt: rgba(248, 113, 113, 0.1);
    --sb2m-sidebar-start: #22090a;
    --sb2m-sidebar-mid: #3a0f13;
    --sb2m-sidebar-end: #56151d;
    --sb2m-sidebar-icon: #fca5a5;
}

.sidebar.bg-gradient-success,
.sidebar.bg-gradient-success ~ #content-wrapper {
    --sb2m-primary: #15803d;
    --sb2m-primary-strong: #16a34a;
    --sb2m-primary-rgb: 21, 128, 61;
    --sb2m-primary-soft: rgba(21, 128, 61, 0.12);
    --sb2m-primary-soft-strong: rgba(22, 163, 74, 0.18);
    --sb2m-primary-soft-alt: rgba(74, 222, 128, 0.1);
    --sb2m-sidebar-start: #052e16;
    --sb2m-sidebar-mid: #0b3d22;
    --sb2m-sidebar-end: #14532d;
    --sb2m-sidebar-icon: #86efac;
}

.sidebar.bg-gradient-info,
.sidebar.bg-gradient-info ~ #content-wrapper {
    --sb2m-primary: #0f766e;
    --sb2m-primary-strong: #0ea5e9;
    --sb2m-primary-rgb: 15, 118, 110;
    --sb2m-primary-soft: rgba(15, 118, 110, 0.12);
    --sb2m-primary-soft-strong: rgba(14, 165, 233, 0.18);
    --sb2m-primary-soft-alt: rgba(103, 232, 249, 0.1);
    --sb2m-sidebar-start: #082f49;
    --sb2m-sidebar-mid: #0f3f5f;
    --sb2m-sidebar-end: #155e75;
    --sb2m-sidebar-icon: #67e8f9;
}

.sidebar {
    background:
        linear-gradient(180deg, var(--sb2m-sidebar-start) 0%, var(--sb2m-sidebar-mid) 62%, var(--sb2m-sidebar-end) 100%) !important;
    box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.08);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    position: relative;
    z-index: 1035;
    overflow: visible;
}

.sidebar .nav-item .nav-link,
.sidebar .sidebar-brand,
.sidebar .sidebar-heading {
    position: relative;
    z-index: 1;
}

.sidebar .nav-item,
.sidebar .sidebar-brand,
.sidebar .sidebar-heading,
.sidebar hr.sidebar-divider {
    position: relative;
    z-index: 1;
}

.sidebar .nav-item .nav-link {
    margin: 0.18rem 0.7rem !important;
    padding: 0.82rem 0.95rem !important;
    width: calc(100% - 1.4rem) !important;
    overflow: hidden;
    border-radius: 12px !important;
    color: rgba(226, 232, 240, 0.82) !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-item .nav-link i {
    color: rgba(148, 163, 184, 0.95) !important;
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link,
.sidebar .nav-item .nav-link[aria-expanded="true"] {
    background: linear-gradient(135deg, var(--sb2m-primary-soft-strong), var(--sb2m-primary-soft-alt)) !important;
    color: #ffffff !important;
}

.sidebar .nav-item .nav-link:hover i,
.sidebar .nav-item.active .nav-link i,
.sidebar .nav-item .nav-link[aria-expanded="true"] i {
    color: var(--sb2m-sidebar-icon) !important;
}

.sidebar .sidebar-brand {
    min-height: 4.75rem;
}

.sidebar hr.sidebar-divider {
    border-top-color: rgba(148, 163, 184, 0.16) !important;
}

.topbar {
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 0 0 var(--sb2m-radius-lg) var(--sb2m-radius-lg);
    box-shadow: var(--sb2m-shadow-sm);
    position: relative;
    z-index: 1045;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.topbar .dropdown .dropdown-menu,
.dropdown-menu {
    border: 1px solid var(--sb2m-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--sb2m-shadow-md) !important;
    z-index: 1090 !important;
}

.sidebar .nav-item .collapse,
.sidebar .nav-item .collapsing,
.sidebar.toggled .nav-item .collapse,
.sidebar.toggled .nav-item .collapsing {
    z-index: 1085 !important;
}

.card,
.modal-content,
.collapse-inner,
.dropdown-list,
.list-group-item,
.input-group-text,
.swal2-popup {
    background: var(--sb2m-surface) !important;
    border: 1px solid var(--sb2m-border) !important;
    box-shadow: var(--sb2m-shadow-sm) !important;
}

.card,
.modal-content {
    border-radius: var(--sb2m-radius-md) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card {
    overflow: visible !important;
}

/* O blur transforma o card em um stacking context e pode cobrir o menu do
   Selectize. Removemos o efeito somente dos cards que contêm esse componente;
   assim o dropdown permanece junto do campo, como no tema original. */
.card:has(.selectize-control) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.card.border-left-primary,
.card.border-left-success,
.card.border-left-info,
.card.border-left-warning,
.card.border-left-danger,
.card.border-left-dark {
    border-left-width: 0.32rem !important;
}

.card.border-left-primary {
    border-left-color: var(--sb2m-primary) !important;
}

.card.border-left-success {
    border-left-color: #15803d !important;
}

.card.border-left-info {
    border-left-color: #0ea5e9 !important;
}

.card.border-left-warning {
    border-left-color: #d97706 !important;
}

.card.border-left-danger {
    border-left-color: #dc2626 !important;
}

.card.border-left-dark {
    border-left-color: #334155 !important;
}

.modal-content {
    overflow: visible !important;
}

.modal,
.modal.show {
    z-index: 2000 !important;
}

.modal-backdrop,
.modal-backdrop.show {
    z-index: 1990 !important;
}

.modal-dialog {
    z-index: 2001;
}

.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    position: relative;
    z-index: 2002;
    pointer-events: auto;
}

.modal-body {
    overflow: visible !important;
    z-index: 2003;
}

.modal-footer {
    z-index: 2002;
}

.swal2-container {
    z-index: 3000 !important;
}

.card-header,
.modal-header,
.dropdown-header {
    background: rgba(255, 255, 255, 0.64) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
}

.card > .card-header:first-child,
.modal-content > .modal-header:first-child,
.modal-content > form:first-child,
.modal-content > form > .modal-header {
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
}

.modal-content > form:last-child,
.modal-content > form > .modal-footer:last-child {
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

.modal-dialog-scrollable .modal-content {
    overflow: hidden !important;
}

.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
}

.card-header .h6,
.card-header h6,
.modal-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--sb2m-title) !important;
}

.text-gray-800,
.text-gray-900 {
    color: var(--sb2m-title) !important;
}

.text-muted,
.text-gray-500,
.text-gray-600 {
    color: var(--sb2m-text-soft) !important;
}

.breadcrumb {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100% !important;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

nav[aria-label="breadcrumb"] {
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    margin-bottom: 0;
}

.container-fluid > nav[aria-label="breadcrumb"] {
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
}

.container-fluid > nav[aria-label="breadcrumb"] .breadcrumb {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100% !important;
}

.d-flex > nav[aria-label="breadcrumb"] + form,
.d-flex > nav[aria-label="breadcrumb"] + .nas-selector-wrapper,
.d-flex.justify-content-between.align-items-center.flex-wrap > form {
    margin-bottom: 1rem;
}

#empresa,
#nas_filtro {
    min-width: 220px;
}

.form-control,
.custom-select,
.select2-container--default .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap4 .select2-selection--multiple,
.selectize-input,
.note-editor.note-frame,
.input-group-text {
    min-height: calc(1.5em + 0.7rem + 2px);
    border-color: rgba(148, 163, 184, 0.22) !important;
    border-radius: 12px !important;
    border-width: 1px !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.form-control.form-control-sm,
.custom-select.form-control-sm,
.input-group-sm > .form-control,
.input-group-sm > .custom-select,
.input-group-sm > .input-group-append > .btn,
.input-group-sm > .input-group-prepend > .btn,
.input-group-sm > .input-group-append > .input-group-text,
.input-group-sm > .input-group-prepend > .input-group-text {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
}

.form-control,
.custom-select,
.select2-container--default .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap4 .select2-selection--multiple,
.selectize-input {
    background: rgba(255, 255, 255, 0.92) !important;
}

.select2-container {
    width: 100% !important;
    font-size: inherit !important;
    vertical-align: top !important;
}

.select2-container--open {
    z-index: 2105 !important;
}

body > .select2-container--open {
    width: auto !important;
}

.select2-dropdown {
    z-index: 2110 !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 12px !important;
    box-shadow: var(--sb2m-shadow-md) !important;
    background: #ffffff !important;
}

.select2-search--dropdown {
    padding: 0.45rem !important;
}

.select2-search--dropdown .select2-search__field {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: var(--sb2m-text) !important;
    box-shadow: none !important;
}

.select2-results__options {
    color: var(--sb2m-text) !important;
}

.select2-results__option {
    color: var(--sb2m-text) !important;
}

.select2-results__option--highlighted[aria-selected] {
    background: var(--sb2m-primary-soft) !important;
    color: #0f172a !important;
}

.select2-container--default .select2-results__option[aria-selected=true] ,
.select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--sb2m-text) !important;
}

.select2-container--default .select2-selection--single ,
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.7rem + 2px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered ,
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    font-size: inherit !important;
    line-height: calc(1.5em + 0.7rem) !important;
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
    color: var(--sb2m-text) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow ,
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.7rem + 2px) !important;
    right: 0.35rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder ,
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: var(--sb2m-text-soft) !important;
}

.select2-container--default .select2-selection--multiple ,
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.7rem + 2px) !important;
    padding: 0.12rem 0.35rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice ,
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    margin-top: 0.18rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--sb2m-primary-soft) !important;
}

.form-control.form-control-sm + .select2-container .select2-selection--single,
select.form-control-sm ~ .select2-container .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px) !important;
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    font-size: .875rem !important;
}

.form-control.form-control-sm + .select2-container .select2-selection--single .select2-selection__rendered,
select.form-control-sm ~ .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + 0.5rem) !important;
    padding-left: .5rem !important;
    padding-right: 1.75rem !important;
}

.form-control.form-control-sm + .select2-container .select2-selection--single .select2-selection__arrow,
select.form-control-sm ~ .select2-container .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.5rem + 2px) !important;
}

.form-control:focus,
.custom-select:focus,
.btn:focus,
.page-link:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--bootstrap4.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single ,
.select2-container--bootstrap4.select2-container--open .select2-selection--single {
    border-color: rgba(var(--sb2m-primary-rgb), 0.48) !important;
    box-shadow: 0 0 0 0.18rem rgba(var(--sb2m-primary-rgb), 0.12) !important;
}

.selectize-control {
    width: 100% !important;
    vertical-align: top !important;
}

.selectize-control .selectize-input,
.selectize-control.single .selectize-input,
.selectize-control.multi .selectize-input {
    min-height: calc(1.5em + 0.7rem + 2px) !important;
    padding: 0.275rem 2.1rem 0.275rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.2rem !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: none !important;
    line-height: 1.5 !important;
}

.selectize-control.single .selectize-input {
    flex-wrap: nowrap !important;
}

.selectize-control.single .selectize-input,
.selectize-control.single .selectize-input.input-active,
.selectize-control.multi .selectize-input,
.selectize-control.multi .selectize-input.input-active {
    box-shadow: none !important;
}

.selectize-control .selectize-input.dropdown-active {
    border-color: rgba(var(--sb2m-primary-rgb), 0.48) !important;
    box-shadow: 0 0 0 0.18rem rgba(var(--sb2m-primary-rgb), 0.12) !important;
}

.selectize-control .selectize-input > input {
    min-width: 4.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    color: var(--sb2m-text) !important;
}

.selectize-control .selectize-input > input::placeholder {
    color: var(--sb2m-text-soft) !important;
}

.selectize-control.multi .selectize-input > div {
    margin: 0 !important;
    padding: 0.14rem 0.6rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--sb2m-primary-soft) !important;
    color: var(--sb2m-text) !important;
}

.selectize-control.single .selectize-input:after {
    border-width: 5px 5px 0 5px !important;
    border-color: #94a3b8 transparent transparent transparent !important;
    right: 0.8rem !important;
    margin-top: -2px !important;
}

.selectize-control.single .selectize-input.dropdown-active:after {
    border-width: 0 5px 5px 5px !important;
    border-color: transparent transparent #94a3b8 transparent !important;
    margin-top: -4px !important;
}

.selectize-dropdown,
.selectize-dropdown.form-control {
    z-index: 2110 !important;
    margin-top: 0.22rem !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 12px !important;
    box-shadow: var(--sb2m-shadow-md) !important;
    background: #ffffff !important;
    color: var(--sb2m-text) !important;
}

.selectize-dropdown-content {
    max-height: 16rem !important;
}

.selectize-dropdown .option,
.selectize-dropdown [data-selectable],
.selectize-dropdown .optgroup-header {
    padding: 0.45rem 0.75rem !important;
}

.selectize-dropdown .option,
.selectize-dropdown [data-selectable] {
    color: var(--sb2m-text) !important;
}

.selectize-dropdown .option:hover,
.selectize-dropdown .active,
.selectize-dropdown .selected {
    background: var(--sb2m-primary-soft) !important;
    color: var(--sb2m-title) !important;
}

.modal .selectize-control {
    position: relative;
    z-index: 2004;
}

.modal .selectize-control.dropdown-active {
    z-index: 2111;
}

.modal .selectize-dropdown,
.modal .select2-dropdown {
    z-index: 2112 !important;
}

.form-control[disabled],
.form-control[readonly],
.custom-select[disabled] {
    background: rgba(241, 245, 249, 0.94) !important;
}

.btn {
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.btn-primary,
.bg-primary,
.badge-primary,
.page-item.active .page-link,
.button.dt-button,
div.dt-button,
a.dt-button {
    background: linear-gradient(135deg, var(--sb2m-primary) 0%, var(--sb2m-primary-strong) 100%) !important;
    border-color: var(--sb2m-primary) !important;
}

.btn-success {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%) !important;
    border-color: #15803d !important;
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
    border-color: #b91c1c !important;
}

.btn-warning {
    color: #ffffff !important;
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
    border-color: #b45309 !important;
}

.btn-light,
.btn-secondary {
    color: var(--sb2m-text) !important;
}

.table {
    color: var(--sb2m-text) !important;
}

.table thead th {
    color: #475569 !important;
    background: rgba(248, 250, 252, 0.94);
    border-bottom-width: 1px !important;
}

.table td,
.table th {
    border-top-color: rgba(148, 163, 184, 0.16) !important;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(248, 250, 252, 0.78) !important;
}

.table-hover tbody tr:hover {
    background: rgba(var(--sb2m-primary-rgb), 0.05) !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 10px !important;
}

.page-link {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: var(--sb2m-primary) !important;
    box-shadow: none !important;
}

.page-link:hover {
    background: rgba(239, 246, 255, 0.95) !important;
    border-color: rgba(var(--sb2m-primary-rgb), 0.2) !important;
    color: var(--sb2m-primary) !important;
}

.page-item.active .page-link {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--sb2m-primary) 0%, var(--sb2m-primary-strong) 100%) !important;
    border-color: var(--sb2m-primary) !important;
    box-shadow: none !important;
}

.page-item.active .page-link:focus,
.page-item.active .page-link:hover,
.page-link:focus {
    box-shadow: none !important;
}

.nav-tabs {
    border-bottom-color: rgba(148, 163, 184, 0.16) !important;
}

.nav-tabs .nav-link {
    border-radius: 12px 12px 0 0 !important;
    color: var(--sb2m-text-soft) !important;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--sb2m-primary) 0%, var(--sb2m-primary-strong) 100%) !important;
}

.alert {
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: var(--sb2m-shadow-sm);
}

.badge {
    border-radius: 999px !important;
    padding: 0.42em 0.62em;
}

.footer,
.sticky-footer {
    background: transparent !important;
}

.scroll-to-top {
    border-radius: 14px !important;
    background: rgba(var(--sb2m-primary-rgb), 0.92) !important;
    box-shadow: 0 12px 28px rgba(var(--sb2m-primary-rgb), 0.25);
}

.swal2-popup {
    background: var(--sb2m-surface-strong) !important;
    overflow: hidden !important;
}

.swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-icon.swal2-success .swal2-success-circular-line-right,
.swal2-icon.swal2-success .swal2-success-fix {
    background: var(--sb2m-surface-strong) !important;
}

.swal2-icon.swal2-loading {
    border-width: 0.25em !important;
    border-color: rgba(var(--sb2m-primary-rgb), 0.18) !important;
    border-right-color: transparent !important;
    border-left-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

.swal2-loader {
    border-color: var(--sb2m-primary) transparent var(--sb2m-primary) transparent !important;
}

.dark-mode,
.dark-mode body,
html.dark-mode {
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 46%, #121b2f 100%) !important;
    color: #dbe6f3 !important;
}

.dark-mode #content-wrapper,
.dark-mode #wrapper,
.dark-mode #page-top,
.dark-mode #content {
    background: transparent !important;
}

.dark-mode .topbar,
.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .collapse-inner,
.dark-mode .dropdown-menu,
.dark-mode .dropdown-list,
.dark-mode .list-group-item,
.dark-mode .input-group-text,
.dark-mode .swal2-popup {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.14) !important;
    color: #dbe6f3 !important;
}

.dark-mode .swal2-popup {
    background: #0f172a !important;
}

.dark-mode .card-header,
.dark-mode .modal-header,
.dark-mode .dropdown-header,
.dark-mode .breadcrumb {
    background: rgba(15, 23, 42, 0.64) !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
}

.dark-mode .text-gray-800,
.dark-mode .text-gray-900,
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6,
.dark-mode .card-header .h6,
.dark-mode .card-header h6,
.dark-mode .modal-title {
    color: #f8fafc !important;
}

.dark-mode .text-muted,
.dark-mode .text-gray-500,
.dark-mode .text-gray-600,
.dark-mode small,
.dark-mode .small {
    color: #94a3b8 !important;
}

.dark-mode .form-control,
.dark-mode .custom-select,
.dark-mode .select2-container--default .select2-selection--single,
.dark-mode .select2-container--bootstrap4 .select2-selection--single,
.dark-mode .select2-container--default .select2-selection--multiple,
.dark-mode .select2-container--bootstrap4 .select2-selection--multiple,
.dark-mode .selectize-input,
.dark-mode .input-group-text {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #dbe6f3 !important;
}

.dark-mode .selectize-control .selectize-input,
.dark-mode .selectize-control.single .selectize-input,
.dark-mode .selectize-control.multi .selectize-input {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #dbe6f3 !important;
}

.dark-mode .selectize-control .selectize-input > input,
.dark-mode .selectize-control .selectize-input > input::placeholder {
    color: #dbe6f3 !important;
}

.dark-mode .selectize-control .selectize-input > input::placeholder {
    color: #94a3b8 !important;
}

.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder ,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #dbe6f3 !important;
}

.dark-mode .select2-dropdown {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

.dark-mode .select2-search--dropdown .select2-search__field {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #dbe6f3 !important;
}

.dark-mode .select2-results__options,
.dark-mode .select2-results__option {
    color: #dbe6f3 !important;
}

.dark-mode .select2-container--default .select2-selection--single .select2-selection__arrow b ,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-top-color: #94a3b8 !important;
}

.dark-mode .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b ,
.dark-mode .select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-bottom-color: #94a3b8 !important;
}

.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice ,
.dark-mode .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background: rgba(var(--sb2m-primary-rgb), 0.14) !important;
    color: #dbe6f3 !important;
}

.dark-mode .selectize-control.multi .selectize-input > div {
    background: rgba(var(--sb2m-primary-rgb), 0.14) !important;
    color: #dbe6f3 !important;
}

.dark-mode .select2-results__option--highlighted[aria-selected] {
    background: rgba(var(--sb2m-primary-rgb), 0.18) !important;
    color: #f8fafc !important;
}

.dark-mode .select2-container--default .select2-results__option[aria-selected=true] ,
.dark-mode .select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background: rgba(148, 163, 184, 0.14) !important;
    color: #dbe6f3 !important;
}

.dark-mode .selectize-dropdown,
.dark-mode .selectize-dropdown.form-control,
.dark-mode .selectize-dropdown-content {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #dbe6f3 !important;
}

.dark-mode .selectize-dropdown .option,
.dark-mode .selectize-dropdown [data-selectable],
.dark-mode .selectize-dropdown .optgroup-header {
    color: #dbe6f3 !important;
}

.dark-mode .selectize-dropdown .option:hover,
.dark-mode .selectize-dropdown .active,
.dark-mode .selectize-dropdown .selected {
    background: rgba(var(--sb2m-primary-rgb), 0.18) !important;
    color: #f8fafc !important;
}

.dark-mode .form-control[disabled],
.dark-mode .form-control[readonly],
.dark-mode .custom-select[disabled] {
    background: rgba(30, 41, 59, 0.92) !important;
}

.dark-mode .table {
    color: #dbe6f3 !important;
}

.dark-mode .table thead th {
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, 0.82) !important;
}

.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(30, 41, 59, 0.38) !important;
}

.dark-mode .table-hover tbody tr:hover {
    background: rgba(var(--sb2m-primary-rgb), 0.11) !important;
}

.dark-mode .card.border-left-primary {
    border-left-color: #38bdf8 !important;
}

.dark-mode .card.border-left-success {
    border-left-color: #4ade80 !important;
}

.dark-mode .card.border-left-info {
    border-left-color: #67e8f9 !important;
}

.dark-mode .card.border-left-warning {
    border-left-color: #fbbf24 !important;
}

.dark-mode .card.border-left-danger {
    border-left-color: #fb7185 !important;
}

.dark-mode .card.border-left-dark {
    border-left-color: #94a3b8 !important;
}

.dark-mode .page-link {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.14) !important;
    color: var(--sb2m-sidebar-icon) !important;
}

.dark-mode .page-link:hover {
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(125, 211, 252, 0.24) !important;
    color: #bae6fd !important;
}

.dark-mode .page-item.active .page-link {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--sb2m-primary) 0%, var(--sb2m-primary-strong) 100%) !important;
    border-color: var(--sb2m-primary) !important;
    box-shadow: none !important;
}

.dark-mode .btn-secondary,
.dark-mode .modal-footer .btn-secondary,
.dark-mode .btn-light {
    background: #475569 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
}

.dark-mode .btn-secondary:hover,
.dark-mode .btn-secondary:focus,
.dark-mode .btn-secondary.focus,
.dark-mode .btn-light:hover,
.dark-mode .btn-light:focus {
    background: #64748b !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 .2rem rgba(148, 163, 184, .2) !important;
}

.dark-mode .btn-secondary:disabled,
.dark-mode .btn-secondary.disabled,
.dark-mode .btn-light:disabled,
.dark-mode .btn-light.disabled {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
    opacity: .8 !important;
}

.dark-mode .note-editor.note-frame {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

.dark-mode .note-editor .note-toolbar {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(148, 163, 184, .2) !important;
}

.dark-mode .note-editor .note-btn {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

.dark-mode .note-editor .note-btn:hover,
.dark-mode .note-editor .note-btn:focus,
.dark-mode .note-editor .note-btn.active {
    background: #475569 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

.dark-mode .note-editor .note-btn [class^="note-icon"],
.dark-mode .note-editor .note-btn [class*=" note-icon"],
.dark-mode .note-editor .note-btn [class^="note-icon"]::before,
.dark-mode .note-editor .note-btn [class*=" note-icon"]::before {
    color: #f8fafc !important;
    opacity: 1 !important;
}

.dark-mode .note-editor .note-editable {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

.dark-mode .note-editor .note-statusbar,
.dark-mode .note-editor .note-dropdown-menu {
    background: #1e293b !important;
    border-color: rgba(148, 163, 184, .2) !important;
    color: #e2e8f0 !important;
}

.dark-mode .swal2-icon.swal2-loading {
    border-color: rgba(var(--sb2m-primary-rgb), 0.2) !important;
    border-right-color: transparent !important;
    border-left-color: transparent !important;
    background: transparent !important;
}

.dark-mode .swal2-icon.swal2-success .swal2-success-circular-line-left,
.dark-mode .swal2-icon.swal2-success .swal2-success-circular-line-right,
.dark-mode .swal2-icon.swal2-success .swal2-success-fix {
    background: #0f172a !important;
}

@media (max-width: 768px) {
    .topbar {
        border-radius: 0 0 16px 16px;
    }

    .card,
    .modal-content {
        border-radius: 14px !important;
    }

    .sidebar .nav-item .nav-link {
        margin-left: 0.45rem !important;
        margin-right: 0.45rem !important;
    }
}

@media (min-width: 768px) {
    .sidebar {
        width: 14rem !important;
        min-width: 14rem !important;
        max-width: 14rem !important;
        flex: 0 0 14rem !important;
    }

    .sidebar .nav-item .nav-link {
        width: calc(100% - 1.4rem) !important;
        max-width: calc(100% - 1.4rem) !important;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .sidebar.toggled {
        overflow: visible !important;
        width: 6.5rem !important;
        min-width: 6.5rem !important;
        max-width: 6.5rem !important;
        flex: 0 0 6.5rem !important;
    }

    .sidebar.toggled .nav-item .nav-link {
        width: calc(100% - 0.9rem) !important;
        max-width: calc(100% - 0.9rem) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .sidebar .nav-item .nav-link {
        transition: none !important;
        transform: none !important;
    }
}

body,
button,
input,
select,
textarea {
  font-family: 'Inter', sans-serif;
}

/* Itens do pacote acompanham o tema da tabela, sem fundo claro fixo no modo escuro. */
.table tbody tr.contrato-pacote-item {
    background-color: #f8f9fc;
}
.dark-mode .table tbody tr.contrato-pacote-item {
    background-color: rgba(17, 24, 39, .55);
}
.dark-mode .table-hover tbody tr.contrato-pacote-item:hover {
    background-color: rgba(55, 65, 81, .6);
}
