@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url('../../assets/fonts/poppins-v24-latin-regular.woff2') format('woff2');
}

/* poppins-500 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    src: url('../../assets/fonts/poppins-v24-latin-500.woff2') format('woff2');
}

/* poppins-600 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    src: url('../../assets/fonts/poppins-v24-latin-600.woff2') format('woff2');
}

/* poppins-700 - latin */
@font-face {
    font-display: swap;
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    src: url('../../assets/fonts/poppins-v24-latin-700.woff2') format('woff2');
}

/* Manrope */
@font-face {
    font-family: 'Manrope';
    src: url('../../assets/fonts/Manrope-VariableFont_wght.ttf') format('truetype');
    font-weight: 200 800;
    font-style: normal;
}

/* --- AJUSTES MOBILE --- */

@media (max-width: 767.98px) {

    .inner-content .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .inner-content .d-flex.justify-content-between>div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-body {
        overflow-x: auto;
    }

    .table {
        min-width: 600px;
    }

    .datagrid-header {
        /* Muda a direção do flex para coluna (empilha os itens) */
        flex-direction: column;

        /* Alinha os itens à esquerda */
        align-items: flex-start !important;
    }

    .datagrid-header h2 {
        /* Adiciona um espaço abaixo do título */
        margin-bottom: 1rem;
    }

    .datagrid-header .d-flex {
        /* Faz o container dos botões usar a largura total */
        width: 100%;

        /* Permite que os botões quebrem a linha de forma organizada */
        flex-wrap: wrap;

        /* Adiciona um pequeno espaço entre os botões quando eles quebram a linha */
        gap: 0.5rem;
    }
}

/* --- 1. VARIÁVEIS DO TEMA --- */
:root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 80px;
    --top-navbar-height: 55px;
    --content-footer-height: 40px;
    --admin-primary-color: #4876c7;
    --admin-sidebar-bg: #2c3136;
    --admin-sidebar-header-bg: #212529;
    --admin-sidebar-link-hover: #495057;
    --admin-body-bg: #f4f6f9;
    --admin-card-bg: #ffffff;
    --admin-border-color: #dee2e6;
    --admin-text-color: #495057;
    --admin-base-font-size: 13px;
    --bs-border-radius: 0.6rem;
    --bs-border-radius-sm: 0.4rem;
    --bs-border-radius-lg: 0.8rem;
    --bs-pagination-font-size: 0.8rem !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 2px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- 2. ESTILOS GLOBAIS --- */
html {
    font-size: var(--admin-base-font-size);
}

body {
    background-color: var(--admin-body-bg);
    font-family: 'Poppins', sans-serif;
    font-size: var(--admin-base-font-size);
    color: var(--admin-text-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
}

.bg-tertiary {
    background-color: var(--bs-tertiary-bg);
}

/* --- 3. LAYOUT PRINCIPAL --- */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--admin-sidebar-bg);
    color: #fff;
    transition: all 0.3s ease-in-out;
    z-index: 1031;
    /* Z-index alto para o menu */
}

.main-container {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: absolute;
}

.top-navbar {
    height: var(--top-navbar-height);
    background-color: var(--admin-card-bg);
    border-bottom: 1px solid var(--admin-border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.content-wrapper {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.content-footer {
    height: var(--content-footer-height);
    background-color: var(--admin-card-bg);
    border-top: 1px solid var(--admin-border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    color: #888;
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: 0 0.125rem 0.25rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Dropdown */
.dropdown-menu {
    font-size: 0.9rem;
}

/* --- 4. ESTADO RECOLHIDO DO MENU --- */

#sidebar.active {
    width: var(--sidebar-width-collapsed);
}

#sidebar.active+.main-container {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

#sidebar.active .sidebar-header h3,
#sidebar.active ul li a span {
    display: none;
}

#sidebar.active .sidebar-header strong {
    display: block;
}

#sidebar.active ul li a {
    text-align: center;
    padding: 15px 10px;
    font-size: 1.1rem;
}

#sidebar.active ul li a i {
    margin-right: 0;
}

