/* ═══════════════════════════════════════════
   Sistema Laticinio v2 — CSS
   Identidade Casa da Ovelha (verde fechado + dourado + creme)
   ═══════════════════════════════════════════ */

:root {
    /* Tipografia da marca
       --font-display: títulos, nav, logo, valores fortes (slab serifa, peso da marca)
       --font-body:    corpo, formulários, tabelas (sans, legibilidade ERP em mobile) */
    --font-display: "Bitter", "Bookman Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-body:    "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    /* Fundo branco operacional. Identidade da marca aparece como assinatura
       (logo, h1 do hero, dourado como acento) — não como ambiente. */
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f6f7f8;
    --text: #143621;
    --text-secondary: #2d4a35;
    --muted: #6b7d6f;
    --line: rgba(20, 54, 33, 0.10);
    --line-strong: rgba(20, 54, 33, 0.18);

    /* Verdes da marca (Casa da Ovelha: C100/M50/Y100/K0 e C88/M50/Y85/K65) */
    --green: #00663A;
    --green-dark: #143621;
    --green-deeper: #0c2516;
    --green-soft: #d6e8db;
    --green-glow: rgba(0, 102, 58, 0.15);

    /* Dourado sóbrio Casa da Ovelha (#D7B13B) — solar #E5AB0F fica como acento opcional */
    --gold: #D7B13B;
    --gold-dark: #a3852a;
    --gold-soft: #FFFAD2;
    --cream: #FFFAD2;

    --red: #a72822;
    --red-soft: #f5dcd9;
    --red-glow: rgba(167, 40, 34, 0.12);
    --amber: #8a5a14;
    --amber-soft: #fbecc4;
    --amber-glow: rgba(138, 90, 20, 0.12);

    --dark-bg: #143621;
    --dark-surface: #1d4830;

    --shadow-sm: 0 2px 8px rgba(20, 54, 33, 0.08), 0 1px 3px rgba(20, 54, 33, 0.06);
    --shadow-md: 0 8px 30px rgba(20, 54, 33, 0.10), 0 2px 8px rgba(20, 54, 33, 0.06);
    --shadow-lg: 0 20px 50px rgba(20, 54, 33, 0.14), 0 8px 20px rgba(20, 54, 33, 0.08);
    --shadow-glow-green: 0 8px 30px rgba(0, 102, 58, 0.18);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --status-ok-bg: #d6e8db;
    --status-ok-fg: #00663A;
    --status-err-bg: #f5dcd9;
    --status-err-fg: #8b1f1a;
    --status-warn-bg: #fbecc4;
    --status-warn-fg: #8a5a14;
    --status-neutral-bg: #ece7d8;
    --status-neutral-fg: #4a5547;
}

/* ─── Sistema de ícones (Lucide via SVG sprite) ───
   Uso: <svg class="ico"><use href="#ico-truck"/></svg>
   Tamanho padrão 1em, herda cor do texto via currentColor. */
.ico {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ico-lg { width: 1.25em; height: 1.25em; }
.ico-xl { width: 1.6em;  height: 1.6em; }
.ico-2x { width: 2em;    height: 2em; }

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

.btn-voltar-painel {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--green-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.btn-voltar-painel:hover {
    background: var(--green-soft);
    border-color: var(--green);
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Serifa display restrita à assinatura da marca: logo do nav + h1 do hero.
   h2/h3, card titles, badges, forms e tabelas usam Inter (sans) — densidade
   e legibilidade de ferramenta industrial vencem sobre estética editorial. */
nav .logo,
h1 {
    font-family: var(--font-display);
    letter-spacing: 0.005em;
}

/* ─── Nav / Header ─── */

nav {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-surface) 50%, #1a3d28 100%);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: 0 4px 20px rgba(12, 31, 20, 0.35);
    position: relative;
    z-index: 10;
}

nav::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 50%, transparent 100%);
}

nav .logo {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 1rem 1.5rem 1rem 0;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
}

