/* SGC Design System Tokens */
:root {
    /* Color Palette - Sóbria, Corporativa e Confiável */
    --sgc-primary: #1e3a8a;          /* Navy Blue Escuro - Confiança, Seriedade */
    --sgc-primary-hover: #1e40af;
    --sgc-secondary: #475569;        /* Slate Gray - Sofisticação, Neutro */
    --sgc-secondary-hover: #334155;
    
    /* Layout Backgrounds */
    --sgc-bg-app: #f8fafc;           /* Cinza ultra claro azulado */
    --sgc-bg-surface: #ffffff;       /* Branco para cards e painéis */
    
    /* Typography Colors */
    --sgc-text-primary: #0f172a;     /* Quase preto para excelente legibilidade */
    --sgc-text-muted: #64748b;       /* Cinza médio para textos auxiliares e labels */
    
    /* Status Colors */
    --sgc-success: #10b981;          /* Esmeralda */
    --sgc-warning: #f59e0b;          /* Âmbar */
    --sgc-danger: #ef4444;           /* Vermelho Suave */
    --sgc-info: #0284c7;             /* Azul Céu */
    
    /* Borders & Dividers */
    --sgc-border: #e2e8f0;           /* Borda muito sutil */
    --sgc-focus-ring: #93c5fd;       /* Azul focado acessível */
    
    /* Layout Metrics & Shapes */
    --sgc-radius-sm: 4px;
    --sgc-radius-md: 8px;
    --sgc-radius-lg: 12px;
    --sgc-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --sgc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacings */
    --sgc-space-xs: 0.25rem;
    --sgc-space-sm: 0.5rem;
    --sgc-space-md: 1rem;
    --sgc-space-lg: 1.5rem;
    --sgc-space-xl: 2rem;
}

/* Base Styles */
body {
    background-color: var(--sgc-bg-app);
    color: var(--sgc-text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* Accessibility Focus States - Conforme item 9 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--sgc-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--sgc-focus-ring) !important;
}

/* Typography Scale */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sgc-primary);
    margin-bottom: var(--sgc-space-lg);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sgc-text-primary);
    margin-bottom: var(--sgc-space-md);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sgc-text-primary);
}

p {
    line-height: 1.6;
}

label {
    font-weight: 500;
    color: var(--sgc-text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--sgc-space-xs);
}

/* Layout Infrastructure Classes - shell base para as próximas etapas */
.sgc-app-shell {
    display: flex;
    min-height: 100vh;
    background-color: var(--sgc-bg-app);
}

.sgc-sidebar {
    width: 280px;
    background-color: #0f172a; /* Azul marinho escuro/quase preto para contraste da sidebar */
    color: #ffffff;
    box-shadow: var(--sgc-shadow-md);
    transition: all 0.3s ease;
}

.sgc-topbar {
    background-color: var(--sgc-bg-surface);
    border-bottom: 1px solid var(--sgc-border);
    box-shadow: var(--sgc-shadow-sm);
}

.sgc-main-content {
    flex-grow: 1;
    background-color: var(--sgc-bg-app);
    min-width: 0; /* Prevents flex items from overflowing */
}

.sgc-content-container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.sgc-page-header {
    border-bottom: 1px solid var(--sgc-border);
    padding-bottom: var(--sgc-space-md);
    margin-bottom: var(--sgc-space-lg);
}

/* Base resets & spacing for Fixed Shell Layout */
body.sgc-has-shell {
    display: block !important;
    padding-top: 64px; /* Altura da navbar de topo */
    background-color: var(--sgc-bg-app);
}

@media (min-width: 992px) {
    body.sgc-has-shell {
        padding-left: 280px; /* Recuo para a sidebar lateral */
    }
}

/* SGC New Topbar style */
.sgc-navbar {
    height: 64px;
    background-color: #0f172a !important; /* Azul marinho sóbrio */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1030;
    box-shadow: var(--sgc-shadow-sm);
}

.sgc-navbar-brand {
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.25rem;
    color: #ffffff !important;
}

