/* Admin e login: visual corporativo e limpo (carregado só em index.html e login.html, depois do style.css).
   Fundo claro, tipografia Inter, cartões com borda fina, azul sóbrio como acento, sem listras nem sombras duras.
   O style.css continua valendo para a estrutura; aqui só a aparência é sobrescrita. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --a-fundo: #f4f6f9;
    --a-cartao: #ffffff;
    --a-borda: #e3e8ef;
    --a-borda-forte: #cdd5df;
    --a-texto: #1e293b;
    --a-titulo: #0f172a;
    --a-suave: #64748b;
    --a-azul: #1d4ed8;
    --a-azul-claro: #eff4ff;
    --a-anel: rgba(37, 99, 235, .18);
    --a-raio: 8px;
    --a-sombra: 0 1px 2px rgba(16, 24, 40, .05);
    --a-sombra-alta: 0 12px 32px -8px rgba(15, 23, 42, .18);
    --a-fonte: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    /* o style.css usa estas para tipografia de arquibancada; no admin tudo vira Inter */
    --display: var(--a-fonte);
    --texto: var(--a-fonte);
    --celeste: #2563eb;
    --celeste-esc: #1d4ed8;
    --celeste-claro: #eff4ff;
    --preto: #0f172a;
    --gelo: #f8fafc;
    --borda: var(--a-borda);
    --cinza: var(--a-suave);
}

body {
    font-family: var(--a-fonte);
    font-size: 14.5px;
    background: var(--a-fundo);
    color: var(--a-texto);
    -webkit-font-smoothing: antialiased;
}

