:root {
    --primary-color: #143b64;
    --dark-header: #133458;
    --header-height: 64px;
    --menu-height: 75px;
    --sidebar-width: 250px;
    --bg-body: #f9fafb;
    --text-main: #334155;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --menu-link-color: #cbd5e1;
}

body.dark-mode {
    --bg-body: #0f172a;
    --text-main: #cbd5e1;
    --card-bg: #133458;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --dark-header: #133458;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* Layout Options */
.top-navbar {
    height: var(--header-height);
    background-color: var(--dark-header);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: relative; /* Adicionado para o z-index funcionar sempre */
    z-index: 1100;
    width: 100%;
    transition: background-color 0.3s ease;
}

.top-navbar .dropdown-menu {
    z-index: 1200 !important; /* Garante que o dropdown fique acima de tudo */
}

body.layout-fixed-topbar {
    padding-top: var(--header-height);
}

body.layout-fixed-topbar .top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* Horizontal Menu Positions */
body.body-horizontal .horizontal-menu {
    height: var(--menu-height);
    background-color: var(--primary-color);
    width: 100%;
    z-index: 1050;
    display: block !important;
}

/* Fixed Menu Horizontal */
body.body-horizontal.layout-fixed-menu .horizontal-menu {
    position: sticky;
    top: 0;
    z-index: 1050;
}

body.body-horizontal.layout-fixed-topbar.layout-fixed-menu .horizontal-menu {
    top: var(--header-height);
}

/* No sticky, elements stay in flow, so we don't need extra padding-top on main-content */
body.body-horizontal.layout-fixed-menu .main-content {
    padding-top: 20px;
}

/* Vertical Sidebar Positions */
body.body-vertical .vertical-sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    height: 100vh;
    z-index: 1200; /* Sidebar acima da topbar */
    box-shadow: 1px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
}

/* Sidebar Logo */
.v-sidebar-logo {
    height: var(--header-height); /* Mesma altura da topbar */
    display: none;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.body-vertical .v-sidebar-logo {
    display: flex;
}

.v-sidebar-logo img {
    height: 32px; /* Logo um pouco menor para ficar mais elegante */
    filter: brightness(0) invert(1);
}

body.body-vertical .top-navbar {
    margin-left: 0;
    width: 100%;
    padding-left: var(--sidebar-width); /* Shift content, not the bar itself */
    background-color: #fff; /* Fundo branco solicitado */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
}

body.body-vertical .top-navbar .btn-link,
body.body-vertical .top-navbar .user-info,
body.body-vertical .top-navbar .search-container i {
    color: #334155 !important;
}

body.body-vertical .top-navbar .search-container .form-control {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

body.body-vertical .top-navbar .search-container .form-control::placeholder {
    color: #94a3b8;
}

body.body-vertical.dark-mode .top-navbar {
    background-color: var(--card-bg);
    border-bottom-color: var(--border-color);
}

body.body-vertical.dark-mode .top-navbar .btn-link,
body.body-vertical.dark-mode .top-navbar .user-info,
body.body-vertical.dark-mode .top-navbar .search-container i {
    color: #cbd5e1 !important;
}

body.body-vertical.dark-mode .top-navbar .search-container .form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.body-vertical.layout-fixed-topbar .top-navbar {
    left: 0;
    right: 0;
    width: 100%;
}

body.body-vertical .top-navbar .navbar-brand {
    display: none;
}

/* Ajuste do container boxed na topbar para não centralizar demais em telas grandes no vertical */
body.body-vertical .top-navbar .container-boxed {
    max-width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
}

body.body-vertical.layout-fixed-topbar .vertical-sidebar {
    top: 0;
    height: 100vh;
}

body.body-vertical.layout-fixed-menu .vertical-sidebar {
    position: fixed;
}

/* Boxed Layout Container */
.container-boxed {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: max-width 0.3s ease;
}

body.layout-boxed {
    background-color: #e2e8f0;
}

body.layout-boxed.dark-mode {
    background-color: #133458;
}

body.layout-boxed .main-content {
    background-color: var(--bg-body);
    min-height: 100vh;
}

body.layout-boxed .container-boxed {
    max-width: 1340px;
}

/* Boxed Layout - Vertical Mode Alignment */
body.layout-boxed.body-vertical .vertical-sidebar {
    left: calc((100% - 1340px) / 2) !important;
}

body.layout-boxed.body-vertical .top-navbar {
    left: calc((100% - 1340px) / 2) !important;
    width: 1340px !important;
    padding-left: var(--sidebar-width);
}

body.layout-boxed.body-vertical .main-content {
    width: calc(1340px - var(--sidebar-width)) !important;
    max-width: calc(1340px - var(--sidebar-width)) !important;
    margin-left: calc((100% - 1340px) / 2 + var(--sidebar-width)) !important;
    margin-right: auto;
}

@media (max-width: 1340px) {
    body.layout-boxed.body-vertical .vertical-sidebar {
        left: 0 !important;
    }
    body.layout-boxed.body-vertical .top-navbar {
        left: 0 !important;
        width: 100% !important;
    }
    body.layout-boxed.body-vertical .main-content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
        max-width: none !important;
    }
}

/* Base elements stay full width */
.top-navbar,
.horizontal-menu,
.main-content {
    width: 100%;
}

body.layout-boxed.layout-fixed-menu.body-horizontal .horizontal-menu {
    left: 0;
    right: 0;
    transform: none !important;
}

@media (max-width: 1340px) {
    body.layout-boxed .container-boxed {
        max-width: 100%;
    }
}

.navbar-brand img {
    height: 38px;
    filter: brightness(0) invert(1);
}

body.body-vertical .navbar-brand img {
    filter: none;
}

body.body-vertical.dark-mode .navbar-brand img {
    filter: brightness(0) invert(1);
}

.search-container {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.search-container .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    padding-left: 35px;
    height: 36px;
    font-size: 0.9rem;
}

.search-container .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
}

