/* ============================================
   SISTEMA DE PLANEJAMENTO ESTRATÉGICO
   Variáveis e Estilos Base
   ============================================ */

:root {
    /* Cores Principais (Brand) */
    --primary-dark: #0B2F4E;
    --primary: #005B96;
    --primary-light: #0B5DA1;
    --accent: #5EE6A6;
    --accent-hover: #4ED18F;

    /* Neutros e Superfícies */
    --background: #F5F7FA;
    --foreground: #263238;
    --border: #B0BEC5;
    --surface: #F8FAFC;
    --surface-alt: #F8FBFD;

    /* Cores Semânticas (Status) */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --muted: #94A3B8;
    --muted-light: #F1F5F9;

    /* Gráficos */
    --chart-axis: #475569;
    --chart-grid: #E2E8F0;
    --chart-tooltip: #CBD5E1;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;

    /* Tipografia */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Bordas */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transições */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   RESET E BASE
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--foreground);
    background-color: var(--background);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.layout {
    display: flex;
    min-height: 100vh;
}

.layout__sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 100;
    transition: width var(--transition);
}

.layout__main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.layout__topbar {
    position: sticky;
    top: 0;
    z-index: 50;
}

.layout__content {
    flex: 1;
    padding: 1.5rem;
    animation: page-enter 200ms ease both;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SETOR VIEW SWITCHER (Mês Atual / Painel Anual)
   Usado em setor_detail e setor_painel via partial.
   ============================================ */

.sv-wrap {
    margin-bottom: 1.5rem;
}

.sv-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    margin-bottom: 0;
}

.sv-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.125rem;
    border-radius: calc(var(--radius-lg) - 2px);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.sv-tab:hover {
    color: var(--primary-dark);
    background: white;
}

.sv-tab--active {
    background: white;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.sv-tab--active svg {
    color: var(--primary);
}

.sv-tab:not(.sv-tab--active) svg {
    opacity: 0.55;
}

.sv-divider {
    height: 1px;
    background: var(--border);
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Sidebar colapsada */
.layout--collapsed .layout__sidebar {
    width: var(--sidebar-collapsed-width);
}

.layout--collapsed .layout__main {
    margin-left: var(--sidebar-collapsed-width);
}

/* Oculta textos e títulos na sidebar colapsada */
.layout--collapsed .sidebar__text,
.layout--collapsed .sidebar__title,
.layout--collapsed .sidebar__section-title,
.layout--collapsed .sidebar__badge {
    display: none;
}

/* Centraliza os links (ícone fica no centro) */
.layout--collapsed .sidebar__link {
    justify-content: center;
    padding: 0.75rem 0;
    margin-right: 0;
    border-radius: 0;
}

/* Centraliza o header (logo fica no centro) */
.layout--collapsed .sidebar__header {
    justify-content: center;
    padding: 1.25rem 0;
}

/* Remove a seção em branco quando título está oculto */
.layout--collapsed .sidebar__section {
    margin-bottom: 0.5rem;
}

/* Remove translação do ícone no hover quando colapsado (já centrado) */
.layout--collapsed .sidebar__link:hover .sidebar__icon {
    transform: none;
}

/* Tooltip nativo ao passar o mouse nos itens colapsados */
.layout--collapsed .sidebar__link {
    position: relative;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    height: 100%;
    /* Gradiente sutil para profundidade visual */
    background: linear-gradient(180deg, #0B2F4E 0%, #0a2640 100%);
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar__header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--topbar-height);
}

.sidebar__logo {
    /* Aumentado para 40px com sombra esverdeada para impacto visual */
    width: 40px;
    height: 40px;
    background-color: var(--accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-dark);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(94, 230, 166, 0.3);
    transition: box-shadow var(--transition);
}

.sidebar__logo:hover {
    box-shadow: 0 6px 18px rgba(94, 230, 166, 0.45);
}

.sidebar__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    /* Leve gradiente no texto para refinamento */
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar__nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    /* Scrollbar fina e discreta */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar__nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}

.sidebar__nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.sidebar__section {
    margin-bottom: 1.5rem;
}

.sidebar__section-title {
    /* Maior hierarquia com borda accent e padding aumentado */
    display: block;
    padding: 0 1.25rem 0 0.75rem;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--accent);
    margin-left: 1rem;
    padding-right: 1.25rem;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* Contraste aumentado de 0.5 para 0.4 (mais visível) */
    color: rgba(255, 255, 255, 0.4);
}