nav .logo::after {
    content: "";
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255,255,255,0.15);
}

nav a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    padding: 1rem 1.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

/* ─── Layout ─── */

.container {
    max-width: 1120px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ─── Cards ─── */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ─── Grid de tanques ─── */

.tanques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.tanque-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.3rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--line-strong);
    transition: box-shadow 0.2s, transform 0.15s;
}

.tanque-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tanque-card.livre { border-left-color: var(--green); }
.tanque-card.ocupado { border-left-color: var(--red); }

.tanque-card .tanque-id {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.tanque-card .tanque-status {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.4rem;
    letter-spacing: 0.05em;
}

.tanque-status.livre { background: var(--status-ok-bg); color: var(--status-ok-fg); }
.tanque-status.ocupado { background: var(--status-err-bg); color: var(--status-err-fg); }

.tanque-card .info {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ─── Tabela ─── */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--dark-bg);
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

tr:hover { background: rgba(13, 107, 48, 0.04); }

/* ─── Badges de status ─── */

.badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.aprovado   { background: var(--status-ok-bg); color: var(--status-ok-fg); }
.badge.descartado { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.badge.liberado   { background: #dbeafe; color: #1e40af; }
.badge.bloqueado  { background: var(--status-err-bg); color: var(--status-err-fg); }

.shelf-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--status-neutral-bg);
    color: var(--text-secondary);
}
.shelf-vencido  { background: #7f1d1d; color: #fff; font-weight: 700; }

/* ─── Cores do painel de producao ─── */

.cor-verde    { background: var(--status-ok-bg); color: var(--status-ok-fg); }
.cor-amarelo  { background: var(--status-warn-bg); color: var(--status-warn-fg); }
.cor-vermelho { background: var(--status-err-bg); color: var(--status-err-fg); }
.cor-cinza    { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }

/* ─── Formularios ─── */

form { margin-bottom: 1rem; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.3rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    accent-color: var(--green);
}

button, .btn {
    display: inline-block;
    padding: 0.6rem 1.6rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(13, 107, 48, 0.2);
}

button:hover, .btn:hover {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-deeper) 100%);
    box-shadow: var(--shadow-md), var(--shadow-glow-green);
    transform: translateY(-1px);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* ─── Alertas ─── */

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 4px solid transparent;
}

