:root {
    --primary-color: #4e73df;
    --primary-dark: #2e59d9;
    --primary-light: #6d88eb;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --gray-light: #e3e6f0;
    --gray-lighter: #f8f9fc;
    --text-muted: #5a5c69;
    
    /* Novas variáveis para padronização */
    --card-radius: 0.35rem;
    --card-padding: 1rem;
    --card-margin: 1rem;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* =============================================
   ESTILOS BASE E REUTILIZÁVEIS
============================================= */

/* --- TÍTULOS DE SEÇÃO (SECTION-HEADER) --- */
.section-header {
    color: var(--primary-color);
    font-weight: 600;
    padding: 15px 20px;
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--gray-lighter) 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    font-size: 1.1rem;
}

/* =============================================
   SISTEMA UNIFICADO DE CARDS
============================================= */

/* Base comum para todos os cards */
.info-card,
.category-progress,
.metric-card,
.auditoria-metric-card,
.contrato-card,
.modern-card {
    border-radius: var(--card-radius);
    transition: var(--transition);
    margin-bottom: var(--card-margin);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* --- CARDS DE INFORMAÇÃO (INFO-CARD) --- */
.info-card {
    background-color: var(--gray-lighter);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 100%;
    padding: 15px;
    border: 1px solid var(--gray-light);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}

.info-card .card-body {
    padding: 1rem;
}

.info-card-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-card-text {
    margin-bottom: 0.5rem;
}

/* --- CAMPOS OBRIGATÓRIOS --- */
.required-field label:after {
    content: " *";
    color: var(--danger-color);
}

/* =============================================
   SISTEMA UNIFICADO DE BADGES
============================================= */

.status-badge,
.badge-custom,
.table-badge,
.badge-auditoria {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
    color: white;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

/* --- STATUS BADGES (ANIMAISTELA) --- */
.status-badge {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
}

.badge-custom {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.table-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
}

.badge-auditoria {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
}

/* Sistema de cores unificado para badges */
.badge-realizado,
.status-badge.success,
.badge-custom.success,
.table-badge.success,
.badge-auditoria.success {
    background-color: var(--success-color) !important;
    color: white;
}

.badge-agendado,
.status-badge.info,
.badge-custom.info, 
.table-badge.info,
.badge-auditoria.info {
    background-color: var(--info-color) !important;
    color: white;
}

.badge-pendente,
.status-badge.warning,
.badge-custom.warning,
.table-badge.warning,
.badge-auditoria.warning {
    background-color: var(--warning-color) !important;
    color: #212529;
}

.badge-cancelado,
.status-badge.danger,
.badge-custom.danger,
.table-badge.danger,
.badge-auditoria.danger {
    background-color: var(--danger-color) !important;
    color: white;
}

.badge-inapto,
.status-badge.secondary,
.badge-custom.secondary,
.table-badge.secondary,
.badge-auditoria.secondary {
    background-color: #6c757d !important;
    color: white;
}

.badge-realizado { background-color: #28a745; }
.badge-agendado { background-color: #17a2b8; }
.badge-pendente { background-color: #ffc107; color: #212529; }
.badge-cancelado { background-color: #dc3545; }
.badge-inapto { background-color: #6c757d; color: white; }

/* =============================================
   ESTILOS DE TABELA (AUDITORIA)
============================================= */

/* Classe para quebrar textos longos em células (Nº Guia) */
.numero-guia {
    word-break: break-all;
    word-wrap: break-word;
    max-width: 120px;
    font-size: 0.9em;
}

/* Ajuste para células da tabela - primeira coluna (Nº Guia) */
.data-table td:first-child {
    max-width: 120px;
    word-break: break-all;
    word-wrap: break-word;
    font-size: 0.9em;
    padding: 8px 4px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Ajuste para cabeçalho da primeira coluna */
.data-table th:first-child {
    max-width: 120px;
    word-break: break-all;
    word-wrap: break-word;
    background-color: var(--primary-color);
    color: white;
}

/* DataTables Responsivo */
.dataTables_wrapper {
    overflow-x: auto;
    margin: 15px;
}
.dataTables_wrapper table {
    width: 100% !important;
}

/* =============================================
   SISTEMA UNIFICADO DE TABELAS
============================================= */

.professional-table,
.data-table {
    border: none;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.9rem;
}

.professional-table thead th,
.data-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    border: none;
    padding: 1rem 0.75rem;
}

.professional-table tbody tr,
.data-table tbody tr {
    transition: var(--transition);
    background: white;
}

.professional-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
    background: var(--gray-lighter);
}

.professional-table tbody tr:hover,
.data-table tbody tr:hover {
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.15);
}

/* =============================================
   ESTILOS DE CIDADES (AUDITORIA / CADASTRO CLINICA)
============================================= */

/* Estilo base para um badge de cidade em destaque */
.cidade-badge-destaque {
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cidade-badge-destaque.vila-velha {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
}
.cidade-badge-destaque.vitoria {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}
.cidade-badge-destaque.serra {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
}
.cidade-badge-destaque.cariacica {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
}
.cidade-badge-destaque.viana {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
}
.cidade-badge-destaque.default {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

.cidade-badge-destaque:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Estilos específicos de Card (CADASTRO CLINICA) */
.city-name {
    font-weight: 600;
    color: var(--primary-color);
}

.city-count {
    font-size: 0.9rem;
    margin: 5px 0;
}

.city-castracoes {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.city-details {
    text-align: left;
    padding: 5px;
    background-color: #fff;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.contract-details {
    background-color: var(--gray-lighter);
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
}

.subcategory-group {
    background-color: var(--gray-lighter);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid var(--gray-light);
}

.user-menu {
    min-width: 200px;
}

/* =============================================
   ESTILOS DE MODAL (ANEXOS / AUDITORIA)
============================================= */

.modal {
  display: none; 
  position: fixed;
  z-index: 1070;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow: auto;
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: modalFadeIn 0.3s ease-out;
}

.close {
  color: #dc3545;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  float: right;
  transition: all 0.2s;
}

.close:hover {
  color: var(--danger-color);
  transform: scale(1.1);
}

.modal-content button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-content button:hover {
  background: var(--primary-dark);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   SISTEMA UNIFICADO DE MODAIS
============================================= */

.modal-unificado,
.modal-cirurgia {
    /* Base comum para modais */
}

.modal-unificado .modal-content,
.modal-cirurgia .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
}

.modal-unificado .modal-header,
.modal-cirurgia .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
}

/* =============================================
   ESTILOS DE FORMULÁRIO (CADASTRO TELA)
============================================= */

/* --- VALIDAÇÃO --- */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.auto-filled {
    background-color: #f0f8ff;
    border-left: 3px solid var(--primary-color);
}


.section-title {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--gray-light);
}

/* --- UPLOAD DE IMAGEM --- */
.preview-container {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--gray-lighter);
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.preview-container:hover {
    border-color: var(--primary-color) !important;
    background-color: #e9ecef;
}

.upload-icon {
    font-size: 2rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.preview-container:hover .upload-icon {
    color: var(--primary-color) !important;
}


.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    transition: all 0.3s ease;
}

/* Quando há uma imagem carregada */
.preview-container.has-image {
    border: none;
    padding: 0;
}
.preview-container.has-image .upload-icon {
    display: none;
}
.preview-container.has-image .preview-image {
    display: block !important;
}

/* =============================================
   ESTILOS DE DASHBOARD
============================================= */

/* Utilização de .category-progress unificada com .info-card */
.category-progress {
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.category-progress:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-label h4 {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 180px;
}

.progress-label .text-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.progress-label .small {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.progress {
    height: 0.5rem;
    border-radius: 6px;
    background-color: #f1f3f4;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #4e73df;
    transition: width 0.6s ease;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.category-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 15px 0 0 0;
    border-top: 1px solid #f1f3f4;
    margin-top: 0.75rem;
}

.category-info span {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 12px;
    background: var(--gray-lighter);
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid #e9ecef;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.category-info span i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* =============================================
   CARDS SUPERIORES DO DASHBOARD - DESIGN MODERNO
============================================= */

.dashboard-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
}

/* Card base - Estilo moderno com gradiente sutil */
.metric-card {
    position: relative;
    border-radius: 16px;
    border: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

/* Barra lateral colorida - Substituindo border-left */
.metric-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    transition: width 0.3s ease;
}

.metric-card:hover::before {
    width: 8px;
}

/* Cores das barras laterais */
.border-left-success::before {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
}

.border-left-info::before {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
}

.border-left-danger::before {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
}

.border-left-warning::before {
    background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%);
}

/* Card body */
.metric-card .card-body {
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 2;
}

/* Título do card (label) */
.metric-card .text-xs {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Ícones do texto */
.metric-card .text-xs i {
    font-size: 0.85rem;
}

/* Número principal - AJUSTADO PARA CABER */
.metric-card .h5 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    animation: countUp 0.6s ease-out;
}

/* Texto small dentro do h5 */
.metric-card .h5 small {
    font-size: 0.45em;
    color: #6c757d;
    font-weight: 400;
}

/* Barra de progresso customizada */
.metric-card .progress-thin {
    height: 6px;
    border-radius: 10px;
    background: #f1f3f5;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.metric-card .progress-thin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.metric-card .progress-bar {
    border-radius: 10px;
    transition: width 1s ease-out;
    position: relative;
    overflow: hidden;
}

/* Gradientes das barras de progresso */
.metric-card .bg-success {
    background: linear-gradient(90deg, #1cc88a 0%, #17a673 100%) !important;
}

.metric-card .bg-info {
    background: linear-gradient(90deg, #36b9cc 0%, #2c9faf 100%) !important;
}

.metric-card .bg-danger {
    background: linear-gradient(90deg, #e74a3b 0%, #d32f2f 100%) !important;
}

.metric-card .bg-warning {
    background: linear-gradient(90deg, #f6c23e 0%, #f4b619 100%) !important;
}

/* Texto de porcentagem */
.metric-card small.text-muted {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.metric-card small.text-muted i {
    font-size: 0.7rem;
}

/* Ícone do card (grande no lado direito) */
.metric-card .metric-icon {
    font-size: 2.5rem !important;
    opacity: 0.15 !important;
    transition: all 0.3s ease;
}

.metric-card:hover .metric-icon {
    opacity: 0.25 !important;
    transform: scale(1.1) rotate(5deg);
}

/* =============================================
   ESTILOS PARA LOGIN E OUTROS COMPONENTES
============================================= */

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color);
}

.upload-area {
    border: 2px dashed var(--gray-light);
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--gray-lighter);
}

.progress-thin {
    height: 6px;
}

.metric-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    color: var(--primary-color);
}

.upload-container {
    display: inline-block;
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

/* =============================================
   SISTEMA UNIFICADO DE BOTÕES
============================================= */

.btn-modern,
.btn-access,
.upload-button {
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: none;
    position: relative;
}

.upload-button:hover {
    background: #3367d6;
}

.upload-button:active {
    background: #2851a3;
}


.file-info {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
}

.file-info.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon-small {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}



.city-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    height: 100%;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.city-card-img {
    height: 120px;
    object-fit: contain;
    background-color: #f8f9fa;
    padding: 1.5rem;
}

.main-card {
    border-radius: 1rem;
    border: none;
}

.logo-img {
    height: 150px;
}


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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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


/* =============================================
   RESPONSIVIDADE E MEDIA QUERIES
============================================= */


@media (max-width: 768px) {
    .login-card {
        border-radius: 0;
    }
    .info-card {
        margin-bottom: 0.5rem;
    }
    .section-header {
        font-size: 1.2rem;
    }
    .category-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .progress-label {
        flex-direction: column;
        align-items: flex-start;
    }
    .progress-label .text-right {
        align-self: flex-end;
        width: 100%;
        justify-content: flex-end;
    }
    .progress-label h4 {
        min-width: auto;
        width: 100%;
    }
    .dataTables_wrapper {
        font-size: 0.875rem;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        margin-bottom: 0.5rem;
    }
    
    /* Dashboard metrics responsivo */
    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .metric-card .h5 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .category-info {
        grid-template-columns: 1fr;
    }
    .category-progress {
        padding: 15px;
    }
    .progress-label h4 {
        font-size: 1.1rem;
    }
    .preview-container {
        width: 120px;
        height: 120px;
        margin: 0 auto 15px;
    }
    
    /* Dashboard metrics mobile */
    .dashboard-metrics {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================
   ANIMAÇÕES E TRANSIÇÕES SUAVES
============================================= */

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sidebar-overlay.show {
    animation: overlayFadeIn 0.3s ease;
}

.sidebar, .sidebar-overlay, #content-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   ESTILOS DO MENU RESPONSIVO (SIDEBAR)
============================================= */

@media (max-width: 768px) {
    .sidebar {
        width: 115px !important;
        min-width: 115px !important;
        max-width: 1440px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1080;
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar .nav-item {
        width: 100%;
        text-align: center;
    }
    
    .sidebar .nav-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0.25rem !important;
        text-align: center;
        min-height: 60px;
    }
    
    .sidebar .nav-link i {
        margin-right: 0 !important;
        margin-bottom: 4px;
        font-size: 1.1rem;
        display: block;
    }
    
    .sidebar .nav-link span {
        font-size: 0.7rem !important;
        line-height: 1.2;
        display: block;
        text-align: center;
        width: 100%;
    }
    
    /* Ajuste do texto do sidebar heading */
    .sidebar .sidebar-heading {
        font-size: 0.65rem;
        padding: 0.5rem;
        text-align: center;
    }
    
    /* Garantir que o active seja visível */
    .sidebar .nav-item.active {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Ajuste do divider */
    .sidebar .sidebar-divider {
        margin: 0.5rem 0;
    }
    
    /* Overlay corrigido */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1079;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
        animation: overlayFadeIn 0.3s ease;
    }
    
    /* Prevenir scroll quando sidebar está aberto */
    body.sidebar-open {
        overflow: hidden;
    }
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 769px) {
    .sidebar {
        transition: 
            width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Suavizar a mudança do content-wrapper */
    #content-wrapper {
        transition: 
            margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Animar os textos do menu com delay */
    .sidebar .nav-link span {
        transition: 
            opacity 0.2s ease 0.1s,
            display 0s linear 0.3s !important;
    }
    
    .sidebar.toggled .nav-link span {
        transition: 
            opacity 0.1s ease,
            display 0s linear 0.2s !important;
    }
    
    /* Brand animation */
    .sidebar-brand {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1rem 1.5rem;
    }
    
    .sidebar.toggled .sidebar-brand {
        padding: 1rem 0.5rem;
        justify-content: center;
    }
    
    .sidebar-brand-icon {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.toggled .sidebar-brand-icon {
        margin-right: 0;
    }
}

/* Prevenir conflitos de transição */
.sidebar {
    transform: none !important;
}

/* Correção para evitar flickering */
.sidebar .nav-link span {
    display: inline-block !important;
}

.sidebar.toggled .nav-link span {
    display: none !important;
}


/* Ajustes para os botões de ação em dispositivos móveis para ficar na horizontal */
@media (max-width: 768px) {
    .table-responsive .btn {
        margin-bottom: 2px;
        display: inline-block;
        width: auto;
    }
    
    /* Garante que os botões fiquem lado a lado */
    td .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 1px;
    }
    
    /* Ajusta o tamanho dos botões em mobile */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Ajusta especificamente a coluna de ações */
    #tabelaTutores td:last-child {
        white-space: nowrap;
        text-align: center;
    }
    
    /* Ajusta a tabela de animais no modal */
    #tabelaanimais td:last-child {
        white-space: nowrap;
        text-align: center;
    }
}

/* Ajustes para os botões de ação em dispositivos móveis - Animais */
@media (max-width: 768px) {
    /* Garante que os botões fiquem lado a lado */
    #tabelaAnimais td:last-child .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 2px;
        width: auto;
    }
    
    /* Ajusta o tamanho dos botões em mobile */
    #tabelaAnimais .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        min-width: 35px;
    }
    
    /* Ajusta especificamente a coluna de ações */
    #tabelaAnimais td:last-child {
        white-space: nowrap;
        text-align: center;
    }
    
    /* Remove o display block padrão do DataTables em mobile */
    #tabelaAnimais tbody td {
        display: table-cell !important;
    }
}

/* =============================================
   CORREÇÃO PARA SOBREPOSIÇÃO DO RODAPÉ
============================================= */

/* Correção para evitar sobreposição do rodapé pelo sidebar */
.custom-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
}

/* Garantir que o content-wrapper tenha altura mínima adequada */
#content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Garantir que o conteúdo principal ocupe o espaço disponível */
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Ajuste para telas menores para evitar sobreposição */
@media (max-width: 768px) {
    .custom-footer {
        z-index: 2;
        margin-top: 2rem;
    }
}

/* =============================================
   ESTILOS TELA DE RELATÓRIOS (RELATORIOSTELA.PHP)
============================================= */

/* ESTILOS PARA O CARD DE RESUMO DO PERÍODO */
.periodo-header-relatorios {
    background: linear-gradient(135deg, var(--primary-color) 0%, #224abe 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 20px -20px;
}

.periodo-title-relatorios {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.periodo-subtitle-relatorios {
    font-size: 1rem;
    opacity: 0.9;
}

.stats-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--gray-lighter);
    border-radius: 10px;
    border: 1px solid var(--gray-light);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaecf4;
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}

.icon-cirurgias { background: var(--primary-color); color: white; }
.icon-exames { background: var(--success-color); color: white; }
.icon-recoleta { background: var(--info-color); color: white; }
.icon-agendadas { background: var(--info-color); color: white; }
.icon-realizadas { background: var(--success-color); color: white; }
.icon-inaptas { background: var(--warning-color); color: white; }
.icon-canceladas { background: var(--danger-color); color: white; }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-number.large {
    font-size: 2.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #858796;
    margin-bottom: 5px;
    font-weight: 600;
}

.stat-percentage {
    font-size: 0.8rem;
    color: #b7b9cc;
    font-weight: 500;
}

.export-section-relatorios {
    background: var(--gray-lighter);
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #d1d3e2;
    margin-top: 20px;
}

/* Animações para números */
.animate-number {
    animation: countUp 1s ease-out;
}


/* Responsividade */
@media (max-width: 768px) {
    .stat-number.large { font-size: 2rem; }
    .stat-number { font-size: 1.5rem; }
    .periodo-title-relatorios { font-size: 1.2rem; }
    .periodo-subtitle-relatorios { font-size: 0.9rem; }
}

/* =============================================
   AJUSTES PARA O MENU ATIVO COM FADE RÁPIDO (0.5s) E LINHA BRANCA NA ESQUERDA
============================================= */

/* 1. Base: Transição rápida (0.5s) para todas as mudanças de estado */
.sidebar .nav-item {
    transition: background-color 0.5s ease, border-left 0.5s ease;
    animation: none !important;
}

/* 2. Estilo Padrão do Item Ativo: Cor de fundo sutil (clarinho) e linha branca na esquerda */
.sidebar .nav-item.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-left: 5px solid white;
    border-radius: 0 4px 4px 0;
    animation: none !important;
}

/* 3. Efeito de Fade (Hover): Simula o fade rápido ao passar/tirar o mouse, mantendo o item 'quente' */
.sidebar .nav-item.active:hover {
    background-color: rgba(255, 255, 255, 0.35) !important;
}

/* 4. Garante que o ícone e o texto do item ativo fiquem brancos (mais vivos) */
.sidebar .nav-item.active .nav-link {
    color: white !important;
}

.sidebar .nav-item.active .nav-link i {
    color: white !important;
}

/* 5. Correção Mobile: Sobrescreve a regra do sidebar.php para usar a nova linha e fundo */
@media (max-width: 768px) {
    .sidebar .nav-item {
        padding-left: 0 !important;
        border-left: none !important;
    }
    
    .sidebar .nav-item.active {
        background-color: rgba(255, 255, 255, 0.35) !important;
        animation: none !important;
    }
}

/* =============================================
   CSS pagina clinicas
============================================= */
.nav-tabs-custom {
    border-bottom: 2px solid #e3e6f0;
    margin-bottom: 2rem;
}

.nav-tabs-custom .nav-link {
    border: none;
    color: #858796;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-tabs-custom .nav-link:hover {
    color: #4e73df;
    background-color: #f8f9fc;
}

.nav-tabs-custom .nav-link.active {
    color: #4e73df;
    border-bottom: 3px solid #4e73df;
    background-color: transparent;
}

/* =============================================
   CARDS DE CONTRATOS
============================================= */
.contratos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contrato-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.contrato-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.contrato-card.finalizando {
    border-left: 4px solid #f6c23e;
}

.contrato-card.inativo {
    border-left: 4px solid #e74a3b;
    opacity: 0.8;
}

.contrato-card.finalizando::before {
    content: "⚠️ Finalizando";
    position: absolute;
    top: 0;
    right: 0;
    background: #f6c23e;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-bottom-left-radius: 8px;
}

.contrato-numero {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2e59d9;
    margin-bottom: 0.5rem;
}

.contrato-cidade {
    color: #5a5c69;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contrato-cidade i {
    color: #e74a3b;
}

.contrato-periodo {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fc;
    border-radius: 6px;
    font-size: 0.85rem;
}

.contrato-periodo-item {
    display: flex;
    flex-direction: column;
}

.contrato-periodo-label {
    color: #858796;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.contrato-periodo-valor {
    color: #5a5c69;
    font-weight: 600;
}

.contrato-itens {
    margin: 1rem 0;
}

.contrato-itens-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-lista {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fc;
    font-size: 0.85rem;
}

.item-lista:last-child {
    border-bottom: none;
}

.item-categoria {
    color: #5a5c69;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-quantidade {
    font-weight: 600;
    color: #4e73df;
    background: #eaecf4;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.contrato-acoes {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e3e6f0;
}

.contrato-acoes .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
}

/* =============================================
   FILTROS
============================================= */
.filtros-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.filtros-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}


/* =============================================
   EMPTY STATE
============================================= */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #858796;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* =============================================
   FORMULÁRIO DE ADICIONAR - MELHORIAS
============================================= */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e3e6f0;
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.form-section-header {
    background: linear-gradient(135deg, var(--gray-lighter) 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-light);
    border-left: 4px solid var(--primary-color);
}

.form-section-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.form-section-header i {
    margin-right: 10px;
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 1.5rem;
}

/* =============================================
   ANIMAÇÕES
============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contrato-card {
    animation: fadeIn 0.3s ease-out;
}

/* =============================================
   RESPONSIVIDADE
============================================= */
@media (max-width: 768px) {
    .contratos-grid {
        grid-template-columns: 1fr;
    }
    
    .filtros-row {
        grid-template-columns: 1fr;
    }
    
    .contrato-acoes {
        flex-direction: column;
    }
    
    .form-row-group {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   ESTILOS ESPECÍFICOS PARA MODAL DE GESTÃO DE CIRURGIAS
============================================= */

.modal-cirurgia .modal-dialog {
    max-width: 900px;
}

.modal-cirurgia .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

.modal-cirurgia .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
}

.modal-cirurgia .modal-title {
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-cirurgia .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
    font-size: 1.5rem;
}

.modal-cirurgia .close:hover {
    opacity: 1;
    color: white;
}

/* Tabs do modal */
.modal-cirurgia .nav-tabs {
    border-bottom: 2px solid var(--gray-light);
    padding: 0 2rem;
    margin-bottom: 1.5rem;
}

.modal-cirurgia .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.modal-cirurgia .nav-link:hover {
    color: var(--primary-color);
    background: transparent;
    border: none;
}

.modal-cirurgia .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border: none;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
}

.modal-cirurgia .nav-link i {
    margin-right: 8px;
    font-size: 0.9em;
}

/* Conteúdo do modal */
.modal-cirurgia .modal-body {
    padding: 0 2rem 1rem;
}

.modal-cirurgia .tab-content {
    min-height: 400px;
}

/* Seções dentro do modal */
.modal-cirurgia .section-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-light);
}