.top-right-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.user-info {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.user-info:hover, .user-info:focus, .user-info.show {
    color: #fff;
}

.btn-logout {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    padding: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: #ff4d4d;
    transform: scale(1.1);
}

body.body-vertical .btn-logout {
    color: #334155;
}

body.body-vertical.dark-mode .btn-logout {
    color: #f1f5f9;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-avatar.initials {
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Menu Comum */
.nav-item {
    position: relative;
    list-style: none;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--menu-link-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    height: 100%;
}

.nav-link i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* Layout Horizontal */
.body-horizontal .horizontal-menu {
    display: block !important;
}

.body-horizontal .main-content {
    padding: 20px;
}

.body-horizontal .vertical-sidebar {
    display: none !important;
}

.h-nav-list {
    display: flex;
    margin: 0;
    padding: 0 20px;
    height: 100%;
    list-style: none;
}

.layout-boxed .h-nav-list{
    padding: 0px !important;
}

.h-nav-item {
    position: relative !important;
    height: 100%;
    display: block;
}

.body-horizontal .nav-link {
    padding: 4px 20px 0 20px; /* Adicionado 4px no topo para compensar a borda de baixo e centralizar */
    border-bottom: 4px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.body-horizontal .nav-link:hover, 
.body-horizontal .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-bottom-color: #fff;
}

/* Dropdowns Horizontal */
.h-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    border-radius: 0 0 8px 8px;
    display: none;
    list-style: none;
    padding: 10px 0;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin: 0;
}

.h-nav-item:hover > .h-dropdown {
    display: block;
}

.h-dropdown li {
    position: relative !important;
}

.h-dropdown a {
    padding: 10px 20px;
    display: block;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.h-dropdown a:hover {
    background-color: var(--bg-body);
    color: var(--primary-color);
}

/* Submenu de segundo nível */
.h-dropdown-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    background-color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    border-radius: 0 8px 8px 8px;
    display: none;
    list-style: none;
    padding: 10px 0;
    z-index: 1001;
    border: 1px solid #e2e8f0;
}

.h-dropdown li:hover > .h-dropdown-submenu {
    display: block;
}

/* Layout Vertical */
.body-vertical .horizontal-menu {
    display: none !important;
}

.body-vertical .vertical-sidebar {
    display: block !important;
}

.body-vertical .main-content {
    margin-left: var(--sidebar-width);
    padding: 20px 30px;
    width: auto;
}

.body-vertical .v-nav-list {
    padding: 20px 0;
}

.body-vertical .nav-link {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 24px;
    color: var(--menu-link-color);
    height: auto;
    border-left: 4px solid transparent;
}

.body-vertical .nav-link i {
    width: 28px;
    font-size: 1.1rem;
    margin-bottom: 0;
    margin-right: 12px;
}

.body-vertical .nav-link:hover,
.body-vertical .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: #fff;
}

