/* ==========================================================================
   AXTRIA.CSS - ARQUIVO MESTRE CONSOLIDADO
   Data: Dezembro/2025
   ========================================================================== */

/* =============================================
   1. VARIÁVEIS GLOBAIS (:ROOT)
   ============================================= */
:root {
    /* Cores Institucionais */
    --primary-color: #4e73df;
    --primary-dark: #2e59d9;
    --primary-light: #6d88eb;
    
    /* Cores de Estado */
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --secondary-color: #858796;
    
    /* Neutros */
    --gray-light: #e3e6f0;
    --gray-lighter: #f8f9fc;
    --text-dark: #2c3e50;
    --text-muted: #5a5c69;
    
    /* Componentes */
    --card-radius: 0.5rem;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --card-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* =============================================
   2. SISTEMA UNIFICADO DE BADGES (ETIQUETAS)
   ============================================= */
.status-badge, .badge-custom, .table-badge, .badge-auditoria, .badge-status {
    display: inline-block; font-weight: 600; line-height: 1; text-align: center;
    white-space: nowrap; vertical-align: baseline; border-radius: 50rem;
    color: white; transition: var(--transition); padding: 0.35em 0.8em; font-size: 0.85em;
}

/* Tamanhos Legado */
.status-badge { font-size: 0.9rem; padding: 6px 12px; }
.badge-custom { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
.table-badge, .badge-auditoria { font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 12px; }

/* Cores Unificadas */
.badge-realizado, .status-badge.success, .badge-custom.success, .table-badge.success, .badge-auditoria.success { background-color: var(--success-color); }
.badge-agendado, .status-badge.info, .badge-custom.info, .table-badge.info, .badge-auditoria.info { background-color: var(--info-color); }
.badge-pendente, .status-badge.warning, .badge-custom.warning, .table-badge.warning, .badge-auditoria.warning { background-color: var(--warning-color); color: #212529; }
.badge-cancelado, .status-badge.danger, .badge-custom.danger, .table-badge.danger, .badge-auditoria.danger { background-color: var(--danger-color); }
.badge-inapto, .status-badge.secondary, .badge-custom.secondary, .table-badge.secondary, .badge-auditoria.secondary { background-color: var(--secondary-color); }

/* Badges Cidades (Destaque) */
.cidade-badge-destaque { color: white; padding: 8px 15px; border-radius: 20px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: var(--transition); }
.cidade-badge-destaque:hover { transform: translateY(-2px); }
.cidade-badge-destaque.vila-velha { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.cidade-badge-destaque.vitoria { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.cidade-badge-destaque.serra { background: linear-gradient(135deg, #27ae60 0%, #229954 100%); }
.cidade-badge-destaque.cariacica { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }
.cidade-badge-destaque.viana { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }

/* =============================================
   3. ELEMENTOS BASE E UTILITÁRIOS
   ============================================= */
.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;
}
.required-field label:after { content: " *"; color: var(--danger-color); }

/* Animações */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-number { animation: countUp 1s ease-out; }
.fade-in { animation: fadeIn 0.8s ease-out; }

/* =============================================
   4. CARDS (SISTEMA GERAL)
   ============================================= */
/* Container Dashboard (Grid 4 colunas) */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

/* Metric Card (Dashboard Principal) */
.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); }
.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; }

.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%); }

.metric-card .card-body { padding: 1.5rem 1.25rem; position: relative; z-index: 2; }
.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; }
.metric-card .metric-icon { font-size: 2.5rem !important; opacity: 0.15 !important; transition: var(--transition); }
.metric-card:hover .metric-icon { opacity: 0.25 !important; transform: scale(1.1) rotate(5deg); }

.auditoria-metric-card.atendimentos::before { background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%); }

/* Auditoria Metric Card */
.auditoria-metric-card {
    display: flex !important; flex-direction: column; justify-content: center;
    min-height: 140px; width: 100%; background: #fff; position: relative;
    overflow: visible !important; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-radius: 12px; margin-bottom: 20px; transition: var(--transition);
}
.auditoria-metric-card::before { content: ''; position: absolute; left: 0; top: 0; width: 5px; height: 100%; transition: width 0.3s ease; }
.auditoria-metric-card:hover { transform: translateY(-5px); }
.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; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auditoria-metric-card .metric-value { font-size: 2rem; font-weight: 700; color: #2c3e50; }
.horizontal100 {width: 100%;}

/* Info Card (Geral) */
.info-card, .category-progress {
    background: white; border-left: 4px solid var(--primary-color);
    box-shadow: var(--card-shadow); border-radius: var(--card-radius);
    padding: 15px; border: 1px solid var(--gray-light); transition: var(--transition); margin-bottom: 1rem;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--card-hover-shadow); }