/* ===== BARRA SUPERIOR ===== */
header {
    background: var(--a-cartao);
    color: var(--a-texto);
    padding: 0 24px;
    border-bottom: 1px solid var(--a-borda);
    position: sticky; top: 0; z-index: 100;
}
header::after { display: none; }
.topo { height: 60px; gap: .8rem; }
.topo img { width: 34px; height: 34px; box-shadow: 0 0 0 1px var(--a-borda); }
.marca { display: flex; align-items: baseline; gap: .6rem; }
.marca h1 {
    font-family: var(--a-fonte); font-size: 1.05rem; font-weight: 700;
    letter-spacing: .02em; text-shadow: none; color: var(--a-titulo);
}
.marca small {
    font-size: .8rem; letter-spacing: 0; text-transform: none; color: var(--a-suave);
    padding-left: .6rem; border-left: 1px solid var(--a-borda);
}
.usuario-box { font-size: .84rem; text-transform: none; letter-spacing: 0; color: var(--a-suave); gap: .6rem; }
.usuario-box strong { color: var(--a-titulo); font-weight: 600; }
.btn-sair, #btn-manual {
    background: var(--a-cartao); color: var(--a-texto);
    border: 1px solid var(--a-borda-forte); border-radius: 6px;
    padding: .38rem .8rem; font-family: var(--a-fonte); font-size: .82rem; font-weight: 500;
    text-transform: none; letter-spacing: 0; cursor: pointer;
}
.btn-sair:hover, #btn-manual:hover { background: var(--gelo); border-color: var(--a-suave); }
.btn-relogio { border: 1px solid var(--a-borda-forte); border-radius: 6px; color: var(--a-suave); width: 36px; height: 34px; background: var(--a-cartao); }
.btn-relogio:hover { background: var(--gelo); }
.btn-relogio svg { width: 19px; height: 19px; }
.btn-relogio.tem { border-color: #f59e0b; color: #b45309; background: #fffbeb; }

/* navegação: abas com sublinhado */
.tabs { margin: 0 auto; gap: .2rem; max-width: 1200px; border-top: 1px solid #f1f4f8; }
.tab-btn {
    font-family: var(--a-fonte); font-size: .88rem; font-weight: 500; letter-spacing: 0;
    background: transparent; color: var(--a-suave);
    clip-path: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    padding: .8rem .85rem .72rem; margin-bottom: -1px;
}
.tab-btn:hover { background: transparent; color: var(--a-titulo); }
.tab-btn.active { background: transparent; color: var(--a-azul); border-bottom-color: var(--a-azul); font-weight: 600; }
@media (min-width: 769px) {
    .tabs { flex-wrap: wrap; row-gap: 0; }
    .tab-btn { font-size: .88rem; padding: .8rem .85rem .72rem; }
}

main { padding: 28px 24px 48px; }

/* ===== TÍTULOS ===== */
h2, .titulo-faixa {
    font-family: var(--a-fonte); font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em;
    background: none; color: var(--a-titulo); padding: 0; border: 0; clip-path: none; display: block;
}
h3 { font-family: var(--a-fonte); font-weight: 600; color: var(--a-titulo); }
.header-actions { margin-bottom: 1.1rem; }
.dica { color: var(--a-suave); font-size: .84rem; line-height: 1.5; }
.dica a, .voltar a { color: var(--a-azul); }

/* ===== BOTÕES ===== */
button { font-family: var(--a-fonte); }
.btn-primary {
    background: var(--a-azul); color: #fff; border: 1px solid var(--a-azul); border-radius: 6px;
    padding: .55rem 1rem; font-size: .86rem; font-weight: 600; text-transform: none; letter-spacing: 0;
    box-shadow: var(--a-sombra); transition: background .15s, border-color .15s;
}
.btn-primary:hover { background: #1e40af; border-color: #1e40af; }
.btn-primary:active { transform: none; box-shadow: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary {
    background: var(--a-cartao); color: var(--a-texto); border: 1px solid var(--a-borda-forte); border-radius: 6px;
    padding: .5rem .95rem; font-size: .86rem; font-weight: 500; text-transform: none; letter-spacing: 0;
}
.btn-secondary:hover { background: var(--gelo); border-color: var(--a-suave); }
.btn-mini, .btn-primary.btn-mini, .btn-secondary.btn-mini { padding: .32rem .65rem; font-size: .8rem; box-shadow: none; }

/* ações das tabelas: botões discretos (excluir neutro, nunca vermelho) */
.actions { gap: .35rem; flex-wrap: wrap; }
.btn-edit, .btn-delete, .btn-view {
    background: var(--a-cartao); border: 1px solid var(--a-borda-forte); border-radius: 6px;
    padding: .3rem .65rem; font-size: .8rem; font-weight: 500; text-transform: none; letter-spacing: 0;
    color: var(--a-texto); box-shadow: none;
}
.btn-edit { color: var(--a-azul); border-color: #c7d7fe; background: var(--a-azul-claro); }
.btn-view { color: var(--a-texto); }
.btn-delete { color: var(--a-suave); }
.btn-edit:hover, .btn-view:hover, .btn-delete:hover { filter: none; border-color: var(--a-suave); color: var(--a-titulo); }
.btn-remove-item { background: var(--a-cartao); color: var(--a-suave); border: 1px solid var(--a-borda-forte); border-radius: 6px; text-transform: none; }
.btn-perigo {
    background: #b42318; color: #fff; border: 1px solid #b42318; border-radius: 6px;
    text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .86rem;
}
.btn-perigo:hover { background: #912018; color: #fff; }

/* ===== TABELAS ===== */
.tabela-wrap, .tabela-leve {
    background: var(--a-cartao); border: 1px solid var(--a-borda); border-radius: 10px;
    box-shadow: var(--a-sombra);
}
th {
    background: #f8fafc; color: var(--a-suave);
    font-family: var(--a-fonte); font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    padding: .7rem .85rem; border-bottom: 1px solid var(--a-borda);
}
td { padding: .7rem .85rem; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: transparent; }
tbody tr:hover { background: #f8fafc; }
td img.thumb { border: 1px solid var(--a-borda); border-radius: 6px; width: 40px; height: 40px; }
.vazio { font-style: normal; color: var(--a-suave); }
.lucro { color: #067647; }

/* ===== MODAIS E DIÁLOGOS ===== */
.modal { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal-content {
    border: 0; border-image: none; border-radius: 12px;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35); padding: 1.6rem 1.7rem;
}
.modal-content h3 { font-family: var(--a-fonte); font-size: 1.15rem; font-weight: 650; letter-spacing: 0; margin-bottom: 1.1rem; }
.close { font-size: 1.5rem; top: .9rem; right: 1.1rem; color: var(--a-suave); }
.dialogo .icone {
    width: 40px; height: 40px; background: #fffaeb; color: #b54708; border: 0;
    font-family: var(--a-fonte); font-size: 1.2rem; font-weight: 700;
}
.dialogo .aviso { background: #fffaeb; border-left: 3px solid #f79009; border-radius: 4px; }

#toast {
    background: var(--a-titulo); border-left: 4px solid #3b82f6; border-radius: 8px;
    box-shadow: var(--a-sombra-alta); font-size: .9rem; padding: .7rem 1.1rem;
}
#toast.erro { border-left-color: #f79009; box-shadow: var(--a-sombra-alta); }

/* ===== FORMULÁRIOS ===== */
label { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 500; color: #334155; }
input, select, textarea {
    font-family: var(--a-fonte); font-size: .9rem; color: var(--a-texto);
    border: 1px solid var(--a-borda-forte); border-radius: 6px; padding: .52rem .65rem;
}
input:focus, select:focus, textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px var(--a-anel); }
input[type=checkbox], input[type=radio] { accent-color: var(--a-azul); }
#imagem-preview img { border: 1px solid var(--a-borda); border-radius: 8px; }
.status-select { border: 1px solid var(--a-borda-forte); border-radius: 6px; font-weight: 500; }

/* ===== STATUS (pílulas) ===== */
.status-badge {
    border-radius: 999px; padding: .16rem .6rem; font-size: .74rem; font-weight: 600;
    text-transform: none; letter-spacing: 0; background: #f1f5f9; color: #334155;
}
.status-emitido { background: #f1f5f9; color: #334155; }
.status-produzindo, .status-aguardando_pagamento { background: #fffaeb; color: #b54708; border: 0; }
.status-pago { background: #eef4ff; color: #3538cd; }
.status-enviado { background: #eff8ff; color: #175cd3; }
.status-entregue { background: #ecfdf3; color: #067647; }
.status-cancelado { background: #f2f4f7; color: #667085; }
.badge-alerta { background: #f79009; color: #fff; font-family: var(--a-fonte); font-size: .7rem; font-weight: 600; }
.tab-btn .badge-alerta { margin-left: .35rem; }
.aviso-inline { background: #fffaeb; color: #b54708; border-radius: 4px; font-weight: 500; }

/* ===== CARTÕES DE NÚMEROS ===== */
.rel-card, .rel-card-full {
    background: var(--a-cartao); border: 1px solid var(--a-borda); border-radius: 10px;
    box-shadow: var(--a-sombra); padding: 1.1rem 1.25rem;
}
.rel-card h3, .rel-card-full h3 {
    font-family: var(--a-fonte); font-size: .8rem; font-weight: 500; letter-spacing: 0;
    color: var(--a-suave); text-transform: none;
}
.rel-card-full h3 { font-size: .95rem; font-weight: 600; color: var(--a-titulo); margin-bottom: .7rem; }
.rel-card p.placar { font-family: var(--a-fonte); font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; color: var(--a-titulo); }
.rel-card.destaque { background: var(--a-cartao); color: var(--a-texto); border-top: 3px solid var(--a-azul); }
.rel-card.destaque h3 { color: var(--a-suave); }
.rel-card.destaque p.placar { color: var(--a-titulo); }
.rel-card.destaque .sub-card { color: var(--a-suave); }
.rel-card.ouro p.placar { color: #067647; }
.rel-card.alerta { background: #fffaeb; border-color: #fedf89; }
.rel-card.alerta h3, .rel-card.alerta .sub-card { color: #b54708; }
.sub-card { color: var(--a-suave); font-size: .8rem; }
.status-item, .cliente-item, .pedido-recente-item { border-bottom: 1px solid #eef2f6; }
.pedido-total { color: var(--a-titulo); }
.no-data-text { font-style: normal; color: var(--a-suave); }
.mini-placar div { background: var(--a-cartao); border: 1px solid var(--a-borda); border-left: 3px solid var(--a-azul); border-radius: 8px; }
.mini-placar b { font-family: var(--a-fonte); font-size: 1.3rem; font-weight: 650; }
.barra { border-radius: 999px; overflow: hidden; background: #eef2f6; }
.barra span { background: var(--a-azul); }

/* ===== SUB-ABAS (controle segmentado) ===== */
.sub-tabs { border: 1px solid var(--a-borda); background: #eef2f6; border-radius: 8px; padding: 3px; gap: 2px; }
.sub-tab {
    background: transparent; border: 0; border-radius: 6px; color: var(--a-suave);
    font-family: var(--a-fonte); font-size: .84rem; font-weight: 500; letter-spacing: 0; padding: .42rem .9rem;
}
.sub-tab + .sub-tab { border-left: 0; }
.sub-tab:hover { color: var(--a-titulo); }
.sub-tab.active { background: var(--a-cartao); color: var(--a-titulo); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.filtro { border-radius: 6px; }

/* ===== BLOCOS DIVERSOS ===== */
.alerta-visita { background: var(--a-cartao); border: 1px solid var(--a-borda); border-left: 4px solid var(--a-azul); border-radius: 8px; }
.alerta-visita.sit-vencida { border-left-color: #f79009; background: #fffcf5; }
.alerta-visita.sit-hoje { border-left-color: #d92d20; background: #fffbfa; }
.sit-rotulo { font-family: var(--a-fonte); font-size: .88rem; font-weight: 600; letter-spacing: 0; }
.sit-badge.sit-vencida { background: #fffaeb; color: #b54708; }
.sit-badge.sit-hoje { background: #fef3f2; color: #b42318; }
.sit-badge.sit-proxima { background: #fff6ed; color: #c4320a; }
.sit-badge.sit-em_dia { background: #eff8ff; color: #175cd3; }
.conc-totais { background: #f8fafc; border-left: 3px solid var(--a-azul); border-radius: 4px; }
.composicao { border: 1px solid var(--a-borda); border-radius: 8px; }
.composicao legend { font-family: var(--a-fonte); font-size: .9rem; font-weight: 600; letter-spacing: 0; }
.composicao-resumo { background: var(--a-titulo); border-radius: 8px; }
.composicao-resumo .destaque { color: #84adff; }
.composicao-resumo .negativo { color: #fdb022; }
small.desc { color: var(--a-azul); }
.divergencia { border-left-color: #f79009; border-radius: 4px; }

.avisos-painel { border: 1px solid var(--a-borda); border-radius: 10px; box-shadow: var(--a-sombra-alta); overflow: hidden; }
.avisos-painel h4 { font-family: var(--a-fonte); font-size: .82rem; font-weight: 600; letter-spacing: 0; background: #f8fafc; color: var(--a-titulo); border-bottom: 1px solid var(--a-borda); padding: .6rem .9rem; }
.avisos-painel a, .avisos-painel p { border-bottom: 1px solid #eef2f6; padding: .6rem .9rem; }
.avisos-painel a:hover { background: #f8fafc; }

.manual-nav button { background: var(--a-cartao); border: 1px solid var(--a-borda-forte); border-radius: 999px; font-weight: 500; padding: .28rem .8rem; }
.manual-nav button.active { background: var(--a-azul); border-color: var(--a-azul); color: #fff; }
.manual h4 { font-family: var(--a-fonte); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.manual .manual-titulo { font-size: 1.3rem; border-bottom: 2px solid var(--a-azul); }

.pedido-site { border: 1px solid var(--a-borda); border-left: 4px solid var(--a-borda-forte); border-radius: 10px; box-shadow: var(--a-sombra); }
.pedido-site.status-borda-aguardando_pagamento { border-left-color: #f79009; }
.pedido-site.status-borda-pago { border-left-color: #444ce7; box-shadow: var(--a-sombra); }
.pedido-site.status-borda-enviado, .pedido-site.status-borda-entregue { border-left-color: #2e90fa; }
.pedido-site-corpo h4 { font-family: var(--a-fonte); font-size: .88rem; font-weight: 600; letter-spacing: 0; }
.chat-lista, .chat-painel { border: 1px solid var(--a-borda); border-radius: 10px; }
.chat-item { border-bottom: 1px solid #eef2f6; }
.chat-item.ativo { background: var(--a-azul-claro); color: var(--a-titulo); }
.chat-item.ativo.nova strong, .chat-item.nova strong { color: var(--a-azul); }
.chat-cab { border-bottom: 1px solid var(--a-borda); }
.chat-form { border-top: 1px solid var(--a-borda); }
.msg.minha { background: var(--a-azul); border-color: var(--a-azul); }
.qr-preview svg { box-shadow: 0 0 0 1px var(--a-borda); border-radius: 8px; }
.cfg-card { border-color: var(--a-borda); box-shadow: var(--a-sombra); }
.cfg-logo img { box-shadow: 0 0 0 1px var(--a-borda); }
.rep-pend { border-color: var(--a-borda); border-left-color: var(--a-azul); box-shadow: var(--a-sombra); }

::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* ===== LOGIN ===== */
.login-page { background: radial-gradient(ellipse 80% 60% at 50% 0%, #e8eefb, transparent 70%), var(--a-fundo); }
.login-card {
    border: 1px solid var(--a-borda); border-image: none; border-radius: 14px;
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .25); padding: 2.2rem 2rem 1.8rem;
}
.login-card img { width: 64px; height: 64px; margin: 0 auto .9rem; box-shadow: 0 0 0 1px var(--a-borda); }
.login-card h1 { font-family: var(--a-fonte); font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; color: var(--a-titulo); }
.login-card .sub { font-size: .84rem; letter-spacing: 0; text-transform: none; margin: .2rem 0 1.5rem; }
.login-card .btn-primary { font-size: .92rem; padding: .7rem; }
.login-erro { background: #fef3f2; border-left: 3px solid #d92d20; border-radius: 4px; color: #912018; }
.voltar a { text-decoration: none; }

/* ===== CELULAR ===== */
@media (max-width: 768px) {
    header { padding: 0 14px; }
    .topo { height: 54px; }
    .marca small { display: none; }
    .marca h1 { font-size: .98rem; }
    .tabs { margin: 0 -14px; padding: 0 6px; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-btn { padding: .7rem .7rem .62rem; font-size: .84rem; }
    main { padding: 18px 14px 40px; }
    h2 { font-size: 1.25rem; }
    .sub-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .sub-tab { flex: 1 0 auto; white-space: nowrap; }
    .modal-content { padding: 1.3rem 1.1rem; }
}
@media (max-width: 480px) {
    .marca h1 { letter-spacing: .02em; font-size: .95rem; }
    .usuario-box button, .usuario-box a { padding: .3rem .55rem; font-size: .78rem; }
}

/* ações dentro da célula: a td continua célula de tabela (alinha as bordas) e os botões ficam em linha */
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { margin: 2px 4px 2px 0; vertical-align: middle; }
td.actions > *:last-child { margin-right: 0; }

/* área útil mais larga (tabelas com muitas colunas) e células mais compactas */
main, .tabs, .topo { max-width: 1360px; }
th { padding: .65rem .65rem; }
td { padding: .65rem .65rem; }

/* ===== CELULAR: tabelas viram cartões, números em duas colunas, modais como folha inferior ===== */
@media (max-width: 640px) {
    /* fonte de 16px nos campos: o iPhone não dá zoom ao focar */
    input, select, textarea { font-size: 16px; }
    .filtro { width: 100%; min-width: 0; }

    .header-actions { gap: .7rem; }
    .header-actions > .btn-primary, .header-actions > .btn-secondary { flex: 1 1 auto; }
    .header-actions > h2 + .btn-primary { flex: 0 0 auto; }
    .relatorios-grid + .header-actions, .relatorios-grid + .rel-card-full { margin-top: .9rem; }

    /* sub-abas: todas à vista, quebrando em linhas em vez de cortar */
    .sub-tabs, #aud-subtabs, #loja-subtabs, #forn-subtabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .sub-tab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .55rem .5rem; }
    .sub-tab:last-child:nth-child(odd) { grid-column: 1 / -1; }

    /* tabela → lista de cartões (rótulos vêm do cabeçalho via data-label, ver rotularTabelas em app.js) */
    .tabela-wrap, .tabela-wrap.tabela-leve { background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
    .tabela-wrap table, .tabela-wrap tbody, .tabela-wrap tr, .tabela-wrap td { display: block; width: 100%; }
    .tabela-wrap thead { display: none; }
    .tabela-wrap tbody tr {
        background: var(--a-cartao); border: 1px solid var(--a-borda); border-radius: 10px;
        box-shadow: var(--a-sombra); padding: .35rem .95rem; margin-bottom: .65rem;
    }
    .tabela-wrap tbody tr:hover { background: var(--a-cartao); }
    .tabela-wrap td {
        display: flex; justify-content: flex-end; align-items: center; gap: .5rem;
        padding: .42rem 0; border-bottom: 1px solid #eef2f6; text-align: right;
        min-height: 2.3rem; overflow-wrap: anywhere;
    }
    .tabela-wrap td::before {
        content: attr(data-label); flex: 0 0 auto; white-space: nowrap; overflow-wrap: normal; margin-right: auto; text-align: left;
        color: var(--a-suave); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    }
    .tabela-wrap td[data-label=""]::before { display: none; }
    .tabela-wrap td:empty { display: none; }
    /* primeira célula é o título do cartão */
    .tabela-wrap td:first-child { font-size: .98rem; font-weight: 600; color: var(--a-titulo); text-align: left; justify-content: flex-start; }
    .tabela-wrap td:first-child::before { display: none; }
    /* ações: botões em linha no rodapé do cartão, com área de toque maior */
    .tabela-wrap td.actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .45rem; white-space: normal; border-bottom: 0; padding: .65rem 0 .45rem; }
    .tabela-wrap td.actions::before { display: none; }
    .tabela-wrap td.actions > * { margin: 0; flex: 1 1 auto; min-height: 38px; }
    .tabela-wrap tr > td:last-child { border-bottom: 0; }
    .tabela-wrap td.td-cheia, .tabela-wrap td.vazio { justify-content: center; text-align: center; border-bottom: 0; font-size: .9rem; font-weight: 400; color: var(--a-suave); }
    .tabela-wrap td.td-cheia::before, .tabela-wrap td.vazio::before { display: none; }
    .tabela-wrap .status-select { min-width: 0; width: auto; max-width: 60%; }
    .tabela-conc input { width: 96px; }

    /* cartões de números: duas colunas; o último sobrando ocupa a linha toda */
    .relatorios-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .relatorios-grid > :last-child:nth-child(odd),
    .relatorios-grid > .rel-card:not(:has(> .placar)),
    #tab-relatorios .rel-card.destaque { grid-column: 1 / -1; }
    .rel-card { padding: .8rem .9rem; }
    .rel-card h3 { font-size: .74rem; }
    .rel-card p.placar { font-size: 1.3rem; overflow-wrap: anywhere; }
    .rel-card-full { padding: 1rem; }
    .mini-placar { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* pedidos recentes: cliente/data à esquerda, status/valor à direita */
    .pedido-recente-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
    .pedido-info { flex-direction: column; align-items: flex-start; gap: .05rem; }
    .pedido-status { flex-direction: column; align-items: flex-end; gap: .2rem; }
    .status-item, .cliente-item { flex-wrap: wrap; }

    /* modais como folha que sobe do rodapé */
    .modal { padding: 0; align-items: flex-end; }
    .modal-content, .modal-content.largo, .dialogo {
        max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0;
        padding: 1.3rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    }
    .modal-content h3 { padding-right: 2rem; }
    .dialogo-botoes > * { flex: 1 1 auto; }
    .remessa-item-row, .custo-extra-row, .pedido-item-row { gap: .4rem; }

    .cfg-grid, .cfg-temas { grid-template-columns: 1fr; }
    .chat-admin { min-height: 0; }
    .msg { max-width: 88%; }
    .pedido-site { padding: .9rem; }
    .alerta-prazo .btn-primary { width: 100%; }
}
@media (hover: none) {
    .tab-btn:hover:not(.active), .sub-tab:hover:not(.active) { color: var(--a-suave); }
}
@media (max-width: 380px) {
    #btn-manual { font-size: 0; padding: .3rem .6rem; }
    #btn-manual::before { content: '?'; font-size: .85rem; font-weight: 600; }
}

/* ===== CELULAR/TABLET: menu de abas inteiro à vista, sem rolagem lateral ===== */
@media (max-width: 768px) {
    header { position: static; }
    .tabs {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: .3rem;
        margin: 0 -14px; padding: .5rem 10px .6rem; border-top: 1px solid #f1f4f8;
    }
    .tab-btn {
        text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        padding: .45rem .25rem; margin: 0; font-size: .82rem;
        border: 1px solid var(--a-borda); border-radius: 6px; background: var(--gelo);
    }
    .tab-btn.active { background: var(--a-azul-claro); border-color: #c7d7fe; color: var(--a-azul); }
}
@media (min-width: 560px) and (max-width: 768px) { .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 360px) { .tab-btn { font-size: .74rem; padding-inline: .1rem; } }
