/* =============================================================================
   PLATAFORMA DE VENDAS : painel administrativo
   Cores e fontes vindas da identidade da Forte Split (branding/tokens.css)
   ============================================================================= */

:root {
  --primary: #1d5466;
  --primary-dark: #143845;
  --secondary: #2c7e9c;
  --accent: #e85d2c;
  --accent-dark: #c4471f;
  --warm: #ff7a45;
  --green: #25d366;
  --green-dark: #128c7e;
  --gold: #f59e0b;
  --bg: #eef5f7;
  --surface: rgba(255, 255, 255, 0.78);
  --border: rgba(29, 84, 102, 0.14);
  --shadow-sm: 0 2px 18px rgba(29, 84, 102, 0.1);
  --shadow-md: 0 8px 36px rgba(29, 84, 102, 0.16);
  --text: #0e2730;
  --muted: rgba(14, 39, 48, 0.62);
  --muted-2: rgba(14, 39, 48, 0.36);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --fd: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fb: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, monospace;
}

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

body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .fd { font-family: var(--fd); letter-spacing: -0.02em; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--fm); font-size: 0.9em; }

/* ---------------------------------------------------------------- ESTRUTURA */
.app { display: flex; min-height: 100vh; }

.lateral {
  width: 250px; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
}
.lateral .marca { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.lateral .marca img { width: 100%; max-width: 170px; filter: brightness(0) invert(1); }
.lateral nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.lateral nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.82); font-size: 14px; font-weight: 500; margin-bottom: 3px; text-decoration: none;
  transition: background .15s, color .15s;
}
.lateral nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.lateral nav a.ativo { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(232,93,44,.35); }
.lateral nav a .ic { width: 20px; text-align: center; font-size: 16px; }
.lateral .rodape { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.7); }
.lateral .rodape strong { display: block; color: #fff; font-size: 13.5px; }
.lateral .rodape button {
  margin-top: 10px; width: 100%; background: rgba(255,255,255,.14); color: #fff; border: 0;
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--fb); font-size: 13px;
}
.lateral .rodape button:hover { background: rgba(255,255,255,.24); }

.miolo { flex: 1; margin-left: 250px; padding: 26px 30px 70px; max-width: 1500px; }

.topo-mobile { display: none; }