/* =============================================
   5. 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; 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); }

.dataTables_wrapper { overflow-x: auto; margin: 15px; }
.numero-guia { word-break: break-all; max-width: 120px; font-size: 0.9em; }

/* Correção Botões de Ação na Tabela (Lado a Lado) */
.table td .btn, .data-table td .btn, #tabelaAnimais td .btn {
    display: inline-flex !important; align-items: center; justify-content: center;
    width: auto !important; margin-right: 5px !important; margin-bottom: 0 !important; vertical-align: middle;
}
.table td .btn:last-child { margin-right: 0 !important; }
.table td:last-child, .data-table td:last-child, #tabelaAnimais td:last-child {
    white-space: nowrap !important; width: 1%;
}

/* =============================================
   6. MODAIS 
   ============================================= */
/* Estrutura Base (Obrigatório para esconder) */
.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[style*="display: block"] { background-color: rgba(0,0,0,0.5) !important; }

/* Estilos Visuais dos 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); padding: 0;
}
.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 !important; border-bottom: none;
}
.modal-cirurgia .modal-body { padding: 0 2rem 1rem !important; }
.modal-cirurgia .modal-footer { border-top: 1px solid var(--gray-light); padding: 1.5rem 2rem !important; }

/* Tabs Modal */
.modal-cirurgia .nav-tabs { border-bottom: 2px solid var(--gray-light); padding: 0 2rem !important; margin-bottom: 1.5rem; }
.modal-cirurgia .nav-link { border: none; color: var(--text-muted); padding: 1rem 1.5rem; }
.modal-cirurgia .nav-link.active { color: var(--primary-color) !important; background: transparent !important; border-bottom: 3px solid var(--primary-color) !important; font-weight: 600; }

/* Upload Modal */
.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-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none;
}
.modal-cirurgia .upload-button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.modal-cirurgia .file-info { background: var(--gray-lighter); border-radius: 8px; padding: 1rem; margin-top: 1rem; }

/* =============================================
   7. BOTÕES E FORMULÁRIOS
   ============================================= */
.btn-modern, .btn-access {
    border-radius: 8px; font-weight: 600; transition: var(--transition);
    border: none; box-shadow: 0 2px 6px rgba(0,0,0,0.1); cursor: pointer;
}
.btn-access {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    color: var(--primary-dark); padding: 0.75rem 2rem; border-radius: 50px;
}
.preview-container {
    width: 150px; height: 150px; border: 2px dashed #ccc; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background-color: var(--gray-lighter); margin-bottom: 15px;
}
.preview-container.has-image { border: none; padding: 0; }
.preview-container.has-image .preview-image { display: block !important; }

/* =============================================
   8. LAYOUT E SIDEBAR
   ============================================= */
.sidebar .nav-item { transition: background-color 0.5s ease, border-left 0.5s ease; }
.sidebar .nav-item.active {
    background-color: rgba(255, 255, 255, 0.2) !important; border-left: 5px solid white; border-radius: 0 4px 4px 0;
}
.sidebar .nav-item.active .nav-link, .sidebar .nav-item.active .nav-link i { color: white !important; }

#content-wrapper { min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.3s ease; }
#content { flex: 1; }
.custom-footer { position: relative; z-index: 1; margin-top: auto; }

/* =============================================
   9. ESPECÍFICO: PÁGINA DE RELATÓRIOS
   ============================================= */
.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; }
.stats-section {
    margin-bottom: 30px; padding: 20px; background: var(--gray-lighter);
    border-radius: 10px; border: 1px solid var(--gray-light);
}
.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, .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); }
.export-section-relatorios {
    background: var(--gray-lighter); padding: 20px; border-radius: 10px; border: 2px dashed #d1d3e2; margin-top: 20px;
}

/* =============================================
   10. ESPECÍFICO: PÁGINA 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-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-periodo {
    display: flex; justify-content: space-between; margin-bottom: 1rem; padding: 0.75rem;
    background: #f8f9fc; border-radius: 6px; font-size: 0.85rem;
}
.contrato-acoes { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e3e6f0; }

/* =============================================
   11. ESPECÍFICO: PÁGINA DE CIDADES E LOGIN
   ============================================= */