.sgc-brand-context {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.sgc-brand-context small {
    display: block;
    max-width: 360px;
    margin-top: 0.2rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.055em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sgc-user-role {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    font-weight: 400;
}

.sgc-navbar-user-dropdown .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--sgc-radius-sm);
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--sgc-space-xs) var(--sgc-space-sm);
    transition: background-color 0.15s ease;
}

.sgc-navbar-user-dropdown .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sgc-navbar-user-dropdown .dropdown-menu {
    border: 1px solid var(--sgc-border);
    box-shadow: var(--sgc-shadow-md);
    border-radius: var(--sgc-radius-md);
    padding: var(--sgc-space-sm) 0;
}

.sgc-navbar-user-dropdown .dropdown-header {
    font-weight: 600;
    color: var(--sgc-text-primary);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--sgc-border);
    padding-bottom: var(--sgc-space-sm);
    margin-bottom: var(--sgc-space-sm);
}

.sgc-navbar-user-dropdown .dropdown-item {
    font-size: 0.9rem;
    color: var(--sgc-secondary);
    font-weight: 500;
    padding: var(--sgc-space-sm) var(--sgc-space-lg);
}

.sgc-navbar-user-dropdown .dropdown-item:hover {
    background-color: var(--sgc-bg-app);
    color: var(--sgc-primary);
}

/* SGC Sidebar style - Sidebar em azul escuro elegante */
.sgc-sidebar-wrapper {
    width: 280px;
    background-color: #0f172a !important; /* Azul marinho corporativo escuro */
    color: #ffffff !important;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1020;
    padding-top: 64px; /* Altura da navbar */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--sgc-shadow-md);
    overflow-y: auto;
    /* Suprime transição no desktop para evitar flickering/redraw flash nas navegações tradicionais */
    transition: none;
}

@media (max-width: 991.98px) {
    .sgc-sidebar-wrapper {
        transition: transform 0.3s ease-in-out;
    }
}

/* Menu de Navegação */
.sgc-nav-list {
    list-style: none;
    padding: var(--sgc-space-md) var(--sgc-space-sm);
    margin: 0;
}

.sgc-nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b; /* Slate Gray suave */
    padding: var(--sgc-space-md) var(--sgc-space-md) var(--sgc-space-xs) var(--sgc-space-md);
}

.sgc-nav-link {
    display: flex;
    align-items: center;
    color: #cbd5e1 !important; /* Texto claro confortável */
    text-decoration: none !important;
    padding: 0.7rem var(--sgc-space-md);
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: var(--sgc-radius-md);
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.sgc-nav-link:hover,
.sgc-nav-link:focus-visible {
    background-color: rgba(147, 197, 253, 0.08);
    color: #ffffff !important;
}

/* Item Ativo - Conforme item 6 do manual SGC */
.sgc-nav-link.active,
.sgc-nav-link.active:hover,
.sgc-nav-link.active:focus-visible {
    background-color: var(--sgc-focus-ring) !important;
    color: var(--sgc-primary) !important;
    font-weight: 600;
    position: relative;
}

.sgc-nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    background-color: var(--sgc-info);
    border-radius: 0 4px 4px 0;
}

.sgc-nav-link i {
    font-size: 1.15rem;
    color: inherit;
    transition: transform 0.2s ease;
}

/* Submenu layout */
.sgc-submenu-collapse {
    list-style: none;
    padding-left: 0;
    margin-bottom: var(--sgc-space-xs);
}

/* Onboarding e coach marks */
.sgc-onboarding-modal:not(.show) {
    display: none;
}

.sgc-onboarding-modal .modal-dialog {
    max-width: 620px;
}

.sgc-onboarding-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.sgc-onboarding-card::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--sgc-primary);
}

.sgc-onboarding-card .modal-header,
.sgc-onboarding-card .modal-body,
.sgc-onboarding-card .modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.sgc-onboarding-eyebrow,
.sgc-onboarding-counter {
    color: var(--sgc-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sgc-onboarding-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    min-height: 150px;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--sgc-border);
    border-radius: 0.75rem;
}

