/* ===========================
   PDV Padaria - App Theme
   Fase 1: UI/UX (visual apenas)
   =========================== */

:root{
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;

  /* cores base (próximas do que você pediu) */
  --primary: #023D54;
  --secondary: #14A0AF;

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;

  --shadow: 0 8px 24px rgba(2, 61, 84, 0.10);
  --radius: 14px;
}

*{ box-sizing: border-box; }

.pdv-body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.pdv-shell{
  padding: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.pdv-topbar{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display:flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.pdv-title{
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.pdv-subtitle{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.pdv-meta{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pdv-chip{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-size: 12px;
}
.pdv-chip-muted{ color: var(--muted); }
.pdv-chip-info{
  border-color: rgba(20,160,175,.35);
  background: rgba(20,160,175,.08);
}

.pdv-link{
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.pdv-link:hover{ text-decoration: underline; }

.pdv-shortcuts{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pdv-shortcut{
  background: rgba(2,61,84,.06);
  border: 1px solid rgba(2,61,84,.10);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #0b2b38;
}
.pdv-shortcut span{
  font-weight: 800;
  color: var(--primary);
  margin-right: 6px;
}

.pdv-alert{
  margin-top: 10px;
  border-radius: var(--radius);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--card);
}
.pdv-alert-sub{ margin-top: 4px; font-size: 12px; color: var(--muted); }

.pdv-alert-error{
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.08);
  color: #7f1d1d;
  font-weight: 700;
}
.pdv-alert-success{
  border-color: rgba(22,163,74,.30);
  background: rgba(22,163,74,.08);
  color: #14532d;
  font-weight: 700;
}
.pdv-alert-warning{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
  color: #7c2d12;
}

.pdv-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
  align-items: start;
}

.pdv-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.pdv-card-header{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.pdv-card-title{
  font-weight: 800;
  color: var(--primary);
}
.pdv-card-hint{
  font-size: 12px;
  color: var(--muted);
}

.pdv-form-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.pdv-field{
  display:flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}
.pdv-field-wide{ flex: 1 1 320px; min-width: 260px; }
.pdv-field span{ font-size: 12px; color: var(--muted); }

input[type="text"], input[type="password"], input[type="date"], select{
  height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 15px;
  background: #fff;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, select:focus{
  border-color: rgba(20,160,175,.7);
  box-shadow: 0 0 0 4px rgba(20,160,175,.12);
}

.pdv-help{
  font-size: 12px;
  color: var(--muted);
}

.pdv-btn{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  color: var(--primary);
}
.pdv-btn:hover{
  border-color: rgba(2,61,84,.35);
}
.pdv-btn:active{
  transform: translateY(1px);
}

.pdv-btn-primary{
  background: linear-gradient(180deg, rgba(20,160,175,.18), rgba(2,61,84,.06));
  border-color: rgba(20,160,175,.45);
}
.pdv-btn-big{
  height: 48px;
  border-radius: 14px;
  font-size: 15px;
}
.pdv-btn-ghost{
  background: transparent;
}

.pdv-btn-small{
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
  padding: 0 10px;
}

.pdv-table-wrap{
  overflow:auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pdv-table{
  border-collapse: collapse;
  width: 100%;
  min-width: 860px;
  background: #fff;
}
.pdv-table th, .pdv-table td{
  border-bottom: 1px solid var(--border);
  padding: 10px 10px;
  font-size: 13px;
}
.pdv-table th{
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  font-weight: 800;
}
.pdv-right{
  text-align: right;
}

.linha-selecionada{
  background: rgba(245,158,11,.18) !important;
}
.linha-ultimo{
  background: rgba(22,163,74,.12) !important;
  font-weight: 800;
}

.pdv-lastitem{
  border-color: rgba(22,163,74,.25);
  background: rgba(22,163,74,.06);
}
.pdv-lastitem-label{
  font-size: 12px;
  color: #14532d;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pdv-lastitem-desc{
  font-size: 16px;
  font-weight: 900;
  color: #14532d;
}
.pdv-lastitem-row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.pdv-lastitem-metrics{
  margin-top: 8px;
  color: #14532d;
}
.pdv-lastitem-metrics span{
  font-size: 12px;
  color: rgba(20,83,45,.75);
  margin-right: 6px;
}

.pdv-paycard{
  position: sticky;
  top: 12px;
}

.pdv-totalbox{
  border: 1px solid rgba(20,160,175,.30);
  background: rgba(20,160,175,.08);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.pdv-totalbox-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pdv-totalbox-value{
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  margin-top: 4px;
}

.pdv-actions{
  margin-top: 12px;
  display:grid;
  gap: 10px;
}

.pdv-split{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.troco-grande{
  font-size: 22px;
  font-weight: 900;
  padding: 10px 12px;
  border: 2px solid rgba(22,163,74,.55);
  background: rgba(22,163,74,.08);
  border-radius: 14px;
  display: inline-block;
  min-width: 200px;
}
.troco-erro{
  border-color: rgba(220,38,38,.70) !important;
  background: rgba(220,38,38,.10) !important;
}

.pdv-troco-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}

/* Responsivo básico (se abrir em janela menor) */
@media (max-width: 1100px){
  .pdv-grid{ grid-template-columns: 1fr; }
  .pdv-paycard{ position: static; }
  .pdv-table{ min-width: 760px; }
}

/* ===========================
   DASHBOARD (Menu Principal)
   =========================== */

.dash-wrap{
  margin-top: 12px;
}

.dash-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-card{
  display:flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--text);
  transition: transform .06s ease, border-color .12s ease;
}

.dash-card:hover{
  border-color: rgba(20,160,175,.45);
}

.dash-card:active{
  transform: translateY(1px);
}

.dash-ico{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(20,160,175,.10);
  border: 1px solid rgba(20,160,175,.22);
  font-size: 22px;
}

.dash-body{
  flex: 1;
  min-width: 0;
}

.dash-title{
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}

.dash-desc{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.dash-arrow{
  font-size: 22px;
  color: rgba(2,61,84,.45);
  font-weight: 900;
}

.dash-footer{
  margin-top: 12px;
  display:flex;
  justify-content:flex-end;
}

@media (max-width: 1100px){
  .dash-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px){
  .dash-grid{ grid-template-columns: 1fr; }
}


/* ===========================
   Inputs adicionais (global)
   =========================== */

input[type="email"],
textarea{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

textarea{
  resize: vertical;
  min-height: 80px;
}

input[type="email"]:focus,
textarea:focus{
  border-color: rgba(20,160,175,.7);
  box-shadow: 0 0 0 4px rgba(20,160,175,.12);
}

/* =========================
   Base global segura
   (não quebra formulários)
   ========================= */

body:not(.pdv-body){
  font-family: Arial, Helvetica, sans-serif;
  background:#f5f6fa;
  margin:0;
  color:#222;
  padding:18px;
}

body:not(.pdv-body) h1,
body:not(.pdv-body) h2,
body:not(.pdv-body) h3{ margin: 0 0 10px 0; }

body:not(.pdv-body) p{ margin: 6px 0; }

body:not(.pdv-body) hr{
  border:0;
  border-top:1px solid #e9e9e9;
  margin:14px 0;
}

body:not(.pdv-body) a{ color:#2b5aa6; text-decoration:none; }
body:not(.pdv-body) a:hover{ text-decoration:underline; }

/* “card” simples sem precisar mexer no HTML */
body:not(.pdv-body) > h1,
body:not(.pdv-body) > p,
body:not(.pdv-body) > form,
body:not(.pdv-body) > table,
body:not(.pdv-body) > hr,
body:not(.pdv-body) > button,
body:not(.pdv-body) > h2,
body:not(.pdv-body) > h3{
  max-width: 1100px;
  margin-left:auto;
  margin-right:auto;
}

body:not(.pdv-body) > h1{
  padding:14px 16px;
  background:#fff;
  border:1px solid #e6e6e6;
  border-radius:10px;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}

body:not(.pdv-body) > p,
body:not(.pdv-body) > form,
body:not(.pdv-body) > table,
body:not(.pdv-body) > hr,
body:not(.pdv-body) > button,
body:not(.pdv-body) > h2,
body:not(.pdv-body) > h3{
  background:#fff;
  border:1px solid #e6e6e6;
  border-radius:10px;
  padding:12px 16px;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}

body:not(.pdv-body) table{
  width:100%;
  border-collapse:collapse;
}

body:not(.pdv-body) th,
body:not(.pdv-body) td{
  border:1px solid #e6e6e6;
  padding:8px;
  font-size:14px;
}

body:not(.pdv-body) th{
  background:#f2f4f8;
  text-align:left;
}

body:not(.pdv-body) input[type="text"],
body:not(.pdv-body) input[type="email"],
body:not(.pdv-body) select,
body:not(.pdv-body) textarea{
  padding:8px 10px;
  border:1px solid #d5d5d5;
  border-radius:8px;
  outline:none;
}

body:not(.pdv-body) input[type="text"]:focus,
body:not(.pdv-body) input[type="email"]:focus,
body:not(.pdv-body) select:focus,
body:not(.pdv-body) textarea:focus{
  border-color:#2b5aa6;
  box-shadow:0 0 0 2px rgba(43,90,166,.12);
}

body:not(.pdv-body) button{
  padding:8px 12px;
  border:0;
  border-radius:8px;
  background:#2b5aa6;
  color:#fff;
  cursor:pointer;
}

body:not(.pdv-body) button:hover{
  filter:brightness(.96);
}

/* ===========================
   CONTAS A PAGAR (telas CRUD)
   =========================== */

.pdv-actions-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.pdv-actions-left,
.pdv-actions-right{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pdv-btn-link{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  text-decoration:none;
}

.pdv-kpis{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pdv-kpi{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}
.pdv-kpi-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pdv-kpi-value{
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

.pdv-row-danger{ background: rgba(220,38,38,.08); }
.pdv-row-muted{ color: #555; background: #f7f7f7; }

.pdv-table td .pdv-miniform{
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.pdv-miniform label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.pdv-miniform input[type="text"],
.pdv-miniform input[type="date"]{
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
}

.pdv-miniform .pdv-btn{
  height: 38px;
  border-radius: 10px;
}

@media (max-width: 900px){
  .pdv-kpis{ grid-template-columns: 1fr; }
}
/* =========================
   CONTAS A PAGAR (ajustes)
   ========================= */

/* resumo em 3 colunas */
.pdv-summary-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.pdv-summary-item{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}
.pdv-summary-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pdv-summary-value{
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

/* linhas da tabela (atraso/pago) */
.pdv-row-late{
  background: rgba(220, 38, 38, .10) !important;
}
.pdv-row-paid{
  opacity: .75;
  background: rgba(15, 23, 42, .03) !important;
}

/* status “pill” */
.pdv-badge{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: #fff;
}
.pdv-badge-open{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
  color: #7c2d12;
}
.pdv-badge-paid{
  border-color: rgba(22,163,74,.30);
  background: rgba(22,163,74,.08);
  color: #14532d;
}
.pdv-badge-cancel{
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.08);
  color: #7f1d1d;
}

/* tabela com “cara” de sistema + larguras mais “antigas” */
.pdv-table-contas{
  table-layout: fixed;
  min-width: 1400px; /* deixa parecido com o “layout antigo” */
}
.pdv-table-contas th, .pdv-table-contas td{
  vertical-align: top;
}
.pdv-col-id{ width: 60px; }
.pdv-col-forn{ width: 190px; }
.pdv-col-desc{ width: 260px; }
.pdv-col-venc{ width: 110px; }
.pdv-col-vtot{ width: 120px; }
.pdv-col-vpag{ width: 120px; }
.pdv-col-rest{ width: 120px; }
.pdv-col-status{ width: 90px; }
.pdv-col-atr{ width: 90px; }
.pdv-col-ent{ width: 110px; }
.pdv-col-obs{ width: 260px; }
.pdv-col-pag{ width: 320px; }

/* formulário de pagamento “compacto” dentro da célula */
.pdv-payform{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.pdv-payform .pdv-field{
  min-width: 0;
}
.pdv-payform input[type="text"],
.pdv-payform input[type="date"]{
  width: 100%;
}
.pdv-payform .pdv-payform-actions{
  grid-column: 1 / -1;
  display:flex;
  justify-content:flex-end;
}
@media (max-width: 900px){
  .pdv-summary-grid{ grid-template-columns: 1fr; }
  .pdv-table-contas{ min-width: 1100px; }
  .pdv-payform{ grid-template-columns: 1fr; }
}
/* Resumo Contas a Pagar */
.pdv-resumo-inline{
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.pdv-resumo-item{
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 14px;
}

.pdv-resumo-item strong{
  font-weight: 900;
}

.pdv-resumo-item span{
  font-weight: 400;
}








/* --- Ajustes pontuais: busca fornecedor / busca itens / filtro entradas --- */
.pdv-form-row.pdv-row-nowrap{ flex-wrap:nowrap !important; }
.pdv-field-actions, .pdv-field[style*="display:flex"]{ white-space:nowrap; }