.sidebar__menu {
    list-style: none;
}

.sidebar__item {
    position: relative;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: rgba(255, 255, 255, 0.65);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    /* Garante que o border-radius do hover funcione corretamente */
    margin: 0 0.5rem 0 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.sidebar__link:hover {
    /* Hover mais expressivo com leve translação no ícone */
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar__link:hover .sidebar__icon {
    transform: translateX(2px);
}

.sidebar__link--active {
    /* Estado ativo com gradiente suave e borda sólida */
    background: rgba(94, 230, 166, 0.15);
    color: white;
    border-left-color: var(--accent);
}

.sidebar__link--active .sidebar__icon {
    color: var(--accent);
    /* Remove a translação no estado ativo para evitar conflito */
    transform: translateX(0);
}

/* Link de logout com estilo diferenciado no hover */
.sidebar__link--logout {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar__link--logout:hover {
    color: #FF6B6B;
    background: rgba(239, 68, 68, 0.1);
}

.sidebar__link--logout:hover .sidebar__icon {
    color: #FF6B6B;
    transform: translateX(2px);
}

.sidebar__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* Transição suave para o efeito de translação no hover */
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.sidebar__text {
    white-space: nowrap;
    overflow: hidden;
    font-size: var(--font-size-sm);
}

.sidebar__badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    background-color: var(--danger);
    border-radius: 9999px;
    /* Pequena animação de pulse para chamar atenção */
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.sidebar__footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   TOPBAR
   ============================================ */

.topbar {
    height: var(--topbar-height);
    background-color: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.topbar__brand-logo {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 93, 161, 0.08);
    overflow: hidden;
}

.topbar__brand-logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1.55);
    transform-origin: center 24%;
}

.topbar__brand-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}

.topbar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--foreground);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background-color var(--transition-fast);
}

.topbar__toggle:hover {
    background-color: var(--surface);
}

.topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.topbar__breadcrumb a {
    color: var(--muted);
}

.topbar__breadcrumb a:hover {
    color: var(--primary);
}

.topbar__breadcrumb-separator {
    color: var(--border);
}

.topbar__breadcrumb-current {
    color: var(--foreground);
    font-weight: 500;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar__empresa {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
    padding: 0.25rem 0.5rem 0.25rem 0.875rem;
    background: transparent;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    color: var(--foreground);
    border: none;
    transition: all var(--transition-fast);
    max-width: 360px;
}

.topbar__empresa::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 28px;
    background-color: var(--border);
}

.topbar__empresa--selectable {
    cursor: pointer;
}

.topbar__empresa--selectable:hover {
    background-color: var(--surface);
}

.topbar__empresa-logo,
.topbar__empresa-logo-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
}

.topbar__empresa-logo {
    object-fit: cover;
    border: 1px solid var(--border);
}

.topbar__empresa-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.topbar__empresa-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.topbar__empresa-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.topbar__icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.topbar__icon-btn:hover {
    background-color: var(--surface);
    color: var(--foreground);
}

.topbar__icon-btn-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    padding-right: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.topbar__user:hover {
    background-color: var(--surface);
}

.topbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.topbar__user-info {
    display: flex;
    flex-direction: column;
}

.topbar__user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--foreground);
}

.topbar__user-role {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--foreground);
}

.card__body {
    padding: 1.25rem;
}

.card__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Padrão visual para botões de adição (Novo/Nova) */
.btn--add {
    width: auto;
    min-width: 186px;
    max-width: 100%;
    height: 48px;
    padding: 0 1rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    gap: 0.5rem;
    border-radius: var(--radius-lg);
}

.btn--add svg {
    width: 16px;
    height: 16px;
}

/* Variante de cor unificada para todos os botões de adição */
.btn--add.btn--primary {
    background-color: var(--primary-dark);
    color: white;
}

.btn--add.btn--primary:hover:not(:disabled) {
    background-color: var(--primary);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn--primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    color: white;
}

.btn--accent {
    background-color: var(--accent);
    color: var(--primary-dark);
}

.btn--accent:hover:not(:disabled) {
    background-color: var(--accent-hover);
    color: var(--primary-dark);
}

.btn--outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn--outline:hover:not(:disabled) {
    background-color: var(--surface);
    border-color: var(--primary);
    color: var(--foreground);
}

.btn--danger {
    background-color: var(--danger);
    color: white;
}

.btn--danger:hover:not(:disabled) {
    background-color: #DC2626;
    color: white;
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
}