.sgc-onboarding-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--sgc-primary);
    background: #dbeafe;
    border-radius: 0.75rem;
    font-size: 1.25rem;
}

.sgc-onboarding-progress {
    display: flex;
    gap: 0.4rem;
}

.sgc-onboarding-progress span {
    width: 0.5rem;
    height: 0.5rem;
    background: #cbd5e1;
    border-radius: 50%;
}

.sgc-onboarding-progress span.active {
    width: 1.4rem;
    background: var(--sgc-primary);
    border-radius: 999px;
}

.sgc-coach-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    z-index: 1060;
}

.sgc-coach-popover {
    position: fixed;
    max-width: 360px;
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius-md);
    box-shadow: var(--sgc-shadow-md);
    padding: 0.9rem;
    z-index: 1070;
}

.sgc-coach-highlight {
    position: relative;
    z-index: 1065;
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
    border-radius: 0.35rem;
    transition: outline-color 0.2s ease;
}

@media (max-width: 767.98px) {
    .sgc-onboarding-card .modal-header,
    .sgc-onboarding-card .modal-body,
    .sgc-onboarding-card .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sgc-onboarding-step {
        min-height: 170px;
        padding: 1rem;
    }

    .sgc-coach-popover {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 1rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgc-onboarding-modal.fade,
    .sgc-onboarding-modal .modal-dialog,
    .sgc-onboarding-progress span {
        transition: none;
    }

    .sgc-coach-highlight {
        transition: none;
    }
}

.sgc-submenu-link {
    display: flex;
    align-items: center;
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 0.5rem var(--sgc-space-lg) 0.5rem calc(var(--sgc-space-xl) + var(--sgc-space-md));
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--sgc-radius-sm);
    transition: all 0.15s ease;
}

.sgc-submenu-link:hover,
.sgc-submenu-link:focus-visible {
    color: #ffffff !important;
    background-color: rgba(147, 197, 253, 0.08);
}

.sgc-submenu-link.active {
    color: var(--sgc-focus-ring) !important;
    font-weight: 600;
}

/* Toggle icon direction */
.sgc-nav-toggle-icon {
    margin-left: auto;
    font-size: 0.8rem !important;
    transition: transform 0.2s ease;
}

.sgc-nav-link[aria-expanded="true"] .sgc-nav-toggle-icon,
.sgc-submenu-link[aria-expanded="true"] .sgc-nav-toggle-icon {
    transform: rotate(90deg);
}

/* Global Content adjustments */
.sgc-main-container {
    padding: var(--sgc-space-lg);
}

.sgc-main-card {
    background-color: var(--sgc-bg-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius-lg);
    box-shadow: var(--sgc-shadow-sm);
    padding: var(--sgc-space-lg);
    margin-bottom: var(--sgc-space-lg);
}

/* Responsividade de Dispositivos Móveis e Tablets */
@media (max-width: 991.98px) {
    .sgc-sidebar-wrapper {
        transform: translateX(-100%); /* Retira a sidebar da tela */
    }
    
    .sgc-sidebar-wrapper.show {
        transform: translateX(0); /* Exibe sidebar offcanvas mobile */
    }
    
    .sgc-navbar-brand {
        font-size: 1.15rem;
    }

    .sgc-brand-context small {
        max-width: 170px;
    }
}

/* Authentication Section */
.sgc-auth-container {
    min-height: 100vh;
    display: flex;
    background-color: var(--sgc-bg-app);
}

.sgc-icea-brand-wrapper {
    margin-bottom: var(--sgc-space-lg);
    display: inline-block;
}

.sgc-icea-logo {
    max-width: 220px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.sgc-auth-sidebar {
    background: linear-gradient(135deg, var(--sgc-primary) 0%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--sgc-space-xl) * 2);
    position: relative;
    overflow: hidden;
    text-align: center; /* Centraliza todo o conteúdo da sidebar institucional */
    align-items: center;
}

.sgc-auth-sidebar::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

.sgc-auth-logo-text {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: var(--sgc-space-sm);
    display: flex;
    align-items: center;
    justify-content: center; /* Garante o alinhamento centralizado do conteúdo interno do SGC (ícone + texto) */
}

