/* Arquivo: public/css/itapema.css
   Descrição: Estilos globais do Sistema Casa Itapema (Design System)
   Versão: 1.0.0
*/

:root {
    /* Paleta Core */
    --itapema-blue: #054c97;
    --itapema-teal: #21b1a0;
    --itapema-dark: #1e293b;

    /* Aliases para Landing Page */
    --landing-blue: var(--itapema-blue);
    --landing-teal: var(--itapema-teal);

    /* BOOTSTRAP OVERRIDES (Força o sistema todo a usar Itapema Blue) */
    --bs-primary: #054c97;
    --bs-primary-rgb: 5, 76, 151;
    --bs-link-color: #054c97;
    --bs-link-hover-color: #033a75;

    /* Cores de Suporte/Status */
    --bs-success-rgb: 25, 135, 84;
    --bs-danger-rgb: 220, 53, 69;
}

/* =========================================
   1. UTILITÁRIOS GERAIS
   ========================================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8f9fe;
    /* Fundo padrão do dashboard */
}

/* FIX GLOBAL DE OVERFLOW */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* BOOTSTRAP BUTTON OVERRIDES */
.btn-primary {
    background-color: var(--itapema-blue);
    border-color: var(--itapema-blue);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #033a75 !important;
    border-color: #033a75 !important;
}

.btn-outline-primary {
    color: var(--itapema-blue);
    border-color: var(--itapema-blue);
}

.btn-outline-primary:hover {
    background-color: var(--itapema-blue);
    border-color: var(--itapema-blue);
}

.text-primary {
    color: var(--itapema-blue) !important;
}

/* Utilitários de Cor */
.bg-itapema-blue {
    background-color: var(--itapema-blue) !important;
    color: #fff;
}

.bg-itapema-teal {
    background-color: var(--itapema-teal) !important;
    color: #fff;
}

.text-itapema-blue {
    color: var(--itapema-blue) !important;
}

.text-itapema-teal {
    color: var(--itapema-teal) !important;
}

/* Tipografia Auxiliar */
.name-primary {
    font-weight: 600;
    color: #32325d;
    margin-bottom: 2px;
    display: block;
}

.text-small {
    font-size: 0.75rem;
    color: #8898aa;
}

/* Tipografia Utilitária (Landing Page) */
.text-xs-uppercase {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
}

.text-xs-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.text-sm-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Ícones com largura fixa (listas) */
.icon-w-16 {
    width: 16px;
    text-align: center;
}

