/* ════════════════════════════════════════════════════════════
   Almoxarifado TsTeck — Design System
   Identidade da lousa (vermelho #9b1006, Inter auto-hospedada,
   estética "precision/enterprise") com caráter industrial de
   almoxarifado: faixas de sinalização, códigos em mono, folha
   A4254 em miniatura. TEMA CLARO ÚNICO (sem modo escuro).
   Cores oficiais TsTeck: #9b1006 · #9c9c9b · #ffffff.
   ════════════════════════════════════════════════════════════ */

/* ── Inter auto-hospedada (mesmos arquivos da lousa) ───────── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ══ Tokens — TEMA CLARO (único) ══ */
:root {
    /* Só o tema claro existe: trava os widgets nativos do navegador
       (date picker, select, scrollbar) em claro mesmo com o Windows
       em modo escuro. */
    color-scheme: light;

    /* Marca — vermelho oficial #9b1006 */
    --primary: #9b1006;
    --primary-dark: #7a0d05;
    --primary-light: #c41a0e;
    --primary-soft: rgba(155, 16, 6, 0.07);
    --primary-soft-2: rgba(155, 16, 6, 0.14);
    --primary-ring: 0 0 0 3px rgba(155, 16, 6, 0.14);
    --on-primary: #ffffff;

    /* Superfícies — branco oficial #ffffff + neutros do cinza #9c9c9b */
    --bg: #f4f4f4;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --raised: #ffffff;
    --overlay: rgba(28, 28, 28, 0.45);

    /* Bordas (escala neutra derivada do cinza oficial) */
    --border: #e2e2e1;
    --border-subtle: #ededec;
    --border-strong: #c9c9c8;

    /* Texto */
    --text: #1c1c1c;
    --text-2: #565655;
    --text-3: #9c9c9b;          /* cinza oficial TsTeck */

    /* Semânticas */
    --ok: #15803d;
    --ok-soft: rgba(22, 163, 74, 0.10);
    --warn: #b45309;
    --warn-soft: rgba(202, 138, 4, 0.12);
    --err: #dc2626;
    --err-soft: rgba(220, 38, 38, 0.09);
    --info: #1d4ed8;
    --info-soft: rgba(37, 99, 235, 0.10);

    /* Sombra (cinza neutro) */
    --shadow-sm: 0 1px 2px rgba(28, 28, 28, 0.05), 0 1px 3px rgba(28, 28, 28, 0.06);
    --shadow-md: 0 4px 10px -2px rgba(28, 28, 28, 0.08), 0 2px 4px -2px rgba(28, 28, 28, 0.05);
    --shadow-lg: 0 12px 32px -8px rgba(28, 28, 28, 0.16), 0 4px 12px -4px rgba(28, 28, 28, 0.07);
    --shadow-primary: 0 6px 16px -4px rgba(155, 16, 6, 0.35);

    /* Faixa de sinalização (assinatura visual) */
    --hazard: repeating-linear-gradient(-55deg,
        var(--primary) 0 14px, var(--primary-dark) 14px 28px);

    /* Fundo do login: grade técnica sutil */
    --login-grid: rgba(28, 28, 28, 0.045);
    --login-glow: rgba(155, 16, 6, 0.09);

    /* Tipografia */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    --transition-fast: 0.12s ease;
    --transition: 0.18s ease;
    --topbar-h: 60px;

    font-size: 14px;
}

/* A logo (vermelho #9b1006 + cinza) é usada crua, sem filtro:
   qualquer inversão a deixava com a cor errada. */

/* ══ Reset ══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
    min-height: 100%;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background var(--transition), color var(--transition);
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; }

/* O atributo `hidden` precisa vencer as regras de display do autor.
   Sem !important, um seletor de ID como #view-login (1,0,0) ganha de
   [hidden] (0,1,0) e o elemento continua visível — era isso que fazia
   a tela de login não sumir depois do login (e o drawer ficar preso
   na tela, e o botão "Cancelar lista" aparecer em lista cancelada). */
[hidden] { display: none !important; }

::selection { background: var(--primary-soft-2); }

/* ══ Boot splash ══ */
#boot {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
}
.boot-logo { width: 170px; animation: boot-pulse 1.2s ease-in-out infinite; }
@keyframes boot-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

/* ══════════════════ LOGIN ══════════════════ */
#view-login {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    overflow: hidden;
}
.login-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(680px 420px at 50% -10%, var(--login-glow), transparent 70%),
        linear-gradient(var(--login-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--login-grid) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
}
.login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 0 36px 30px;
    overflow: hidden;
    animation: card-entra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-entra {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
.hazard-strip {
    height: 7px;
    margin: 0 -36px 30px;
    background: var(--hazard);
}
.login-logo { width: 168px; margin: 0 auto 20px; }
.login-titulo {
    text-align: center;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
}
.login-sub {
    text-align: center;
    color: var(--text-2);
    margin: 6px 0 26px;
    font-size: 0.92rem;
}
.campo { display: block; margin-bottom: 16px; }
.campo span {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-2);
    margin-bottom: 6px;
}
.campo input, .filtro input, .filtro select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.campo input::placeholder, .filtro input::placeholder { color: var(--text-3); }
.campo input:focus, .filtro input:focus, .filtro select:focus,
.qtd-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--primary-ring);
    background: var(--surface);
}
.form-erro {
    background: var(--err-soft);
    color: var(--err);
    border: 1px solid color-mix(in srgb, var(--err) 30%, transparent);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 0.88rem;
    margin-bottom: 14px;
}
.login-rodape {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-3);
}

