:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f4f6f9;
    --dark-text: #212529;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-color: #dee2e6;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --sidebar-bg: #0e1b33;
    /* Dark blue from image */
    --sidebar-hover: #1a2b4b;
    --header-height: 60px;
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow-md: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* =========================
   Mobile layout (sidebar drawer)
   ========================= */
@media (max-width: 900px) {
    body {
        display: block; /* evita overflow lateral em telas pequenas */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .page-header {
        margin: -1rem -1rem 1rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        width: var(--sidebar-width);
        z-index: 2000;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-mobile-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1990;
    }

    /* No mobile, não usar o modo "collapsed" (fica ruim/usabilidade) */
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Layout Structure */
.wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #fff;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.1rem 1.5rem 1.35rem; /* sobe o bloco do logo/sino */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center; /* centraliza textos do topo do sidebar */
}

.sidebar-brand-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* reserva espaço do lado direito pro sino sem deslocar o centro */
    padding-right: 44px;
}

.sidebar-brand-row .sidebar-brand {
    margin-bottom: 0; /* já há espaçamento via subtitle */
    position: relative;
    z-index: 1;
}

.sidebar-notif-btn {
    position: absolute;
    top: 50%;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
    transform: translateY(-50%);
    z-index: 5; /* garante clique em qualquer parte do sino */
    padding: 0;
    touch-action: manipulation;
}

.sidebar-notif-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-notif-btn:active {
    /* mantém fixo (não "pula" ao clicar) */
    transform: translateY(-50%);
}

.sidebar-notif-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

.sidebar-notif-badge {
    position: absolute;
    top: 50%;
    right: -4px; /* flutua do lado do sino, sem “pegar” na borda */
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transform: translate(35%, -50%);
}

body.sidebar-collapsed .sidebar-notif-btn {
    right: 6px;
}

body.sidebar-collapsed .sidebar-notif-badge {
    right: -2px;
    transform: translate(30%, -50%);
}

body.sidebar-collapsed .sidebar-brand-row {
    padding-right: 0;
}

/* Notifications Popover */
.notif-popover {
    position: fixed;
    z-index: 1500;
    width: min(420px, calc(100vw - 16px));
}

.notif-popover[hidden] {
    display: none !important;
}

.notif-popover-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.notif-popover-arrow {
    position: absolute;
    top: -6px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.10);
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    transform: rotate(45deg);
}

.notif-popover-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-popover-title {
    font-weight: 700;
    color: var(--dark-text);
}

.notif-popover-close {
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 10px;
}

.notif-popover-close:hover {
    background: rgba(13, 110, 253, 0.08);
}

.notif-popover-body {
    padding: 12px 14px 14px;
    max-height: 320px; /* rolagem dentro do popover quando tiver muitas notificações */
    overflow: auto;
}

.notif-popover-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed #d7dbe0;
    background: #fbfbfc;
}

.notif-popover-empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.10);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.notif-popover-empty-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.notif-item:hover {
    background: #f7f9fc;
    border-color: rgba(13, 110, 253, 0.18);
}

.notif-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(108, 117, 125, 0.10);
    color: rgba(108, 117, 125, 0.95);
    flex: 0 0 auto;
    margin-top: 2px;
    white-space: nowrap;
}

.notif-status-badge.unread {
    background: rgba(13, 110, 253, 0.10);
    border-color: rgba(13, 110, 253, 0.22);
    color: var(--primary-color);
}

.notif-status-badge.read {
    background: rgba(108, 117, 125, 0.10);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(108, 117, 125, 0.95);
}

.notif-item-main {
    flex: 1;
    min-width: 0;
}

.notif-item-actions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}

.notif-mark-read {
    border: 1px solid rgba(13, 110, 253, 0.22);
    background: rgba(13, 110, 253, 0.08);
    color: var(--primary-color);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.notif-mark-read:hover {
    background: rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.30);
}

.notif-mark-read:disabled {
    opacity: 0.55;
    cursor: default;
}