.modal-cirurgia .section-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Grupos de informação */
.modal-cirurgia .info-group {
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: var(--gray-lighter);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.modal-cirurgia .info-group:hover {
    background: #f8f9fc;
    border-left: 3px solid var(--primary-light);
}

.modal-cirurgia .info-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-cirurgia .info-value {
    color: #2c3e50;
    font-weight: 500;
    font-size: 1rem;
}

/* Formulários dentro do modal */
.modal-cirurgia .form-group {
    margin-bottom: 1.5rem;
}

.modal-cirurgia .form-control {
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.modal-cirurgia .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.modal-cirurgia .input-group .form-control {
    border-radius: 6px 0 0 6px;
}

.modal-cirurgia .input-group .form-control:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

/* Campos condicionais */
.modal-cirurgia .status-fields {
    background: var(--gray-lighter);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--warning-color);
}

.modal-cirurgia #camposRealizado {
    border-left-color: var(--success-color);
}

.modal-cirurgia #camposInapto {
    border-left-color: var(--warning-color);
}

.modal-cirurgia #camposCancelado {
    border-left-color: var(--danger-color);
}

/* Anexos */
.modal-cirurgia .file-card {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    width: 120px;
    margin: 0.5rem;
}

.modal-cirurgia .file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-cirurgia .file-icon {
    margin-bottom: 0.5rem;
}