.alert.success { background: var(--status-ok-bg); color: var(--status-ok-fg); border-left-color: var(--green); }
.alert.error   { background: var(--status-err-bg); color: var(--status-err-fg); border-left-color: var(--red); }
.alert.warning { background: var(--status-warn-bg); color: var(--status-warn-fg); border-left-color: var(--amber); }
.alert.info    { background: #dbeafe; color: #1e40af; border-left-color: #2563eb; }

/* ─── Legenda ─── */

.legenda {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.legenda span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legenda .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.verde    { background: var(--green); }
.dot.amarelo  { background: var(--amber); }
.dot.vermelho { background: var(--red); }
.dot.cinza    { background: #94a3b8; }

/* ─── Responsivo ─── */

@media (max-width: 600px) {
    nav { flex-wrap: wrap; padding: 0 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .painel-grid { grid-template-columns: 1fr; }
    .container { padding: 0 0.75rem; margin: 1rem auto; }
}

/* ═══════════════════════════════════════════
   Painel — Fluxo Operacional
   ═══════════════════════════════════════════ */

/* Header de tela: presente mas industrial. Barrinha verde à esquerda
   funciona como assinatura sutil da marca (em vez do underline central
   que fazia parecer logo). */
.fluxo-header {
    text-align: left;
    margin: 0 0 1.2rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--green);
}

.fluxo-header h1 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.fluxo-header span { display: none; }

/* ─── Fluxo: linha horizontal ─── */

.fluxo {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Etapa: card da etapa ─── */

.etapa {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.95rem 0.9rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
    user-select: none;
}

.etapa:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.etapa.ativo {
    transform: translateY(0);
    box-shadow: var(--shadow-md), 0 0 0 2px var(--green-glow);
}

.etapa.cinza.ativo {
    box-shadow: var(--shadow-md), 0 0 0 2px rgba(148,163,184,0.3);
    opacity: 1;
}

/* Status: borda topo colorida */
.etapa.verde    { border-top-color: var(--green); }
.etapa.amarelo  { border-top-color: var(--amber); }
.etapa.vermelho { border-top-color: var(--red); }
.etapa.cinza    { border-top-color: #94a3b8; opacity: 0.6; }
.etapa.cinza:hover { opacity: 0.85; }

/* ─── Cabecalho da etapa ─── */

.etapa-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Ícone de etapa: sem fundo, herda cor do status (verde/amarelo/vermelho).
   Comunica "ferramenta de operação" — direto, sem decoração. */
.etapa-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    color: var(--green);
    line-height: 1;
    flex-shrink: 0;
}
.etapa-icone svg.ico {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 1.8;
}
.etapa.amarelo  .etapa-icone { color: #b45309; }
.etapa.vermelho .etapa-icone { color: var(--red); }
.etapa.verde    .etapa-icone { color: var(--green); }
.etapa.cinza    .etapa-icone { color: var(--muted); }

.etapa-titulo {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
}

.etapa-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.etapa-dot.verde    { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.etapa-dot.amarelo  { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.etapa-dot.vermelho { background: var(--red);   box-shadow: 0 0 6px var(--red-glow); }
.etapa-dot.cinza    { background: #94a3b8; }

/* ─── Mensagem principal ─── */

.etapa-msg {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.etapa.vermelho .etapa-msg { color: var(--red); }
.etapa.amarelo  .etapa-msg { color: var(--amber); }

/* ─── Detalhe e dependencia ─── */

.etapa-sub {
    font-size: 0.72rem;
    color: var(--muted);
    flex: 1;
    margin-bottom: 0.3rem;
}

.etapa-dep {
    font-size: 0.72rem;
    color: var(--amber);
    font-weight: 500;
    flex: 1;
    margin-bottom: 0.3rem;
}

.etapa.vermelho .etapa-dep { color: var(--red); }

/* ─── Indicador de expandir ─── */

/* Affordance de "expandir" reduzida ao mínimo: chevron pequeno discreto à direita.
   O card inteiro é clicável; rótulo "VER DETALHES" some — operador profissional
   não precisa de tutorial em cada card. */
.etapa-expand {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: auto;
    padding: 0.3rem 0 0;
    font-size: 0.65rem;
    color: var(--muted);
    transition: color 0.15s;
}

.etapa-expand-label { display: none; }

.etapa:hover .etapa-expand { color: var(--text-secondary); }
.etapa.ativo  .etapa-expand { color: var(--green); }
.etapa.cinza  .etapa-expand { color: #94a3b8; }

.etapa-expand-chevron {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.5;
    display: inline-block;
    transition: transform 0.2s, opacity 0.15s;
}
.etapa:hover .etapa-expand-chevron { opacity: 0.85; }

.etapa.ativo .etapa-expand-chevron { transform: rotate(180deg); }


/* ─── Conector com seta ─── */

.fluxo-seta {
    flex-shrink: 0;
    width: 28px;
    align-self: center;
    position: relative;
    height: 2px;
    margin-bottom: 1.8rem; /* alinha visualmente com o corpo do card */
}

.fluxo-seta::before {
    content: "";
    position: absolute;
    left: 0;
    right: 10px;
    top: 0;
    height: 2px;
}

.fluxo-seta::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 9px solid;
}

.fluxo-seta.ok::before     { background: var(--green); }
.fluxo-seta.ok::after      { border-left-color: var(--green); }
.fluxo-seta.muted::before  { background: #c8d4cc; }
.fluxo-seta.muted::after   { border-left-color: #c8d4cc; }

/* ─── Responsivo ─── */

@media (max-width: 900px) {
    .fluxo {
        flex-direction: column;
        gap: 0.6rem;
    }

    .fluxo-seta { display: none; }

    .etapa { border-top-width: 3px; border-left: 4px solid; border-left-color: inherit; }
    .etapa.verde    { border-left-color: var(--green); }
    .etapa.amarelo  { border-left-color: var(--amber); }
    .etapa.vermelho { border-left-color: var(--red); }
    .etapa.cinza    { border-left-color: #94a3b8; }

    .etapa-expand { padding-left: 1rem; }
}

/* ═══════════════════════════════════════════
   Recebimento — Grid de tanques
   ═══════════════════════════════════════════ */

.rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.rec-header h1 { margin-bottom: 0; }

.rec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
    margin-bottom: 2rem;
}

.rec-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 5px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.4rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.rec-card.livre     { border-top-color: var(--green); background: linear-gradient(160deg, #f0faf4 0%, var(--surface) 60%); }
.rec-card.em_uso    { border-top-color: var(--amber);  background: linear-gradient(160deg, #fffbf0 0%, var(--surface) 60%); }
.rec-card.bloqueado { border-top-color: var(--red);    background: linear-gradient(160deg, #fff0f0 0%, var(--surface) 60%); }
.rec-card.aguardando { border-top-color: var(--amber); background: linear-gradient(160deg, #fffbf0 0%, var(--surface) 60%); }

.rec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.rec-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rec-tanque-id {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.rec-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rec-dot.livre     { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.rec-dot.em_uso    { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.rec-dot.bloqueado { background: var(--red);   box-shadow: 0 0 8px var(--red-glow); }
.rec-dot.aguardando { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }

.rec-cap {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.rec-estado-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-top: 0.3rem;
}

.rec-estado-label.vermelho { color: var(--red); }

.rec-lote-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.rec-horas {
    font-size: 0.75rem;
    color: var(--muted);
}

.rec-btn {
    display: block;
    margin-top: auto;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
    margin-top: 0.8rem;
}

.rec-btn:hover {
    background: linear-gradient(135deg, var(--green-dark), var(--green-deeper));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.rec-btn-disabled {
    display: block;
    margin-top: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: var(--status-neutral-bg);
    color: var(--muted);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    cursor: default;
}

.rec-btn-blocked {
    background: var(--status-err-bg);
    color: var(--status-err-fg);
}

/* ═══════════════════════════════════════════
   Recebimento — Wizard
   ═══════════════════════════════════════════ */

.wizard-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.wizard-tanque-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--dark-bg);
    color: #fff;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    margin-bottom: 1.8rem;
}

.wizard-tanque-id {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.wizard-tanque-cap {
    font-size: 0.75rem;
    opacity: 0.55;
}

/* Barra de progresso */
.wizard-progress {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 0;
}

.wizard-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--line-strong);
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s;
}

.wizard-step-dot.active {
    background: var(--green);
    box-shadow: 0 0 0 4px var(--green-glow);
}

.wizard-step-dot.done {
    background: var(--green);
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: var(--line-strong);
    transition: background 0.3s;
}

.wizard-step-line.done {
    background: var(--green);
}

.wizard-step-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 2rem;
}

/* Paineis */
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.wizard-titulo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.4rem;
    letter-spacing: -0.01em;
}

.wizard-field-big {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.wizard-input-big {
    width: 100%;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 2.5px solid var(--line-strong);
    border-radius: 0;
    padding: 0.2rem 0;
    outline: none;
    transition: border-color 0.2s;
    max-width: 280px;
}

.wizard-input-big:focus { border-bottom-color: var(--green); }

.wizard-unit {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.wizard-hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.wizard-error {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--red);
    background: var(--status-err-bg);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
}

.hidden { display: none !important; }

/* Opcoes de origem */
.wizard-opcoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.wizard-opcao { cursor: pointer; }
.wizard-opcao input { display: none; }

.wizard-opcao-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem 0.8rem;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.wizard-opcao.selecionado .wizard-opcao-box {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: 0 0 0 3px var(--green-glow);
}

.wizard-opcao-icone { font-size: 1.8rem; }
.wizard-opcao-label { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

.wizard-field {
    margin-bottom: 1.2rem;
}

.wizard-field-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.wizard-input {
    width: 100%;
    max-width: 200px;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}

.wizard-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }

.wizard-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

/* Checkboxes de qualidade */
.wizard-checks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
}

.wizard-check-item { cursor: pointer; }
.wizard-check-item input { display: none; }

.wizard-check-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.88rem;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}

.wizard-check-item input:checked + .wizard-check-box {
    border-color: var(--green);
    background: var(--green-soft);
}

.wizard-check-mark {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: transparent;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.wizard-check-item input:checked + .wizard-check-box .wizard-check-mark {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* Resumo */
.wizard-resumo {
    background: var(--surface-hover);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin-bottom: 1.4rem;
}

.wizard-resumo-titulo {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.wizard-resumo-linha {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--line);
}

.wizard-resumo-linha:last-child { border-bottom: none; }
.wizard-resumo-linha span { color: var(--muted); }

/* Navegacao */
.wizard-nav {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1.6rem;
}

.btn-ghost {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.15s;
}

.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--green-dark), var(--green-deeper));
}

@media (max-width: 600px) {
    .rec-header { flex-direction: column; align-items: flex-start; }
    .wizard-wrap { padding: 0; }
    .wizard-input-big { font-size: 2rem; }
}

/* ═══════════════════════════════════════════
   Leite — Painel de Gestão
   ═══════════════════════════════════════════ */

.leite-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.leite-page-header h1 { margin-bottom: 0.1rem; }

.leite-page-sub {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.leite-acoes-topo {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Layout lateral: tanques + resumo ─── */

.leite-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.leite-tanques {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* tank cards as links */
a.rec-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.leite-resumo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.8rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 180px;
}

.leite-resumo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.leite-resumo-titulo {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.leite-resumo-lista {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex: 1;
}

.leite-resumo-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}
.leite-resumo-item:last-child { border-bottom: none; padding-bottom: 0; }

.leite-resumo-item-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.leite-resumo-lote-id {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.leite-resumo-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.leite-resumo-destino {
    font-size: 0.78rem;
    font-weight: 600;
}
.leite-resumo-destino.liberado  { color: var(--green); }
.leite-resumo-destino.aprovado  { color: var(--green-dark); }
.leite-resumo-destino.pendente  { color: var(--amber); }
.leite-resumo-destino.bloqueado { color: var(--red); }

.leite-resumo-vazio {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.leite-resumo-hint {
    font-size: 0.78rem;
    opacity: 0.7;
}

.leite-resumo-rodape {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: auto;
}

/* ─── Métricas (mantidas mas não usadas no painel) ─── */

.leite-metricas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.leite-metrica {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
}

.leite-metrica.verde    { border-top-color: var(--green); }
.leite-metrica.amarelo  { border-top-color: var(--amber); }
.leite-metrica.vermelho { border-top-color: var(--red); }
.leite-metrica.cinza    { border-top-color: #94a3b8; }

.leite-metrica-valor {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.leite-metrica.verde    .leite-metrica-valor { color: var(--green); }
.leite-metrica.amarelo  .leite-metrica-valor { color: var(--amber); }
.leite-metrica.vermelho .leite-metrica-valor { color: var(--red); }
.leite-metrica.cinza    .leite-metrica-valor { color: #94a3b8; }

.leite-metrica-total {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.5;
}

.leite-metrica-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.leite-metrica-desc {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* ─── Título de seção ─── */

.leite-secao-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.7rem;
}

.leite-secao-count {
    font-weight: 400;
    font-size: 0.7rem;
}

/* ─── Estado aguardando para rec-card ─── */

.rec-card.aguardando    { border-top-color: var(--amber); }
.rec-dot.aguardando     { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }

/* ─── Lote cards ─── */

.lotes-lista { display: flex; flex-direction: column; gap: 0.6rem; }

.lote-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm);
}

.lote-card.aprovado  { border-left-color: var(--green); }
.lote-card.liberado  { border-left-color: #2563eb; }
.lote-card.pendente  { border-left-color: var(--amber); }
.lote-card.bloqueado { border-left-color: var(--red); }
.lote-card.neutro    { border-left-color: var(--line-strong); }
.lote-card.concluido { border-left-color: var(--green); opacity: 0.65; }

.pcp-dia-sep {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0 0.25rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.4rem;
}

.pcp-tipo-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.pcp-secao-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg);
    padding: 0.6rem 0 0.3rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.pcp-secao-sub {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--muted);
}

.pcp-inline-form {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: var(--status-neutral-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.pcp-select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--fg);
    font-size: 0.82rem;
    flex: 1;
    min-width: 160px;
}

.pcp-input-data {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--fg);
    font-size: 0.82rem;
    width: 130px;
}

.pcp-aviso {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.pcp-form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.lote-card-acoes {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
}

.lote-card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.lote-id {
    font-weight: 700;
    font-size: 0.95rem;
}

.lote-tanque-ref {
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--status-neutral-bg);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
}

.lote-horas-ref {
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: auto;
}

.lote-meta {
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}

.lote-testes {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* ─── Badges de teste ─── */

.teste {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.teste.ok       { background: var(--status-ok-bg);   color: var(--status-ok-fg); }
.teste.falhou   { background: var(--status-err-bg);  color: var(--status-err-fg); }
.teste.temp-ok  { background: var(--status-ok-bg);   color: var(--status-ok-fg); }
.teste.temp-warn{ background: var(--status-warn-bg); color: var(--status-warn-fg); }

/* ─── Badge pendente (reanálise) ─── */

.badge.pendente { background: var(--status-warn-bg); color: var(--status-warn-fg); }

/* ─── Botão warn ─── */

.btn-warn {
    background: linear-gradient(135deg, var(--amber) 0%, #7a3508 100%);
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(146, 64, 14, 0.2);
}

.btn-warn:hover {
    background: linear-gradient(135deg, #7a3508 0%, #5a2605 100%);
}

/* ─── Ações rodapé ─── */

.leite-acoes-rodape {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

/* ─── Responsivo ─── */

@media (max-width: 700px) {
    .leite-metricas { grid-template-columns: repeat(2, 1fr); }
    .leite-page-header { flex-direction: column; }
}

/* ═══════════════════════════════════════════
   Painel — Painéis de Detalhe Expansíveis
   ═══════════════════════════════════════════ */

.detalhes-area {
    margin-top: 0.8rem;
    /* quando inserido dentro do .fluxo (mobile) ocupa a largura toda */
    flex: none;
    width: 100%;
    min-width: 0;
}

.detalhe-panel {
    display: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-lg);
    animation: detalheSlide 0.18s ease;
}

.detalhe-panel.ativo {
    display: block;
}

@keyframes detalheSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Cabeçalho do painel ─── */

.detalhe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.detalhe-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.detalhe-fechar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: transparent;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.detalhe-fechar:hover {
    background: var(--status-err-bg);
    color: var(--red);
    border-color: var(--red);
}

/* ─── Título de seção interna ─── */

.detalhe-secao {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.7rem;
}

/* ─── Estado vazio ─── */

.detalhe-vazio {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.4rem 1.2rem;
    background: var(--surface-hover);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.detalhe-vazio-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ─── Linha de resumo (PCP) ─── */

.detalhe-resumo-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

/* ─── Ações no rodapé do painel ─── */

.detalhe-acoes {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
    .detalhe-panel { padding: 1rem; }
    .leite-metricas { grid-template-columns: repeat(2, 1fr); }
}

/* ── Estoque: locais grid ── */

.estoque-locais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.estoque-local-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.estoque-local-card.alerta {
    border-color: var(--amber);
    background: var(--amber-soft);
}

.estoque-local-nome {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.estoque-bar-container {
    height: 8px;
    background: var(--line);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.estoque-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.estoque-local-nums {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Rastreabilidade */
.rastreio-resultado {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}
.rastreio-secao {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}
.rastreio-secao strong {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
.rastreio-subsecao {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.rastreio-subsecao em {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════
   Hamburger Nav Toggle (mobile)
   ═══════════════════════════════════════════ */

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
    box-shadow: none;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links { display: contents; }

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        order: 10;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.8rem 1rem;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
}

/* ═══════════════════════════════════════════
   MOBILE — Responsive Overrides
   Phones (<= 480px) and Tablets (<= 768px)
   ═══════════════════════════════════════════ */

/* ── Touch targets mínimos ── */
@media (max-width: 768px) {
    button, .btn, .btn-ghost, .rec-btn, .rec-btn-disabled {
        min-height: 44px;
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select,
    .pcp-select,
    .pcp-input-data,
    .wizard-input,
    .q-input {
        min-height: 44px;
        font-size: 1rem;
    }
}

/* ── Painel: fluxo vertical em mobile ── */
@media (max-width: 768px) {
    .fluxo-header {
        margin: 0.2rem 0 1rem;
    }

    .fluxo-header h1 {
        font-size: 0.95rem;
    }

    .etapa {
        padding: 0.9rem 0.8rem 0;
    }

    .etapa-msg {
        font-size: 0.85rem;
    }

    .detalhe-panel {
        padding: 1rem 0.8rem;
    }

    .detalhe-header {
        padding-bottom: 0.7rem;
        margin-bottom: 1rem;
    }

    .detalhe-titulo {
        font-size: 0.9rem;
    }

    .detalhe-acoes {
        flex-direction: column;
    }

    .detalhe-acoes .btn,
    .detalhe-acoes .btn-ghost {
        width: 100%;
        text-align: center;
    }
}

/* ── Recebimento: tanques grid stack ── */
@media (max-width: 768px) {
    .rec-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rec-card {
        padding: 1.2rem 1rem;
    }

    .rec-tanque-id {
        font-size: 1.2rem;
    }

    .rec-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Leite: layout e métricas ── */
@media (max-width: 768px) {
    .leite-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .leite-tanques {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.8rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .leite-tanques .rec-card {
        min-width: 140px;
        flex-shrink: 0;
    }
}


/* ═══════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════ */

.login-page {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-surface) 40%, #1a3d28 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--muted);
}

.login-card .form-group { margin-bottom: 1.2rem; }

.btn-login {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ── User badge in nav ── */

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    padding: 0.4rem 0.8rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.nav-user .user-name {
    color: #fff;
}

.nav-user a {
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    text-transform: uppercase;
}

.nav-user a:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.07);
    }

    .leite-metricas {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }

    .leite-metrica {
        padding: 0.9rem 1rem;
    }

    .leite-metrica-valor {
        font-size: 1.8rem;
    }

    .leite-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .leite-acoes-topo {
        width: 100%;
    }

    .leite-acoes-topo .btn,
    .leite-acoes-topo .btn-warn {
        flex: 1;
        text-align: center;
    }

    .leite-resumo-item-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ── Tabelas: scroll horizontal ── */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .fc-table {
        display: table;
        min-width: 400px;
    }

    th, td {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* ── Tanques: grid adaptável ── */
@media (max-width: 768px) {
    .tanques-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
}

/* ── Wizard (entrada leite v2) ── */
@media (max-width: 768px) {
    .wizard-wrap {
        padding: 0;
    }

    .wizard-input-big {
        font-size: 2rem;
        max-width: 100%;
    }

    .wizard-opcoes {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .wizard-opcao-box {
        padding: 0.9rem 0.6rem;
    }

    .wizard-nav {
        flex-direction: column;
    }

    .wizard-nav .btn,
    .wizard-nav .btn-ghost {
        width: 100%;
        text-align: center;
    }

    .wizard-step-labels {
        font-size: 0.6rem;
    }
}

/* ── Entrada Leite v2 ── */
@media (max-width: 768px) {
    .entry-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .entry-hero-meta {
        flex-wrap: wrap;
    }

    .entry-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .tank-sel-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.6rem;
    }

    .choice-sel-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .choice-sel-btn {
        padding: 0.8rem;
    }

    .q-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .q-input {
        font-size: 1.1rem;
    }
}

/* ── Liberação ── */
@media (max-width: 768px) {
    .checkbox-group {
        flex-direction: column;
        gap: 0.7rem;
    }

    .checkbox-group label {
        font-size: 0.9rem;
        padding: 0.3rem 0;
    }
}

/* ── Produção (PCP) ── */
@media (max-width: 768px) {
    .pcp-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 0.7rem 0.8rem;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .pcp-controls h1 {
        font-size: 1rem;
    }

    .pcp-ctrl-right {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pcp-btn-row {
        flex-wrap: wrap;
    }

    .pcp-summary {
        padding: 0.5rem 0.8rem;
        gap: 0.4rem;
    }

    .pcp-pending {
        padding: 0.6rem 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pcp-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .pcp-select,
    .pcp-input-data {
        width: 100%;
        min-width: 0;
    }

    .mini-tl-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Fabricação ── */
@media (max-width: 768px) {
    .fab-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .fab-stat .val {
        font-size: 1.3rem;
    }

    .fab-card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.65rem 0.8rem;
    }

    .fab-card-meta {
        flex-wrap: wrap;
    }

    .fab-estoque-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Estoque locais ── */
@media (max-width: 768px) {
    .estoque-locais-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Lote cards ── */
@media (max-width: 768px) {
    .lote-card {
        padding: 0.8rem;
    }

    .lote-card-header {
        gap: 0.5rem;
    }

    .lote-meta {
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    .lote-card-acoes {
        flex-direction: column;
    }

    .lote-card-acoes .btn,
    .lote-card-acoes .btn-ghost,
    .lote-card-acoes .btn-sm {
        width: 100%;
        text-align: center;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Ficha modal mobile ── */
@media (max-width: 768px) {
    .ficha-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .ficha-modal {
        width: 100%;
        max-height: 85vh;
        padding: 1.2rem 1rem;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .fc-grid--dual {
        flex-direction: column;
    }

    .fmod-title {
        flex-direction: column;
        gap: 0.2rem;
    }

    .fmod-id {
        font-size: 1.2rem;
    }
}

/* ── Alertas mobile ── */
@media (max-width: 768px) {
    .alert {
        font-size: 0.85rem;
        padding: 0.7rem 0.9rem;
    }
}

/* ── Específico para telas pequenas (phones) ── */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
        margin: 0.75rem auto;
    }

    h1 {
        font-size: 1.15rem;
    }

    .leite-metricas {
        grid-template-columns: 1fr 1fr;
    }

    .leite-metrica-valor {
        font-size: 1.5rem;
    }

    .rec-card {
        padding: 1rem 0.8rem;
    }

    .tanques-grid {
        grid-template-columns: 1fr 1fr;
    }

    .fab-stats {
        grid-template-columns: 1fr 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .wizard-opcoes {
        grid-template-columns: 1fr;
    }

    .etapa {
        padding: 0.7rem 0.6rem 0;
    }

    .etapa-icone {
        width: 1.4rem;
        height: 1.4rem;
    }
    .etapa-icone svg.ico {
        width: 1.3rem;
        height: 1.3rem;
    }

    .etapa-titulo {
        font-size: 0.7rem;
    }

    .etapa-msg {
        font-size: 0.8rem;
    }

    button, .btn, .btn-ghost {
        font-size: 0.82rem;
        padding: 0.55rem 1.2rem;
    }
}
