/**
 * SGDoc — estilos globais extraídos das telas HTML de referência
 * (daschboad_main.html, listagem_processo.html, departamentos.html, …)
 */

html.light {
    color-scheme: light;
}

body.sgdoc-app {
    font-family: 'Public Sans', system-ui, sans-serif;
    background-color: #f0f4f9; /* surface-container-low — listagem_processo */
    min-height: max(884px, 100dvh);
    -webkit-font-smoothing: antialiased;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/**
 * Bootstrap 5 Reboot: todos os <a> ficam com text-decoration: underline.
 * Isso desenha uma barra por baixo dos glifos Material Symbols (ícones como texto),
 * visível nos botões «Novo Processo», «Exportar», links do header, etc.
 * Remover o sublinhado por defeito; usar utilities Tailwind (hover:underline, underline)
 * onde se quiser sublinhado.
 */
body.sgdoc-app a {
    text-decoration: none;
}

/**
 * Lateral (aside): Bootstrap 5 Reboot sublinha todos os links e colore como âncora.
 * As telas de referência (daschboad_main.html) não têm sublinhado — reset à medida.
 */
body.sgdoc-app aside {
    --bs-link-color: inherit;
    --bs-link-hover-color: inherit;
    --bs-link-decoration: none;
    --bs-link-hover-decoration: none;
}

body.sgdoc-app aside a {
    text-decoration: none !important;
}

body.sgdoc-app aside .material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased;
}

/**
 * Botões padronizados SGDoc (Stitch / Material)
 * Uso: class="sgdoc-btn sgdoc-btn--primary" | --secondary | --neutral | --ghost | --danger | --inverse
 * Tamanhos: sgdoc-btn--sm | (default) | sgdoc-btn--lg
 * Ícone só: sgdoc-btn--icon (+ ghost ou neutral)
 * Largura total: sgdoc-btn--block
 */
.sgdoc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

button.sgdoc-btn {
    font: inherit;
}

.sgdoc-btn:focus-visible {
    outline: 2px solid #0041a2;
    outline-offset: 2px;
}

.sgdoc-btn:disabled,
.sgdoc-btn[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ícones ghost em tabelas: sem meia-transparência extra (senão ícones claros somem) */
.sgdoc-btn.sgdoc-btn--ghost.sgdoc-btn--icon:disabled,
.sgdoc-btn.sgdoc-btn--ghost.sgdoc-btn--icon[aria-disabled='true'] {
    opacity: 1;
}

/* Primário — acções principais */
.sgdoc-btn--primary {
    background-color: #0041a2;
    color: #ffffff;
    border-color: #0041a2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.sgdoc-btn--primary:hover:not(:disabled) {
    background-color: #0856cf;
    border-color: #0856cf;
}

.sgdoc-btn--primary:active:not(:disabled) {
    opacity: 0.92;
}

/* Secundário — contorno (cancelar, exportar relatório, outline) */
.sgdoc-btn--secondary {
    background-color: #ffffff;
    color: #171c20;
    border-color: #c3c6d6;
}

.sgdoc-btn--secondary:hover:not(:disabled) {
    background-color: #eaeef3;
    border-color: #aeb2c5;
}

/* Superfície + texto primário (exportar PDF/CSV, acções em barra) */
.sgdoc-btn--soft {
    background-color: #eaeef3;
    color: #0041a2;
    border-color: #c3c6d6;
}

.sgdoc-btn--soft:hover:not(:disabled) {
    background-color: #dfe3e8;
    border-color: #aeb2c5;
}

/* Neutro — filtros, acções secundárias em barra */
.sgdoc-btn--neutral {
    background-color: #f1f5f9;
    color: #334155;
    border-color: transparent;
}

.sgdoc-btn--neutral:hover:not(:disabled) {
    background-color: #e2e8f0;
}

/* Fantasma — ícones em tabela, ajuda */
.sgdoc-btn--ghost {
    background-color: transparent;
    color: #565e74;
    border-color: transparent;
}

.sgdoc-btn--ghost:hover:not(:disabled) {
    background-color: #eaeef3;
    color: #171c20;
}

/* Sobre fundo escuro (pré-visualização, hero) */
.sgdoc-btn--glass {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: transparent;
    backdrop-filter: blur(8px);
}

.sgdoc-btn--glass:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Perigo — remover / texto destrutivo */
.sgdoc-btn--danger {
    background-color: transparent;
    color: #ba1a1a;
    border-color: transparent;
}

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

/* Link textual — ver, ver todos */
.sgdoc-btn--link {
    background: transparent;
    border-color: transparent;
    color: #0041a2;
    padding: 0.375rem 0.5rem;
    box-shadow: none;
}

.sgdoc-btn--link:hover:not(:disabled) {
    background-color: rgba(0, 65, 162, 0.08);
}

/* Sobre fundo escuro / cartão primário */
.sgdoc-btn--inverse {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
    font-weight: 700;
}

.sgdoc-btn--inverse:hover:not(:disabled) {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
}

/* Pequeno — pills, linhas de tabela */
.sgdoc-btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.6875rem;
    border-radius: 0.375rem;
}

.sgdoc-btn--lg {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
}

/* Apenas ícone */
.sgdoc-btn--icon {
    padding: 0.45rem;
    border-radius: 0.375rem;
}

.sgdoc-btn--icon.sgdoc-btn--sm {
    padding: 0.3rem;
}

.sgdoc-btn .material-symbols-outlined {
    font-size: 1.125rem;
    line-height: 1;
}

.sgdoc-btn--sm .material-symbols-outlined {
    font-size: 1rem;
}

.sgdoc-btn--block {
    width: 100%;
}

/* Item de menu (dropdown) — texto normal, alinhado à esquerda */
.sgdoc-btn--menu {
    width: 100%;
    justify-content: flex-start;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: normal;
    padding: 0.5rem 1rem;
}

/* Pill compacto (RECEBER, TAG) */
.sgdoc-btn--pill {
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
}

/* Fallback ícones (trecho opcional de departamentos.html) */
.material-symbols-outlined.sgdoc-ms-fallback {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}