.modal-cirurgia .file-name {
    word-break: break-all;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-cirurgia .file-name a {
    color: var(--text-muted);
    text-decoration: none;
}

.modal-cirurgia .file-name a:hover {
    color: var(--primary-color);
}

/* Upload area */
.modal-cirurgia .upload-container {
    margin-bottom: 1rem;
}

.modal-cirurgia .file-info {
    background: var(--gray-lighter);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.modal-cirurgia .file-list {
    max-height: 200px;
    overflow-y: auto;
}

.modal-cirurgia .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.modal-cirurgia .file-item:last-child {
    border-bottom: none;
}

.modal-cirurgia .file-icon-small {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Footer do modal */
.modal-cirurgia .modal-footer {
    border-top: 1px solid var(--gray-light);
    padding: 1.5rem 2rem;
    border-radius: 0 0 12px 12px;
}

/* Badges no modal */
.modal-cirurgia .status-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-cirurgia .modal-dialog {
        margin: 1rem;
    }
    
    .modal-cirurgia .modal-header,
    .modal-cirurgia .modal-body,
    .modal-cirurgia .modal-footer {
        padding: 1rem;
    }
    
    .modal-cirurgia .nav-tabs {
        padding: 0 1rem;
    }
    
    .modal-cirurgia .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-cirurgia .file-card {
        width: 100px;
        margin: 0.25rem;
    }
}

/* Animações suaves */
.modal-cirurgia .tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

/* =============================================
   CORREÇÕES ESPECÍFICAS PARA O MODAL DE CIRURGIAS
============================================= */

/* 1. Remove a borda azul dos info-group */
.modal-cirurgia .info-group {
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: var(--gray-lighter);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.modal-cirurgia .info-group:hover {
    background: #f8f9fc;
    border-left: 3px solid var(--primary-light);
}

/* 2. Corrige a visualização das tabs ativas */
.modal-cirurgia .nav-link.active {
    color: var(--primary-color) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid var(--primary-color) !important;
    font-weight: 600;
}

.modal-cirurgia .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.modal-cirurgia .nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-lighter);
    border: none;
}

/* 3. Corrige o botão de anexos */
.modal-cirurgia .upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.modal-cirurgia .upload-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.modal-cirurgia .upload-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 4. Remove o padding padrão do modal-content e ajusta */
.modal-cirurgia .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    padding: 0;
}