.btn--lg {
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
}

.btn--icon {
    padding: 0.5rem;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--foreground);
}

.form-label--required::after {
    content: ' *';
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: white;
    color: var(--foreground);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 150, 0.1);
}

.form-input::placeholder {
    color: var(--muted);
}

.form-input--error {
    border-color: var(--danger);
}

.form-input--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    margin-top: 0.375rem;
    font-size: var(--font-size-sm);
    color: var(--danger);
}

.form-hint {
    margin-top: 0.375rem;
    font-size: var(--font-size-sm);
    color: var(--muted);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: 9999px;
}

.badge--success {
    background-color: var(--success-light);
    color: #065F46;
}

.badge--danger {
    background-color: var(--danger-light);
    color: #991B1B;
}

.badge--warning {
    background-color: var(--warning-light);
    color: #92400E;
}

.badge--info {
    background-color: var(--info-light);
    color: #1E40AF;
}

.badge--muted {
    background-color: var(--muted-light);
    color: #475569;
}

/* ============================================
   ALERTAS / MENSAGENS
   ============================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;

    /* Suporte à animação de fade-out controlada via JS */
    opacity: 1;
    transition: opacity 0.5s ease, margin-bottom 0.5s ease, padding 0.5s ease, max-height 0.5s ease, border-width 0.5s ease;
    overflow: hidden;
    max-height: 200px; /* valor generoso para caber qualquer mensagem */
}

/* Estado aplicado pelo JS antes de remover o elemento do DOM */
.alert--dismissing {
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: 0 !important;
    border: none !important;
    overflow: hidden;
}

.alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert__content {
    flex: 1;
}

.alert__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert__close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert__close:hover {
    opacity: 1;
}

.alert--success {
    background-color: var(--success-light);
    border: 1px solid var(--success);
    color: #065F46;
}

.alert--danger {
    background-color: var(--danger-light);
    border: 1px solid var(--danger);
    color: #991B1B;
}

.alert--warning {
    background-color: var(--warning-light);
    border: 1px solid var(--warning);
    color: #92400E;
}

.alert--info {
    background-color: var(--info-light);
    border: 1px solid var(--info);
    color: #1E40AF;
}

/* ============================================
   TABELAS
   ============================================ */

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--muted);
    background-color: var(--surface);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--surface);
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */

.login-body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #05131f;
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 18%, rgba(94, 230, 166, 0.18), transparent 34%),
        radial-gradient(circle at 82% 14%, rgba(56, 189, 248, 0.16), transparent 26%),
        linear-gradient(135deg, #041321 0%, #0a2740 54%, #061a2c 100%);
    padding: clamp(1rem, 2.8vw, 2.75rem);
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2rem;
    pointer-events: none;
}

.login-page__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at center, black 34%, transparent 92%);
    opacity: 0.4;
    pointer-events: none;
}

.login-page__glow {
    position: absolute;
    width: min(560px, 45vw);
    height: min(560px, 45vw);
    border-radius: 50%;
    filter: blur(88px);
    pointer-events: none;
    opacity: 0.46;
}

.login-page__glow--left {
    top: -24%;
    left: -10%;
    background: rgba(94, 230, 166, 0.32);
}

.login-page__glow--right {
    right: -12%;
    bottom: -30%;
    background: rgba(59, 130, 246, 0.34);
}

.login-layout {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(460px, 1.08fr) minmax(380px, 0.92fr);
    gap: clamp(1rem, 1.8vw, 1.5rem);
    align-items: stretch;
}

.login-aside {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: clamp(1.1rem, 2.2vw, 1.65rem);
    align-content: start;
    padding: clamp(1.2rem, 2.5vw, 1.85rem);
    border-radius: 1.35rem;
    overflow: hidden;
    color: #eaf5ff;
    background:
        linear-gradient(160deg, rgba(6, 23, 37, 0.9), rgba(8, 40, 66, 0.62)),
        radial-gradient(circle at top right, rgba(94, 230, 166, 0.18), transparent 28%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 32px 80px rgba(1, 10, 20, 0.34);
    backdrop-filter: blur(10px);
}

.login-aside::after {
    content: '';
    position: absolute;
    inset: 0.6rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.login-aside__intro,
.login-showcase {
    position: relative;
    z-index: 1;
}

.login-aside__intro {
    display: grid;
    gap: 0.85rem;
}

.login-aside__pill {
    justify-self: start;
    display: inline-flex;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 230, 166, 0.22);
    background: rgba(94, 230, 166, 0.12);
    color: #9ff4ce;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-aside__eyebrow {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(203, 230, 247, 0.68);
}

.login-aside__title {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: clamp(1.6rem, 2.8vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    max-width: 16ch;
}

.login-aside__description {
    max-width: 40ch;
    color: rgba(232, 241, 247, 0.86);
    font-size: 0.92rem;
    line-height: 1.5;
}

.login-showcase {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
}

.login-showcase__panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-showcase__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.login-showcase__label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(203, 230, 247, 0.72);
}

.login-showcase__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(94, 230, 166, 0.12);
    color: #9ff4ce;
    font-size: 0.64rem;
    font-weight: 700;
}