/* Vertical Submenus */
.v-submenu {
    display: none;
    list-style: none;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.v-submenu li a {
    display: block;
    padding: 10px 24px 10px 55px;
    color: var(--menu-link-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.v-submenu li a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Second level vertical submenu indentation */
.v-submenu .v-submenu li a {
    padding-left: 75px;
}

.has-submenu.open > .v-submenu {
    display: block;
}

.has-submenu.open > a .fa-chevron-down {
    transform: rotate(180deg);
}

.fa-chevron-down {
    transition: transform 0.2s;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none; /* jQuery .show() will set to display: block */
}

/* Ensure flex centering when shown */
#preloader[style*="display: block"] {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.customSplash {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.lds-ring {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}
.lds-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 5px solid #fff;
    border-radius: 50%;
    animation: lds-ring 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #fff transparent transparent transparent;
}
@keyframes lds-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-stats {
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px 24px;
    background-color: var(--card-bg);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-stats .info {
    display: flex;
    flex-direction: column;
}

.card-stats .info h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: #133458;
}

.card-stats .info p {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-stats .icon {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 1.8rem;
    color: #cbd5e1;
}

.border-orange { border-bottom: 4px solid #f97316; }
.border-red { border-bottom: 4px solid #ef4444; }
.border-green { border-bottom: 4px solid #22c55e; }
.border-blue { border-bottom: 4px solid #3b82f6; }

.footer {
    padding: 10px;
    text-align: center;
    color: #8390a1;
    font-size: 0.85rem;
}

/* Typography & Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: #0d2744;
}

/* Overrides de visibilidade para Modo Escuro */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6,
body.dark-mode .h1, 
body.dark-mode .h2, 
body.dark-mode .h3, 
body.dark-mode .h4, 
body.dark-mode .h5, 
body.dark-mode .h6,
body.dark-mode .text-dark,
body.dark-mode .card-title {
    color: #f8fafc !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .bg-white {
    background-color: var(--card-bg) !important;
}

body.dark-mode .table {
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.02);
    color: #fff;
}

body.dark-mode .card-stats .info h2 {
    color: #f8fafc;
}

body.dark-mode .card-stats .info p {
    color: #94a3b8;
}

body.dark-mode .card-header {
    background-color: rgba(0,0,0,0.2) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: #f8fafc !important;
}

body.dark-mode .card-header .card-title {
    color: #f8fafc !important;
}

body.dark-mode .breadcrumb-item,
body.dark-mode .breadcrumb-item a,
body.dark-mode .form-label {
    color: #94a3b8 !important;
}

/* Alerts Dark Mode */
body.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

body.dark-mode .alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
}

body.dark-mode .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

body.dark-mode .alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

body.dark-mode .alert .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .alert-heading {
    color: inherit !important;
}

/* Tables Dark Mode */
body.dark-mode .table-responsive {
    background: var(--card-bg);
}

body.dark-mode .table.tabList thead th,
body.dark-mode th.superior {
    background-color: rgba(0,0,0,0.2) !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid var(--border-color) !important;
}

body.dark-mode .table.tabList tbody td {
    color: #cbd5e1;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .table.tabList tbody tr:hover td {
    background-color: rgba(255,255,255,0.02) !important;
}

/* Horizontal Menu Dark Mode */
body.dark-mode .h-dropdown {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .h-dropdown a {
    color: #cbd5e1;
}

body.dark-mode .h-dropdown a:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
}

/* Vertical Sidebar Dark Mode */
body.dark-mode .vertical-sidebar {
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
}

body.dark-mode .v-submenu {
    background-color: rgba(0,0,0,0.2);
}

body.dark-mode .v-submenu li a {
    color: #94a3b8;
}

/* Cards & Forms Dark Mode */
body.dark-mode .card,
body.dark-mode .card-stats {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

body.dark-mode .form-control, 
body.dark-mode .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .dropdown-menu {
    background-color: #133458;
    border: 1px solid #334155;
    color: #cbd5e1;
}

body.dark-mode .dropdown-item {
    color: #cbd5e1;
}

body.dark-mode .dropdown-item:hover {
    background-color: #334155;
    color: #fff;
}

body.dark-mode .dropdown-header {
    color: #f8fafc !important;
}

/* Color Picker */
.color-picker {
    padding: 5px 0;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: #334155;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

body.dark-mode .color-option.active {
    border-color: #fff;
}

.table.tabList {
    margin-bottom: 0;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

.table.tabList thead th,
th.superior {
    background-color: #f8fafc !important;
    color: #64748b !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.72rem !important;
    letter-spacing: 0.5px;
    padding: 12px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
}

.table.tabList tbody td {
    padding: 12px 16px !important;
    vertical-align: middle;
    color: #334155;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
}

.table.tabList tbody tr:last-child td {
    border-bottom: none;
}

.table.tabList .checkboxLista, 
.table.tabList #checkPadrao {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Links inside tables */
.table.tabList a {
    font-weight: 500;
    color: var(--primary-color);
}

.table.tabList a:hover {
    text-decoration: underline;
}

/* Action Links in Tables */
.table.tabList a[href*="acao=form"],
.table.tabList a[href*="duplicar.php"],
.table.tabList a.lnkExcluir {
    font-size: 0.85rem;
    color: var(--primary-color);
    display: inline-block;
    margin: 0 5px;
}

.table.tabList a[href*="acao=form"]:hover { color: #0d2744; text-decoration: underline; }
.table.tabList a.lnkExcluir { color: #ef4444; }
.table.tabList a.lnkExcluir:hover { color: #dc2626; text-decoration: underline; }

/* Status Images */
.table.tabList img.status {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.table.tabList img.status:hover {
    transform: scale(1.15);
}

/* Forms and Inputs */
.form-control, .form-select {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 59, 100, 0.1);
    outline: 0;
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background-color: #0d2744;
    border-color: #0d2744;
}

/* Content adjustment */
#conteudoPagina {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toastr Custom Style */
#toast-container > div {
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    opacity: 1 !important;
    padding: 15px 15px 15px 50px !important;
    font-family: 'Inter', sans-serif !important;
}

#toast-container > .toast-success {
    background-color: #15d458 !important;
}

#toast-container > .toast-error {
    background-color: #ff2e2e !important;
}

#toast-container > .toast-warning {
    background-color: #ffb000 !important;
}

#toast-container > .toast-info {
    background-color: #0084ff !important;
}

.toast-title {
    font-weight: 700 !important;
    margin-bottom: 3px !important;
}

.toast-message {
    font-size: 0.85rem !important;
    opacity: 0.9;
}

/* Fix for legacy gerarBusca output */
#formBusca .control-group {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}

#formBusca .control-label {
    font-weight: 500;
    color: #475569;
    font-size: 0.85rem;
}

#formBusca .controls input.form-control,
#formBusca .controls select.form-control {
    max-width: 100%;
}

/* Filtros Estilo Agrupado */
.custom-btn-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}
.custom-btn-group .btn {
    border: 0;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    background-color: transparent;
    transition: all 0.2s;
    flex: 1 1 auto;
    border-radius: 6px !important;
    margin: 1px;
}

.custom-btn-group .btn:hover {
    color: var(--primary-color);
    opacity: 0.8;
}

.custom-btn-group .btn-check:checked + .btn {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
}

body.dark-mode .custom-btn-group .btn {
    background-color: transparent;
    color: #94a3b8;
}

body.dark-mode .custom-btn-group .btn:hover {
    color: #fff;
}

body.dark-mode .custom-btn-group .btn-check:checked + .btn {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .form-control::placeholder {
    color: #94a3b8 !important;
}

/* Dark Mode Overrides for Titles and Text */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6,
body.dark-mode .h1, 
body.dark-mode .h2, 
body.dark-mode .h3, 
body.dark-mode .h4, 
body.dark-mode .h5, 
body.dark-mode .h6 {
    color: #f8fafc !important;
}

body.dark-mode .text-dark {
    color: #f1f5f9 !important;
}

body.dark-mode .text-muted,
body.dark-mode .small,
body.dark-mode p.text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .breadcrumb-item.active {
    color: #cbd5e1;
}

body.dark-mode .card-header {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--border-color);
    color: #f8fafc;
}

body.dark-mode .card-footer {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-top: 1px solid var(--border-color);
}

/* Alerts in Dark Mode */
body.dark-mode .alert {
    background-color: #133458;
    border: 1px solid #334155;
    color: #cbd5e1;
}

body.dark-mode .alert-success { background-color: rgba(21, 212, 88, 0.1); border-color: rgba(21, 212, 88, 0.2); color: #4ade80; }
body.dark-mode .alert-danger { background-color: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #f87171; }
body.dark-mode .alert-warning { background-color: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.2); color: #fbbf24; }
body.dark-mode .alert-info { background-color: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* Paginacao Estilo Singular */
.pagination {
    gap: 5px;
}

.pagination .page-link {
    border: 0;
    padding: 8px 14px;
    border-radius: 8px !important;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background-color: #f1f5f9;
}

.pagination .page-link:hover {
    background-color: #e2e8f0;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pagination .page-item.disabled .page-link {
    background-color: transparent;
    color: #94a3b8;
    opacity: 0.6;
}

body.dark-mode .pagination .page-link {
    background-color: rgba(255,255,255,0.05);
    color: #cbd5e1;
}

body.dark-mode .pagination .page-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
}

/* Custom Checkbox Style */
.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0;
    cursor: pointer;
    border-color: #cbd5e1;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(20, 59, 100, 0.1);
}

body.dark-mode .form-check-input {
    background-color: rgba(255,255,255,0.05);
    border-color: #475569;
}

body.dark-mode .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Toastr Position Fix */
#toast-container {
    padding-right: 20px !important;
    padding-bottom: 20px !important;
}

/* Topbar em modo Vertical - Fundo Branco */
body.body-vertical .top-navbar {
    background-color: #fff !important;
    border-bottom: 1px solid #e2e8f0;
}

body.body-vertical .top-navbar .navbar-brand img {
    filter: brightness(0) !important;
}

body.body-vertical .top-navbar .user-info,
body.body-vertical .top-navbar .btn-link {
    color: #334155 !important;
}

body.body-vertical .search-container .form-control {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

body.body-vertical .search-container i {
    color: #94a3b8;
}

/* No modo escuro, volta a ser escuro mesmo em vertical */
body.body-vertical.dark-mode .top-navbar {
    background-color: var(--card-bg) !important;
    border-bottom: 1px solid var(--border-color);
}

body.body-vertical.dark-mode .top-navbar .navbar-brand img {
    filter: brightness(0) invert(1) !important;
}

body.body-vertical.dark-mode .top-navbar .user-info,
body.body-vertical.dark-mode .top-navbar .btn-link {
    color: #f1f5f9 !important;
}

/* Custom Tabs - Segmented Style */
.custom-tabs-wrapper {
    background: #feffff;
    padding: 5px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid rgba(0,0,0,0.05);
    max-width: 100%;
}
.custom-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    width: 100%;
}
.custom-tabs .nav-item {
    flex: 1 1 auto;
}
.custom-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    height: 36px;
    width: 100%;
}
.custom-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
}

.custom-tabs .nav-link.tab-active,
.custom-tabs .nav-link.active,
.custom-tabs .nav-link.Ativo,
.custom-tabs .nav-link.ativo {
    background: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode .custom-tabs-wrapper {
    background: #0f172a;
}
body.dark-mode .custom-tabs .nav-link.tab-active,
body.dark-mode .custom-tabs .nav-link.active,
body.dark-mode .custom-tabs .nav-link.Ativo,
body.dark-mode .custom-tabs .nav-link.ativo {
    background: var(--primary-color) !important;
    color: #fff !important;
}