/* ══ Botões ══ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast),
                transform var(--transition-fast);
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; padding: 11px 16px; }
.btn-mini { padding: 5px 11px; font-size: 0.84rem; }

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }

.btn-contorno {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.btn-contorno:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-fantasma { color: var(--text-2); }
.btn-fantasma:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); border-radius: var(--radius); }

.btn-perigo {
    background: transparent;
    border-color: color-mix(in srgb, var(--err) 45%, transparent);
    color: var(--err);
}
.btn-perigo:hover:not(:disabled) { background: var(--err); border-color: var(--err); color: #fff; }

.btn-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius);
    color: var(--text-2);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-icone:hover { color: var(--primary); background: var(--primary-soft); }

/* ══════════════════ TOPBAR ══════════════════ */
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 28px;
    padding: 0 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.hazard-linha {
    height: 3px;
    background: var(--hazard);
    position: sticky; top: var(--topbar-h); z-index: 50;
    opacity: 0.9;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 30px; width: auto; }
.brand-sep { width: 1px; height: 22px; background: var(--border-strong); }
.brand-nome {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 0.86rem;
    color: var(--text-2);
}

.tabs { display: flex; gap: 4px; margin-right: auto; }
.tab {
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--text-2);
    transition: color var(--transition-fast), background var(--transition-fast);
    display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab.active::after {
    content: '';
    position: absolute; left: 12px; right: 12px; bottom: -2px;
    height: 2px; border-radius: 2px;
    background: var(--primary);
}
.badge-contagem {
    min-width: 19px; height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
}

.topbar-acoes { display: flex; align-items: center; gap: 14px; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 6px 4px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-2);
}
.user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.74rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.user-nome { font-size: 0.88rem; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════ CONTEÚDO / TELAS ══════════════════ */
.conteudo { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }
.screen { display: none; animation: screen-entra 0.22s ease both; }
.screen.active { display: block; }
@keyframes screen-entra {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.screen-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 18px;
}
.screen-head h2 { font-size: 1.35rem; }
.screen-sub { color: var(--text-2); font-size: 0.88rem; margin-top: 3px; }

/* ── Filtros ── */
.filtros {
    display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.filtro { display: flex; flex-direction: column; gap: 5px; }
.filtro > span {
    font-size: 0.74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-3);
}
.filtro select { min-width: 120px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.filtro input { padding: 8px 10px; }
.filtro input[type="date"] { min-width: 140px; }
.filtro-busca { flex: 1 1 220px; }
.filtro-nota { color: var(--text-3); font-size: 0.84rem; padding-bottom: 9px; }

/* ── Tabelas ── */
.tabela-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.tabela-wrap-plana { border: none; box-shadow: none; border-radius: 0; background: transparent; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabela th {
    text-align: left;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.tabela td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr { transition: background var(--transition-fast); }
.linha-clicavel { cursor: pointer; }
.linha-clicavel:hover { background: var(--primary-soft); }
.linha-cancelada td { opacity: 0.55; }
.col-num { text-align: right; }
td.col-num { font-family: var(--font-mono); font-size: 0.86rem; }
.col-acao { width: 1%; }
.col-qtd { width: 110px; }

.codigo-mono {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.texto-suave { color: var(--text-3); }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-entrada { background: var(--ok-soft); color: var(--ok); }
.badge-saida { background: var(--primary-soft-2); color: var(--primary); }
.badge-ativa { background: var(--info-soft); color: var(--info); }
.badge-cancelada { background: var(--warn-soft); color: var(--warn); }
.badge-tipo-prod { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-tipo-prod::before { display: none; }
.badge-impressas { background: var(--primary-soft); color: var(--primary); font-family: var(--font-mono); }
.badge-impressas::before { display: none; }

/* Armazém editável (endereço na prateleira: A1, B99) */
.col-armazem { width: 96px; }
.col-etiquetas { width: 92px; }
.txt-fraco { color: var(--text-3); }
.input-armazem {
    width: 72px;
    padding: 5px 8px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    color: var(--text);
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), background var(--transition-fast),
                box-shadow var(--transition-fast);
}
.input-armazem::placeholder { color: var(--text-3); font-weight: 400; }
.input-armazem:hover:not(:disabled) { border-color: var(--primary); background: var(--surface); }
.input-armazem:focus {
    outline: none;
    background: var(--surface);
    border-style: solid;
    border-color: var(--primary);
    box-shadow: var(--primary-ring);
}
.input-armazem:disabled { opacity: 0.5; cursor: progress; }

/* Estados vazios / loading */
.estado-vazio {
    text-align: center;
    padding: 54px 20px;
    color: var(--text-2);
}
.vazio-icone { font-size: 2rem; color: var(--text-3); margin-bottom: 10px; }
.vazio-sub { font-size: 0.84rem; color: var(--text-3); margin-top: 4px; }
.linha-loading td {
    text-align: center;
    padding: 34px;
    color: var(--text-3);
}
.spinner {
    display: inline-block;
    width: 17px; height: 17px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    vertical-align: -4px;
    margin-right: 9px;
    animation: gira 0.7s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }

/* Paginação */
.paginacao {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 14px;
}
.paginacao-info { color: var(--text-2); font-size: 0.88rem; }
.paginacao-botoes { display: flex; gap: 8px; }

/* ══════════════════ ETIQUETAS ══════════════════ */
.etq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}
.painel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.painel-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    margin-bottom: 12px;
}
.painel-head h3 { font-size: 1rem; }
.painel-nota { font-size: 0.78rem; color: var(--text-3); }

.qtd-input {
    width: 76px;
    text-align: right;
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 9px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-remover {
    color: var(--text-3);
    width: 28px; height: 28px;
    border-radius: var(--radius);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-remover:hover { color: var(--err); background: var(--err-soft); }

/* Mini-folha A4254: 2 colunas × 11 linhas, proporção da A4 */
.folha-a4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    aspect-ratio: 210 / 297;
    max-width: 250px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-subtle);
}
.slot {
    border: 1px dashed var(--border-strong);
    border-radius: 3px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), transform var(--transition-fast);
    cursor: pointer;
    min-height: 0;
}
.slot:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.04); }
.slot-usada {
    background: repeating-linear-gradient(-45deg,
        var(--border-subtle) 0 5px, transparent 5px 10px);
    color: var(--text-3);
    border-style: solid;
}
.slot-inicio {
    background: var(--primary);
    border: 1px solid var(--primary-dark);
    color: var(--on-primary);
    font-weight: 700;
}
.slot-prevista {
    background: var(--primary-soft-2);
    border: 1px solid var(--primary);
    color: var(--primary);
}
.folha-legenda {
    display: flex; justify-content: center; gap: 14px;
    margin-top: 10px;
    font-size: 0.74rem;
    color: var(--text-2);
}
.folha-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.leg { width: 11px; height: 11px; border-radius: 2px; display: inline-block; border: 1px solid var(--border-strong); }
.leg-usada { background: repeating-linear-gradient(-45deg, var(--border-subtle) 0 3px, transparent 3px 6px); }
.leg-inicio { background: var(--primary); border-color: var(--primary-dark); }
.leg-prevista { background: var(--primary-soft-2); border-color: var(--primary); }