.login-showcase__status::before {
    content: '';
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0.28rem rgba(94, 230, 166, 0.15);
}

/* ── Chart container ─────────────────────────────── */
.login-showcase__chart {
    position: relative;
    min-height: 110px;
    margin-bottom: 0.25rem;
}

/* ── Horizontal grid lines ───────────────────────── */
.login-showcase__gridlines {
    position: absolute;
    inset: 0 0 22px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.login-showcase__gridlines span {
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    width: 100%;
}

/* ── Meta dashed line at 85% ─────────────────────── */
.login-showcase__meta-line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(22px + 85% * (110px - 22px) / 110);
    border-top: 1.5px dashed rgba(251, 191, 36, 0.55);
    pointer-events: none;
}

.login-showcase__meta-tag {
    position: absolute;
    right: 0;
    top: -9px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}

/* ── Bar columns ─────────────────────────────────── */
.login-showcase__bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    padding-bottom: 22px;
}

.login-showcase__col {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    height: 100%;
    justify-content: flex-end;
}

.login-showcase__val {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
}

.login-showcase__month {
    position: absolute;
    bottom: 4px;
    font-size: 0.56rem;
    font-weight: 600;
    color: rgba(203, 230, 247, 0.55);
    letter-spacing: 0.04em;
    line-height: 1;
}

/* ── Individual bars ─────────────────────────────── */
@keyframes bar-grow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

.login-showcase__bar {
    display: block;
    width: 100%;
    height: var(--bar-h, 60%);
    border-radius: 4px 4px 3px 3px;
    transform-origin: bottom;
    animation: bar-grow 600ms cubic-bezier(0.34, 1.3, 0.64, 1) both;
    position: relative;
}

.login-showcase__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%);
    pointer-events: none;
}

.login-showcase__col:nth-child(1) .login-showcase__bar { animation-delay: 80ms; }
.login-showcase__col:nth-child(2) .login-showcase__bar { animation-delay: 160ms; }
.login-showcase__col:nth-child(3) .login-showcase__bar { animation-delay: 240ms; }
.login-showcase__col:nth-child(4) .login-showcase__bar { animation-delay: 320ms; }
.login-showcase__col:nth-child(5) .login-showcase__bar { animation-delay: 400ms; }
.login-showcase__col:nth-child(6) .login-showcase__bar { animation-delay: 480ms; }

/* Verde */
.login-showcase__bar--green {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3);
}

/* Amarelo */
.login-showcase__bar--yellow {
    background: linear-gradient(180deg, #fcd34d 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(252, 211, 77, 0.28);
}

/* Vermelho */
.login-showcase__bar--red {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(248, 113, 113, 0.28);
}

.login-showcase__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.login-showcase__stat {
    padding: 0.5rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.login-showcase__stat strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
}

.login-showcase__stat span {
    display: block;
    margin-top: 0.08rem;
    color: rgba(232, 241, 247, 0.76);
    font-size: 0.63rem;
    line-height: 1.25;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 253, 0.96));
    box-shadow: 0 28px 60px rgba(1, 18, 32, 0.28);
    backdrop-filter: blur(14px);
    animation: login-card-enter 420ms var(--transition-slow);
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, rgba(94, 230, 166, 0.75), rgba(11, 93, 161, 0.75));
}

.login-card__header {
    padding: 1.3rem 1.7rem 1.05rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 248, 251, 0.52));
    border-bottom: 1px solid rgba(176, 190, 197, 0.32);
    display: grid;
    gap: 0.65rem;
}

.login-card__eyebrow {
    justify-self: center;
    display: inline-flex;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: rgba(11, 93, 161, 0.08);
    color: #0b5da1;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-card__brand {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
}