.modal-cirurgia .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
    margin: 0;
}

.modal-cirurgia .modal-body {
    padding: 0 2rem 1rem;
    margin: 0;
}

.modal-cirurgia .modal-footer {
    border-top: 1px solid var(--gray-light);
    padding: 1.5rem 2rem;
    border-radius: 0 0 12px 12px;
    margin: 0;
}

/* Ajustes adicionais para melhor visualização */
.modal-cirurgia .nav-tabs {
    border-bottom: 2px solid var(--gray-light);
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.modal-cirurgia .tab-content {
    min-height: 400px;
    padding: 0;
}

/* Melhora a visualização dos arquivos selecionados */
.modal-cirurgia .file-info {
    background: var(--gray-lighter);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--gray-light);
}

.modal-cirurgia .file-list {
    max-height: 150px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.modal-cirurgia .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    background: white;
    margin-bottom: 0.25rem;
    border-radius: 4px;
}

.modal-cirurgia .file-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Ajusta os grupos de formulário */
.modal-cirurgia .form-group {
    margin-bottom: 1.5rem;
}

.modal-cirurgia .form-control {
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.modal-cirurgia .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Ajusta os campos de data e hora lado a lado */
.modal-cirurgia .input-group-date {
    display: flex;
    gap: 10px;
}

.modal-cirurgia .input-group-date .form-control {
    flex: 1;
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-cirurgia .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-cirurgia .modal-header,
    .modal-cirurgia .modal-body,
    .modal-cirurgia .modal-footer {
        padding: 1rem;
    }
    
    .modal-cirurgia .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-cirurgia .upload-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Garante que as tabs tenham indicação visual clara */
.modal-cirurgia .nav-tabs .nav-item {
    margin-bottom: -2px;
}

.modal-cirurgia .nav-tabs .nav-link.active {
    background: white !important;
    border-bottom: 3px solid var(--primary-color) !important;
}

.modal-cirurgia .modal-content > * {
    padding-left: 0;
    padding-right: 0;
}

/* =============================================
   CORREÇÕES PARA COMBOBOX NO MODAL
============================================= */

.modal-cirurgia select.form-control {
    padding: 0.75rem 1rem;
    height: auto !important;
    min-height: 48px;
    line-height: 1.5;
    overflow: visible !important;
}

.modal-cirurgia .form-control option {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal !important;
    word-wrap: break-word;
}

/* Garante que o texto fique visível */
.modal-cirurgia select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    outline: none;
}

/* Ajusta especificamente o combobox de veterinários */
#modal-veterinario {
    min-height: 48px;
}

