/* ============================================================
   SGP Frutali - Folha de estilo compartilhada (design system)
   Responsiva / mobile-first. Cada pagina define sua cor com um
   pequeno bloco:  <style>:root{ --primary: #16a085; }</style>

   Breakpoints: 480px (celular) | 768px (tablet) | >768px (desktop)
   Tokens: escala de espacamento --space-1..6, raios --radius-sm/md/lg,
           alvo de toque --touch-min.
   Dark mode: reservado para fase futura (nao implementado aqui).
   ============================================================ */

/* Fonte da marca (Inter). Importada aqui para que TODAS as telas que
   carregam este arquivo tenham a mesma tipografia — antes so ~10 telas
   traziam o <link> e as demais caiam no fallback do sistema. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --bg: #f4f6f9;
  --dark: #2c3e50;
  --primary: #2c3e50;        /* sobrescrito por pagina/modulo */
  --text-main: #2d3748;
  --text-light: #5b6b7c;   /* escurecido p/ atingir contraste WCAG AA (>=4.5:1 no branco) */
  --card-bg: #ffffff;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --border: #e2e8f0;
  --shadow: 0 4px 15px rgba(0,0,0,0.06);

  /* Escala de espacamento */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Raios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Alvo de toque minimo (WCAG) */
  --touch-min: 44px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 0 calc(40px + env(safe-area-inset-bottom));
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.0625rem);
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text-main);
  -webkit-text-size-adjust: 100%;
}

/* ---------- Top nav (paginas internas) ---------- */
.top-nav {
  background: var(--dark); color: #fff;
  padding: 14px max(20px, env(safe-area-inset-right));
  padding-left: max(20px, env(safe-area-inset-left));
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
}
.top-nav a { color: #fff; text-decoration: none; font-weight: bold; display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Container / paper ---------- */
.container, .paper {
  background: #fff; width: 100%; max-width: 1100px;
  margin: 0 auto; padding: 25px; border-radius: 12px;
  box-shadow: var(--shadow); border-top: 5px solid var(--primary);
}

/* ---------- Cabecalho interno (titulo + acao) ---------- */
.header-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
h1, h2 { color: var(--primary); margin-top: 0; }
h1 { font-size: clamp(1.4rem, 1.2rem + 1.2vw, 1.9rem); line-height: 1.2; }
h2 { font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.4rem); line-height: 1.25; }

/* ---------- Grids responsivos ---------- */
.grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.full-width { grid-column: 1 / -1; }

/* ---------- Formularios ---------- */
label { display: block; font-weight: bold; font-size: 0.85rem; color: #555; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 11px; border: 1px solid #ccc; border-radius: 8px;
  font-size: 16px; /* >=16px evita o zoom automatico no iOS */
  font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }
