:root {
  --ink: #163044;
  --muted: #5d7384;
  --line: #d7e3ec;
  --paper: #f4f7fa;
  --card: #fff;
  --teal: #0f3d56;
  --teal-btn: #147a9e;
  --blue: #1565c0;
  --green: #1f9d55;
  --orange: #e06a1f;
  --danger: #b42318;
  --low-bg: #fdecee;
  --low-text: #c62828;
  --ok-bg: #e7f6ee;
  --ok-text: #1b7f45;
  --warn-bg: #fff6d8;
  --warn-text: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button, input { font: inherit; }

a { color: inherit; }

#app { min-height: 100vh; }

.gate {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-weight: 700;
  font-size: 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
}

.gate h1 {
  margin: 28px 0 8px;
  font-size: 28px;
}

.lede {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 46ch;
}

.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.role-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.role-card h2 { margin: 0; font-size: 20px; }

.role-card p { margin: 0; color: var(--muted); flex: 1; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-teal { background: var(--teal-btn); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--teal);
  border: 1px solid #b7c9d6;
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--teal);
  color: #fff;
}

.bar-actions, .switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.switch a, .bar button, .bar a.quiet {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  cursor: pointer;
}

.switch a.on { background: #fff; color: var(--teal); border-color: #fff; }

.stage { padding: 20px 16px 40px; }

.v1, .v2 {
  width: min(420px, 100%);
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(16, 48, 68, 0.08);
}

.v2 {
  background: #f7f9fc;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.head {
  background: var(--teal);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.head-blue { background: var(--blue); letter-spacing: 0; }

.body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.v2 .body { flex: 1; }

h2.screen { margin: 0; font-size: 22px; }

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

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.stat strong { font-size: 32px; }

.field {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.field label, .search-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.field input, .search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ok-title {
  margin: 8px 0 0;
  text-align: center;
  color: var(--green);
  letter-spacing: 0.04em;
}

.center { text-align: center; }

.notice {
  background: #fff4f2;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
}

.low { color: var(--orange); font-weight: 700; }

.aviso { color: var(--orange); font-weight: 700; margin: 0; }

.product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.product:last-child { border-bottom: 0; }

.glyph {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eef5;
  display: grid;
  place-items: center;
  flex: none;
}

.product .meta { flex: 1; }
.product .meta strong { display: block; }
.product .meta span { color: var(--muted); font-size: 13px; }

.qty-chip {
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}

.btn-add {
  background: #fff;
  color: var(--blue);
  border: 1px solid #b9d0ea;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.search input { background: #fff; }

.table-head, .table-row {
  display: grid;
  grid-template-columns: 1fr 52px 92px;
  gap: 8px;
  align-items: center;
}

.table-head {
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px 6px;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge-low { background: var(--low-bg); color: var(--low-text); }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }

.warn {
  display: flex;
  gap: 8px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 12px;
  padding: 12px;
}

.nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
}

.nav a {
  text-decoration: none;
  text-align: center;
  padding: 10px 4px 12px;
  color: var(--muted);
  font-size: 12px;
}

.nav a.on { color: var(--blue); font-weight: 700; }
.nav-one { grid-template-columns: 1fr; }

.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }

.welcome p { margin: 6px 0 0; color: var(--muted); }

.total { font-size: 18px; font-weight: 700; margin: 0; }

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