.login-card__logo-shell {
    position: relative;
    width: 64px;
    height: 64px;
    padding: 0.15rem;
    border-radius: 0.9rem;
    background: rgba(11, 93, 161, 0.06);
    box-shadow: none;
}

.login-card__logo {
    width: 100%;
    height: 100%;
    border-radius: 0.85rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #081a2a 0%, #0c2a43 100%);
}

.login-card__logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.login-card__headline {
    display: grid;
    gap: 0.3rem;
    justify-items: center;
}

.login-card__title {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: clamp(1.28rem, 1.8vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--primary-dark);
}

.login-card__subtitle {
    max-width: 34ch;
    font-size: 0.8rem;
    color: #4d6476;
}

.login-card__trust {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    max-width: 38ch;
    padding: 0.4rem 0.6rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(11, 93, 161, 0.1);
    color: #526879;
    font-size: 0.7rem;
}

.login-card__trust-dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(180deg, #72f3d7 0%, #22abc6 100%);
    box-shadow: 0 0 0 0.3rem rgba(94, 230, 166, 0.16);
}

.login-card__body {
    padding: 1.25rem 1.7rem 1.35rem;
}

.login-alert {
    margin-bottom: 1.2rem;
}

.login-form {
    display: grid;
    gap: 0.45rem;
}

.form-input-wrap {
    position: relative;
}

.form-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #6b7f91;
    pointer-events: none;
}

.form-input-icon svg {
    width: 100%;
    height: 100%;
}

.form-input--with-icon {
    padding-left: 2.8rem;
}

.form-input--with-action {
    padding-right: 3rem;
}

.form-input-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    border: none;
    background: transparent;
    color: #607486;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.form-input-toggle:hover {
    color: var(--primary-dark);
    background-color: rgba(11, 93, 161, 0.08);
}

.form-input-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 93, 161, 0.25);
}

.form-input-toggle svg {
    width: 1rem;
    height: 1rem;
}

.form-input-toggle .icon-eye-off {
    display: none;
}

.form-input-toggle[aria-pressed='true'] .icon-eye {
    display: none;
}

.form-input-toggle[aria-pressed='true'] .icon-eye-off {
    display: block;
}

.login-form__meta {
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.checkbox-control {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #42596b;
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.checkbox-control input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.login-link {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

.login-card__footer {
    padding: 0.82rem 1.7rem 0.95rem;
    background-color: rgba(248, 250, 252, 0.75);
    text-align: center;
    font-size: 0.72rem;
    color: #71869a;
    border-top: 1px solid rgba(176, 190, 197, 0.28);
}

@keyframes login-card-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PAGE HEADER (Dashboard e páginas internas)
   ============================================ */

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.page-subtitle {
    color: var(--muted);
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
}

/* ============================================
   STAT CARDS (Cards de estatística do Dashboard)
   ============================================ */

/* Grid responsivo para os stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Grid 2fr/1fr para seções de conteúdo */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Card de estatística com hover lift */
.stat-card {
    background-color: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    /* Efeito "lift" ao passar o mouse */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card__body {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container do ícone: 48x48px com border-radius e cor variante */
.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Transição suave no hover do card pai */
    transition: transform var(--transition);
}

.stat-card:hover .stat-card__icon {
    transform: scale(1.05);
}

/* Variantes de cor para os ícones */
.stat-card__icon--info {
    background-color: var(--info-light);
    color: var(--info);
}

.stat-card__icon--info svg {
    stroke: var(--info);
}

.stat-card__icon--primary {
    background-color: rgba(0, 91, 150, 0.1);
    color: var(--primary);
}

.stat-card__icon--primary svg {
    stroke: var(--primary);
}

.stat-card__icon--success {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-card__icon--success svg {
    stroke: var(--success);
}

.stat-card__icon--warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-card__icon--warning svg {
    stroke: var(--warning);
}

/* Conteúdo textual do stat card */
.stat-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--muted);
    font-weight: 500;
}

.stat-card__value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.1;
}

.stat-card__value-secondary {
    font-size: var(--font-size-sm);
    color: var(--muted);
    font-weight: 400;
}

/* Badge opcional de tendência */
.stat-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-top: 0.25rem;
    width: fit-content;
}

.stat-card__trend--up {
    background-color: var(--success-light);
    color: #065F46;
}

.stat-card__trend--down {
    background-color: var(--danger-light);
    color: #991B1B;
}

/* ============================================
   EMPTY STATE (Estado vazio nas listas)
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.empty-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    opacity: 0.45;
    /* Centralização consistente independente do tamanho do SVG */
    width: fit-content;
}

