/* Novo Shell - utilidades base
   Complementa Bootstrap + EMNG.css. Usa tokens de Temas/EMNG.Temas.css. */

.ns-hover-reveal {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ns-hover-parent:hover .ns-hover-reveal,
.ns-hover-parent:focus-within .ns-hover-reveal,
.ns-hover-reveal:focus-visible {
    opacity: 1;
}

.ns-transition { transition: all 0.15s ease; }

.ns-rounded { border-radius: var(--radius-md); }
.ns-rounded-sm { border-radius: var(--radius); }
.ns-rounded-full { border-radius: var(--radius-full); }

.ns-shadow-sm { box-shadow: var(--shadow-sm); }
.ns-shadow-md { box-shadow: var(--shadow-md); }
.ns-shadow-lg { box-shadow: var(--shadow-lg); }

.ns-surface {
    background: var(--content);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
}

.ns-text { color: var(--text); }
.ns-text-light { color: var(--text-light); }
.ns-text-muted { color: var(--text-muted); }
.ns-text-faint { color: var(--text-faint); }

.ns-fade-in { animation: ns-fade-in 0.2s ease-in; }

@keyframes ns-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ns-scroll-hidden { scrollbar-width: none; }
.ns-scroll-hidden::-webkit-scrollbar { display: none; }

.ns-scroll-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-border) transparent;
}
.ns-scroll-thin::-webkit-scrollbar { width: 4px; }
.ns-scroll-thin::-webkit-scrollbar-track { background: transparent; }
.ns-scroll-thin::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 2px;
}

.ns-clickable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ns-clickable:hover {
    background: var(--primary-10);
    color: var(--primary);
}

/* Novo Shell - Login
 * Pagina standalone (Layout = null). Usa tokens do tema claro e inclui
 * fallback para ambiente isolado. Nao oferece variante dark: login legado
 * tambem e' sempre claro. */

.ns-login-body {
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    color: var(--text, rgb(30, 41, 59));
}

.ns-login-page {
    display: flex;
    width: 100%;
    max-width: 1040px;
    min-height: 520px;
    background: #FFFFFF;
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.12)), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--surface-border, rgb(220, 224, 238));
}

/* Painel esquerdo: arte do Gilmar (img de fundo) + logo SVG sobreposta.
 * border-radius nos cantos esquerdos + overflow:hidden recortam ambas. */
.ns-login-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md, 8px) 0 0 var(--radius-md, 8px);
}

.ns-login-side__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    /* Sem object-fit:cover — Chrome produz mais aliasing nas diagonais com
     * cover (uniform scale + clip) que com o stretch direto (non-uniform mas
     * pixel-aligned). A arte e' geometrica, ~11% de squish vertical e'
     * imperceptivel; vale o ganho de nitidez. */
}

.ns-login-side__logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 360px;
    height: auto;
    pointer-events: none;
}

/* Painel direito: formulario.
 * border-radius nos cantos direitos casa com o card; sem overflow:hidden
 * para permitir que o dropdown de usuarios extrapole o card sem ser cortado. */
.ns-login-form-side {
    width: 460px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem;
    background: #FFFFFF;
    border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
}

.ns-login-form-inner {
    width: 100%;
    max-width: 380px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ns-login-form-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ns-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.ns-login-logo img {
    max-width: 340px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ns-login-title {
    text-align: center;
    margin-bottom: 1.75rem;
}

.ns-login-title h1 {
    font-size: 18px;
    font-weight: 400;
    color: var(--text, rgb(30, 41, 59));
    margin: 0 0 0.2rem;
}

.ns-login-title p {
    font-size: 13px;
    color: var(--text-muted, rgb(100, 116, 139));
    margin: 0;
}

.ns-login-field {
    margin-bottom: 1.25rem;
}

.ns-login-label {
    display: block;
    font-size: 13px;
    color: var(--text-light, rgb(71, 85, 105));
    margin-bottom: 0.35rem;
}

.ns-login-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--surface-border, rgb(220, 224, 238));
    border-radius: var(--radius, 4px);
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ns-login-input-wrap:focus-within {
    border-color: var(--primary, rgb(0, 123, 255));
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.ns-login-input-wrap__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    flex-shrink: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 14px;
}

.ns-login-input-wrap input,
.ns-login-input-wrap select {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.6rem 0.5rem 0.6rem 0;
    font-size: 14px;
    color: var(--text, rgb(30, 41, 59));
    background: transparent;
    width: 100%;
    min-width: 0;
}

.ns-login-input-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 0.5rem;
    cursor: pointer;
}