.notif-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-item-msg {
    color: var(--text-muted);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-item-meta {
    color: rgba(108, 117, 125, 0.85);
    font-size: 0.78rem;
    margin-top: 6px;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center; /* centraliza ícone + texto */
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.user-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-menu {
    padding: 1rem 0;
    flex: 1;
}

.menu-category {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background-color: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
}

/* Collapsed sidebar - show only icons */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

body.sidebar-collapsed .sidebar-subtitle,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .menu-category,
body.sidebar-collapsed .sidebar-brand-text {
    display: none;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
}

body.sidebar-collapsed .nav-link i {
    margin-right: 0;
}

body.sidebar-collapsed .nav-link .nav-text {
    display: none;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s, width 0.3s;
}

/* Page Header with Title and Sidebar Toggle */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e3e6ea;
    margin: -2rem -2rem 1rem;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1100;
}

/* Diagnóstico Inicial - botões flutuantes (Salvar rascunho / Enviar e finalizar) */
.diag-floating-actions {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200; /* acima do conteúdo, abaixo de modais */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.diag-floating-actions .btn {
    white-space: nowrap;
}

.diag-floating-spacer {
    height: 96px; /* evita o fim do formulário ficar por baixo do floating */
}

@media (max-width: 600px) {
    .diag-floating-actions {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        justify-content: space-between !important;
    }
    .diag-floating-actions .btn {
        flex: 1;
    }
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-text);
}

.sidebar-toggle {
    border: none;
    background: transparent;
    color: var(--dark-text);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 100%;
    /* Fluid container for dashboard */
    margin: 0 auto;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.w-100 {
    width: 100%;
}

/* Quando um botão usa w-100, ele deve ocupar a linha inteira */
.btn.w-100 {
    display: block;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Diagnóstico (Pró-Gestão) - destaque de pergunta */
.diag-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
}

/* Pró-Gestão (Diagnóstico) - melhorar legibilidade do enunciado + texto auxiliar */
#diagnosticoForm .card-body > p.mb-3 {
    font-size: 0.9rem;           /* texto auxiliar menor */
    line-height: 1.55;
    margin-bottom: 1.25rem;      /* separa o bloco do enunciado das alternativas */
}

#diagnosticoForm .card-body > p.mb-3 > strong {
    display: block;              /* quebra linha “natural” */
    font-size: 1rem;             /* enunciado mais destacado */
    margin-bottom: 0.5rem;       /* espaço entre enunciado e instrução */
    color: var(--dark-text);
}

/* Evita “linha extra” entre pergunta e texto auxiliar (por causa do <br> no HTML) */
#diagnosticoForm .card-body > p.mb-3 > br {
    display: none;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-secondary {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: var(--danger-color);
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 0;
    /* Cleaner look */
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
    font-weight: 600;
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Progress Bars */
.progress {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: var(--primary-color);
    transition: width .6s ease;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-tabs .nav-link {
    margin-bottom: -1px;
    background: 0 0;
    border: 1px solid transparent;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
    display: block;
    padding: .75rem 1.25rem;
    text-decoration: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    border-top: 2px solid var(--primary-color);
}

.tab-content {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-bottom-left-radius: .25rem;
    border-bottom-right-radius: .25rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    text-align: left;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Small KPI Cards for Dashboards/Reports */
.kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.kpi-card {
    flex: 1;
    min-width: 220px;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
}

.kpi-card--primary { border-left: 4px solid var(--primary-color); }
.kpi-card--success { border-left: 4px solid var(--success-color); }
.kpi-card--warning { border-left: 4px solid var(--warning-color); }
.kpi-card--danger  { border-left: 4px solid var(--danger-color); }

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}
.kpi-icon--primary { background: rgba(13,110,253,.12); color: var(--primary-color); }
.kpi-icon--success { background: rgba(25,135,84,.12);  color: var(--success-color); }
.kpi-icon--warning { background: rgba(255,193,7,.18);  color: var(--warning-color); }
.kpi-icon--danger  { background: rgba(220,53,69,.12);  color: var(--danger-color); }

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 600;
}

.kpi-value-muted {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.kpi-bar {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
    margin-top: 0.5rem;
}

.kpi-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width .4s ease;
}

.kpi-bar-fill--primary { background-color: var(--primary-color); }
.kpi-bar-fill--success { background-color: var(--success-color); }
.kpi-bar-fill--warning { background-color: var(--warning-color); }
.kpi-bar-fill--danger  { background-color: var(--danger-color); }

/* Searchable Select (vanilla JS) */
html.js .ss-native {
    display: none !important;
}

.ss-container {
    position: relative;
    width: 100%;
}

.ss-display {
    text-align: left;
    position: relative;
    padding-right: 2.25rem;
    background: #fff;
    cursor: pointer;
}

.ss-display::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.ss-container.open .ss-display {
    border-color: rgba(13,110,253,.45);
    box-shadow: 0 0 0 .15rem rgba(13,110,253,.15);
}

.ss-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
}

.ss-search {
    margin-bottom: 0.5rem;
}