.empty-state__text {
    font-size: var(--font-size-sm);
    color: var(--muted);
    margin-bottom: 0;
}

.empty-state__title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

.empty-state__action {
    margin-top: 1rem;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }
.hidden { display: none; }

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1024px) {
    .layout__sidebar {
        transform: translateX(-100%);
    }

    .layout__main {
        margin-left: 0;
    }

    .layout--sidebar-open .layout__sidebar {
        transform: translateX(0);
    }

    .layout--sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .login-layout {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
        max-width: 980px;
        gap: 1rem;
    }

    .login-aside {
        padding: 1rem;
        gap: 0.8rem;
    }

    .login-aside__title {
        max-width: 13ch;
    }

    .login-showcase__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .login-layout {
        grid-template-columns: 1fr;
        max-width: 620px;
    }

    .login-card {
        order: -1;
        max-width: none;
    }

    .login-aside {
        order: 1;
    }
}

@media (max-width: 768px) {
    .login-page::before {
        inset: 0.7rem;
        border-radius: 1.4rem;
    }

    .login-page__grid {
        background-size: 56px 56px;
    }

    .login-aside {
        border-radius: 1.2rem;
        padding: 0.95rem;
    }

    .login-aside::after {
        inset: 0.55rem;
        border-radius: 0.85rem;
    }

    .login-showcase__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .topbar__empresa,
    .topbar__user-info,
    .topbar__brand-text {
        display: none;
    }

    .login-page {
        padding: 0.75rem;
    }

    .login-layout {
        gap: 0.9rem;
    }

    .login-aside {
        padding: 0.9rem;
        gap: 0.75rem;
    }

    .login-aside__pill {
        font-size: 0.68rem;
        letter-spacing: 0.1em;
    }

    .login-aside__title {
        font-size: clamp(1.45rem, 7vw, 1.95rem);
        max-width: 12ch;
    }

    .login-aside__description {
        font-size: 0.86rem;
    }

    .login-showcase__panel {
        padding: 1rem;
    }

    .login-showcase__chart {
        min-height: 88px;
        gap: 0.55rem;
    }

    .login-card {
        border-radius: 1.45rem;
    }

    .login-card__header {
        padding: 1.15rem 1.15rem 0.95rem;
    }

    .login-card__logo-shell {
        width: 64px;
        height: 64px;
        border-radius: 0.9rem;
    }

    .login-card__body {
        padding: 1rem 1.15rem 1.05rem;
    }

    .login-form__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .login-card__footer {
        padding: 0.9rem 1.15rem 1rem;
        font-size: var(--font-size-xs);
    }
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modal-fade-in 150ms ease;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-slide-in 200ms ease;
}

/* Variantes de tamanho */
.modal--sm {
    max-width: 380px;
}

.modal--lg {
    max-width: 720px;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--foreground);
}

.modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background: var(--muted-light);
    color: var(--foreground);
}

.modal__body {
    padding: 1.5rem;
}

.modal__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-slide-in {
    from { transform: translateY(-16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal responsivo: desliza de baixo no mobile */
@media (max-width: 640px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 92vh;
        max-width: 100%;
        animation: modal-slide-up 220ms ease;
    }
}

@keyframes modal-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   EMPRESA CARD (lista de empresas)
   ============================================ */

.empresa-card {
    transition: transform var(--transition), box-shadow var(--transition);
}

.empresa-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Logo circular com imagem */
.empresa-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

/* Logo com iniciais (fallback sem imagem) */
.empresa-logo-initials {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
}

/* Variante grande (detail page) */
.empresa-logo--lg {
    width: 80px;
    height: 80px;
    font-size: var(--font-size-2xl);
}

/* Barra de busca */
.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar .form-input {
    max-width: 360px;
}

@media (max-width: 640px) {
    .search-bar .form-input {
        max-width: 100%;
        width: 100%;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================
   LAYOUT — TOPNAV (substitui sidebar)
   ============================================ */

:root {
    --navbar-height: 56px;
}

/* Redefine layout para coluna (sem sidebar lateral) */
/* !important garante override sobre a regra .layout da linha 109 */
.layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh;
}

.layout__navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--navbar-height);
    z-index: 200;
    /* overflow: visible permite dropdowns ultrapassarem o container */
    overflow: visible;
    flex-shrink: 0;
}

/* Remove herança da sidebar no main */
.layout__main {
    margin-left: 0 !important;
    margin-top: var(--navbar-height);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--navbar-height));
    transition: none;
}