/* Cards de Destaque */
.card-landing {
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.card-landing-sm {
    border-radius: 12px;
}

/* Círculo de Ícone (60x60) */
.icon-circle-60 {
    width: 60px;
    height: 60px;
}

/* Mockup Content */
.mockup-min-height {
    min-height: 800px;
}

/* Z-index Utilities */
.z-2 {
    z-index: 2;
}

.fw-bold-custom {
    font-weight: 600;
}

/* Links */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* =========================================
   2. COMPONENTES DE UI
   ========================================= */

/* --- Avatars --- */
.avatar-itapema {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--itapema-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.mockup-content .avatar-itapema {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
}

/* Variação menor */

/* --- Tabelas (Estilo Argon) --- */
.table-argon {
    border-collapse: separate;
    border-spacing: 0;
}

.table-argon thead th {
    background-color: #f8f9fa;
    color: #8898aa;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef;
    border-top: 0;
    padding: 12px 24px;
}

.table-argon tbody td {
    padding: 20px 24px;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    color: #525f7f;
    font-size: 0.9rem;
}

.table-argon tbody tr:last-child td {
    border-bottom: 0;
}

/* Interatividade da Tabela (Transparência) */
.row-hover {
    cursor: pointer;
    transition: background-color 0.2s;
}

.row-hover:hover td {
    background-color: #e9ecef !important;
    --bs-table-accent-bg: #e9ecef !important;
}

.row-selected td {
    background-color: #e9ecef !important;
    --bs-table-accent-bg: #e9ecef !important;
}

/* --- Cards e Headers --- */
.card {
    border: 0;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    border-radius: 0.5rem;
}

.card-icon-header {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background-color: #f0f2f5;
    color: var(--itapema-blue);
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* KPI Card Hover */
.kpi-card {
    transition: transform 0.2s ease-in-out;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

/* Dashboard Components */
.heatmap-container {
    height: 600px;
    width: 100%;
}

.chart-container {
    height: 250px;
}

.chart-center-text {
    pointer-events: none;
}

/* Print Attachments */
.pdf-fallback-container {
    height: 300px;
}

.print-attachment-img {
    max-height: 900px;
}

/* Hover Effects para Cards de Link */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
    background-color: #fff;
}

.card-icon {
    color: var(--itapema-blue);
    transition: color 0.2s ease;
}

.hover-card:hover .card-icon,
.hover-card:hover h5 {
    color: var(--itapema-teal) !important;
}

/* --- Documentos (Attachments) --- */
.doc-card {
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    height: 100%;
    background-color: #f8f9fa;
}

.doc-card:hover {
    border-color: var(--itapema-blue);
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08);
    background-color: #fff;
}

.doc-check-item {
    cursor: pointer;
    user-select: none;
}

.doc-check-item.checked .doc-checkbox {
    color: var(--bs-success) !important;
}

.doc-check-item.checked span {
    text-decoration: line-through;
    opacity: 0.6;
}

/* --- Forms --- */
.form-control:focus,
.form-select:focus {
    border-color: var(--itapema-blue);
    box-shadow: 0 0 0 0.2rem rgba(5, 76, 151, 0.1);
}

.filter-input {
    border-color: #e9ecef;
    font-size: 0.875rem;
}

.filter-input:focus {
    border-color: var(--itapema-blue);
    box-shadow: 0 0 0 0.2rem rgba(5, 76, 151, 0.1);
}

.btn-filter-fix {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
}

.dropdown-item:active {
    background-color: #f8f9fa;
    color: inherit;
}

/* --- Form Wizard (Step Indicator) --- */
fieldset {
    border: 0;
    padding: 0;
    margin-top: 1.5rem;
}

fieldset .row {
    margin-bottom: 1.75rem;
}

fieldset[data-step="1"] .form-check {
    margin-bottom: 0.75rem;
}

fieldset>.mb-3 {
    margin-bottom: 2rem !important;
}

.step-indicator-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 700px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    font-weight: 500;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    background-color: #fff;
    transition: all 0.3s ease;
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: #adb5bd;
    margin: 0 1rem;
    transform: translateY(-1rem);
    transition: all 0.3s ease;
}

.step.active {
    color: var(--itapema-blue);
}

.step.active .step-icon {
    border-color: var(--itapema-blue);
    background-color: #e7f0ff;
    color: var(--itapema-blue);
}

.step.completed {
    color: var(--itapema-teal);
}

.step.completed .step-icon {
    border-color: var(--itapema-teal);
    background-color: var(--itapema-teal);
    color: #fff;
}

.step-line.active {
    background-color: var(--itapema-teal);
}

/* --- Paginação --- */
.page-item.active .page-link {
    background-color: var(--itapema-blue) !important;
    border-color: var(--itapema-blue) !important;
    color: #fff !important;
}

.page-link {
    color: var(--itapema-blue) !important;
}

.page-link:hover {
    background-color: #e9ecef;
    color: #033a75 !important;
}

/* =========================================
   3. LOADERS
   ========================================= */
.custom-loader {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--itapema-blue);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.local-box-loader {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 50;
    border-radius: inherit;
    align-items: center;
    justify-content: center;
}

/* =========================================
   4. LANDING PAGE (Welcome)
   ========================================= */
.hero-section {
    padding-top: 1.5rem;
    padding-bottom: 4rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    margin-top: 0 !important;
}

.mockup-wrapper {
    perspective: 1500px;
    margin-top: 2rem;
    width: 130%;
    margin-right: -30%;
}

.browser-window {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 60px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transform: rotateY(-10deg) rotateX(5deg);
    transition: transform 0.5s ease;
    max-height: 600px;
    position: relative;
}

.browser-window:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.browser-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background: #ef4444;
}

