/* Variáveis globais */

/* ------------------------------------------------ */

/* Geral */

.hide, #hide {
    display: none;
}

/* ------------------------------------------------ */

/* TinyMCE */

.tox-help__more-link{
    display: none;
}

/* ------------------------------------------------ */

.custom-width_list {
    max-width: 1200px;
    margin-left: 0;
}

.custom-width_view {
    max-width: 1000px;
    margin-left: 0;
}

.custom-width_editar {
    max-width: 1000px;
    margin-left: 0;
}

.custom-width_aux {
    max-width: 100%;
    margin-left: 0;
}

.custom-a4 {
    width: 210mm;
}

/* ------------------------------------------------ */

:root {
    --primary-color: #EC182E;
    --menu-color: #001A49;
    --header-height: 60px;
    --sidebar-width: 250px;
    --footer-height: 60px;
}

/* Estilos Gerais */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body:not(.login-page) {
    padding-top: var(--header-height);
    padding-left: var(--sidebar-width);
    padding-bottom: var(--footer-height);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--primary-color);
    color: white;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1030;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.header .logo {
    height: 40px;
}

.header .dropdown-toggle {
    color: white;
    text-decoration: none;
}

.header .dropdown-toggle:hover,
.header .dropdown-toggle:focus {
    color: rgba(255, 255, 255, 0.8);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: var(--footer-height);
    width: var(--sidebar-width);
    background-color: var(--menu-color);
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1025;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.3), inset -1px 0 3px rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    color: white;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(0,0,0,0.05);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Dashboard Widgets */
.dashboard-widget {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    transition: transform 0.2s;
}

/* Tabela de Histórico de Pagamentos */
.table-responsive {
    min-width: auto;
    width: 100%;
}

.table-responsive table {
    width: 100%;
    margin-bottom: 0;
}

.dashboard-widget:hover {
    transform: translateY(-2px);
}

.dashboard-widget h5 {
    font-size: 1rem;
    color: var(--menu-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-widget i {
    width: 20px;
    text-align: center;
}

.dashboard-widget .badge {
    font-size: 0.875rem;
    padding: 0.35rem 0.65rem;
}

/* Área de Conteúdo do Cliente */
.content-cliente {
    /* Posicionamento */
    position: absolute;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    
    /* Espaçamento */
    padding: 20px !important;
    padding-bottom: 80px !important;
    
    /* Comportamento */
    overflow-y: auto;
    box-sizing: border-box;
}

/* Responsividade */
@media (max-width: 992px) {
    /* Ajustes gerais */
    body:not(.login-page) {
        padding-left: 0;
        padding-top: calc(var(--header-height) + 1rem);
    }

    .header {
        padding: 0 0.5rem;
    }
    
    /* Ajuste da área de conteúdo do cliente para dispositivos móveis */
    .content-cliente {
        left: 0;
        padding: 20px !important;
        padding-bottom: 80px !important;
    }
}

@media (max-width: 992px) {
    /* Menu lateral */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block !important;
    }

    /* Container e espaçamentos */
    .container-fluid {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    /* Botões */
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.9rem;
    }

    /* Cards */
    .card-body {
        padding: 0.75rem;
    }

    /* Tabelas */
    .table td, .table th {
        padding: 0.5rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Formulários */
    .form-control {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    /* Botões */
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Tabelas */
    .table td, .table th {
        padding: 0.375rem;
        font-size: 0.85rem;
    }

    /* Formulários */
    .form-control {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    /* Modais */
    .modal-header {
        padding: 0.75rem;
    }

    .modal-body {
        padding: 0.75rem;
    }

    .modal-footer {
        padding: 0.75rem;
    }

    /* Textos */
    .h1, h1 { font-size: 1.75rem; }
    .h2, h2 { font-size: 1.5rem; }
    .h3, h3 { font-size: 1.25rem; }
    .h4, h4 { font-size: 1.125rem; }
    .h5, h5 { font-size: 1rem; }
    .h6, h6 { font-size: 0.875rem; }
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: fit-content;
    padding: 0.375rem 0.75rem;
}

.btn i {
    font-size: 0.9em;
    width: 1em;
    text-align: center;
}

.btn-group {
    display: inline-flex;
    gap: 0.25rem;
}

.btn-group .btn {
    padding: 0.375rem 0.5rem;
}

/* Formulários */
.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Tabelas */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

/* Botões */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #d11628;
    border-color: #d11628;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* Responsividade Global */
.table-responsive {
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
    width: calc(100% + 1rem);
    overflow-x: auto;
}

.card-body {
    padding: 1rem;
}

/* Utilitários de Responsividade */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-auto {
    table-layout: auto;
}

.w-min {
    width: min-content !important;
}

.w-max {
    width: max-content !important;
}

/* Animações do Menu */
.menu-arrow {
    transition: transform 0.3s ease;
}

.nav-link[aria-expanded="true"] .menu-arrow:not(.active-indicator) {
    transform: rotate(180deg);
}

.collapse {
    transition: all 0.3s ease-in-out;
}

.collapse.show {
    transition: all 0.3s ease-in-out;
}

/* Estilos para o submenu */
.nav-item .submenu {
    padding-left: 2rem;
}

.nav-item .nav-link[data-bs-toggle="collapse"] {
    position: relative;
}

.nav-item .nav-link[data-bs-toggle="collapse"] .fa-chevron-down {
    transition: transform 0.2s ease-in-out;
}

.nav-item .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.submenu .nav-link {
    padding-left: 1rem;
    font-size: 0.9rem;
}

.submenu .nav-link.active {
    background-color: rgba(236, 24, 46, 0.1);
    color: #EC182E;
}

/* Páginas de Visualização e Assinatura */
.contratos-view .card-body,
.contratos-modelos-view .card-body,
.contratos-assinar .card-body {
    padding: 40px !important;
}

.contrato-wrapper {
    padding: 40px !important;
}

.contrato-a4 {
    padding: 40px !important;
}

/* Espaçamentos para a área de conteúdo do usuário na tela admin */
.admin-content {
    padding: 20px !important;
    padding-bottom: 80px !important;
}

/* Indicador de menu ativo */
.active-indicator {
    color: #fff;
    font-size: 0.8em;
}

/* Ajustes de largura mínima para campos de filtro */
.filter-date-inicio, 
.filter-date-fim {
    min-width: 150px;
}

.filter-numero-contrato {
    min-width: 120px;
}