.ns-login-input-wrap input::placeholder {
    color: var(--text-muted, rgb(100, 116, 139));
}

/* Combobox (select + filtro por digitacao) */
.ns-login-select-wrap {
    position: relative;
}

.ns-login-select-display {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid var(--surface-border, rgb(220, 224, 238));
    border-radius: var(--radius, 4px);
    background: #FFFFFF;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ns-login-select-display:focus-within {
    border-color: var(--primary, rgb(0, 123, 255));
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.ns-login-select-display .ns-login-input-wrap__icon {
    pointer-events: none;
}

.ns-login-select-display input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.6rem 0.5rem 0.6rem 0;
    font-size: 14px;
    color: var(--text, rgb(30, 41, 59));
    background: transparent;
    min-width: 0;
}

.ns-login-select-display input::placeholder {
    color: var(--text-muted, rgb(100, 116, 139));
}

.ns-login-select-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    flex-shrink: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 11px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, color 0.2s;
}

.ns-login-select-arrow:hover {
    color: var(--text-light, rgb(71, 85, 105));
}

.ns-login-select-wrap.is-open .ns-login-select-arrow {
    transform: rotate(180deg);
}

.ns-login-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid var(--surface-border, rgb(220, 224, 238));
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    z-index: 10;
    max-height: 290px;
    overflow-y: auto;
    display: none;
    padding: 4px;
}

.ns-login-select-wrap.is-open .ns-login-select-options {
    display: block;
}

.ns-login-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text, rgb(30, 41, 59));
    cursor: pointer;
    transition: background 0.1s;
    border-radius: var(--radius, 4px);
}

.ns-login-select-option:hover,
.ns-login-select-option.is-highlighted {
    background: var(--primary-10, rgb(229, 242, 255));
    color: var(--primary, rgb(0, 123, 255));
}

.ns-login-select-option__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-10, rgb(229, 242, 255));
    color: var(--primary, rgb(0, 123, 255));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    transition: background 0.1s, color 0.1s;
}

.ns-login-select-option:hover .ns-login-select-option__avatar,
.ns-login-select-option.is-highlighted .ns-login-select-option__avatar {
    background: var(--primary, rgb(0, 123, 255));
    color: #FFFFFF;
}

.ns-login-select-option__name {
    font-size: 15px;
    line-height: 1.2;
}

.ns-login-select-empty {
    padding: 0.875rem;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted, rgb(100, 116, 139));
}

.ns-login-input-wrap__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    flex-shrink: 0;
    color: var(--text-muted, rgb(100, 116, 139));
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.ns-login-input-wrap__toggle:hover {
    color: var(--text-light, rgb(71, 85, 105));
}

.ns-login-input-wrap.is-invalid {
    border-color: var(--danger, rgb(220, 53, 69));
    animation: ns-login-shake 0.4s ease;
}

.ns-login-btn,
.ns-login-btn:focus,
.ns-login-btn:active {
    width: 100%;
    padding: 0.75rem;
    font-size: 14px;
    color: #FFFFFF;
    background: var(--primary, rgb(0, 123, 255));
    border: none;
    border-radius: var(--radius, 4px);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    transition: background 0.2s, box-shadow 0.25s, transform 0.15s;
}

.ns-login-btn__text,
.ns-login-btn__text i {
    color: #FFFFFF;
}