.dot-yellow {
    background: #f59e0b;
}

.dot-green {
    background: #10b981;
}

.browser-address {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    height: 24px;
    flex-grow: 1;
    margin-left: 12px;
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.mockup-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    z-index: 50;
    pointer-events: none;
}

/* Steps (Timeline vertical na landing) */
.timeline-steps {
    position: relative;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.step-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 3rem;
    z-index: 1;
}

.step-circle {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--itapema-blue);
    color: var(--itapema-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Score Circle (Landing Page e Status) */
.score-summary-card {
    border-radius: 16px;
    padding: 3rem 2rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.score-circle-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--itapema-blue) 0% 100%, #e9ecef 100% 100%);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle-lg::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background-color: #fff;
    border-radius: 50%;
    z-index: 1;
}

.score-circle-content {
    z-index: 2;
    position: relative;
}

/* Critérios de Pontuação (Lista) */
.criteria-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.criteria-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #e2e8f0;
}

.criteria-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Ícones coloridos soft */
.bg-soft-blue {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.bg-soft-green {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.bg-soft-orange {
    background-color: #fff3e0;
    color: #e65100;
}

.icon-blue {
    background-color: #e0f2fe;
    color: #0284c7;
}

.icon-green {
    background-color: #dcfce7;
    color: #16a34a;
}

.icon-red {
    background-color: #fee2e2;
    color: #dc2626;
}

.icon-yellow {
    background-color: #fef9c3;
    color: #ca8a04;
}

.icon-purple {
    background-color: #f3e8ff;
    color: #9333ea;
}

.icon-pink {
    background-color: #fce7f3;
    color: #db2777;
}

.icon-orange {
    background-color: #ffedd5;
    color: #ea580c;
}

.badge-points {
    background-color: #f1f5f9;
    color: var(--itapema-blue);
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50rem;
    font-size: 0.65rem;
    margin-left: auto;
}

/* FAQ */
.accordion-button.faq-question {
    color: var(--itapema-blue) !important;
}

.accordion-button.faq-question:hover {
    color: var(--itapema-teal) !important;
}

.accordion-button.faq-question:not(.collapsed) {
    color: var(--itapema-teal) !important;
    background-color: transparent;
}

.accordion-button.faq-question:focus {
    box-shadow: none;
    border-color: transparent;
}

/* =========================================
   LANDING PAGE COMPONENTS (Welcome)
   ========================================= */

/* Body override for landing */
body.landing-page {
    background-color: #fff !important;
    overflow-x: hidden;
}

/* Income Cards */
.income-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.income-card:hover {
    border-color: var(--itapema-teal);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(-5px);
}

.income-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--itapema-teal);
    background: rgba(33, 177, 160, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Score Table */
.score-table-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.score-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem 1.5rem;
}

.score-table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.score-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(110deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.cta-pattern {
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.5;
}

/* Criteria List Header */
.criteria-list-header {
    display: flex;
    justify-content: space-between;
    padding: 0 0.75rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

.criteria-card h6 {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.criteria-card .text-muted {
    font-size: 0.7rem !important;
}

.criteria-points {
    margin-left: auto;
    padding-left: 0.5rem;
    flex-shrink: 0;
}

/* Alert Info Light */
.alert-info-light {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

/* Mockup Static Buttons */
.mockup-btn-static {
    pointer-events: none !important;
    cursor: default !important;
}

.mockup-btn-static:hover,
.mockup-btn-static:focus,
.mockup-btn-static:active {
    transform: none !important;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
    background-color: #fff !important;
    border-color: #dee2e6 !important;
}

/* Document Card Icon Header (Welcome variant) */
.doc-card-icon-header {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background-color: #f0f2f5;
    color: var(--itapema-blue);
    flex-shrink: 0;
}

/* Landing Footer Hidden (uses app footer) */
.landing-footer {
    display: none !important;
}

/* Hero Section Overrides */
.hero-section .btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.hero-section .btn-white:hover {
    background-color: var(--itapema-blue) !important;
    color: #fff !important;
    border-color: var(--itapema-blue) !important;
}

/* Icon Circle (Landing cards) */
.icon-circle {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Utility: Text Small Uppercase */
.text-xs-uppercase {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
}

.text-xs {
    font-size: 0.8rem;
}

.text-center-paragraph {
    max-width: 600px;
}

/* Cursor Utilities */
.cursor-pointer {
    cursor: pointer;
}

.pe-none {
    pointer-events: none;
}

/* Form Input Utilities */
.autocomplete-input {
    height: 48px;
    background-color: white;
    padding-right: 40px;
}

.map-container {
    height: 350px;
    width: 100%;
}

.z-10 {
    z-index: 10;
}

.whitespace-pre-line {
    white-space: pre-line;
}

/* Card Welcome Style */
.card-welcome {
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

/* Step Circle Success Variant */
.step-circle-success {
    background-color: var(--itapema-teal) !important;
    color: white !important;
    border-color: var(--itapema-teal) !important;
}

/* Footer Logos */
.footer-logo {
    height: 40px;
    filter: grayscale(100%);
    opacity: 0.7;
}

.footer-logo-lg {
    height: 50px;
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Alias: Step Circle Teal (usa mesma definição de success) */
.step-circle-teal {
    background-color: var(--itapema-teal) !important;
    color: white !important;
    border-color: var(--itapema-teal) !important;
}

/* Badge Timeline (margem negativa para alinhamento) */
.badge-timeline {
    margin-left: -2px;
}

/* Texto Landing Blue */
.text-landing-blue {
    color: var(--itapema-blue);
}

/* =========================================
   5. MEDIA QUERIES & MOBILE
   ========================================= */
@media (max-width: 991.98px) {

    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Navbar fixa no mobile */
    .navbar-glass {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        margin-right: 0;
    }

    /* Compensação para navbar fixa */
    #app {
        padding-top: 85px;
    }

    .mockup-wrapper {
        width: 100%;
        margin-right: 0;
        margin-top: 2rem;
        perspective: none;
    }

    .browser-window {
        transform: none;
        max-height: 600px;
    }

    .timeline-steps::before {
        left: 19px;
    }

    .step-item {
        padding-left: 50px;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .hero-section h1,
    section .text-center,
    section h2,
    section h6,
    section .lead {
        text-align: center !important;
    }

    /* Exceção: Critérios de pontuação ficam alinhados à esquerda */
    .criteria-card,
    .criteria-card h6,
    .criteria-card .text-muted {
        text-align: left !important;
    }

    .w-mobile-100 {
        width: 100% !important;
    }
}

@media (min-width: 768px) {
    .filter-input-search {
        width: 200px !important;
    }

    .filter-input-status {
        width: 150px !important;
    }
}

/* =========================================
   6. IMPRESSÃO (Print Styles)
   ========================================= */
@media print {
    @page {
        size: auto;
        margin: 10mm;
    }

    .d-print-none,
    .btn,
    .alert,
    nav,
    header,
    footer,
    .modal,
    .toast,
    .debug-bar {
        display: none !important;
    }

    body {
        background-color: white !important;
        color: #000 !important;
        font-family: Arial, sans-serif !important;
    }

    .container,
    .row,
    .col-md-12,
    .col-md-4,
    .col-md-8 {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-radius: 0 !important;
        margin-bottom: 20px !important;
        break-inside: avoid;
    }

    .card-header {
        background-color: #f8f9fa !important;
        border-bottom: 1px solid #000 !important;
        padding: 10px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    .badge {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: transparent !important;
    }

    /* Documentos na Impressão */
    .doc-print-container {
        display: block !important;
        break-before: page;
    }

    .doc-print-item {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #eee;
        padding: 10px;
    }

    /* Logos */
    .print-logo-casa {
        height: 60px !important;
        width: auto !important;
    }

    .print-logo-pref {
        height: 50px !important;
        width: auto !important;
    }
}

/* =========================================
   7. LAYOUT APP (Portal do Cidadão)
   ========================================= */

/* --- Tipografia & Base --- */
body.app-layout {
    font-family: 'Rubik', sans-serif;
    color: #344767;
    background-color: #f8f9fa !important;
}

/* --- Buttons --- */
.btn {
    font-weight: 600;
    letter-spacing: 0.025em;
    font-size: 0.85rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(310deg, var(--itapema-blue) 0%, #043b75 100%);
    border: 0;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    background: linear-gradient(310deg, #0658af 0%, #054c97 100%) !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #043b75 !important;
    border-color: #043b75 !important;
}

.btn-outline-primary {
    color: var(--itapema-blue) !important;
    border-color: var(--itapema-blue) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--itapema-blue) !important;
    border-color: var(--itapema-blue) !important;
    color: #fff !important;
}

.btn-outline-primary:active {
    background-color: #043b75 !important;
    border-color: #043b75 !important;
    color: #fff !important;
}

.btn-success {
    background: linear-gradient(310deg, #17ad37 0%, #98ec2d 100%);
    border: 0;
}

/* --- Forms --- */
.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #344767;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #d2d6da;
    padding: 0.75rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

/* File Input Reset */
input[type="file"].form-control {
    padding: 0 !important;
    height: calc(1.5em + 1.5rem + 2px);
}

input[type="file"].form-control::file-selector-button {
    border: none;
    margin: 0;
    margin-right: 1rem;
    height: 100%;
    padding: 0 1.5rem;
    background-color: #e9ecef;
    color: #344767;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

input[type="file"].form-control::-webkit-file-upload-button {
    border: none;
    margin: 0;
    margin-right: 1rem;
    height: 100%;
    padding: 0 1.5rem;
    background-color: #e9ecef;
    color: #344767;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

input[type="file"].form-control:hover::file-selector-button {
    background-color: #dee2e6;
}

input[type="file"].form-control:hover::-webkit-file-upload-button {
    background-color: #dee2e6;
}

/* --- Cards (App Layout Override) --- */
.card {
    border: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f2f5;
    padding: 1.5rem;
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}

/* --- Step Indicator (Horizontal) --- */
.step-indicator {
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

.step-indicator .nav-link {
    color: #6c757d;
    font-weight: 500;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 1rem;
}

.step-indicator .nav-link.active {
    color: var(--itapema-blue);
    border-bottom-color: var(--itapema-blue);
    background-color: transparent;
}

.step-indicator .nav-link.disabled {
    color: #adb5bd;
    pointer-events: none;
}

/* --- User Avatar (Navbar) --- */
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--itapema-teal);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 5px;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* --- Navbar --- */
.navbar-glass {
    position: -webkit-sticky;
    /* Safari support */
    position: sticky;
    top: 0;
    z-index: 1040;
    /* Boost z-index above Bootstrap defaults */
    background: rgba(255, 255, 255, 0.75);
    /* Mais transparência para efeito vidro */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    /* Garantir largura total */
}

.logo-navbar {
    height: 45px;
    width: auto;
}

.navbar-nav .nav-link {
    color: var(--itapema-blue);
    font-weight: 600;
}

.navbar-nav .nav-link:hover {
    color: var(--itapema-teal);
}

.navbar-toggler {
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.logout-highlight {
    color: #dc3545 !important;
    font-weight: 700 !important;
}

.dropdown-item.logout-highlight:active,
.dropdown-item.logout-highlight:focus {
    background-color: #f8f9fa !important;
    color: #dc3545 !important;
}

.dropdown-item-admin:active,
.dropdown-item-admin.active {
    background-color: transparent !important;
    color: var(--itapema-blue) !important;
}

@media (min-width: 768px) {
    .navbar-brand {
        margin-right: 3rem !important;
    }
}

/* --- Footer --- */
.app-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 2rem 0;
    text-align: center;
}

.logo-footer {
    height: 30px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.8;
}

.footer-divider {
    width: 1px;
    height: 20px;
    background-color: #e0e0e0;
}

/* --- Global Loader --- */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.custom-loader {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--itapema-blue);
    border-right-color: var(--itapema-blue);
    border-bottom-color: var(--itapema-teal);
    border-left-color: var(--itapema-teal);
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 1.5rem;
    color: var(--itapema-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Input Group Password Toggle --- */
.input-group .toggle-password {
    background-color: transparent !important;
    border-color: #dee2e6 !important;
    transition: none;
    display: flex;
    align-items: center;
}

.input-group .toggle-password:hover {
    border-color: #dee2e6 !important;
    background-color: transparent !important;
}

.input-group .toggle-password:hover i {
    color: var(--itapema-blue);
}

.input-group input:focus {
    z-index: 10;
}

/* --- Required Asterisk --- */
.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* --- Alpine.js Cloak --- */
[x-cloak] {
    display: none !important;
}

/* --- Help Floating Button --- */
.btn-help-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--itapema-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    border: none;
    transition: transform 0.2s;
}

.btn-help-floating:hover {
    transform: scale(1.1);
    background-color: #1a9c8d;
    color: white;
}

@media (max-width: 767.98px) {
    .btn-help-floating {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* --- Helpdesk Modal --- */
@media (min-width: 768px) {
    .modal-helpdesk .modal-dialog {
        position: fixed;
        bottom: 100px;
        right: 30px;
        margin: 0;
        width: 400px;
        max-width: 90vw;
    }

    .modal-helpdesk .modal-content {
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
        border-radius: 15px;
    }
}

@media (max-width: 767.98px) {
    .modal-helpdesk .modal-dialog {
        display: flex;
        align-items: center;
        min-height: calc(100% - 2rem);
        margin: 1rem;
    }

    .modal-helpdesk .modal-content {
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3) !important;
        border-radius: 15px;
    }
}

/* --- Custom Tooltips --- */
.custom-tooltip-content {
    position: absolute;
    bottom: 120%;
    left: 50%;
    margin-left: -100px;
    width: 200px;
    font-size: 0.75rem;
    z-index: 1000;
    pointer-events: none;
}

.custom-tooltip-arrow {
    position: absolute;
    bottom: -4px;
    left: 50%;
    margin-left: -4px;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
}

/* --- Helper Icon Touch Target --- */
.js-trigger-ajuda {
    font-size: 0.90rem !important;
    padding: 10px !important;
    margin: -10px 0 -10px -5px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    cursor: pointer;
}

/* =========================================
   8. MOBILE OVERRIDES (App Layout)
   ========================================= */
@media (max-width: 767px) {

    /* Vertical Rhythm: Flex Gap Strategy */
    .row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .row>[class*="col-"] {
        margin-bottom: 0 !important;
        width: 100% !important;
    }

    /* Tooltip Mobile Positioning */
    .custom-tooltip-content {
        position: absolute !important;
        bottom: 125% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: max-content !important;
        min-width: 200px !important;
        max-width: 80vw !important;
        margin-left: 0 !important;
        z-index: 1000 !important;
        font-size: 0.75rem !important;
        padding: 0.75rem !important;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5) !important;
        white-space: normal !important;
        top: auto !important;
        right: auto !important;
        border: none !important;
    }

    .custom-tooltip-arrow {
        display: block !important;
        position: absolute !important;
        bottom: -4px !important;
        left: 50% !important;
        margin-left: -4px !important;
        width: 8px;
        height: 8px;
        transform: rotate(45deg) !important;
    }
}

/* =========================================
   7. FIX DE Z-INDEX (Modais sobre Header)
   ========================================= */
.modal-backdrop {
    z-index: 100040 !important;
}

.modal {
    z-index: 100050 !important;
}

/* Garante que o header fique abaixo do backdrop */
header,
nav.navbar,
.navbar {
    z-index: 1020 !important;
}

/* Dropdown do navbar deve ficar acima dos cards */
.navbar .dropdown-menu {
    z-index: 1030 !important;
}

/* Sticky-top deve ficar abaixo do dropdown do navbar */
.sticky-top {
    z-index: 1010 !important;
}