input[readonly] { background: #eef2f7; color: #2d3748; } /* legivel: campos de total sao lidos, nao editados */
.radio-group { display: flex; gap: 20px; flex-wrap: wrap; background: #f9f9f9; padding: 10px; border-radius: 8px; border: 1px solid #eee; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 0; font-weight: normal; }

/* ---------- Botoes ---------- */
.btn, .btn-save, .btn-new, .btn-details, .btn-add, .btn-view, .btn-submit,
.btn-create, .btn-success, .btn-remove, .btn-danger, .btn-back, .btn-action,
.btn-stock, .btn-card, .btn-new-person {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: none; border-radius: 8px; font-size: 1rem;
  font-weight: bold; cursor: pointer; text-decoration: none; color: #fff;
  background: var(--primary); transition: filter .15s, opacity .15s; min-height: 44px;
}
.btn:hover, .btn-save:hover, .btn-new:hover, .btn-details:hover, .btn-add:hover { filter: brightness(0.92); }
.btn-save, .btn-submit, .btn-create { width: 100%; margin-top: 18px; }
.btn-success { background: var(--success); }
.btn-remove, .btn-danger { background: var(--danger); }
.btn-back, .btn-view { background: #64748b; }
.btn-logout { color: var(--danger); background: transparent; border: 1px solid var(--danger); padding: 6px 14px; font-weight: bold; border-radius: 6px; text-decoration: none; }
.btn-logout:hover { background: var(--danger); color: #fff; }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon-small { min-height: 40px; min-width: 40px; padding: 8px; }

/* ---------- Tabelas responsivas (scroll horizontal no mobile) ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--dark); color: #fff; padding: 11px; text-align: left; white-space: nowrap; }
td { padding: 11px; border-bottom: 1px solid #eee; }

/* ---------- Tabela -> cards no celular (repetidores / listas) ---------- */
/* Aplicar a classe .table-cards numa <table>. No >480px continua tabela normal;
   no <=480px cada <tr> vira um card e cada <td> mostra seu rotulo via data-label. */
/* Especificidade com `table.table-cards ...` (0,1,2) de proposito: vence as
   regras `.classe td` (0,1,1) que as paginas definem no proprio <style>
   (ex.: .table-list td, .table-input td) e que sao carregadas DEPOIS do app.css.
   Sem isso, o layout de cartao no celular era sobrescrito e a tabela "quebrava".
   Layout: cada <tr> vira um cartao; cada <td> empilha rotulo (data-label) + valor. */
@media (max-width: 480px) {
  table.table-cards thead { display: none; }
  table.table-cards,
  table.table-cards tbody,
  table.table-cards tr,
  table.table-cards td { display: block; width: 100%; }
  table.table-cards tr {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: var(--space-3); margin-bottom: var(--space-4);
    background: #fff; box-shadow: var(--shadow);
  }
  table.table-cards td { padding: var(--space-2) 0; border: none; text-align: left; }
  table.table-cards td::before {
    content: attr(data-label); display: block;
    font-weight: 700; font-size: 0.8rem; color: var(--text-light);
    margin-bottom: var(--space-1);
  }
  table.table-cards td[data-label=""]::before,
  table.table-cards td.cell-action::before { content: none; }
  table.table-cards td input,
  table.table-cards td select,
  table.table-cards td textarea { width: 100%; }
  /* celula de acao (ex.: excluir): botoes largura total no fim do card */
  table.table-cards td.cell-action { display: flex; flex-direction: column; gap: var(--space-2); }
  table.table-cards td.cell-action button,
  table.table-cards td.cell-action a { width: 100%; min-height: var(--touch-min); }
}

/* ---------- Barra de resumo fixa (telas de lancamento) ---------- */
.entry-summary-bar {
  display: flex; gap: var(--space-5); flex-wrap: wrap; align-items: baseline;
  background: var(--dark); color: #fff;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.entry-summary-bar span { font-size: 0.8rem; opacity: 0.85; }
.entry-summary-bar strong { font-size: 1.2rem; margin-left: var(--space-2); }
@media (max-width: 480px) {
  .entry-summary-bar { position: sticky; top: 0; z-index: 50; border-radius: 0; }
}

/* ---------- Botao de acao fixo na base (mobile) ---------- */
@media (max-width: 480px) {
  .btn-sticky-bottom {
    position: sticky; bottom: env(safe-area-inset-bottom);
    width: 100%; z-index: 40; box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
  }
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 9px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; color: #fff; }
.bg-cli { background: #f1c40f; color: #333; }
.bg-for { background: #8e44ad; }
.bg-time { background: #27ae60; }

/* ---------- Modal ---------- */
/* Oculto por padrao: o JS de cada tela abre com style.display='flex'/'block'.
   (Antes era display:flex aqui, o que deixava a modal aparecendo ao carregar a pagina.) */
.modal, .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 15px; }
.modal-content, .modal-box { background: #fff; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; border-radius: 14px; padding: 24px; }

/* ============================================================
   DASHBOARD (index.php) - menu de modulos
   ============================================================ */
.main-header { background: #fff; padding: 15px max(24px, env(safe-area-inset-right)); padding-left: max(24px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 2px 15px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #eee; }
.brand { display: flex; align-items: center; gap: 15px; }
.brand-icon { font-size: 1.4rem; color: var(--primary); background: #eef2f7; padding: 10px; border-radius: 12px; }
.brand-text h1 { margin: 0; font-size: 1.15rem; font-weight: 700; color: #1a202c; }
.brand-text p { margin: 0; font-size: 0.8rem; color: var(--text-light); }
.user-info { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; }
.user-details { text-align: right; }
.user-details strong { display: block; }
.user-badge { background: #edf2f7; padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; color: #4a5568; text-transform: uppercase; font-weight: bold; }
.dashboard-container { max-width: 1400px; margin: 30px auto; padding: 0 20px; }
.section-divider { display: flex; align-items: center; margin: 32px 0 18px; color: #4a5568; font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 1px; }
.section-divider::after { content: ''; flex-grow: 1; height: 1px; background: var(--border); margin-left: 18px; }
.section-divider i { margin-right: 10px; color: #5b6b7c; /* escurecido de #a0aec0 (2.26:1) p/ var(--text-light) — WCAG AA */ }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { background: var(--card-bg); border-radius: 16px; border: 1px solid rgba(0,0,0,0.04); box-shadow: 0 4px 6px rgba(0,0,0,0.02); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: transform .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--accent-color, var(--primary)); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.card:hover::before { transform: scaleX(1); }
.card-header { padding: 22px 22px 8px; display: flex; align-items: center; gap: 14px; }
.icon-bubble { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; color: #fff; background: var(--accent-color, var(--primary)); }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #2d3748; }
.card-subtitle { font-size: 0.78rem; color: var(--text-light); }
.card-body { padding: 16px 22px 22px; flex-grow: 1; display: flex; flex-direction: column; gap: 9px; }
.menu-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #f7fafc; border-radius: 10px; text-decoration: none; color: #4a5568; font-weight: 500; font-size: 0.9rem; transition: all .2s; border: 1px solid transparent; }
.menu-link:hover { background: #fff; border-color: var(--accent-color, var(--primary)); color: var(--accent-color, var(--primary)); }
.menu-link.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.footer { text-align: center; margin-top: 50px; color: #cbd5e0; font-size: 0.8rem; padding-bottom: 30px; }
/* Cores de acento por modulo */
.card-porto{--accent-color:#e67e22}.card-acai{--accent-color:#8e44ad}.card-molho{--accent-color:#2980b9}
.card-lab{--accent-color:#16a085}.card-producao{--accent-color:#27ae60}.card-diario{--accent-color:#c0392b}
.card-crm{--accent-color:#f1c40f}.card-eng{--accent-color:#3f51b5}.card-op{--accent-color:#34495e}.card-admin{--accent-color:#7f8c8d}

/* ============================================================
   UTILITARIOS DE TOQUE (Atomic Design)
   ============================================================ */
.touch-target {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ============================================================
   PREFERENCIAS DO USUARIO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   RESPONSIVO — CELULAR (ate 480px)
   ============================================================ */
@media (max-width: 480px) {
  .container, .paper { padding: 16px; border-radius: 0; }
  .grid-row { grid-template-columns: 1fr; }
  .full-width { grid-column: 1; }
  .header-top { align-items: flex-start; }
  .header-top .btn-new, .header-top .btn, .btn-save { width: 100%; }
  .main-header { padding: 12px max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .dashboard-container { padding: 0 12px; margin: 18px auto; }
  .modules-grid { grid-template-columns: 1fr; gap: 16px; }
  .user-details { display: none; } /* poupa espaco no topo do celular */
}

/* ============================================================
   RESPONSIVO — TABLET (481px a 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   NAVEGAÇÃO MOBILE (M2) — bottom nav + bottom-sheet do menu
   Só aparece no celular/tablet (≤768px); no desktop usa-se o menu (index).
   ============================================================ */
.bottom-nav { display: none; }
.bottom-nav-spacer { display: none; }

@media (max-width: 768px) {
  .bottom-nav-spacer { display: block; height: calc(58px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
    background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-height: 56px; padding: 6px 2px; border: none; background: none;
    color: #4a5568; /* escurecido de #718096 (4.02:1) para #4a5568 (7.53:1) — WCAG AA */
    font-size: 0.66rem; font-weight: 600; line-height: 1.1;
    text-decoration: none; cursor: pointer; font-family: inherit;
  }
  .bottom-nav a i, .bottom-nav button i { font-size: 1.15rem; }
  .bottom-nav a.active { color: var(--primary); }
}

/* Bottom-sheet com a lista completa de módulos (aberto pelo botão Menu) */
.nav-sheet-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 950; }
.nav-sheet-overlay.open { display: block; }
.nav-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 960;
  background: #fff; border-radius: 16px 16px 0 0; max-height: 82vh; overflow-y: auto;
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease;
}
.nav-sheet.open { transform: translateY(0); }
.nav-sheet .sheet-handle { width: 40px; height: 4px; background: #cbd5e0; border-radius: 2px; margin: 10px auto 6px; }
.nav-sheet .sheet-title { text-align: center; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.nav-sheet h4 { margin: 14px 0 4px; font-size: 0.74rem; text-transform: uppercase; color: #4a5568; /* escurecido de #718096 (4.02:1) p/ #4a5568 (7.53:1) — WCAG AA */ letter-spacing: .5px; }
.nav-sheet a {
  display: flex; align-items: center; gap: 12px; padding: 13px 6px; min-height: var(--touch-min);
  border-bottom: 1px solid #f0f0f0; color: var(--dark); text-decoration: none; font-weight: 500;
}
.nav-sheet a i { width: 22px; text-align: center; color: var(--primary); }

/* ============================================================
   MODAIS → BOTTOM-SHEET NO CELULAR (M5)
   No ≤480px o modal sobe de baixo, largura total, cantos só no topo.
   Cobre as páginas que usam o modal do design system (.modal-overlay/.modal-content).
   Páginas com modal de estilo próprio têm um override equivalente no <style> delas.
   ============================================================ */
@keyframes sheetUp { from { transform: translateY(100%); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 480px) {
  .modal, .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-content, .modal-box {
    max-width: none; width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    animation: sheetUp .25s ease;
  }
}

/* ============================================================
   TOAST — feedback nao-bloqueante (substitui alert())
   Uso via JS: toast('Mensagem', 'ok'|'erro'|'aviso') — ver assets/js/app.js
   ============================================================ */
.toast-stack {
  position: fixed; z-index: 2000;
  left: 50%; transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom)); /* acima da bottom-nav no mobile */
  display: flex; flex-direction: column; gap: 10px;
  width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 769px) { .toast-stack { bottom: 24px; } }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--dark); color: #fff;
  padding: 14px 16px; border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  font-size: 0.95rem; font-weight: 600;
  border-left: 5px solid #fff;
  animation: sheetUp .2s ease;
}
.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast .toast-close { margin-left: auto; background: none; border: none; color: #fff; opacity: .7; cursor: pointer; font-size: 1rem; padding: 4px; }
.toast .toast-close:hover { opacity: 1; }
.toast .toast-action { margin-left: auto; background: rgba(255,255,255,0.18); border: none; color: #fff; cursor: pointer; font-weight: 700; padding: 6px 12px; border-radius: 6px; min-height: 36px; }
.toast-ok    { border-left-color: var(--success); }
.toast-erro  { border-left-color: var(--danger); }
.toast-aviso { border-left-color: var(--warning); }

/* ============================================================
   ESTADO VAZIO — nunca "Nenhum registro" seco (NN/g)
   ============================================================ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 2.6rem; color: #cbd5e0; margin-bottom: 12px; display: block; }
.empty-state h3 { color: var(--text-main); margin: 0 0 6px; }
.empty-state p { margin: 0 auto 16px; max-width: 34ch; }
/* Quando usado dentro de <td colspan> num tbody */
td .empty-state { padding: 30px 12px; }

/* ============================================================
   ESTADO DE CARREGANDO — skeleton/spinner (visibilidade de status)
   ============================================================ */
.is-loading { position: relative; min-height: 80px; pointer-events: none; }
.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ACAO DESTRUTIVA DISCRETA (Lei de Fitts)
   Botao de excluir em linha: menor e afastado da acao principal.
   ============================================================ */
.btn-ghost-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; min-width: 40px; padding: 8px 12px;
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 8px;
  font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.85rem;
  transition: background .15s, color .15s;
}
.btn-ghost-danger:hover { background: var(--danger); color: #fff; }

/* Dica contextual (tooltip acessivel via title/aria) e icone de ajuda */
.info-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #cbd5e0; color: #2d3748; font-size: 0.7rem; font-weight: 700;
  margin-left: 6px; cursor: help; vertical-align: middle;
}

/* Conteudo so para leitor de tela (acessibilidade) */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Foco visivel reforcado (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px;
}

/* ============================================================
   BREADCRUMB — rastro de navegação (Issue #7 / §3.4 Auditoria)
   Uso:
     <nav class="breadcrumb" aria-label="Caminho">
       <a href="index.php">Início</a>
       <a href="financeiro_titulos.php">Financeiro</a>
       <span aria-current="page">Título #42</span>
     </nav>
   O separador › é inserido via CSS (sem texto extra no HTML).
   Aparece abaixo da .top-nav e acima do .container/.paper.
   ============================================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 8px max(20px, env(safe-area-inset-right));
  padding-left: max(20px, env(safe-area-inset-left));
  background: var(--dark);           /* mesmo fundo da top-nav — continuidade */
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  margin-bottom: 20px;
}
.breadcrumb a,
.breadcrumb span {
  color: #a0aec0;
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 0;
}
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb span[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  /* trunca nomes longos (ex.: título com descrição extensa) */
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Separador › entre itens */
.breadcrumb a::after,
.breadcrumb span:not([aria-current="page"])::after {
  content: '›';
  margin: 0 8px;
  color: #4a5568;
  font-weight: normal;
}

@media (max-width: 480px) {
  .breadcrumb { font-size: 0.75rem; padding: 6px 16px; }
  .breadcrumb span[aria-current="page"] { max-width: 18ch; }
}

/* ============================================================
   ORDENS DE PRODUÇÃO (.op-*) — controle_op.php (issue #38)
   Mobile-first: 1 coluna por padrão; 2 colunas em >768px.
   ============================================================ */

/* Layout principal: painel criar + lista de OPs */
.op-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 769px) {
  .op-layout { grid-template-columns: 350px 1fr; }
}

/* Card de nova OP */
.op-card-new {
  background: var(--card-bg); padding: 24px; border-radius: var(--radius-md);
  box-shadow: var(--shadow); height: fit-content;
  border-top: 4px solid #f1c40f;
}
.op-form-group { margin-bottom: 15px; }

/* Preview de ingredientes */
.op-ingredientes-preview {
  background: #f9f9f9; padding: 10px; border: 1px dashed #ccc;
  margin-top: 15px; border-radius: var(--radius-sm); font-size: 0.9rem;
  max-height: 200px; overflow-y: auto; display: none;
}
.op-ing-row {
  display: flex; justify-content: space-between;
  border-bottom: 1px solid #eee; padding: 4px 0;
}

/* Card de cada OP existente */
.op-card {
  background: var(--card-bg); border-radius: var(--radius-md);
  box-shadow: var(--shadow); margin-bottom: 20px;
  overflow: hidden; border: 1px solid var(--border);
}
.op-header {
  background: #ecf0f1; padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; border-bottom: 1px solid #ddd; flex-wrap: wrap;
}
.op-title { font-weight: bold; font-size: 1.05rem; color: var(--primary); }
.op-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }
.op-custo { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }
.op-custo i { color: #f1c40f; margin-right: 3px; }
.op-status { font-weight: bold; color: var(--primary); font-size: 0.9rem; white-space: nowrap; }

/* ---- Stepper de etapas ---- */
/* Mobile-first: empilhado em coluna */
.op-stepper-container { padding: 16px; }
.op-stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* Linha vertical conectora no mobile */
.op-stepper::before {
  content: '';
  position: absolute;
  top: 15px; bottom: 15px; left: 14px;
  width: 2px;
  background: #ddd;
  z-index: 0;
}

.op-step {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 12px;
}
.op-step-circle {
  width: 30px; height: 30px; flex-shrink: 0;
  background: #ddd; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: bold; font-size: 0.8rem;
  transition: background 0.3s;
}
.op-step-body { flex: 1; padding-top: 4px; }
.op-step-label { font-size: 0.9rem; color: var(--text-light); font-weight: 500; line-height: 1.3; }
.op-step-action { margin-top: 8px; }

/* Estados do step */
.op-step.done .op-step-circle  { background: var(--success); }
.op-step.active .op-step-circle {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.2);
}
.op-step.pending .op-step-circle { background: #bdc3c7; }

/* No desktop (≥768px) o stepper volta a ser horizontal */
@media (min-width: 769px) {
  .op-stepper {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .op-stepper::before {
    top: 14px; bottom: auto; left: 0; right: 0;
    width: 100%; height: 2px;
  }
  .op-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    gap: 0;
  }
  .op-step-circle { margin-bottom: 10px; }
  .op-step-body { padding-top: 0; }
  .op-step-label { font-size: 0.85rem; }
}

/* Botões inline do stepper — alvo ≥44px */
.op-btn-step {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 14px; font-size: 0.82rem;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  color: white; font-weight: 600; font-family: inherit;
}
.op-btn-start  { background: #3498db; }
.op-btn-start:hover  { background: #2980b9; }
.op-btn-finish { background: var(--success); }
.op-btn-finish:hover { background: #219150; }

/* Área de finalização (enviar para estoque) */
.op-action-area {
  padding: 15px; background: #fdfefe;
  border-top: 1px solid #eee; text-align: right;
}
.op-msg-done {
  color: var(--success); font-weight: bold;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}

/* Empty state dentro da lista de OPs */
.op-empty-state {
  background: var(--card-bg); border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