#modal-veterinario option {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

#modal-veterinario option:last-child {
    border-bottom: none;
}

/* Corrige o z-index do dropdown para ficar acima do modal */
.modal-cirurgia select.form-control {
    z-index: 1060;
}

.modal-cirurgia .form-control:focus {
    z-index: 1061;
}

/* Ajustes para quando o dropdown abrir */
.modal-cirurgia select:active,
.modal-cirurgia select:focus {
    position: relative;
}

/* =============================================
   CORREÇÕES FINAIS DO MODAL
============================================= */

/* 1. Padding lateral para modal-body, header e footer */
.modal-cirurgia .modal-header {
    padding: 1.5rem 2rem !important;
}

.modal-cirurgia .modal-body {
    padding: 0 2rem 1rem !important;
}

.modal-cirurgia .modal-footer {
    padding: 1.5rem 2rem !important;
}

/* 2. Botão padrão do sistema para selecionar arquivo */
.modal-cirurgia .upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.modal-cirurgia .upload-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-cirurgia .upload-button:active {
    transform: translateY(0);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.modal-cirurgia .upload-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 3. Remove qualquer estilo conflitante do input file */
.modal-cirurgia .file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.modal-cirurgia .upload-container {
    display: inline-block;
    position: relative;
}

/* 4. Ajusta o container do upload para ficar alinhado */
.modal-cirurgia .form-group .upload-container {
    margin-top: 0.5rem;
}

/* 5. Garante que as tabs tenham o mesmo padding */
.modal-cirurgia .nav-tabs {
    padding: 0 2rem !important;
    margin: 0 0 1.5rem 0 !important;
}

/* 6. Ajuste responsivo */
@media (max-width: 768px) {
    .modal-cirurgia .modal-header,
    .modal-cirurgia .modal-body,
    .modal-cirurgia .modal-footer {
        padding: 1rem 1.5rem !important;
    }
    
    .modal-cirurgia .nav-tabs {
        padding: 0 1.5rem !important;
    }
    
    .modal-cirurgia .upload-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* =============================================
   ESTILOS DAS TELAS ESPECÍFICAS
============================================= */

/* --- TELA AJUDA --- */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.funcionalidade-item {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.funcionalidade-item:hover {
    border-left-color: var(--primary-dark);
    background-color: var(--gray-lighter);
}

.help-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}


/* --- TELA CIDADES --- */
.city-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    background: white;
}

.city-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.city-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.city-card:hover::before {
    opacity: 1;
}

.city-card-img {
    height: 140px;
    object-fit: contain;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1.5rem;
    transition: all 0.4s ease;
}

.city-card:hover .city-card-img {
    transform: scale(1.05);
}

.city-card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    background: white;
}