.ss-options {
    max-height: 260px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ss-option {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    padding: 0.45rem 0.5rem;
    border-radius: 0.4rem;
    cursor: pointer;
}

.ss-option:hover {
    background: #f8f9fa;
}

.ss-option.active {
    border-color: rgba(13,110,253,.35);
    background: rgba(13,110,253,.08);
}

.ss-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ss-empty {
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

/* Diagnóstico Inicial - destaque visual por status */
.diag-answered {
    border-left: 4px solid var(--success-color);
}

.diag-pending {
    border-left: 4px solid var(--danger-color);
}

.diag-legend {
    font-size: 0.8rem;
    margin-left: 0.75rem;
    color: var(--text-muted);
}

.diag-legend span {
    margin-right: 0.75rem;
}

.diag-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 0.25rem;
}

.diag-legend-dot.ok {
    background-color: var(--success-color);
}

.diag-legend-dot.pending {
    background-color: var(--danger-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

/* Login Page Specific - Override Sidebar */
body.login-page {
    display: block;
    background: linear-gradient(180deg, #4b9ae6 0%, #2b6fb8 40%, #134e8f 100%);
    min-height: 100vh;
}

body.login-page .sidebar {
    display: none;
}

body.login-page .main-content {
    margin-bottom: 0;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
    font-weight: 600;
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Progress Bars */
.progress {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: var(--primary-color);
    transition: width .6s ease;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-tabs .nav-link {
    margin-bottom: -1px;
    background: 0 0;
    border: 1px solid transparent;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
    display: block;
    padding: .75rem 1.25rem;
    text-decoration: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    border-top: 2px solid var(--primary-color);
}

.tab-content {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-bottom-left-radius: .25rem;
    border-bottom-right-radius: .25rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    text-align: left;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

/* Login Page Specific - Override Sidebar */
body.login-page {
    display: block;
    background: radial-gradient(circle at center, #4b9ae6 0%, #134e8f 100%);
    min-height: 100vh;
}

body.login-page .sidebar {
    display: none;
}

body.login-page .main-content {
    margin-left: 0;
    width: 100%;
    padding: 0;
}

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 60px 20px 20px;
}

.login-header {
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.login-header p {
    font-size: 1rem;
    opacity: 0.9;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.login-title {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

.input-group .form-control {
    padding-left: 45px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
    height: 45px;
    transition: all 0.2s;
}

.input-group .form-control::placeholder {
    color: #adb5bd;
}

.input-group .form-control:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .15);
    border-color: #86b7fe;
    color: #212529;
    outline: none;
}

.btn-login {
    background-color: #2196f3;
    /* Azul mais claro */
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: 45px;
    width: 100%;
    margin-top: 1rem;
}

.btn-login:hover {
    background-color: #1976d2;
    color: white;
}

.forgot-password {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0;
    font-size: 0.85rem;
    color: #2196f3;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    color: #ffffff;
    font-size: 0.8rem;
    margin-top: 1.5rem;
}

/* =========================================================
   MOBILE OVERRIDES (colocado no final para não ser sobrescrito)
   ========================================================= */
@media (max-width: 900px) {
    body {
        display: block !important;
        overflow-x: hidden;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
    }

    .page-header {
        margin: -1rem -1rem 1rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Sidebar vira drawer */
    .sidebar {
        width: min(86vw, 320px) !important;
        transform: translateX(-105%) !important;
        transition: transform 0.22s ease !important;
        z-index: 2000 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0) !important;
    }

    body.sidebar-mobile-open::before {
        content: '' !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.35) !important;
        z-index: 1990 !important;
    }

    /* Compacta topo e itens do menu */
    .sidebar-header {
        padding: 0.85rem 1rem 1rem !important;
    }

    .sidebar-subtitle {
        font-size: 0.72rem;
        margin-bottom: 0.6rem;
    }

    .user-info {
        font-size: 0.78rem;
    }

    .sidebar-menu {
        padding: 0.6rem 0 !important;
    }

    .menu-category {
        padding: 0.5rem 1rem 0.25rem !important;
        font-size: 0.68rem;
    }

    .nav-link {
        padding: 0.55rem 1rem !important;
    }

    .nav-link i {
        width: 22px;
        margin-right: 8px;
    }

    .nav-text {
        font-size: 0.95rem;
    }

    /* Cards mais enxutos no mobile */
    .card-header {
        padding: 0.85rem 1rem;
    }
    .card-body {
        padding: 1rem;
    }
}