body.sidebar-collapsed .main-container {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

@media (max-width: 991.98px) {
    .main-container {
        margin-left: 0;
        width: 100%;
    }
}

/* --- 5. ESTILOS DE COMPONENTES --- */

.sidebar-header {
    padding: 15px;
    text-align: center;
    background: var(--admin-sidebar-header-bg);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    margin: 0;
}

.sidebar-header strong {
    display: none;
    font-size: 1.5rem;
}

#offcanvasMenu {
    width: 75% !important;
}

#sidebar ul.components,
.offcanvas-body ul.components {
    padding: 15px 0;
}

#sidebar ul li a,
.offcanvas-body ul li a {
    padding: 10px 15px;
    font-size: 0.95rem;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

#sidebar ul li a:hover,
.offcanvas-body ul li a:hover {
    color: #fff;
    background: var(--admin-sidebar-link-hover);
}

#sidebar ul li.active>a,
.offcanvas-body ul li.active>a {
    color: #fff;
    background: var(--admin-primary-color);
}

#sidebar ul li a i,
.offcanvas-body ul li a i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

/* Cards, Títulos, Tabelas, etc. */
.card {
    border-color: var(--admin-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075);
}

.card-header {
    background-color: #f7f7f9;
    border-bottom-color: var(--admin-border-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.content-wrapper h2 {
    font-size: 1.3rem;
    margin-bottom: 0 !important;
}

.dataTables_length,
.dataTables_info,
.datagrid-modelos_filter {
    font-size: 0.9rem !important;
}

table.dataTable {
    line-height: 2;
}

/* Breadcrumb */

.breadcrumb {
    --bs-breadcrumb-divider: '>';
    font-size: 0.85rem;
    padding: 0.5rem 0;
    background-color: transparent;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: #6c757d;
    /* Cinza secundário */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.breadcrumb-item a:hover {
    color: var(--admin-primary-color);
}

.breadcrumb-item.active {
    color: var(--admin-text-color);
    font-weight: 600;
}

/* Tabelas */
td {
    padding: 0px;
}

.table thead th {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--admin-text-color);
    vertical-align: middle;
    background-color: #f7f7f7;
    border-bottom-width: 2px;
}

.table tbody td {
    vertical-align: middle;
    color: #2C3136;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    cursor: pointer;
}

.table>:not(caption)>*>* {
    padding: 4px 8px;
}

th.dt-checkbox-col,
td.dt-checkbox-col {
    width: 10px !important;
    min-width: 10px !important;
}

/* Botões */
.actions-dropdown-toggle {
    border-radius: 25% !important;

}

.actions-dropdown-toggle::after {
    display: none !important;
}

/* Formulários */
.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    font-size: 0.9rem;
    border-radius: 0.25rem;
    border-color: var(--admin-border-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--admin-primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--admin-primary-color), 0.25);
}

.form-check-label {
    font-size: 0.9rem;
}

/* Listas */
.list-group-item.active {
    background-color: var(--bs-primary-border-subtle);
    border-color: var(--bs-primary-border-subtle);
}

/* Botões */


/* Modais */


/* Mailcheck */
.mailcheck-suggestion strong {
    cursor: pointer;
    text-decoration: none;
}

.mailcheck-suggestion strong:hover {
    color: #0a58ca;
}

/* --- 6. ANIMAÇÕES E TOASTS --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.content-container {
    opacity: 0;
}

.inner-content {
    animation: fadeIn 0.4s ease-in-out;
}

.custom-toast {
    width: 350px;
    max-width: 100%;
    font-size: 0.9rem;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem !important;
    opacity: 0;
    transform: translateX(110%);
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.custom-toast--success {
    background-color: var(--bs-success-bg-subtle);
}

.custom-toast--error {
    background-color: var(--bs-danger-bg-subtle);
}

.custom-toast--warning {
    background-color: var(--bs-warning-bg-subtle);
}

.custom-toast--info {
    background-color: var(--bs-primary-bg-subtle);
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-toast .toast-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-toast .toast-body {
    padding: 1rem;
}