.city-card-title {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.city-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 3;
}

.selection-hint {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

/* --- TELA TERMOS --- */
.help-logo {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
}

.termos-container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    border: 1px solid var(--gray-light);
}

.termos-section {
    margin-bottom: 2.5rem;
}

.termos-section:last-child {
    margin-bottom: 0;
}

.termos-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-light);
}

.termos-subtitle {
    color: var(--primary-dark);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.termos-content {
    line-height: 1.6;
    color: var(--text-muted);
}

.termos-list {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.termos-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.highlight-box {
    background: var(--gray-lighter);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.nav-termos {
    background: var(--gray-lighter);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-light);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.nav-link-termos {
    background: white;
    border: 1px solid var(--gray-light);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link-termos:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* --- BOTÃO DE ACESSO (COMUM) --- */
.btn-access {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    font-size: 1.1rem;
}

.btn-access::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.btn-access:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-color: rgba(255,255,255,0.8);
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.btn-access:hover::before {
    left: 100%;
}

.btn-access:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-access i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-access:hover i {
    transform: translateX(3px) scale(1.1);
}

.btn-access::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-access:hover::after {
    opacity: 1;
}

/* --- ANIMAÇÕES ESPECÍFICAS --- */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.stagger-item {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* --- RESPONSIVIDADE ESPECÍFICA --- */
@media (max-width: 768px) {
    .help-header {
        padding: 2rem 0;
    }
    
    .termos-container {
        padding: 1.5rem;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-link-termos {
        width: 100%;
        text-align: center;
    }
    
    .city-card-img {
        height: 120px;
        padding: 1rem;
    }
    
    .city-card-body {
        padding: 1rem;
    }
}

/* --- BACKGROUND ESPECIAL TELA CIDADES --- */
.city-background {
    background: linear-gradient(135deg, #5f45f2 0%, #7c4dff 50%, #6a11cb 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.city-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" opacity="0.05"><polygon fill="white" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
    z-index: -1;
}

/* =============================================
   CORREÇÕES FINAIS DO MENU MOBILE
============================================= */

/* Garantir que o topbar fique acima do sidebar */
.topbar {
    z-index: 1080 !important;
}

/* Sidebar mobile */
.sidebar {
    z-index: 1081 !important;
}

/* Overlay do sidebar */
.sidebar-overlay {
    z-index: 1079 !important;
}

/* Prevenir scroll quando sidebar está aberto */
html.sidebar-open {
    overflow: hidden;
}

/* Ajuste específico para mobile */
@media (max-width: 768px) {
    #content-wrapper {
        margin-left: 0 !important;
    }
    
    /* Garantir que o botão do menu seja sempre visível */
    #sidebarToggleTop {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* =============================================
   ESTILOS PROFISSIONAIS PARA TABELAS
============================================= */

/* Tabela moderna */
.professional-table {
    border: none;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.9rem;
}

.professional-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    border: none;
    padding: 1rem 0.75rem;
    position: relative;
}

.professional-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.professional-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.professional-table tbody tr {
    transition: all 0.3s ease;
    background: white;
}

.professional-table tbody tr:nth-child(even) {
    background: var(--gray-lighter);
}

.professional-table tbody tr:hover {
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.15);
}

.professional-table tbody td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
    color: var(--text-muted);
    font-weight: 500;
}

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

/* Ações da tabela */
.table-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.table-actions .btn {
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Status badges na tabela */
.table-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}


/* Cards modernos */
.modern-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modern-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.modern-card .card-header {
    background: white;
    border-bottom: 1px solid var(--gray-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}


/* Botões modernos */
.btn-modern {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsividade para tabelas */
@media (max-width: 768px) {
    .professional-table {
        font-size: 0.8rem;
    }
    
    .professional-table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .professional-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .table-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* =============================================
   ESTILOS PARA O MODAL UNIFICADO
============================================= */

.modal-unificado .modal-dialog {
    max-width: 900px;
}

.modal-unificado .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
}

.modal-unificado .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
}

.modal-unificado .modal-title {
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

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

.modal-unificado .modal-footer {
    border-top: 1px solid var(--gray-light);
    padding: 1.5rem 2rem;
    border-radius: 0 0 12px 12px;
}

/* Seções de informação */
.modal-unificado .info-section {
    margin-bottom: 2rem;
}

.modal-unificado .info-section:last-child {
    margin-bottom: 0;
}

.modal-unificado .info-group {
    background: var(--gray-lighter);
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-light);
}

.modal-unificado .info-group p {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.modal-unificado .info-group p:last-child {
    margin-bottom: 0;
}

.modal-unificado .info-group strong {
    min-width: 140px;
    color: var(--text-muted);
    font-weight: 600;
}

.modal-unificado .info-group span {
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
}

/* Badges no modal */
.modal-unificado .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* Tabelas dentro do modal */
.modal-unificado .table {
    margin-bottom: 0;
}

.modal-unificado .professional-table th {
    background: var(--gray-lighter);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-light);
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-unificado .modal-dialog {
        margin: 1rem;
    }
    
    .modal-unificado .modal-header,
    .modal-unificado .modal-body,
    .modal-unificado .modal-footer {
        padding: 1.25rem;
    }
    
    .modal-unificado .info-group p {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-unificado .info-group strong {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
}

/* =============================================
   ESTILOS ESPECÍFICOS PARA CIRURGIAS
============================================= */

.cirurgias-header {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.cirurgias-header-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.cirurgias-header-divider {
    border-color: var(--gray-light);
    margin: 1rem 0;
}

/* =============================================
   ESTILOS ESPECÍFICOS PARA AUDITORIA
============================================= */

/* Cabeçalho da Auditoria */
.auditoria-header {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.auditoria-header-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.auditoria-header-divider {
    border-color: var(--gray-light);
    margin: 1rem 0;
}


.auditoria-metric-card {
    position: relative;
    border-radius: 16px;
    border: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.auditoria-metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.auditoria-metric-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    transition: width 0.3s ease;
}

.auditoria-metric-card:hover::before {
    width: 8px;
}

.auditoria-metric-card.castricoes::before {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
}

.auditoria-metric-card.exames::before {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
}

.auditoria-metric-card.recoletas::before {
    background: linear-gradient(135deg, #4e73df 0%, #2e59d9 100%);
}

.auditoria-metric-card .card-body {
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 2;
}

.auditoria-metric-card .metric-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #6c757d;
}

.auditoria-metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.auditoria-metric-card .metric-icon {
    font-size: 2.5rem !important;
    opacity: 0.15 !important;
    transition: all 0.3s ease;
}

.auditoria-metric-card:hover .metric-icon {
    opacity: 0.25 !important;
    transform: scale(1.1) rotate(5deg);
}


/* Badges específicos da Auditoria */
.badge-auditoria {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}


/* =============================================
   ANIMAÇÕES UNIFICADAS
============================================= */

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

.animate-number {
    animation: countUp 1s ease-out;
}

/* Loading skeleton para cards */
.metric-card.loading {
    pointer-events: none;
}

.metric-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
    animation: loading 1.5s infinite;
    z-index: 10;
}

/* Badge flutuante para métricas */
.metric-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    z-index: 3;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.metric-badge.badge-success {
    color: #1cc88a;
    border: 2px solid #1cc88a;
}

.metric-badge.badge-info {
    color: #36b9cc;
    border: 2px solid #36b9cc;
}

.metric-badge.badge-danger {
    color: #e74a3b;
    border: 2px solid #e74a3b;
}

.metric-badge.badge-warning {
    color: #f6c23e;
    border: 2px solid #f6c23e;
}

/* Para telas muito grandes (Full HD+) mantém proporções */
@media (min-width: 1920px) {
    .dashboard-metrics {
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* =============================================
   CORREÇÕES DEFINITIVAS PARA MENU MOBILE
============================================= */

/* Garantir que o topbar fique acima do sidebar */
.topbar {
    z-index: 1080 !important;
    position: relative;
}

/* Sidebar mobile */
.sidebar {
    z-index: 1081 !important;
}

/* Overlay do sidebar - garantindo que fique entre topbar e sidebar */
.sidebar-overlay {
    z-index: 1079 !important;
}

/* Prevenir scroll quando sidebar está aberto */
html.sidebar-open,
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Ajuste específico para mobile */
@media (max-width: 768px) {
    #content-wrapper {
        margin-left: 0 !important;
        transition: transform 0.3s ease;
    }
    
    /* Efeito de push no content quando sidebar abre */
    body.sidebar-open #content-wrapper {
        transform: translateX(115px);
    }
    
    /* Garantir que o botão do menu seja sempre visível */
    #sidebarToggleTop {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Overlay com fundo semitransparente */
    .sidebar-overlay {
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
    }
}

/* Animações suaves */
.sidebar,
.sidebar-overlay,
#content-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}