.ns-login-btn__text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 14px;
}

.ns-login-btn__text i {
    font-size: 14px;
    transition: transform 0.25s;
}

.ns-login-btn:hover {
    background: var(--primary-dark, rgb(0, 102, 255));
    box-shadow: 0 8px 18px rgba(0, 123, 255, 0.32);
    transform: translateY(-1px);
}

.ns-login-btn:hover .ns-login-btn__text i {
    transform: translateX(3px);
}

.ns-login-btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

.ns-login-btn[disabled] {
    opacity: 0.8;
    cursor: progress;
}

.ns-login-btn.is-loading .ns-login-btn__text {
    visibility: hidden;
}

.ns-login-btn.is-loading .ns-login-btn__spinner {
    display: block;
}

.ns-login-btn__spinner {
    display: none;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: ns-login-spin 0.6s linear infinite;
}

.ns-login-alert {
    display: none;
    padding: 0.55rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 13px;
    border-radius: var(--radius, 4px);
    align-items: flex-start;
    gap: 0.5rem;
}

.ns-login-alert.is-show {
    display: flex;
}

.ns-login-alert--danger {
    color: var(--danger, rgb(220, 53, 69));
    background: var(--danger-10, rgb(251, 234, 236));
    border: 1px solid rgba(220, 53, 69, 0.15);
}

.ns-login-alert--warning {
    color: var(--warning-dark, rgb(204, 153, 0));
    background: var(--warning-10, rgb(253, 247, 230));
    border: 1px solid rgba(230, 172, 0, 0.2);
}

.ns-login-alert__body {
    flex: 1;
}

.ns-login-alert__title {
    font-weight: 500;
    display: block;
    margin-bottom: 0.15rem;
}

.ns-login-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding-top: 1.5rem;
}

.ns-login-footer-brand img {
    max-width: 220px;
    height: auto;
}

.ns-login-version {
    font-size: 10px;
    color: var(--text-muted, rgb(100, 116, 139));
    padding-top: 5px;
}

@keyframes ns-login-spin {
    to { transform: rotate(360deg); }
}

@keyframes ns-login-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@media (max-width: 960px) {
    .ns-login-body { padding: 1rem; }
    .ns-login-page { max-width: 480px; min-height: 0; }
    .ns-login-side { display: none; }
    .ns-login-form-side { width: 100%; }
}

@media (max-width: 480px) {
    .ns-login-body { padding: 0; }
    .ns-login-page { border-radius: 0; min-height: 100vh; box-shadow: none; border: none; }
    .ns-login-form-side { padding: 2rem 1.5rem; }
    .ns-login-form-inner { max-width: 100%; }
}

/* Novo Shell - Menu (icon bar + slide panel + config panel)
 *
 * Reestiliza os IDs/classes existentes do _MenuHome preservando toda a
 * interacao JS (alterneMenu, abraSubmodulo, preenchaListaSubmodulos,
 * botao-submodulo-ativo, etc). DOM e nomes de classes dinamicas geradas
 * em JS nao podem mudar — aqui so trocamos visual/tokens. */

/* =============================================================
   ICON BAR (72px)
   ============================================================= */
#menu-modulos {
    height: 100vh;
    width: 72px;
    overflow-y: auto;
    overflow-x: hidden;
    position: absolute;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-active) 100%);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
    padding-top: 14px;
    padding-bottom: 14px;
    z-index: 10;
}

#menu-modulos .separador-menu {
    opacity: 1;
    border: 0;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.16);
    margin-left: 14px;
    margin-right: 14px;
}

#menu-modulos .nav-item + .nav-item {
    margin-top: 4px;
}

/* =============================================================
   BOTOES DE MODULO (.botao-modulo)
   ============================================================= */
