/* =============================================
   NFS-e Easy: Reset e Tipografia Base
   ============================================= */

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Guarda contra scroll horizontal acidental em telas estreitas (mobile).
   overflow-x: clip (com fallback hidden) NAO cria contexto de rolagem, entao
   preserva o position: sticky do header (.top-bar). overflow-x: hidden quebraria. */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* fallback para navegadores sem suporte a clip */
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: var(--font-size-2xl); font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--font-size-lg); font-weight: 600; }
h4 { font-size: var(--font-size-md); font-weight: 600; }

p {
    margin-bottom: var(--space-3);
    color: var(--color-text-secondary);
}

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

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

a.btn:hover, a.btn-primary:hover, a.btn-secondary:hover, a.btn-danger:hover, a.btn-success:hover {
    color: #ffffff !important;
}

img {
    max-width: 100%;
    height: auto;
}

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

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

code, pre, .mono {
    font-family: var(--font-mono);
}

::selection {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
