/* Tema claro, alto contraste */
:root{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --shadow:0 6px 18px rgba(17,24,39,.06);
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --danger:#dc2626;
  --warn:#b45309;
  --ok:#059669;
  --radius:14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
}

.topbar{
  position:sticky; top:0;
  z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(160%) blur(12px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:40px;height:40px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  box-shadow: var(--shadow);
}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted)}
.right{display:flex; align-items:center; gap:10px}

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
}

.wrap{
  max-width:1100px;
  margin:18px auto;
  padding:0 14px 60px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}

.panelHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.panel h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}
.actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}

.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{border-color:#cbd5e1}
.btn:active{transform:translateY(1px)}
.btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btn.primary:hover{background:var(--primary2); border-color:var(--primary2)}
.btn.danger{
  background:#fff;
  border-color:#fecaca;
  color:var(--danger);
}
.btn.small{padding:8px 10px; border-radius:10px}

.field{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted)}
.field.inline{flex-direction:row; align-items:center; gap:10px}
.field input{
  font-size:14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  outline:none;
  background:#fff;
  color:var(--text);
}
.field input:focus{border-color:#93c5fd; box-shadow:0 0 0 4px rgba(147,197,253,.25)}
.srOnly{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width: 820px){.grid2{grid-template-columns:1fr}}

.idRow{display:flex; gap:8px; align-items:center}
.idRow input{flex:1}

.status{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:13px;
}
.status.info{background:#eff6ff;border-color:#bfdbfe;color:#1e40af}
.status.ok{background:#ecfdf5;border-color:#bbf7d0;color:#065f46}
.status.warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.status.err{background:#fef2f2;border-color:#fecaca;color:#991b1b}

.help{margin-top:10px}
.help summary{cursor:pointer; color:var(--muted); font-weight:700}
.helpBody{padding:8px 2px; color:var(--muted); font-size:13px}
.helpBody pre{
  background:#0b1220;
  color:#e5e7eb;
  padding:10px;
  border-radius:12px;
  overflow:auto;
}

.split{
  display:grid;
  grid-template-columns: 1fr 1.1fr;
  gap:14px;
}
@media (max-width: 980px){.split{grid-template-columns:1fr}}

.smallMuted{font-size:12px;color:var(--muted); margin-bottom:8px}

.list{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  min-height:320px;
}
.item{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:#fff;
}
.item:last-child{border-bottom:none}
.item .meta{display:flex; flex-direction:column; gap:2px}
.item .code{font-weight:900; letter-spacing:.2px}
.item .desc{font-size:13px; color:var(--muted)}
.item .add{white-space:nowrap}

.cartHead{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px}
.totals{display:flex; gap:12px; font-size:12px; color:var(--muted)}
.totals b{color:var(--text)}

.tableWrap{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:auto;
  background:#fff;
}
.table{width:100%; border-collapse:separate; border-spacing:0}
.table thead th{
  position:sticky; top:0;
  background:#f9fafb;
  border-bottom:1px solid var(--border);
  text-align:left;
  font-size:12px;
  color:var(--muted);
  padding:10px 12px;
}
.table td{
  border-bottom:1px solid var(--border);
  padding:10px 12px;
  vertical-align:middle;
  font-size:13px;
}
.table tr:last-child td{border-bottom:none}
.empty{color:var(--muted); text-align:center}

.qty{
  display:flex; align-items:center; gap:8px;
}
.qty button{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:900;
  cursor:pointer;
}
.qty button:hover{border-color:#cbd5e1}
.qty input{
  width:60px;
  text-align:center;
  padding:8px 8px;
  border-radius:12px;
  border:1px solid var(--border);
}

.saved{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.saved .row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}
.saved .row .meta{display:flex; flex-direction:column; gap:2px}
.saved .row .meta .id{font-weight:900}
.saved .row .meta .sub{font-size:12px; color:var(--muted)}
.saved .row .right{display:flex; gap:8px; align-items:center}

.footer{
  position:fixed;
  left:0; right:0; bottom:0;
  padding:10px 14px;
  border-top:1px solid var(--border);
  background:rgba(255,255,255,.86);
  backdrop-filter:saturate(160%) blur(12px);
  font-size:12px;
  color:var(--muted);
}