#menu-modulos .botao-modulo,
#menu-modulos .botao-modulo:focus,
#menu-modulos .botao-modulo:focus-visible {
    border-radius: 10px !important;
    font-size: 20px;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    color: var(--sidebar-text, rgba(255, 255, 255, 0.75)) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    position: relative;
    transition: background-color 0.18s, color 0.18s;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#menu-modulos .botao-modulo i {
    color: inherit !important;
    display: block;
    line-height: 1;
}

#menu-modulos .botao-modulo:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
}

#menu-modulos .botao-modulo:hover i {
    color: #FFFFFF !important;
}

#menu-modulos .botao-modulo.active,
#menu-modulos .botao-modulo.active:hover,
#menu-modulos .botao-modulo.active:focus {
    background: #FFFFFF !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.12)) !important;
}

#menu-modulos .botao-modulo.active i {
    color: var(--primary) !important;
}

/* =============================================================
   BOTAO EXPANDIR / RECOLHER
   ============================================================= */
#botao-expandir-menu {
    background: var(--primary) !important;
    position: absolute;
    width: 28px;
    height: 28px;
    left: 73px;
    top: 20px;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border: 2px solid #FFFFFF;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.15));
    transition: background-color 0.18s, transform 0.18s;
}

#botao-expandir-menu:hover {
    background: var(--primary-dark) !important;
    transform: scale(1.05);
}

#botao-expandir-menu i {
    font-size: 14px;
    font-weight: 500 !important;
    color: #FFFFFF;
}

/* =============================================================
   SLIDE PANEL (submodulos, 320px)
   ============================================================= */
#menu-submodulos {
    height: 100vh;
    left: 72px;
    position: absolute;
    width: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 99;
    background-color: var(--content) !important;
    border-right: 1px solid var(--surface-border, rgb(220, 224, 238));
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
    padding: 20px !important;
}

#menu-submodulos *:not(i) {
    color: var(--text, rgb(30, 41, 59));
    font-family: inherit !important;
}

#menu-submodulos i {
    color: var(--text-light, rgb(71, 85, 105));
}

#menu-submodulos .separador-menu {
    opacity: 1;
    border: 0;
    height: 1px;
    background-color: var(--surface-border, rgb(220, 224, 238));
    margin-top: 0.85rem !important;
}

#titulo-modulo {
    font-size: 17px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: left;
    margin: 0 !important;
    padding: 6px 0 !important;
    color: var(--text, rgb(30, 41, 59)) !important;
    transition: color 0.15s;
}

#titulo-modulo:hover {
    color: var(--primary) !important;
}

#caminho-modulo {
    display: block;
    font-size: 12px;
    font-weight: 500 !important;
    color: var(--text-muted, rgb(100, 116, 139));
    line-height: 1.4;
}

#caminho-modulo .link-menu,
#caminho-modulo .link-menu:hover,
#caminho-modulo .link-menu:focus,
#caminho-modulo .link-menu:active,
#caminho-modulo .link-menu.active,
#caminho-modulo .link-menu:focus-visible {
    font-size: 12px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    text-align: left;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: color 0.15s;
}

#caminho-modulo .link-menu {
    color: var(--text-muted, rgb(100, 116, 139)) !important;
}

#caminho-modulo .link-menu:hover {
    color: var(--primary) !important;
}

#caminho-modulo .link-menu.botao-submodulo-ativo {
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* =============================================================
   BUSCA (.pesquisa-modulos + .input-pesquisa-modulos)
   ============================================================= */
.pesquisa-modulos {
    display: flex !important;
    align-items: center;
    position: relative;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.pesquisa-modulos i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    font-size: 13px !important;
    color: var(--text-muted, rgb(100, 116, 139));
    pointer-events: none;
    z-index: 1;
}

.input-pesquisa-modulos {
    background: #FFFFFF !important;
    border: 1px solid var(--surface-border, rgb(220, 224, 238)) !important;
    border-radius: var(--radius-md, 8px) !important;
    box-sizing: border-box;
    font-size: 13px !important;
    font-weight: 400 !important;
    padding: 9px 12px 9px 34px !important;
    color: var(--text, rgb(30, 41, 59)) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    margin: 0 !important;
}