/* Cards de Cidade */
.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:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }
.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-background {
    background: linear-gradient(135deg, #5f45f2 0%, #7c4dff 50%, #6a11cb 100%);
    min-height: 100vh; position: relative; overflow-x: hidden;
}

/* Login */
.login-card { background: white; border-radius: 15px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); animation: fadeInUp 0.8s ease-out; }
.bg-gradient-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; }

/* =============================================
   12. ESPECÍFICO: TERMOS E AJUDA
   ============================================= */
.video-container {
    position: relative; width: 100%; 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; }
.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-title { color: var(--primary-color); font-weight: 600; margin-bottom: 1rem; border-bottom: 2px solid var(--gray-light); }

/* =============================================
   13. ESPECÍFICO: CADASTRO CLÍNICA (ESTRUTURA COMPLETA)
   ============================================= */
.form-section {
    background: white; border-radius: 8px; padding: 1.5rem;
    border: 1px solid var(--gray-light); margin-bottom: 1.5rem;
}
.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); display: flex; align-items: center;
}
.form-section-header h5 { margin: 0; color: var(--primary-color); font-weight: 600; font-size: 1.1rem; }
.form-section-header i { margin-right: 10px; color: var(--primary-color); }

/* Grids do Formulário */
.form-row-group { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 1.5rem; }
.subcategory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.subcategory-group {
    background-color: var(--gray-lighter); padding: 15px; border-radius: 5px;
    margin-bottom: 15px; border: 1px solid var(--gray-light);
}
.city-details {
    text-align: left; padding: 5px; background-color: #fff;
    border-radius: 4px; border-left: 3px solid var(--primary-color); margin-bottom: 5px;
}
.contract-details {
    background-color: var(--gray-lighter); padding: 10px; border-radius: 4px;
    margin-top: 5px; font-size: 0.9rem;
}

/* =============================================
   14. UTILITÁRIOS FINAIS E BARRAS DE PROGRESSO
   ============================================= */
/* Cores Fundo Progress */
.progress-bar.bg-success { background-color: var(--success-color); }
.progress-bar.bg-info { background-color: var(--info-color); }
.progress-bar.bg-warning { background-color: var(--warning-color); }
.progress-bar.bg-danger { background-color: var(--danger-color); }

/* Estrutura Barra de Progresso (Números Brancos e Visíveis) */
.progress {
    display: flex; height: 1rem; overflow: hidden; font-size: 0.75rem;
    background-color: var(--gray-light); border-radius: 0.35rem; margin-bottom: 0.5rem;
}
.progress-bar {
    display: flex; flex-direction: column; justify-content: center;
    color: #fff !important; text-align: center; white-space: nowrap;
    background-color: var(--primary-color); transition: width 0.6s ease;
    font-weight: 700; box-shadow: none;
}

/* =============================================
   15. MOBILE & RESPONSIVIDADE 
   ============================================= */
@media (max-width: 768px) {
    /* Overlay e Menu Mobile */
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background-color: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
        z-index: 1090 !important; display: none; transition: opacity 0.3s ease;
    }
    .sidebar-overlay.show { display: block; animation: overlayFadeIn 0.3s ease; }

    body #wrapper .sidebar {
        position: fixed !important; top: 0; left: 0; height: 100vh !important;
        width: 10rem !important; z-index: 1100 !important;
        transform: translateX(-100%) !important; transition: transform 0.3s ease-in-out !important;
        display: block !important; overflow-y: auto;
    }
    body #wrapper .sidebar.toggled { transform: translateX(0) !important; }
    
    /* Itens do Menu Mobile */
    body #wrapper .sidebar .nav-item .nav-link {
        text-align: left !important; padding: 0.8rem 1rem !important; width: 100%;
        display: flex !important; flex-direction: row !important; align-items: center;
    }
    body #wrapper .sidebar .nav-item .nav-link i { margin-right: 0.5rem !important; font-size: 1rem !important; }
    body #wrapper .sidebar .nav-item .nav-link span { display: inline !important; font-size: 0.85rem !important; }
    .sidebar .nav-item { padding-left: 0 !important; border-left: none !important; }
    
    #sidebarToggleTop { display: block !important; opacity: 1 !important; visibility: visible !important; z-index: 1101 !important; }
    #content-wrapper { margin-left: 0 !important; width: 100% !important; }
    body.sidebar-open { overflow: hidden; position: fixed; width: 100%; }

    /* Ajustes Gerais Mobile */
    .table-responsive .btn, td .btn { display: inline-flex; width: auto; margin: 2px; padding: 0.25rem 0.5rem; }
    .dashboard-metrics, .contratos-grid { grid-template-columns: 1fr !important; }
    .modal-cirurgia .modal-header, .modal-cirurgia .modal-body { padding: 1rem !important; }
    .modal-cirurgia .nav-tabs { padding: 0 1rem !important; }
    
    /* Cadastro Clínica Mobile */
    .form-row-group { grid-template-columns: 1fr; }
}
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }


/* =============================================
   REFORMULAÇÃO TELA CIDADE (MODERNA)
   ============================================= */

/* Fundo aprimorado com overlay suave */
.city-background {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Efeito de partículas/ruído sutil no fundo (Opcional, dá textura) */
.city-background::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Container transparente (Glassmorphism) */
.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 3rem;
}

/* Títulos e Textos */
.welcome-title {
    color: white;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.welcome-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
}

/* O Novo Card de Cidade */
.city-modern-card {
    background: transparent; 
    border: none;
    border-radius: 20px;
    overflow: visible !important; 
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    height: 100%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.city-modern-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* Área da Imagem com Gradiente Overlay */
.city-img-wrapper {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fc;
    overflow: hidden; /* Mantém o efeito de brilho/círculo dentro da área da imagem */
    border-radius: 20px 20px 0 0; /* Arredonda as pontas de cima */
}

/* Círculo decorativo atrás da imagem */
.city-img-wrapper::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    bottom: 0;
    left: -50%;
    background: inherit; /* Pega o gradiente do estilo inline */
    opacity: 0.1;
    transform: skewY(-10deg);
    transform-origin: bottom left;
}

.city-modern-img {
    max-height: 90px;
    width: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.15));
    transition: transform 0.5s ease;
}

.city-modern-card:hover .city-modern-img {
    transform: scale(1.15) rotate(-3deg);
}

/* Corpo do Card */
.city-modern-body {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    background: white; /* O fundo branco vem pra cá */
    border-radius: 0 0 20px 20px; /* Arredonda as pontas de baixo */
}

/* Indicador de Estado (Badge Flutuante) */
.state-badge {
    position: absolute;
    top: -12px; /* Ajuste fino da altura */
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10; 
}

