/* ========================================
   SINAPSI - COMPONENTES REUTILIZÁVEIS
   Arquivo CSS global para padronização visual
======================================== */

/* Variáveis CSS globais da identidade visual Sinapsi */
:root {
    /* Cores principais */
    --primary-blue: #4a6fa5;
    --primary-green: #7cb342;
    --secondary-blue: #5a7fb8;
    --light-blue: #e8f0fe;
    --dark-blue: #3a5f95;
    
    /* Gradientes suaves */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, rgba(74, 111, 165, 0.9) 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);

    --gradient-success: linear-gradient(135deg, #28a745 0%, rgba(40, 167, 69, 0.9) 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, rgba(255, 193, 7, 0.9) 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, rgba(220, 53, 69, 0.9) 100%);
    --gradient-info: linear-gradient(135deg, #17a2b8 0%, rgba(23, 162, 184, 0.9) 100%);
    
    /* Sombras */
    --shadow-card: 0 4px 15px rgba(74, 111, 165, 0.08);

    --shadow-button: 0 2px 8px rgba(74, 111, 165, 0.2);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    /* Bordas */
    --border-radius: 12px;
    --border-radius-small: 6px;
    --border-radius-large: 16px;
    
    /* Transições */

}

/* ========================================
   CARDS MODERNOS
======================================== */
.sinapsi-card {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(74, 111, 165, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Responsividade para cards sinapsi */
@media (max-width: 575.98px) {
    .sinapsi-card {
        margin-bottom: 0.75rem;
    }
    
    .sinapsi-card .card-header .card-title {
        font-size: 0.8rem;
    }
    
    .sinapsi-card-header {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .sinapsi-card-body {
        padding: 1rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .sinapsi-card {
        margin-bottom: 1rem;
    }
    
    .sinapsi-card .card-header .card-title {
        font-size: 0.85rem;
    }
    
    .sinapsi-card-header {
        padding: 0.9rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .sinapsi-card-body {
        padding: 1.2rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .sinapsi-card {
        margin-bottom: 1.2rem;
    }
    
    .sinapsi-card .card-header .card-title {
        font-size: 0.9rem;
    }
    
    .sinapsi-card-header {
        padding: 1rem 1.3rem;
        font-size: 0.9rem;
    }
    
    .sinapsi-card-body {
        padding: 1.3rem;
    }
}



/* Cabeçalhos padronizados seguindo configuracoes.html */
.sinapsi-card .card-header {
    background: transparent;
    border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
    color: var(--dark-blue);
}

.sinapsi-card .card-header .card-title {
    color: var(--dark-blue);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.sinapsi-card .card-header .card-title i {
    color: var(--primary-blue);
    margin-right: 0.5rem;
}

.card-primary.card-outline .card-header .card-title i {
    color: var(--primary-blue);
}

.card-info.card-outline .card-header {
    border-bottom-color: #17a2b8;
}

.card-info.card-outline .card-header .card-title i {
    color: #17a2b8;
}

.card-success.card-outline .card-header {
    border-bottom-color: #28a745;
}

.card-success.card-outline .card-header .card-title i {
    color: #28a745;
}

.card-warning.card-outline .card-header {
    border-bottom-color: #ffc107;
}

.card-warning.card-outline .card-header .card-title i {
    color: #ffc107;
}

.card-danger.card-outline .card-header {
    border-bottom-color: #dc3545;
}

.card-danger.card-outline .card-header .card-title i {
    color: #dc3545;
}

.sinapsi-card-header {
    border-bottom: 2px solid rgba(52, 144, 220, 0.2);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.sinapsi-card-body {
    padding: 1.5rem;
}

.sinapsi-card-footer {
    background: rgba(248, 249, 250, 0.8);
    border-top: 1px solid rgba(74, 111, 165, 0.08);
    padding: 1rem 1.5rem;
}

/* ========================================
   BOTÕES MODERNOS - PADRÃO SINAPSI
======================================== */
.btn-sinapsi {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;

    box-shadow: var(--shadow-button);
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



.btn-sinapsi:focus {
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

.btn-sinapsi:active {
    background: var(--dark-blue);
    color: white;
}

/* Variações de botões com cores uniformes */
.btn-sinapsi.btn-primary {
    background: var(--gradient-primary);
}

.btn-sinapsi.btn-success {
    background: var(--gradient-success);
}

.btn-sinapsi.btn-warning {
    background: var(--gradient-warning);
    color: #212529;
}

.btn-sinapsi.btn-danger {
    background: var(--gradient-danger);
}

.btn-sinapsi.btn-info {
    background: var(--gradient-info);
}

.btn-sinapsi.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, rgba(108, 117, 125, 0.9) 100%);
}

/* Botões outline */
.btn-sinapsi.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: none;
}



.btn-sinapsi.btn-outline-success {
    background: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    box-shadow: none;
}



.btn-sinapsi.btn-outline-danger {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    box-shadow: none;
}



.btn-sinapsi.btn-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    box-shadow: none;
}



/* ========================================
   FORMULÁRIOS MODERNOS
======================================== */
.form-sinapsi {
    position: relative;
}

.form-control-sinapsi {
    border: 1px solid rgba(74, 111, 165, 0.2);
    border-radius: var(--border-radius-small);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    height: 38px;
    display: flex;
    align-items: center;
}

.form-control-sinapsi:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.15rem rgba(74, 111, 165, 0.1);
    background: white;
}

.form-group-sinapsi {
    margin-bottom: 1.5rem;
}

.form-label-sinapsi {
    font-weight: 500;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    display: block;
}

/* Filtros padronizados */
.filtros-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(74, 111, 165, 0.08);
    margin-bottom: 2rem;
}

.filtros-card .card-body {
    padding: 1.5rem;
}

.form-control-modern {
    border-radius: 6px;
    border: 1px solid rgba(74, 111, 165, 0.2) !important;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.875rem;
    height: 38px;
    box-shadow: none !important;
}

/* Correção específica para selects */
select.form-control-modern {
    padding-right: 2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
}

select.form-control-modern:focus {
    outline: none;
    border-color: rgba(74, 111, 165, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25) !important;
}

.form-control-modern:focus {
    border-color: rgba(74, 111, 165, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25) !important;
    outline: none;
}

.form-control-modern::placeholder {
    color: #6c757d;
    opacity: 0.8;
}
    background: white;
}

/* Estilos específicos para select com form-control-modern */
select.form-control-modern {
    padding-right: 2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 8px 10px;
}

select.form-control-modern:focus {
    outline: none;
}

.btn-filtro {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;

    box-shadow: 0 2px 6px rgba(74, 111, 165, 0.2);
    font-size: 0.875rem;
    height: 38px;
}



.btn-limpar {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;

    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.2);
    font-size: 0.875rem;
    height: 38px;
}



/* ========================================
   BADGES MODERNOS
======================================== */
.badge-sinapsi {
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    overflow: hidden;
}

.badge-sinapsi-primary {
    background: var(--gradient-primary);
    color: white;
}

/* ========================================
   ALERTAS PADRONIZADOS
======================================== */
/* Alerta para 'sem dados' seguindo padrão de historicos.html */
.alert-sinapsi {
    border-radius: var(--border-radius-small);
    border: none;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.alert-sinapsi i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.alert-info.alert-sinapsi {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-warning.alert-sinapsi {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-success.alert-sinapsi {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger.alert-sinapsi {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.badge-sinapsi-success {
    background: var(--gradient-success);
    color: white;
}

.badge-sinapsi-warning {
    background: var(--gradient-warning);
    color: white;
}

.badge-sinapsi-danger {
    background: var(--gradient-danger);
    color: white;
}

.badge-sinapsi-info {
    background: var(--gradient-info);
    color: white;
}

/* ========================================
   ALERTAS MODERNOS
======================================== */
.alert-sinapsi {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert-sinapsi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.alert-sinapsi-primary {
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary-blue);
    border-left: 4px solid var(--primary-blue);
}

.alert-sinapsi-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-sinapsi-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-sinapsi-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ========================================
   TABELAS MODERNAS
======================================== */
.table-sinapsi {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table-sinapsi thead th {
    border-bottom: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}





.table-sinapsi tbody td {
    padding: 1rem;
    border-top: 1px solid rgba(74, 111, 165, 0.1);
    vertical-align: middle;
}

/* ========================================
   CALENDÁRIO
======================================== */
.calendar-day {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    height: 40px;
    vertical-align: middle;
    text-align: center;
    min-width: 40px;
}

.calendar-day:hover {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary-blue);
}

.calendar-day.active {
    background-color: var(--primary-blue) !important;
    color: white !important;
    font-weight: 600;
}

.calendar-day.has-events {
    background-color: rgba(124, 179, 66, 0.2);
    color: var(--primary-green);
    font-weight: 500;
}

.calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary-green);
    border-radius: 50%;
}

.calendar-day.active.has-events::after {
    background-color: white;
}

/* Responsividade do calendário */
#calendar-table {
    table-layout: fixed;
    width: 100%;
}

#calendar-table th,
#calendar-table td {
    width: 14.28%; /* 100% / 7 dias */
    padding: 0.25rem;
    font-size: 0.875rem;
}

/* Responsividade para tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .calendar-day {
        height: 35px;
        font-size: 0.875rem;
    }
    
    #calendar-table th,
    #calendar-table td {
        padding: 0.2rem;
    }
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .calendar-day {
        height: 30px;
        font-size: 0.75rem;
        min-width: 30px;
    }
    
    #calendar-table {
        font-size: 0.75rem;
    }
    
    #calendar-table th,
    #calendar-table td {
        padding: 0.15rem 0.1rem;
        font-size: 0.75rem;
    }
    
    #calendar-table th {
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .calendar-day.has-events::after {
        width: 4px;
        height: 4px;
        bottom: 2px;
    }
}

/* Responsividade para dispositivos muito pequenos */
@media (max-width: 575.98px) {
    .calendar-day {
        height: 25px;
        font-size: 0.7rem;
        min-width: 25px;
    }
    
    #calendar-table th,
    #calendar-table td {
        padding: 0.1rem 0.05rem;
        font-size: 0.7rem;
    }
    
    #calendar-table th {
        font-size: 0.65rem;
        padding: 0.2rem 0.05rem;
    }
    
    .calendar-day.has-events::after {
        width: 3px;
        height: 3px;
        bottom: 1px;
    }
    
    /* Ajustar o card do calendário para dispositivos pequenos */
    .sinapsi-card .card-body {
        padding: 0.75rem;
    }
    
    .card-header h3.card-title {
        font-size: 1rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   MODAIS MODERNOS
======================================== */
.modal-sinapsi .modal-content {
    border: none;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}

.modal-sinapsi .modal-header {
    border-bottom: 2px solid rgba(52, 144, 220, 0.2);
}

.modal-sinapsi .modal-header .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
}



.modal-sinapsi .modal-body {
    padding: 2rem;
}

.modal-sinapsi .modal-footer {
    background: rgba(248, 249, 250, 0.8);
    border-top: 1px solid rgba(74, 111, 165, 0.1);
    padding: 1.5rem;
}

/* ========================================
   PAGINAÇÃO MODERNA
======================================== */
.pagination-sinapsi {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.pagination-sinapsi .page-link {
    border: none;
    color: var(--primary-blue);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--border-radius-small);

    background: white;
    box-shadow: 0 2px 4px rgba(74, 111, 165, 0.1);
}



.pagination-sinapsi .page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-button);
}

/* ========================================
   FILTROS MODERNOS
======================================== */
.filtros-sinapsi {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(74, 111, 165, 0.08);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.filtros-sinapsi .form-control {
    border: 1px solid rgba(74, 111, 165, 0.2);
    border-radius: var(--border-radius-small);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    height: 38px;

}

.filtros-sinapsi .form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.15rem rgba(74, 111, 165, 0.15);
}

.btn-filtro-sinapsi {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    height: 38px;

}



.btn-limpar-sinapsi {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    height: 38px;

}



/* ========================================
   RESPONSIVIDADE TABLETS (768px - 1024px)
======================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Otimização de tabelas para tablets - mantém estrutura desktop mas com ajustes */
    .table-mobile-stack {
        display: table;
    }
    
    .table-mobile-stack thead {
        display: table-header-group;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: table-cell;
    }
    
    .table-mobile-stack tr {
        display: table-row;
        background: transparent;
        border: none;
        border-radius: 0;
        margin-bottom: 0;
        padding: 0;
        box-shadow: none;
    }
    
    /* Ajuste de botões em tabelas para tablets */
    .table-mobile-stack .btn-group {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        width: auto;
    }
    
    .table-mobile-stack .btn-group .btn {
        width: auto;
        margin: 0;
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Otimização de botões gerais para tablets */
    .btn-group-mobile {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        width: auto;
    }
    
    .btn-group-mobile .btn {
        width: auto;
        justify-content: center;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .btn-group-mobile .btn i {
        margin-right: 0.5rem;
        width: auto;
    }
    
    /* Ajuste de cards de filtro para tablets */
    .filtros-card .row {
        margin: 0;
    }
    
    .filtros-card .col-md-4,
    .filtros-card .col-md-3,
    .filtros-card .col-md-2 {
        padding: 0 0.5rem;
    }
    
    /* Otimização de paginação para tablets */
    .pagination-sinapsi {
        justify-content: center;
    }
    
    .pagination-sinapsi .page-item .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Ajuste de alertas para tablets */
    .alert-sinapsi {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Otimização de modais para tablets */
    .modal-sinapsi .modal-dialog {
        max-width: 650px;
        margin: 1.5rem auto;
    }
    
    .modal-sinapsi .modal-body {
        padding: 1.25rem;
    }
    
    .modal-sinapsi .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-sinapsi .modal-footer {
        padding: 0.75rem 1.25rem;
    }
}

/* ========================================
   RESPONSIVIDADE MOBILE
======================================== */
/* Otimização de tabelas para mobile */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table-mobile-stack {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack thead {
        display: none;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack tr {
        background: white;
        border: 1px solid rgba(74, 111, 165, 0.1);
        border-radius: var(--border-radius-small);
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-card);
    }
    
    /* Estilos de table-mobile-stack movidos para custom.css para evitar conflitos */
    
    .table-mobile-stack .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .table-mobile-stack .btn-group .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Otimização de botões para mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        border-radius: 4px !important;
    }
    
    .btn-group-mobile .btn i {
        margin-right: 8px;
        width: 16px;
        text-align: center;
    }
    
    /* Ajustes para cards de filtro em mobile */
    .filtros-card .row {
        margin: 0;
    }
    
    .filtros-card .col-md-4,
    .filtros-card .col-md-3,
    .filtros-card .col-md-2 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    .input-group-append {
        margin-top: 0.5rem;
        display: flex;
        width: 100%;
    }
    
    .input-group-append .btn {
        width: 100%;
    }
}

/* ========================================
   ANIMAÇÕES
======================================== */
/* Animações removidas para melhor performance */

/* ========================================
   CARDS DE PACIENTES - ESTILOS ESPECÍFICOS
======================================== */

/* Cards de Pacientes Modernizados */
.paciente-card {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(74, 111, 165, 0.08);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.paciente-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
}

/* Avatar do Paciente */
.paciente-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* Informações do Paciente */
.paciente-nome {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #2c3e50;
    line-height: 1.2;
}

.paciente-idade {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.paciente-info {
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    color: #495057;
}

.paciente-info i {
    width: 16px;
    color: var(--primary-blue);
    margin-right: 8px;
    font-size: 0.875rem;
}

/* Badges Modernizados */
.badge-status {
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-ativo {
    background: var(--gradient-success);
    color: white;
}

.badge-inativo {
    background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    color: white;
}

.badge-particular {
    background: var(--gradient-primary);
    color: white;
}

.badge-convenio {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
}

.badge-sus {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
}

/* Botões de Ação Modernizados */
.btn-paciente {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-paciente::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.btn-visualizar {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.3);
}

.btn-editar {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 3px 10px rgba(74, 111, 165, 0.3);
}

.btn-excluir {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

/* Alert de Filtros */
.alert-filtros {
    background: linear-gradient(135deg, rgba(74, 111, 165, 0.1) 0%, rgba(74, 111, 165, 0.05) 100%);
    border: 1px solid rgba(74, 111, 165, 0.2);
    border-radius: 12px;
    color: var(--primary-blue);
    padding: 1rem 1.5rem;
}

.alert-filtros .badge {
    background: var(--gradient-primary);
    color: white;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

/* Paginação Modernizada */
.pagination-modern {
    margin: 0;
}

.pagination-modern .page-link {
    border: none;
    border-radius: 8px;
    margin: 0 2px;
    padding: 0.75rem 1rem;
    color: var(--primary-blue);
    background: rgba(74, 111, 165, 0.05);
    font-weight: 500;
}

.pagination-modern .page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.pagination-modern .page-item.disabled .page-link {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Botão Exportar */
.btn-exportar {
    background: linear-gradient(135deg, #7cb342 0%, #9cc76a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(124, 179, 66, 0.3);
}

/* ========================================
   RESPONSIVIDADE
======================================== */
@media (max-width: 768px) {
    .sinapsi-card-body {
        padding: 1rem;
    }
    
    .btn-sinapsi {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .filtros-sinapsi {
        padding: 1rem;
    }
    
    .modal-sinapsi .modal-body {
        padding: 1.5rem;
    }
    
    /* Responsividade específica para cards de pacientes */
    .paciente-card {
        margin-bottom: 1rem;
    }
    
    .filtros-card .card-body {
        padding: 1.5rem;
    }
    
    .btn-paciente {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .paciente-avatar {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .sinapsi-card-body {
        padding: 0.75rem;
    }
    
    .filtros-sinapsi {
        padding: 0.75rem;
    }
    
    .modal-sinapsi .modal-body {
        padding: 1rem;
    }
}

/* ========================================
   MEDIA QUERIES ESPECÍFICAS PARA IPAD RETRATO
   Aplicar comportamento mobile no iPad em modo retrato
======================================== */

/* iPad retrato - aplicar estilos mobile */
@media only screen and (device-width: 768px) and (orientation: portrait),
       only screen and (min-device-width: 768px) and (max-device-width: 768px) and (orientation: portrait) {
    
    /* Otimização de tabelas para mobile */
    .table-responsive {
        border: none;
    }
    
    .table-mobile-stack {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack thead {
        display: none;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack tr {
        background: white;
        border: 1px solid rgba(74, 111, 165, 0.1);
        border-radius: var(--border-radius-small);
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-card);
    }
    
    .table-mobile-stack .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .table-mobile-stack .btn-group .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Otimização de botões para mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
    
    /* Responsividade geral */
    .sinapsi-card-body {
        padding: 1rem;
    }
    
    .btn-sinapsi {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .filtros-sinapsi {
        padding: 1rem;
    }
    
    .modal-sinapsi .modal-body {
        padding: 1.5rem;
    }
    
    /* Responsividade específica para cards de pacientes */
    .paciente-card {
        margin-bottom: 1rem;
    }
    
    .filtros-card .card-body {
        padding: 1.5rem;
    }
    
    .btn-paciente {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .paciente-avatar {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* ========================================
   ESTILOS ESSENCIAIS TRANSFERIDOS DE HISTORICOS.CSS
======================================== */

/* Transições globais */
:root {
    --transition-fast: all 0.2s ease;
}

/* Cards padronizados */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

/* Form controls padronizados */
.form-control:not(.form-control-modern) {
    border: 2px solid rgba(74, 111, 165, 0.1);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    background: white;
}

.form-control:not(.form-control-modern):focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.15);
    background: white;
}

.form-control:not(.form-control-modern)::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

/* Botões padronizados */
.btn {
    border-radius: var(--border-radius-small);
    font-weight: 500;
    transition: var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    color: white;
}

.btn-outline-secondary {
    border: 2px solid rgba(108, 117, 125, 0.3);
    color: #6c757d;
    background: white;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    background: white;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: white;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #dc3545 0%, rgba(220, 53, 69, 0.8) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* Tabelas padronizadas */
.table {
    margin-bottom: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 1rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition-fast);
    border-bottom: 1px solid rgba(74, 111, 165, 0.1);
}

.table tbody tr:hover {
    background: rgba(74, 111, 165, 0.05);
}

.table tbody td {
    padding: 1rem;
    border-top: none;
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
}

/* Badges padronizados */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: var(--transition-fast);
}

.badge-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(74, 111, 165, 0.3);
}

/* Alertas padronizados */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-info i {
    color: #17a2b8;
}

/* Paginação padronizada */
.pagination {
    margin-bottom: 0;
}

.page-item .page-link {
    border: none;
    color: var(--primary-blue);
    background: white;
    margin: 0 0.25rem;
    border-radius: var(--border-radius-small);
    padding: 0.5rem 0.75rem;
    transition: var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-item .page-link:hover {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-button);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-button);
}

.page-item.disabled .page-link {
    background: #f8f9fa;
    color: #6c757d;
    box-shadow: none;
}

/* Modais padronizados */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

.modal-footer .btn {
    margin-left: 0.5rem;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Grupo de botões */
.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Input group padronizado */
.input-group {
    box-shadow: var(--shadow-card);
    border-radius: var(--border-radius-small);
    overflow: hidden;
}

.input-group .form-control {
    border-right: none;
    border-radius: 0;
    box-shadow: none;
}

.input-group .form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: none;
}

.input-group-append .btn {
    border-radius: 0;
    border-left: none;
}

/* Estados de loading */
.loading-table {
    position: relative;
}

.loading-table::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-table::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 111, 165, 0.1);
    border-left: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Melhorias visuais específicas */
.text-muted {
    color: #6c757d !important;
    font-style: italic;
}

.justify-content-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Efeito de brilho nos botões */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Melhorias de acessibilidade */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

.form-control:focus {
    outline: none;
}

/* ========================================
   RESPONSIVIDADE ADICIONAL
======================================== */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .filtros-card .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        margin-right: 0;
        width: 100%;
    }
}

/* ========================================
   UTILITÁRIOS
======================================== */
.text-sinapsi-primary {
    color: var(--primary-blue) !important;
}

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

.bg-sinapsi-light {
    background: var(--light-blue) !important;
}

.border-sinapsi {
    border-color: rgba(74, 111, 165, 0.2) !important;
}

.shadow-sinapsi {
    box-shadow: var(--shadow-card) !important;
}

/* ========================================
   RESPONSIVIDADE PARA BOTÕES - MOBILE
======================================== */
/* Botões responsivos em dispositivos móveis (col-sm-12) */
@media (max-width: 575.98px) {
    .btn,
    .btn-sinapsi,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-warning,
    .btn-danger,
    .btn-info,
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-success,
    .btn-outline-warning,
    .btn-outline-danger,
    .btn-outline-info,
    .btn-filtro,
    .btn-limpar,
    .btn-exportar,
    .btn-paciente,
    .btn-visualizar,
    .btn-editar,
    .btn-excluir {
        width: 100% !important;
        margin-bottom: 0.5rem;
        margin-top: 0.5rem;
        display: block;
    }
    
    /* Exceções para botões em grupos que devem manter layout horizontal */
    .btn-group .btn,
    .btn-group-mobile .btn,
    .modal-footer .btn {
        width: auto !important;
        display: inline-flex;
        margin-bottom: 0;
    }
    
    /* Botões em cards de pacientes */
    .paciente-card .btn-group-mobile .btn {
        width: auto !important;
        flex: 1;
    }
    
    /* Botões de ação rápida no dashboard */
    .quick-action-btn {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
}