.input-pesquisa-modulos:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

/* =============================================================
   LISTA DE SUBMODULOS (.botao-submodulo)
   ============================================================= */
#lista-submodulos {
    margin-top: 0 !important;
    padding-left: 0 !important;
    list-style: none;
}

#lista-submodulos .nav-item {
    margin-bottom: 4px;
}

.botao-submodulo {
    background: #FFFFFF !important;
    border: 1px solid var(--surface-border, rgb(220, 224, 238)) !important;
    border-radius: var(--radius-md, 8px) !important;
    box-sizing: border-box;
    min-height: 48px;
    text-align: left;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    position: relative;
}

.botao-submodulo:hover {
    background: var(--primary-10, rgb(229, 242, 255)) !important;
    border-color: var(--primary-20, rgb(204, 229, 255)) !important;
}

.botao-submodulo:hover,
.botao-submodulo:hover span,
.botao-submodulo:hover i {
    color: var(--primary) !important;
}

.botao-submodulo i {
    font-size: 18px !important;
}

.botao-submodulo-ativo,
.botao-submodulo-ativo span,
.botao-submodulo-ativo i {
    color: var(--primary) !important;
}

.botao-submodulo-ativo {
    background: var(--primary-10, rgb(229, 242, 255)) !important;
    border-color: var(--primary) !important;
}

.texto-botao-submodulo {
    font-size: 13px !important;
    font-style: normal;
    font-weight: 500 !important;
    line-height: 16px;
    color: var(--text, rgb(30, 41, 59));
}

.col-icone-modulo {
    width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.col-texto-modulo {
    flex: 1;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    padding-left: 6px;
}

.col-abrir-modulo {
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.col-abrir-modulo i {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-muted, rgb(100, 116, 139)) !important;
}

.botao-submodulo:hover .col-abrir-modulo i {
    color: var(--primary) !important;
}

.botao-submodulo .row {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    width: 100%;
}

/* =============================================================
   SCROLLBAR DENTRO DOS PAINEIS
   ============================================================= */
#menu-submodulos::-webkit-scrollbar,
#menu-configuracoes::-webkit-scrollbar {
    width: 8px;
}

#menu-submodulos::-webkit-scrollbar-thumb,
#menu-configuracoes::-webkit-scrollbar-thumb {
    background-color: var(--surface-border, rgb(220, 224, 238));
    border-radius: var(--radius-full, 9999px);
}

#menu-submodulos::-webkit-scrollbar-thumb:hover,
#menu-configuracoes::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-faint, rgb(203, 213, 225));
}

/* =============================================================
   CONFIG PANEL (500px)
   ============================================================= */
#menu-configuracoes {
    height: 100vh;
    left: 72px;
    position: absolute;
    width: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    background-color: var(--content) !important;
    border-right: 1px solid var(--surface-border, rgb(220, 224, 238));
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
    padding: 24px !important;
}

#menu-configuracoes *:not(i) {
    color: var(--text, rgb(30, 41, 59));
    font-family: inherit !important;
}

#menu-configuracoes input {
    background: #FFFFFF !important;
    border: 1px solid var(--surface-border, rgb(220, 224, 238)) !important;
    border-radius: var(--radius, 4px) !important;
    font-size: 13px;
    padding: 8px 12px !important;
    color: var(--text, rgb(30, 41, 59)) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#menu-configuracoes input:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

#menu-configuracoes input[readonly] {
    background: var(--secondary-50, rgb(237, 239, 246)) !important;
    color: var(--text-light, rgb(71, 85, 105)) !important;
    cursor: default;
}

.titulo-configuracoes {
    display: block;
    font-weight: 600 !important;
    font-size: 20px;
    line-height: 24px;
    padding: 4px 0 14px !important;
    color: var(--text, rgb(30, 41, 59)) !important;
}