/* ------------------------------------------------------------------ CABECALHO */
.cabecalho { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecalho h1 { font-size: 25px; font-weight: 800; }
.cabecalho p { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* ---------------------------------------------------------------- COMPONENTES */
.cartao {
  background: var(--surface); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px;
}
.cartao > h2 { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 15px; }

.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.numero {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.numero::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.numero.laranja::after { background: var(--accent); }
.numero.verde::after { background: var(--green-dark); }
.numero.dourado::after { background: var(--gold); }
.numero.vermelho::after { background: var(--accent-dark); }
.numero .rot { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.numero .val { font-family: var(--fd); font-size: 27px; font-weight: 800; margin-top: 5px; letter-spacing: -.03em; }
.numero .sub { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------- TABELAS */
.rolagem { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--border); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.6); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.forte { font-weight: 700; }
.apoio { font-size: 12.5px; color: var(--muted); }
.dinheiro { font-variant-numeric: tabular-nums; font-weight: 600; }
.riscado { text-decoration: line-through; color: var(--muted-2); font-weight: 400; }

/* ---------------------------------------------------------------- FORMULARIO */
.campo { margin-bottom: 15px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--fb); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(44,126,156,.16);
}
input[type=checkbox] { width: auto; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.filtros { display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end; }
.filtros .campo { margin-bottom: 0; flex: 1; min-width: 170px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #fff; border: 0; padding: 11px 19px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--fb); text-decoration: none; white-space: nowrap;
  transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.laranja { background: var(--accent); }
.btn.laranja:hover { background: var(--accent-dark); }
.btn.verde { background: var(--green-dark); }
.btn.claro { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.claro:hover { background: #f7fafb; color: var(--text); }
.btn.pequeno { padding: 6px 13px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --------------------------------------------------------------------- AVISOS */
.aviso { padding: 13px 17px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.aviso.ok { background: #e9f9f1; color: #0b6b45; border: 1px solid #b6ecd3; }
.aviso.erro { background: #fdecea; color: #9b2c17; border: 1px solid #f8ccc2; }
.aviso.info { background: #eaf3f7; color: #14526b; border: 1px solid #c5dfe9; }

.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.etiqueta.cinza { background: rgba(14,39,48,.07); color: var(--muted); }
.etiqueta.verde { background: #e9f9f1; color: #0b6b45; }
.etiqueta.amarela { background: #fff5e5; color: #96590a; }
.etiqueta.vermelha { background: #fdecea; color: #9b2c17; }
.etiqueta.azul { background: #eaf3f7; color: #14526b; }
.etiqueta.laranja { background: #fdeee7; color: var(--accent-dark); }

/* ---------------------------------------------------------------------- LOGIN */
.login-tela { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 60%, #0b2b36 100%); }
.login-caixa { width: 100%; max-width: 400px; }
.login-caixa .marca { text-align: center; margin-bottom: 26px; }
.login-caixa .marca img { width: 210px; filter: brightness(0) invert(1); }
.login-caixa .marca p { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 8px; }
.login-caixa .cartao { background: #fff; }

/* -------------------------------------------------------------- NOVO PEDIDO */
.busca-produto { position: relative; }
.sugestoes {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 340px; overflow-y: auto; z-index: 40;
}
.sugestao { padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.sugestao:last-child { border-bottom: 0; }
.sugestao:hover, .sugestao.marcada { background: #eaf3f7; }
.sugestao .nome { font-weight: 600; font-size: 14px; }
.sugestao .det { font-size: 12px; color: var(--muted); }
.sugestao .preco { font-family: var(--fd); font-weight: 800; color: var(--primary); white-space: nowrap; }
.sugestao.sem-estoque { opacity: .55; }

.linha-item { display: grid; grid-template-columns: 1fr 92px 118px 118px 44px; gap: 11px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.linha-item .explicacao { font-size: 12px; color: var(--green-dark); font-weight: 600; }
.linha-item .alerta { font-size: 12px; color: var(--accent-dark); font-weight: 700; }
.remover { background: #fdecea; color: #9b2c17; border: 0; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px; }
.remover:hover { background: #f8ccc2; }

.totais { display: flex; justify-content: flex-end; }
.totais table { width: auto; min-width: 290px; }
.totais td { border: 0; padding: 5px 0; }
.totais .grande { font-family: var(--fd); font-size: 25px; font-weight: 800; color: var(--primary); }

.barra-acao { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 72%, transparent);
  padding: 16px 0 8px; display: flex; gap: 11px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ CARREGANDO */
.esqueleto { background: linear-gradient(90deg, rgba(255,255,255,.5) 25%, rgba(255,255,255,.85) 50%, rgba(255,255,255,.5) 75%);
  background-size: 200% 100%; animation: brilho 1.3s infinite; border-radius: var(--radius-sm); height: 15px; margin: 9px 0; }
@keyframes brilho { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.vazio { text-align: center; padding: 44px 20px; color: var(--muted); }
.vazio .ic { font-size: 40px; opacity: .35; margin-bottom: 12px; }

/* ---------------------------------------------------------------------- MODAL */
.fundo-modal { position: fixed; inset: 0; background: rgba(14,39,48,.55); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: #fff; border-radius: var(--radius); max-width: 520px; width: 100%; box-shadow: var(--shadow-md);
  max-height: 90vh; overflow-y: auto; }
.modal .cab { padding: 19px 22px; border-bottom: 1px solid var(--border); font-family: var(--fd); font-weight: 800; font-size: 17px; }
.modal .corpo { padding: 22px; }
.modal .pe { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* --------------------------------------------------------------------- CELULAR */
@media (max-width: 900px) {
  .lateral { transform: translateX(-100%); transition: transform .22s; width: 265px; }
  .lateral.aberta { transform: translateX(0); box-shadow: var(--shadow-md); }
  .miolo { margin-left: 0; padding: 14px 15px 60px; }
  .topo-mobile {
    display: flex; align-items: center; gap: 13px; background: var(--primary); color: #fff;
    padding: 12px 15px; position: sticky; top: 0; z-index: 50;
  }
  .topo-mobile img { height: 26px; filter: brightness(0) invert(1); }
  .topo-mobile button { background: rgba(255,255,255,.16); border: 0; color: #fff; width: 38px; height: 38px;
    border-radius: 9px; font-size: 19px; cursor: pointer; }

  /* Tabela vira cartao: em tela estreita nunca tabela */
  table.responsiva thead { display: none; }
  table.responsiva tr { display: block; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 10px; padding: 9px 11px; }
  table.responsiva td { display: flex; justify-content: space-between; gap: 12px; align-items: center;
    border: 0; padding: 5px 0; text-align: right; }
  table.responsiva td::before { content: attr(data-rot); font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted); font-weight: 700; text-align: left; }
  table.responsiva td.cheia { display: block; text-align: left; }
  table.responsiva td.cheia::before { content: ''; }

  .linha-item { grid-template-columns: 1fr 1fr; }
  .numero .val { font-size: 23px; }
}