.city-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.city-action {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.city-modern-card:hover .city-action {
    opacity: 1;
    color: var(--primary-color);
}

/* Barra colorida inferior baseada na cidade */
.city-bar {
    height: 6px;
    width: 0;
    margin: 0 auto;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.city-modern-card:hover .city-bar {
    width: 60%;
}

/* Helpers de Gradiente */
.grad-vila-velha { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.grad-vitoria { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.grad-viana { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }
.grad-cariacica { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }
.grad-serra { background: linear-gradient(135deg, #27ae60 0%, #229954 100%); }
.grad-padrao { background: linear-gradient(135deg, #5a5c69 0%, #2c3e50 100%); }

/* =============================================
   MODAL ANIMAIS (ANEXOS)
   ============================================= */

/* Container que envolve a tabela para dar borda e arredondamento */
.anexos-modal-wrapper {
    border: 1px solid var(--gray-light);
    border-top: none; 
    border-radius: 0 0 8px 8px;
    background-color: white;
    overflow: hidden; /* Garante que o scroll respeite as bordas */
}

/* Área de rolagem  */
.anexos-scroll-container {
    max-height: 250px; 
    overflow-y: auto;  /* Adiciona scroll vertical se passar da altura */
    overflow-x: hidden; 
}

/* Estilização específica da tabela dentro do modal */
#tabela-anexos {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed; /* CRUCIAL: Força a tabela a respeitar a largura do container */
    border-collapse: collapse;
}

#tabela-anexos th {
    position: sticky; 
    top: 0;
    background-color: var(--gray-lighter); /* Cor de fundo para tapar o conteúdo ao rolar */
    z-index: 10;
    box-shadow: 0 2px 2px rgba(0,0,0,0.05);
}

#tabela-anexos td {
    vertical-align: middle;
    padding: 5px 6px;
    font-size: 0.8rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--gray-light);
}


#tabela-anexos td:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona "..." no final se for muito grande */
    font-weight: 500;
    max-width: 0; 
}


#tabela-anexos th:not(:first-child),
#tabela-anexos td:not(:first-child) {
    text-align: center;
    width: auto; 
}


#tabela-anexos td:last-child {
    width: 60px;
}


/* =============================================
   Tela cadastro geral
   ============================================= */

 .cm-card {
        background: #ffffff;
        border-radius: 16px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); /* Sombra quase invisível */
        margin-bottom: 30px;
        border: 1px solid #e3e6f0;
        overflow: hidden;
    }

    /* Cabeçalho da Seção (Apenas Texto e Linha) */
    .cm-header {
        padding: 20px 30px;
        border-bottom: 1px solid #f0f2f5;
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .cm-header-icon {
        width: 40px;
        height: 40px;
        background: #eef2fd; /* Azul bem clarinho */
        color: #4e73df;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    .cm-header h5 {
        margin: 0;
        color: #2c3e50;
        font-weight: 800;
        font-size: 1.1rem;
        letter-spacing: -0.5px;
    }
    
    .cm-header small {
        display: block;
        color: #858796;
        font-weight: 400;
        font-size: 0.8rem;
        margin-top: 2px;
    }

    /* Corpo com espaçamento generoso */
    .cm-body {
        padding: 30px;
    }

    /* Labels Limpos */
    .cm-label {
        font-size: 0.75rem;
        font-weight: 700;
        color: #5a5c69;
        text-transform: uppercase;
        margin-bottom: 8px;
        letter-spacing: 0.5px;
        display: block;
    }

    /* Inputs "Soft" */
    .form-control.cm-input {
        height: 50px;
        background-color: #f8f9fc; /* Fundo cinza claro */
        border: 1px solid transparent; /* Sem borda visível inicialmente */
        border-radius: 8px;
        color: #2e3440;
        font-weight: 500;
        font-size: 0.95rem;
        transition: all 0.3s ease;
        padding-left: 15px;
    }

    /* Efeito ao clicar no input */
    .form-control.cm-input:focus {
        background-color: #ffffff;
        border-color: #4e73df;
        box-shadow: 0 4px 12px rgba(78, 115, 223, 0.1);
    }
    
    /* Inputs bloqueados */
    .form-control.cm-input[readonly] {
        background-color: #eaecf4;
        color: #858796;
        cursor: not-allowed;
    }

    /* Botões de Busca (Lupa) integrados */
    .input-group.cm-group {
        background: #f8f9fc;
        border-radius: 8px;
        border: 1px solid transparent;
        transition: all 0.3s;
    }
    .input-group.cm-group:focus-within {
        background: #fff;
        border-color: #4e73df;
        box-shadow: 0 4px 12px rgba(78, 115, 223, 0.1);
    }
    .input-group.cm-group .cm-input {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        height: 48px;
    }
    .input-group.cm-group .btn {
        color: #4e73df;
        padding: 0 20px;
        border: none;
    }
    .input-group.cm-group .btn:hover {
        background: transparent;
        color: #224abe;
        transform: scale(1.1);
    }

    /* Área de Upload Limpa */
    .cm-upload-wrapper {
        background: #fff;
        border: 2px dashed #d1d3e2;
        border-radius: 12px;
        height: 100%;
        min-height: 280px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        cursor: pointer;
        transition: all 0.3s;
    }
    .cm-upload-wrapper:hover {
        border-color: #4e73df;
        background: #fcfdff;
    }
    .cm-upload-content {
        text-align: center;
    }
    .cm-upload-btn {
        background: #4e73df;
        color: white;
        padding: 8px 20px;
        border-radius: 50px;
        font-size: 0.85rem;
        font-weight: 600;
        margin-top: 10px;
        display: inline-block;
    }

    /* Barra de Ações */
    .cm-footer {
        display: flex;
        justify-content: flex-end;
        gap: 20px;
        margin-top: 20px;
        padding-bottom: 40px;
    }
    .btn-save-big {
        padding: 15px 50px;
        font-size: 1rem;
        font-weight: 700;
        border-radius: 10px;
        letter-spacing: 0.5px;
        background: #4e73df;
        border: none;
        box-shadow: 0 10px 20px rgba(78, 115, 223, 0.3);
        transition: transform 0.2s;
    }
    .btn-save-big:hover {
        transform: translateY(-2px);
        background: #2e59d9;
    }
    
    .required-marker { color: #e74a3b; margin-left: 3px; }