.subtitulo-configuracoes {
    display: block;
    font-weight: 600 !important;
    font-size: 14px;
    line-height: 18px;
    padding: 8px 0 6px !important;
    color: var(--text, rgb(30, 41, 59)) !important;
    letter-spacing: 0.01em;
}

.separador-configuracoes {
    opacity: 1;
    border: 0;
    height: 1px;
    background-color: var(--surface-border, rgb(220, 224, 238));
    margin: 0.75rem 0 !important;
}

.subsubtitulo-configuracoes {
    display: block;
    font-weight: 500 !important;
    font-size: 13px;
    line-height: 16px;
    padding: 4px 0 !important;
    color: var(--text, rgb(30, 41, 59)) !important;
}

.texto-configuracoes {
    display: block;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-muted, rgb(100, 116, 139)) !important;
}

.menu-configuracoes-radio {
    width: 200px;
    height: 34px;
}

.menu-configuracoes-radio .btn-outline-primary {
    font-size: 12px !important;
    padding: 6px 10px !important;
}

.menu-configuracoes-icone {
    background: var(--secondary-50, rgb(237, 239, 246)) !important;
    border-radius: var(--radius, 4px) !important;
    width: 32px;
    height: 32px;
    margin: 3px 2px;
    padding: 0 !important;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: var(--text-light, rgb(71, 85, 105)) !important;
    transition: background-color 0.15s, color 0.15s;
}

.menu-configuracoes-icone:hover {
    background: var(--primary-10, rgb(229, 242, 255)) !important;
    color: var(--primary) !important;
}

.menu-configuracoes-icone i {
    font-size: 15px;
}

.menu-configuracoes-link-senha {
    font-size: 12px;
    line-height: 14px;
    text-decoration: none !important;
    color: var(--primary) !important;
    cursor: pointer;
    text-align: right;
    margin-top: -46px;
    transition: opacity 0.15s;
}

.menu-configuracoes-link-senha:hover {
    opacity: 0.75;
    text-decoration: underline !important;
}

/* =============================================================
   MOBILE BAR (#menu-mobile)
   ============================================================= */
#menu-mobile {
    width: 100vw;
    height: 60px;
    background: linear-gradient(90deg, var(--sidebar) 0%, var(--sidebar-active) 100%);
    display: none;
    align-items: center;
    padding: 0 8px;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
}

#menu-mobile .btn {
    overflow: hidden;
    white-space: nowrap;
}

#menu-mobile .btn,
#menu-mobile .btn * {
    color: #FFFFFF !important;
}

@media only screen and (max-width: 600px) {
    #menu-mobile {
        display: flex !important;
    }

    #menu-modulos {
        display: none !important;
    }
}

/* =============================================================
   DARK MODE (herda tokens do .theme-dark)
   ============================================================= */
.theme-dark #menu-submodulos,
.theme-dark #menu-configuracoes {
    background-color: var(--content) !important;
}

.theme-dark .botao-submodulo {
    background: var(--content) !important;
    border-color: var(--surface-border) !important;
}

.theme-dark .input-pesquisa-modulos {
    background: var(--content) !important;
    color: var(--text, rgb(226, 232, 240)) !important;
}

.theme-dark #menu-configuracoes input {
    background: var(--content) !important;
    color: var(--text, rgb(226, 232, 240)) !important;
}

.theme-dark #menu-configuracoes input[readonly] {
    background: var(--body) !important;
}

/* Novo Shell - Cards (Aviso e Favorito) */

/* ===== CARD AVISO ===== */
.ns-card-aviso {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--content);
    border: 1px solid var(--surface-border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    position: relative;
}

.ns-card-aviso + .ns-card-aviso { margin-top: 8px; }

.ns-card-aviso__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-10);
    color: var(--primary);
    font-size: 14px;
}

.ns-card-aviso__body { flex: 1; min-width: 0; }

.ns-card-aviso__titulo {
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
}

.ns-card-aviso__descricao {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.4;
}