.sgc-auth-tagline {
    font-size: 1.15rem;
    color: var(--sgc-focus-ring);
    font-weight: 500;
    margin-bottom: var(--sgc-space-xl);
}

.sgc-auth-features {
    list-style: none;
    padding-left: 0;
    margin-top: var(--sgc-space-xl);
}

.sgc-auth-features li {
    margin-bottom: var(--sgc-space-md);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}

.sgc-auth-features li i {
    color: var(--sgc-success);
    font-size: 1.25rem;
}

.sgc-auth-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sgc-space-lg);
    background-color: var(--sgc-bg-app);
}

.sgc-auth-card {
    background-color: var(--sgc-bg-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius-lg);
    box-shadow: var(--sgc-shadow-md);
    width: 100%;
    max-width: 440px;
    padding: var(--sgc-space-xl);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sgc-auth-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.sgc-auth-title {
    font-weight: 700;
    color: var(--sgc-primary);
    margin-bottom: var(--sgc-space-xs);
    font-size: 1.5rem;
}

.sgc-auth-subtitle {
    color: var(--sgc-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--sgc-space-lg);
}

.sgc-auth-input-group {
    position: relative;
    margin-bottom: var(--sgc-space-md);
}

.sgc-auth-input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--sgc-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.sgc-auth-input-group .form-control {
    border: 1.5px solid var(--sgc-border);
    border-radius: var(--sgc-radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--sgc-text-primary);
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.sgc-auth-input-group .form-control:focus {
    border-color: var(--sgc-primary);
    box-shadow: 0 0 0 3px var(--sgc-focus-ring);
    outline: none;
}

.sgc-auth-btn-submit {
    background-color: var(--sgc-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--sgc-radius-md);
    padding: 0.8rem;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.15s ease;
}

.sgc-auth-btn-submit:hover {
    background-color: var(--sgc-primary-hover);
    color: #ffffff;
}

.sgc-auth-btn-submit:focus {
    box-shadow: 0 0 0 3px var(--sgc-focus-ring);
}

@media (max-width: 991.98px) {
    .sgc-auth-container {
        flex-direction: column;
    }
    .sgc-auth-sidebar {
        padding: var(--sgc-space-lg) var(--sgc-space-md);
        text-align: center;
        align-items: center;
        justify-content: center;
        min-height: auto;
    }
    .sgc-auth-features {
        display: none;
    }
    .sgc-auth-form-area {
        flex-grow: 1;
        padding-top: var(--sgc-space-xl);
    }
}

/* Page Headers */
.sgc-page-header-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--sgc-text-primary);
    margin-bottom: 2px;
}

.sgc-page-header-desc {
    font-size: 0.9rem;
    color: var(--sgc-text-muted);
    margin-bottom: 0;
}

/* Filters */
.sgc-filter-card {
    background-color: var(--sgc-bg-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius-md);
    box-shadow: var(--sgc-shadow-sm);
    margin-bottom: var(--sgc-space-lg);
}

.sgc-filter-header {
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sgc-secondary);
    border-bottom: 1px solid var(--sgc-border);
    padding: var(--sgc-space-sm) var(--sgc-space-md);
    display: flex;
    align-items: center;
}

.sgc-filter-body {
    padding: var(--sgc-space-md);
}

.sgc-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sgc-secondary);
    margin-bottom: 4px;
}

.sgc-filter-select, .sgc-filter-input {
    font-size: 0.875rem;
    border-color: var(--sgc-border);
    border-radius: var(--sgc-radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--sgc-text-primary);
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.sgc-filter-select:focus, .sgc-filter-input:focus {
    border-color: var(--sgc-primary);
    box-shadow: 0 0 0 3px var(--sgc-focus-ring);
    outline: none;
}

/* Data Tables */
.sgc-table-card {
    background-color: var(--sgc-bg-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius-md);
    box-shadow: var(--sgc-shadow-sm);
    overflow: hidden;
    margin-bottom: var(--sgc-space-md);
}

.sgc-table {
    margin-bottom: 0;
    width: 100%;
}

.sgc-table th {
    background-color: #f8fafc;
    color: var(--sgc-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--sgc-border);
    border-top: none;
}

.sgc-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--sgc-text-primary);
    border-bottom: 1px solid var(--sgc-border);
    vertical-align: middle;
}