.layout__content {
    flex: 1;
    padding: 1.75rem 2rem;
    animation: page-enter 200ms ease both;
}

/* Oculta sidebar antiga (não está mais no DOM mas garante) */
.layout__sidebar,
.layout__topbar {
    display: none !important;
}

/* ============================================
   NAVBAR HORIZONTAL
   ============================================ */

.navbar {
    /* width: 100% garante que o nav ocupe toda a largura do pai fixed */
    width: 100%;
    height: var(--navbar-height);
    background: linear-gradient(90deg, var(--primary-dark) 0%, #0a2640 100%);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0;
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    /* overflow: visible para os dropdowns não serem cortados */
    overflow: visible;
    box-sizing: border-box;
}

/* Brand */
.navbar__brand {
    flex-shrink: 0;
    margin-right: 2rem;
    padding-right: 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar__brand-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.navbar__logo {
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(2, 12, 24, 0.18);
    transition: box-shadow var(--transition), background-color var(--transition);
}

.navbar__brand-link:hover .navbar__logo {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(2, 12, 24, 0.24);
}

.navbar__logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1.55);
    transform-origin: center 24%;
}

.navbar__brand-text {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* Nav items container */
.navbar__nav {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    gap: 0;
}

/* Item base (link simples ou trigger de dropdown) */
.navbar__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 1.25rem;
    height: var(--navbar-height);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.navbar__item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
}

.navbar__item--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.navbar__item--active:hover {
    color: var(--accent);
}

.navbar__chevron {
    opacity: 0.6;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

/* Grupo com dropdown */
.navbar__group {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Dropdown panel (oculto por padrão, visível no hover/is-open) */
.navbar__panel {
    display: none;
    position: absolute;
    top: calc(var(--navbar-height) - 2px);
    left: 0;
    min-width: 210px;
    background: #0d3459;
    border-top: 2px solid var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    z-index: 300;
    padding: 0.375rem 0;
    animation: dropdown-enter 150ms ease both;
}

@keyframes dropdown-enter {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Abrir com hover no desktop ou classe via JS */
@media (min-width: 1025px) {
    .navbar__group:hover .navbar__panel {
        display: block;
    }

    .navbar__group:hover .navbar__item--trigger {
        color: white;
        background: rgba(255, 255, 255, 0.07);
    }

    .navbar__group:hover .navbar__chevron {
        transform: rotate(180deg);
        opacity: 1;
    }
}

.navbar__group.is-open .navbar__panel {
    display: block;
}

.navbar__group.is-open .navbar__chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Item dentro do dropdown panel */
.navbar__panel-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6875rem 1.25rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8375rem;
    font-weight: 450;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar__panel-item:hover {
    background: rgba(255, 255, 255, 0.09);
    color: white;
    text-decoration: none;
}

.navbar__panel-item--active {
    color: var(--accent);
    background: rgba(94, 230, 166, 0.1);
}

.navbar__panel-item--active:hover {
    color: var(--accent);
}

.navbar__panel-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}

.navbar__panel-item--active .navbar__panel-icon,
.navbar__panel-item:hover .navbar__panel-icon {
    opacity: 1;
}

/* Controles à direita */
.navbar__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Empresa atual */
.navbar__empresa {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    margin-left: 0.25rem;
}

.navbar__empresa-logo {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.navbar__empresa-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar__empresa-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ícone de notificação */
.navbar__icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.navbar__icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 1.5px solid var(--primary-dark);
}

/* Avatar do usuário */
.navbar__user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.3rem 0.5rem 0.3rem 0.375rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background var(--transition-fast);
    position: relative;
}

.navbar__user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.navbar__user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.navbar__user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar__user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* User dropdown */
.navbar__user-dropdown {
    position: fixed;
    top: calc(var(--navbar-height) + 4px);
    right: 1rem;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 400;
    padding: 0.375rem;
    animation: dropdown-enter 150ms ease both;
}

.navbar__user-dropdown.hidden {
    display: none;
}

.navbar__user-drop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--foreground);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.navbar__user-drop-item:hover {
    background: var(--surface);
    color: var(--foreground);
    text-decoration: none;
}

.navbar__user-drop-item svg {
    color: var(--muted);
    flex-shrink: 0;
}

.navbar__user-drop-item--danger {
    color: var(--danger);
}

.navbar__user-drop-item--danger svg {
    color: var(--danger);
}

