:root {
  --primary: #5bbab2;
  --bg: #f6f7f8;
  --text: #1f2933;
  --border: #e5e7eb;
  --radius: 12px;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

h1 {
  margin-bottom: 8px;
}

p {
  margin-bottom: 24px;
  font-size: 15px;
  opacity: .85;
}

.btn-primary {
  display: block;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: .9;
}

.hint {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  opacity: .6;
}

.topbar {
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.topbar h1 {
  margin: 0;
}

.subtitle {
  font-size: 13px;
  opacity: .6;
}

.dashboard {
  padding: 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card-action {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

.card-action h2 {
  margin-top: 0;
}

.btn-secondary {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.muted {
  opacity: .6;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  padding: 4px 8px;
  background: #e5e7eb;
  border-radius: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.stat strong {
  font-size: 28px;
  display: block;
}

/* ===== Pedido Novo (compacto) ===== */

select, input, button { font: inherit; }

.fieldInput {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.field input {
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 15px;
}

.panel { padding: 14px; }
.pageWrap { padding: 14px; }

.row2 { gap: 10px; }
.row { gap: 10px; }

.rowItem {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.rowHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.rowGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.optHidden { display: none !important; }

.btn {
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;

  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.btn.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.errBox {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
}

.inputError {
  border-color: #ef4444 !important;
  background: #fff7f7 !important;
}

.addRowFooter {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.addRowFooter .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .addRowFooter .btn { width: auto; }
}

@media (min-width: 860px) {
  .panel { padding: 18px; }
  .pageWrap { padding: 18px; }

  .rowGrid {
    grid-template-columns: 140px 140px 1fr 140px 1fr;
    align-items: end;
  }
}


/* ===== Utilities ===== */

.hidden { display: none !important; }

.mb12 { margin-bottom: 12px; }
.mt12 { margin-top: 12px; }

.prewrap { white-space: pre-wrap; overflow: auto; }

.note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.pageWrap {
  max-width: 980px;
  margin: 0 auto;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.field input, .field select {
  border: 1px solid var(--border);
  outline: none;
}

.field input:focus, .field select:focus, .fieldInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 186, 178, .16);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 720px) {
  .row2 { grid-template-columns: 1fr 1fr; }
}

.stickyBar {
  position: sticky;
  bottom: 0;
  margin-top: 14px;
  padding: 12px 0 0;
  background: rgba(246, 247, 248, .92);
  backdrop-filter: blur(6px);
}

.barInner {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn:hover { background: #f3f4f6; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { opacity: .92; }