.sgc-table tbody tr {
    transition: background-color 0.15s ease;
}

.sgc-table tbody tr:hover {
    background-color: #f1f5f9;
}

.sgc-table td a {
    color: var(--sgc-primary);
    text-decoration: none;
    font-weight: 600;
}

.sgc-table td a:hover {
    text-decoration: underline;
    color: var(--sgc-primary-hover);
}

.diagnostico-table {
    min-width: 1120px;
    table-layout: fixed;
}

.diagnostico-table .col-codigo {
    width: 130px;
    white-space: nowrap;
}

.diagnostico-table .col-unidade {
    width: 105px;
    white-space: nowrap;
}

.diagnostico-table .col-tipo {
    width: 125px;
    white-space: nowrap;
}

.diagnostico-table .col-data {
    width: 125px;
    white-space: nowrap;
}

.diagnostico-table .col-status {
    width: 145px;
    white-space: nowrap;
}

.diagnostico-table .col-acoes {
    width: 105px;
    white-space: nowrap;
}

.diagnostico-table .col-texto-truncado {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status Badges */
.sgc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.775rem;
    font-weight: 600;
    border-radius: 50rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sgc-badge-active,
.sgc-badge-sim,
.sgc-badge-concluido {
    background-color: #d1fae5;
    color: #065f46;
}

.sgc-badge-inactive,
.sgc-badge-nao,
.sgc-badge-cancelado {
    background-color: #fee2e2;
    color: #991b1b;
}

.sgc-badge-rascunho {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.sgc-badge-em-aplicacao {
    background-color: #e0f2fe;
    color: #0369a1;
}

.sgc-badge-em-analise {
    background-color: #fef3c7;
    color: #92400e;
}

.sgc-badge-soft-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.sgc-badge-soft-warning {
    background-color: #fef3c7;
    color: #854d0e;
    border: 1px solid #fde68a;
}

.sgc-badge-soft-orange {
    background-color: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.sgc-badge-soft-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.sgc-badge-soft-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.sgc-badge-soft-neutral {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Empty States */
.sgc-empty-state {
    transition: transform 0.2s ease;
}

/* Pagination */
.sgc-pagination .pagination {
    margin-bottom: 0;
}

.sgc-pagination .page-link {
    color: var(--sgc-secondary);
    border-color: var(--sgc-border);
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sgc-pagination .page-link:hover {
    background-color: #f1f5f9;
    border-color: var(--sgc-border);
    color: var(--sgc-primary);
}

.sgc-pagination .page-item.active .page-link {
    background-color: var(--sgc-primary);
    border-color: var(--sgc-primary);
    color: #ffffff;
    font-weight: 600;
}

.sgc-pagination .page-item.disabled .page-link {
    color: #94a3b8;
    background-color: #f8fafc;
    border-color: var(--sgc-border);
}

/* List Actions */
.btn {
    border-radius: var(--sgc-radius-md);
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #ffffff;
    background-color: var(--sgc-primary-hover);
    border-color: var(--sgc-primary-hover);
}

.btn-outline-primary,
.btn-outline-secondary {
    color: var(--sgc-primary);
    background-color: transparent;
    border-color: #93a4bf;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: var(--sgc-primary-hover);
    background-color: #eff6ff;
    border-color: var(--sgc-primary-hover);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
    color: #b91c1c;
    background-color: #fef2f2;
    border-color: #dc2626;
}

.btn:disabled,
.btn.disabled {
    color: #94a3b8;
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.72;
    pointer-events: none;
}

.sgc-btn-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 32px;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--sgc-primary);
    border-radius: var(--sgc-radius-md);
    color: #ffffff;
    background-color: var(--sgc-primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sgc-btn-create:hover {
    color: #ffffff;
    background-color: var(--sgc-primary-hover);
    border-color: var(--sgc-primary-hover);
}

.sgc-btn-help {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}

button.sgc-btn-help {
    -webkit-appearance: none;
    appearance: none;
}

.sgc-btn-help .bi {
    display: block;
    font-size: 1.35rem;
    line-height: 1;
}

.sgc-btn-help:hover {
    color: #0a58ca;
}

.sgc-btn-help:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.45);
    outline-offset: 3px;
    border-radius: 50%;
}

.sgc-btn-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 32px;
    padding: 0.35rem 0.7rem;
    border: 1px solid #93c5fd;
    border-radius: var(--sgc-radius-md);
    color: #1e3a8a;
    background-color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sgc-btn-ai:hover {
    color: var(--sgc-primary-hover);
    background-color: #eff6ff;
    border-color: #60a5fa;
}

.sgc-btn-ai:focus-visible {
    outline: 2px solid rgba(30, 64, 175, 0.45);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.35) !important;
}

.sgc-inova-ia-loading {
    max-width: 34rem;
    margin-inline: auto;
    padding: 1rem;
    text-align: center;
}

.sgc-inova-ia-brain {
    width: 8rem;
    height: auto;
    color: #0891b2;
    fill: rgba(14, 165, 233, 0.14);
}

.sgc-inova-ia-brain circle {
    fill: #2563eb;
    animation: sgc-inova-node 1.8s ease-in-out infinite alternate;
}

.sgc-inova-ia-circuit {
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 12 7;
    animation: sgc-inova-circuit 2.4s linear infinite;
}

.sgc-inova-ia-circuit-delay { animation-delay: -1.2s; }

.sgc-inova-ia-status {
    min-height: 1.5rem;
    color: #0f4c81;
}

.sgc-inova-ia-status span {
    display: block;
    height: 0;
    opacity: 0;
    animation: sgc-inova-status 6s ease-in-out infinite;
}
.sgc-inova-ia-status span:nth-child(2) { animation-delay: 2s; }
.sgc-inova-ia-status span:nth-child(3) { animation-delay: 4s; }

@keyframes sgc-inova-circuit { to { stroke-dashoffset: -38; } }
@keyframes sgc-inova-node { to { opacity: 0.45; transform: scale(0.86); transform-origin: center; } }
@keyframes sgc-inova-status {
    0%, 28% { height: auto; opacity: 1; }
    33%, 100% { height: 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sgc-inova-ia-brain circle,
    .sgc-inova-ia-circuit,
    .sgc-inova-ia-status span { animation: none; }
    .sgc-inova-ia-status span { display: none; }
    .sgc-inova-ia-status span:first-child { display: block; height: auto; opacity: 1; }
}

.sgc-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--sgc-radius-md);
    color: var(--sgc-secondary);
    background-color: transparent;
    border: 1px solid var(--sgc-border);
    transition: all 0.2s ease;
}

.sgc-btn-action:hover {
    color: var(--sgc-primary);
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.sgc-btn-action-primary {
    color: var(--sgc-primary);
    border-color: rgba(30, 58, 138, 0.15);
}

.sgc-btn-action-primary:hover {
    color: var(--sgc-primary-hover);
    background-color: #eff6ff;
    border-color: #93c5fd;
}

.sgc-btn-action-danger {
    color: var(--sgc-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.sgc-btn-action-danger:hover {
    color: #b91c1c;
    background-color: #fef2f2;
    border-color: #fca5a5;
}

.sgc-btn-create:disabled,
.sgc-btn-create.disabled,
.sgc-btn-ai:disabled,
.sgc-btn-ai.disabled,
.sgc-btn-action:disabled,
.sgc-btn-action.disabled {
    color: #94a3b8;
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.72;
    pointer-events: none;
}

.sgc-btn-help:disabled,
.sgc-btn-help.disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.72;
    pointer-events: none;
}

/* Dashboard Estratégico */
.sgc-kpi-card {
    border-left: 4px solid var(--sgc-kpi-color) !important;
}

.sgc-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--sgc-kpi-color);
    background: #eff6ff;
    font-size: 1.15rem;
}

.sgc-kpi-value {
    color: var(--sgc-text-primary);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.sgc-kpi-blue { --sgc-kpi-color: #2563eb; }
.sgc-kpi-green { --sgc-kpi-color: #16a34a; }
.sgc-kpi-yellow { --sgc-kpi-color: #ca8a04; }
.sgc-kpi-orange { --sgc-kpi-color: #ea580c; }
.sgc-kpi-red { --sgc-kpi-color: #dc2626; }
.sgc-kpi-slate { --sgc-kpi-color: #475569; }

.sgc-dashboard-donut-wrap {
    position: relative;
    width: min(11rem, 46vw);
    height: min(11rem, 46vw);
    min-width: 8.5rem;
    min-height: 8.5rem;
    margin-inline: auto;
}

.sgc-dashboard-donut-legend {
    padding: 0.35rem 0.45rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.sgc-dashboard-donut-legend:hover,
.sgc-dashboard-donut-legend:focus-visible {
    background-color: rgb(37 99 235 / 7%);
}

.sgc-dashboard-donut-legend:focus-visible {
    outline: 2px solid rgb(37 99 235 / 35%);
    outline-offset: 1px;
}

.sgc-chart-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.sgc-chart-low { background-color: #16a34a !important; }
.sgc-chart-medium { background-color: #eab308 !important; }
.sgc-chart-high { background-color: #f97316 !important; }
.sgc-chart-critical { background-color: #dc2626 !important; }

.sgc-exposure-chart-wrap {
    position: relative;
    width: 100%;
    height: 20rem;
    min-height: 17rem;
}

@media (max-width: 575.98px) {
    .sgc-exposure-chart-wrap {
        height: 17rem;
    }
}

.sgc-dashboard-bar {
    height: 0.65rem;
    background-color: #e2e8f0;
}

.sgc-concentration-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.sgc-concentration-summary > div {
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid var(--sgc-primary, #2563eb);
    background-color: #f8fafc;
}

.sgc-concentration-summary strong,
.sgc-concentration-summary span {
    display: block;
}

.sgc-concentration-summary strong {
    color: var(--sgc-text-primary);
    font-size: 1.5rem;
    line-height: 1;
}

.sgc-concentration-summary span {
    margin-top: 0.35rem;
    color: var(--sgc-text-secondary, #64748b);
    font-size: 0.75rem;
}

.sgc-dashboard-radar {
    position: relative;
    width: 100%;
    height: 21rem;
    margin-inline: auto;
}

.sgc-dashboard-radar canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.sgc-panorama-areas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.sgc-panorama-areas > div {
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid var(--sgc-panorama-cor);
    background: #f8fafc;
}

.sgc-panorama-areas strong,
.sgc-panorama-areas span {
    display: block;
}

.sgc-panorama-areas span {
    margin-top: 0.2rem;
    color: var(--sgc-text-secondary, #64748b);
    font-size: 0.75rem;
}

.sgc-panorama-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.sgc-dashboard-panorama {
    position: relative;
    min-width: 43rem;
    height: 24rem;
}

.sgc-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.sgc-chart-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sgc-series-key {
    display: inline-block;
    width: 1.5rem;
    border-top: 3px solid;
}

.sgc-series-current {
    border-color: var(--sgc-primary);
}

.sgc-series-target {
    border-color: var(--sgc-info);
    border-top-style: dashed;
}

@media (max-width: 767.98px) {
    .sgc-concentration-summary {
        grid-template-columns: 1fr;
    }

    .sgc-dashboard-radar {
        height: 19rem;
    }

    .sgc-panorama-areas {
        grid-template-columns: 1fr;
    }

    .sgc-dashboard-panorama {
        height: 26rem;
    }
}
.sgc-text-justified {
    text-align: justify;
    overflow-wrap: anywhere;
}

.sgc-institutional-list {
    padding-left: 1.25rem;
    list-style: disc outside;
    overflow-wrap: anywhere;
}

.sgc-institutional-list li + li {
    margin-top: 0.2rem;
}