.navbar__user-drop-item--danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.navbar__user-drop-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* Hamburger mobile */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

.navbar__hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar__hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: all var(--transition-fast);
    transform-origin: center;
}

/* Animação do X ao abrir */
.navbar__hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar__hamburger.is-open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================
   RESPONSIVO — NAVBAR MOBILE (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
    .navbar__hamburger {
        display: flex;
        order: 10;
    }

    .navbar__nav {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: #0B2F4E;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        border-top: 2px solid var(--accent);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        z-index: 199;
        padding: 0.5rem 0 1rem;
    }

    .navbar__nav--open {
        display: flex;
    }

    .navbar__item {
        height: auto;
        padding: 0.875rem 1.5rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        justify-content: space-between;
    }

    .navbar__item--active {
        border-left-color: var(--accent);
        color: var(--accent);
        background: rgba(94, 230, 166, 0.08);
    }

    .navbar__group {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .navbar__panel {
        display: none;
        position: static;
        border-top: none;
        border-left: 3px solid rgba(94, 230, 166, 0.3);
        margin-left: 1.5rem;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .navbar__group.is-open .navbar__panel {
        display: block;
    }

    .navbar__user-info {
        display: none;
    }

    .navbar__empresa-name {
        display: none;
    }

    .navbar__brand-text {
        display: none;
    }
}

/* ============================================================
   SC-CARD — Componente de card com cabeçalho colorido
   Usado em: setores, empresas, indicadores, objetivos
   ============================================================ */
.sc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.sc-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
    transform: translateY(-3px);
}
.sc-card--inativo .sc-card__head {
    filter: grayscale(0.5);
    opacity: 0.75;
}

/* Cabeçalho colorido */
.sc-card__head {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.sc-card__head--purple  { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.sc-card__head--emerald { background: linear-gradient(135deg, #059669, #047857); }
.sc-card__head--blue    { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.sc-card__head--cyan    { background: linear-gradient(135deg, #0891B2, #0E7490); }
.sc-card__head--orange  { background: linear-gradient(135deg, #EA580C, #C2410C); }
.sc-card__head--teal    { background: linear-gradient(135deg, #0D9488, #0F766E); }
.sc-card__head--pink    { background: linear-gradient(135deg, #DB2777, #BE185D); }
.sc-card__head--amber   { background: linear-gradient(135deg, #D97706, #B45309); }
.sc-card__head--slate   { background: linear-gradient(135deg, #475569, #334155); }
.sc-card__head--indigo  { background: linear-gradient(135deg, #4338CA, #3730A3); }
.sc-card__head--primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.sc-card__head--rose    { background: linear-gradient(135deg, #E11D48, #9F1239); }

/* Ícone circular */
.sc-card__icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    transition: background 0.2s;
}
.sc-card:hover .sc-card__icon-wrap { background: rgba(255,255,255,0.28); }

/* Texto do cabeçalho */
.sc-card__meta { flex: 1; min-width: 0; }
.sc-card__name {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-card__company {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.65);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge Ativo/Inativo */
.sc-card__badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.sc-card__badge--on  { background: rgba(255,255,255,0.20); color: #fff; }
.sc-card__badge--off { background: rgba(0,0,0,0.20); color: rgba(255,255,255,0.55); }

/* Corpo */
.sc-card__body { padding: 0.9rem 1.1rem 1rem; flex: 1; }
.sc-card__desc {
    font-size: var(--font-size-sm);
    color: var(--muted);
    min-height: 2.5em;
    margin-bottom: 0.9rem;
    line-height: 1.5;
}
.sc-card__stats     { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.sc-card__stat      { display: flex; flex-direction: column; gap: 2px; }
.sc-card__stat-v    { font-size: var(--font-size-lg); font-weight: 700; color: var(--foreground); line-height: 1; }
.sc-card__stat-l    { font-size: var(--font-size-xs); color: var(--muted); }

/* Rodapé */
.sc-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    gap: 0.5rem;
}
.sc-card__btn-main {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s, gap 0.15s;
}
.sc-card__btn-main:hover { color: var(--primary-dark); gap: 0.55rem; }

.sc-card__icon-actions { display: flex; gap: 0.25rem; }
.sc-card__icon-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.sc-card__icon-btn:hover             { background: var(--border); color: var(--foreground); border-color: transparent; }
.sc-card__icon-btn--danger:hover     { background: #FEE2E2; color: var(--danger); border-color: transparent; }
