html {
    font-size: 14px;
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #212529;
}

.health360-sidebar {
    width: 240px;
    min-height: 100vh;
    background: #17233b;
    color: white;
    padding: 0;
}

.sidebar-brand {
    padding: 22px 20px;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.health360-sidebar .nav {
    padding: 12px;
}

.health360-sidebar .nav-link {
    color: rgba(255,255,255,0.78);
    border-radius: 6px;
    padding: 9px 12px;
    margin-bottom: 3px;
}

    .health360-sidebar .nav-link:hover {
        background: rgba(255,255,255,0.08);
        color: white;
    }

.health360-topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.health360-content {
    padding: 24px;
}

:root {
    /* Identidade Health360 */
    --h360-navy: #15253f;
    --h360-navy-dark: #101c31;
    --h360-primary: #1687e8;
    --h360-primary-soft: #eaf5ff;
    --h360-teal: #00afa3;
    --h360-teal-soft: #e8f9f7;
    --h360-green: #23b26d;
    --h360-green-soft: #eaf8f0;
    --h360-lime: #64c466;
    /* Superfícies */
    --h360-bg: #f7f9fa;
    --h360-surface: #ffffff;
    /* Texto */
    --h360-text: #101828;
    --h360-text-muted: #667085;
    --h360-text-soft: #98a2b3;
    /* Estrutura */
    --h360-border: #e8edf2;
    /* Estados */
    --h360-success: #23b26d;
    --h360-warning: #f59e0b;
    --h360-danger: #e5484d;
    --h360-info: #1687e8;
    --h360-sidebar-width: 250px;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    background: var(--h360-bg);
    color: var(--h360-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Sidebar */

.health360-sidebar {
    width: var(--h360-sidebar-width);
    min-width: var(--h360-sidebar-width);
    min-height: 100vh;
    background: linear-gradient( 180deg, #172944 0%, #13223a 100% );
    color: white;
}

.sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient( 135deg, var(--h360-teal), var(--h360-primary) );
    color: white;
    font-size: 18px;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: .8px;
}

/* Sidebar navigation */

.sidebar-nav {
    padding: 14px 12px;
}

.sidebar-section-title {
    padding: 8px 10px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.40);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    text-decoration: none;
    color: rgba(255,255,255,0.72);
    margin-bottom: 3px;
    transition: all .15s ease;
    
}

    .sidebar-link i {
        width: 20px;
        font-size: 16px;
    }

    .sidebar-link:hover {
        background: rgba(255,255,255,0.07);
        color: white;
    }

    .sidebar-link.active {
        background: rgba(0, 175, 163, 0.16);
        color: #ffffff;
    }
        
            .sidebar-link.active i {
                color: #49d1c5;
            }
            /* Topbar */

            .health360-topbar {
                min-height: 72px;
                background: var(--h360-surface);
                border-bottom: 1px solid var(--h360-border);
                padding: 0 24px;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }

            .topbar-left {
                display: flex;
                align-items: center;
                gap: 12px;
            }

            .page-title {
                font-size: 16px;
                font-weight: 700;
            }

            .page-subtitle {
                font-size: 11px;
                color: var(--h360-text-muted);
            }

            .topbar-actions {
                display: flex;
                align-items: center;
                gap: 14px;
            }

            .topbar-icon-button {
                width: 36px;
                height: 36px;
                border: 0;
                background: transparent;
                border-radius: 8px;
                font-size: 17px;
            }

                .topbar-icon-button:hover {
                    background: #f3f4f6;
                }

            .user-info {
                display: flex;
                align-items: center;
                gap: 9px;
            }

            .user-avatar {
                width: 36px;
                height: 36px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                background: #eff6ff;
                color: var(--h360-primary);
            }

            .user-name {
                font-size: 12px;
                font-weight: 600;
            }

            .user-role {
                font-size: 10px;
                color: var(--h360-text-muted);
            }
            /* Main */

            .health360-content {
                padding: 24px;
            }
            /* KPI cards */

            .h360-kpi-card {
                background: #ffffff;
                border: 1px solid var(--h360-border);
                border-radius: 12px;
                padding: 18px;
                height: 100%;
                box-shadow: 0 3px 12px rgba(16, 24, 40, 0.035);
                transition: transform .15s ease, box-shadow .15s ease;
            }

                .h360-kpi-card:hover {
                    transform: translateY(-1px);
                    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
                }

            .kpi-header {
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 12px;
            }

            .kpi-title {
                color: var(--h360-text-muted);
                font-size: 11px;
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: .35px;
            }

            .kpi-icon {
                width: 34px;
                height: 34px;
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                background: #eff6ff;
                color: var(--h360-primary);
                font-size: 16px;
            }

            .kpi-value {
                font-size: 28px;
                font-weight: 700;
                line-height: 1.1;
                letter-spacing: -0.5px;
                color: var(--h360-text);
            }

            .kpi-footer {
                margin-top: 10px;
                font-size: 11px;
                color: var(--h360-text-muted);
            }

            .kpi-trend-up {
                color: var(--h360-success);
            }

            .kpi-icon-blue {
                background: var(--h360-primary-soft);
                color: var(--h360-primary);
            }

            .kpi-icon-teal {
                background: var(--h360-teal-soft);
                color: var(--h360-teal);
            }

            .kpi-icon-green {
                background: var(--h360-green-soft);
                color: var(--h360-green);
            }

            .kpi-icon-warning {
                background: #fff7e6;
                color: #d97706;
            }
            /* Generic cards */

            .h360-card {
                background: white;
                border: 1px solid var(--h360-border);
                border-radius: 10px;
                box-shadow: 0 1px 2px rgba(0,0,0,.03);
            }

            .h360-card-header {
                padding: 15px 18px;
                border-bottom: 1px solid #eef1f4;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }

            .h360-card-title {
                font-size: 13px;
                font-weight: 650;
                color: var(--h360-text);
                margin: 0;
            }

            .h360-card-body {
                padding: 18px;
            }
            /* Tables */

            .h360-table {
                margin-bottom: 0;
            }

                .h360-table thead th {
                    font-size: 10px;
                    font-weight: 700;
                    color: #7d8795;
                    text-transform: uppercase;
                    letter-spacing: .45px;
                    background: #fbfcfd;
                    border-bottom: 1px solid var(--h360-border);
                    padding: 11px 14px;
                }

                .h360-table tbody td {
                    padding: 12px 14px;
                    border-bottom: 1px solid #f0f2f5;
                    vertical-align: middle;
                    font-size: 12px;
                    color: #344054;
                }

                    .h360-table tbody td strong {
                        color: var(--h360-text);
                        font-weight: 600;
                    }

                .h360-table tbody tr {
                    transition: background .12s ease;
                }

                    .h360-table tbody tr:hover {
                        background: #f8fbfd;
                    }
            /* Buttons */

            .btn {
                border-radius: 7px;
            }

            .btn-primary {
                background: linear-gradient( 135deg, var(--h360-teal), #07998f );
                border-color: transparent;
                color: white;
            }

                .btn-primary:hover {
                    background: #078f86;
                    border-color: transparent;
                }
            /* Forms */

            .form-control,
            .form-select {
                border-radius: 7px;
                border-color: var(--h360-border);
                font-size: 13px;
                min-height: 38px;
            }

            .form-label {
                font-size: 12px;
                font-weight: 500;
            }

            .form-control:focus,
            .form-select:focus {
                border-color: var(--h360-primary);
                box-shadow: 0 0 0 .18rem rgba(37,99,235,.12);
            }
            /* Badges */

            .h360-badge {
                display: inline-flex;
                align-items: center;
                gap: 4px;
                padding: 4px 9px;
                border-radius: 999px;
                font-size: 10px;
                font-weight: 600;
                white-space: nowrap;
            }

            .h360-badge-success {
                color: #128554;
                background: #eaf8f0;
            }

            .h360-badge-warning {
                color: #92400e;
                background: #fef3c7;
            }

            .h360-badge-danger {
                background: #fee2e2;
                color: #b42318;
            }

            .h360-badge-followup {
                color: #087f77;
                background: #e8f9f7;
            }

            .h360-badge-pending {
                color: #b76800;
                background: #fff4df;
            }

            .h360-badge-info {
                color: #136fc2;
                background: #eaf5ff;
            }

            .h360-badge-muted {
                color: #667085;
                background: #f2f4f7;
            }
            /* Títulos bastante fortes, com pequenos textos coloridos acima. */

            .page-eyebrow {
                font-size: 10px;
                font-weight: 700;
                color: var(--h360-teal);
                text-transform: uppercase;
                letter-spacing: .8px;
                margin-bottom: 4px;
            }

            .page-heading-title {
                font-size: 22px;
                font-weight: 750;
                letter-spacing: -0.4px;
                color: var(--h360-text);
                margin-bottom: 4px;
            }

            .page-heading-description {
                font-size: 12px;
                color: var(--h360-text-muted);
                margin: 0;
            }

/* =========================================================
   HEALTH360 - HISTÓRICO CLÍNICO
   ========================================================= */

.clinical-section {
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.clinical-section-header {
    min-height: 54px;
    padding: 14px 18px;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clinical-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clinical-section-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef7fb;
    color: #087f8c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .clinical-section-icon i {
        font-size: 16px;
    }

.clinical-section-title h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #14213d;
}

.clinical-section-count {
    font-size: 12px;
    color: #7a8696;
    white-space: nowrap;
}

.clinical-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    .clinical-table thead th {
        background: #f8fafc;
        border-bottom: 1px solid #e7ecf1;
        color: #718096;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
        padding: 11px 16px;
        white-space: nowrap;
    }

    .clinical-table tbody td {
        padding: 13px 16px;
        vertical-align: middle;
        border-bottom: 1px solid #eef2f6;
        font-size: 13px;
        color: #334155;
    }

    .clinical-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .clinical-table tbody tr:hover {
        background: #fbfdff;
    }

    .clinical-table .cell-primary {
        font-weight: 600;
        color: #162033;
    }

    .clinical-table .cell-secondary {
        font-size: 11px;
        color: #8a96a6;
        margin-top: 2px;
    }

.clinical-empty {
    padding: 30px 20px;
    text-align: center;
}

.clinical-empty-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    border-radius: 12px;
    background: #f4f7fa;
    color: #8391a2;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .clinical-empty-icon i {
        font-size: 19px;
    }

.clinical-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 3px;
}

.clinical-empty-text {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.clinical-action {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid #e6ebf0;
    background: #fff;
    color: #425466;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

    .clinical-action:hover {
        background: #f5f8fb;
        color: #0b7f8e;
    }

.clinical-result {
    font-weight: 600;
}

    .clinical-result.abnormal {
        color: #c0392b;
    }

.clinical-balance {
    font-weight: 600;
}

    .clinical-balance.pending {
        color: #b7791f;
    }

    .clinical-balance.complete {
        color: #198754;
    }

@media (max-width: 768px) {
    .clinical-table thead {
        display: none;
    }

    .clinical-table,
    .clinical-table tbody,
    .clinical-table tr,
    .clinical-table td {
        display: block;
        width: 100%;
    }

        .clinical-table tr {
            padding: 10px 0;
            border-bottom: 1px solid #eef2f6;
        }

        .clinical-table td {
            border: 0;
            padding: 5px 16px;
        }
}

.clinical-action {
    cursor: pointer;
}

button.clinical-action {
    padding: 0;
}

.clinical-action.text-danger:hover {
    background: #fff5f5;
    border-color: #f1b8b8;
    color: #b42318 !important;
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-kpi-icon,
.dashboard-service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eef7fb;
    color: #087f8c;
}

.dashboard-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 20px;
}

.dashboard-service-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 18px;
}

.h360-card a {
    color: inherit;
}

.h360-card:hover {
    border-color: #d7e3eb;
}

/* =========================================================
   DASHBOARD CHARTS
   ========================================================= */

.dashboard-chart-container {
    position: relative;
    width: 100%;
    min-height: 320px;
}

.dashboard-chart-medium {
    min-height: 280px;
}

.dashboard-chart-small {
    min-height: 280px;
}

/* =========================================================
   CONFIGURAÇÃO INSTITUCIONAL
   ========================================================= */

.institution-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: #f8fafc;
}

    .institution-logo-preview img {
        display: block;
        max-width: 100%;
        max-height: 120px;
        object-fit: contain;
    }

/* =========================================================
   VERIFICAÇÃO DE RELATÓRIOS
   ========================================================= */

.report-verification-result {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid;
    border-radius: 12px;
}

.report-verification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
}

.report-verification-title {
    font-size: 16px;
    font-weight: 700;
}

.report-verification-message {
    margin-top: 3px;
    font-size: 13px;
}

.report-verification-valid {
    background: #f0fdf9;
    border-color: #b8e8da;
}

    .report-verification-valid .report-verification-icon {
        background: #d6f5eb;
        color: #087f68;
    }

    .report-verification-valid .report-verification-title {
        color: #087f68;
    }

.report-verification-warning {
    background: #fffbeb;
    border-color: #f4dda1;
}

    .report-verification-warning .report-verification-icon {
        background: #fff1c7;
        color: #9a6700;
    }

    .report-verification-warning .report-verification-title {
        color: #8a5c00;
    }

.report-verification-invalid {
    background: #fff5f5;
    border-color: #efc6c6;
}

    .report-verification-invalid .report-verification-icon {
        background: #fbe1e1;
        color: #b42318;
    }

    .report-verification-invalid .report-verification-title {
        color: #b42318;
    }

.report-hash {
    display: block;
    width: 100%;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
}