.etq-resumo {
    margin: 14px 0;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.55;
}
.etq-resumo strong { color: var(--text); font-family: var(--font-mono); }

/* ══════════════════ DRAWER ══════════════════ */
.overlay {
    position: fixed; inset: 0; z-index: 100;
    background: var(--overlay);
    animation: fade-entra 0.2s ease both;
}
.overlay-modal { z-index: 120; }
@keyframes fade-entra { from { opacity: 0; } to { opacity: 1; } }

.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
    width: min(480px, 96vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: drawer-entra 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes drawer-entra {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.drawer-titulo-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-head h3 { font-size: 1.05rem; }
.drawer-corpo { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-rodape {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.drawer-rodape .btn:only-child { margin-left: auto; }

.meta-grade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 18px;
}
.meta-item { min-width: 0; }
.meta-item dt {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 2px;
}
.meta-item dd { font-size: 0.92rem; overflow-wrap: break-word; }
.meta-obs { grid-column: 1 / -1; }

.drawer-itens-titulo {
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 8px;
}

/* ══════════════════ MODAL ══════════════════ */
.modal {
    position: fixed; z-index: 130;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw);
    background: var(--raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 22px;
    animation: modal-entra 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes modal-entra {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--text-2); line-height: 1.55; }
.modal-botoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ══════════════════ TOASTS ══════════════════ */
.toasts {
    position: fixed; z-index: 200;
    bottom: 22px; right: 22px;
    display: flex; flex-direction: column; gap: 9px;
    max-width: min(380px, calc(100vw - 44px));
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--raised);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--info);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 11px 14px;
    font-size: 0.9rem;
    animation: toast-entra 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast-ok { border-left-color: var(--ok); }
.toast-erro { border-left-color: var(--err); }
.toast-saindo { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-entra {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}

/* ══════════════════ RESPONSIVO ══════════════════ */
@media (max-width: 1000px) {
    .etq-layout { grid-template-columns: 1fr; }
    .etq-folha { max-width: 430px; }
}
@media (max-width: 860px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
    .hazard-linha { position: static; }
    .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
    .topbar-acoes { margin-left: auto; }
    .brand-nome { display: none; }
    .user-nome { display: none; }
    .conteudo { padding: 18px 12px 50px; }
    .screen-head { flex-direction: column; align-items: stretch; }
    .meta-grade { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