.ns-card-aviso__data {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.ns-card-aviso__acoes {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.ns-card-aviso__acao {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.ns-card-aviso__acao:hover {
    background: var(--primary-10);
    color: var(--primary);
}

.ns-card-aviso--info { border-left-color: var(--info); }
.ns-card-aviso--info .ns-card-aviso__icon { background: var(--info-10); color: var(--info); }

.ns-card-aviso--success { border-left-color: var(--success); }
.ns-card-aviso--success .ns-card-aviso__icon { background: var(--success-10); color: var(--success); }

.ns-card-aviso--warning { border-left-color: var(--warning); }
.ns-card-aviso--warning .ns-card-aviso__icon { background: var(--warning-10); color: var(--warning-dark); }

.ns-card-aviso--danger { border-left-color: var(--danger); }
.ns-card-aviso--danger .ns-card-aviso__icon { background: var(--danger-10); color: var(--danger); }

/* ===== CARD FAVORITO ===== */
.ns-card-favorito {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--content);
    border: 1px solid var(--surface-border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    position: relative;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ns-card-favorito + .ns-card-favorito { margin-top: 8px; }

.ns-card-favorito:hover {
    box-shadow: var(--shadow-sm);
    background: var(--secondary-50);
}

.ns-card-favorito__link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.ns-card-favorito__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-10);
    color: var(--primary);
    font-size: 15px;
}

.ns-card-favorito__body { flex: 1; min-width: 0; }

.ns-card-favorito__titulo {
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-card-favorito__subtitulo {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-card-favorito__remover {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ns-card-favorito__remover:hover {
    background: var(--danger-10);
    color: var(--danger);
}

.ns-card-favorito--success { border-left-color: var(--success); }
.ns-card-favorito--success .ns-card-favorito__icon { background: var(--success-10); color: var(--success); }

.ns-card-favorito--warning { border-left-color: var(--warning); }
.ns-card-favorito--warning .ns-card-favorito__icon { background: var(--warning-10); color: var(--warning-dark); }

.ns-card-favorito--danger { border-left-color: var(--danger); }
.ns-card-favorito--danger .ns-card-favorito__icon { background: var(--danger-10); color: var(--danger); }

.ns-card-favorito--info { border-left-color: var(--info); }
.ns-card-favorito--info .ns-card-favorito__icon { background: var(--info-10); color: var(--info); }

.ns-card-favorito--violet { border-left-color: var(--violet); }
.ns-card-favorito--violet .ns-card-favorito__icon { background: var(--violet-10); color: var(--violet); }

.ns-card-favorito--purple { border-left-color: var(--purple); }
.ns-card-favorito--purple .ns-card-favorito__icon { background: var(--purple-10); color: var(--purple); }

/* Novo Shell - Collapse */

.ns-collapse-section { display: block; }

.ns-collapse__header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.ns-collapse__header:hover { background: var(--secondary-50); }

.ns-collapse__titulo {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.ns-collapse__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.ns-collapse__chevron {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ns-collapse__header[aria-expanded="false"] .ns-collapse__chevron {
    transform: rotate(-90deg);
}

.ns-collapse__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.ns-collapse__body.ns-collapse-open { max-height: 2000px; }

.ns-collapse__body-inner { padding: 8px 4px 4px; }

/* Novo Shell - Paginacao */

.ns-pagina-controles {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--surface-border);
}

.ns-pagina-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
    background: var(--content);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ns-pagina-btn:hover:not(:disabled) {
    background: var(--primary-10);
    color: var(--primary);
    border-color: var(--primary);
}

.ns-pagina-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ns-pagina-info {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

/* Novo Shell - Tabs */

.ns-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 12px;
}

.ns-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    margin-bottom: -1px;
}

.ns-tab:hover { color: var(--text); }

.ns-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.ns-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--secondary-70);
    color: var(--text-muted);
    font-size: 11px;
}

.ns-tab-active .ns-tab__badge {
    background: var(--primary-10);
    color: var(--primary);
}

