:root {
  --bg: #f6f1ea;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #b45309;
  --primary-dark: #92400e;
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 241, 234, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand strong { font-size: 18px; }
.brand span { color: var(--muted); font-size: 13px; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a, .btn, button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary, .nav a.secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger { background: var(--danger); }
.btn-ok { background: var(--ok); }

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { align-items: flex-start; flex-direction: column; }
}

.produto-card {
  overflow: hidden;
  padding: 0;
}

.produto-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f3f4f6;
  display: block;
}

.produto-body {
  padding: 16px;
}

.produto-title {
  font-size: 18px;
  margin: 0 0 6px;
}

.produto-desc {
  color: var(--muted);
  min-height: 40px;
  font-size: 14px;
}

.preco {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-dark);
}

.categoria-title {
  margin-top: 32px;
  border-bottom: 2px solid rgba(180,83,9,.22);
  padding-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: white;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  margin: 10px 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}

.toolbar > * {
  flex: 1 1 180px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.alert-ok {
  background: #dcfce7;
  color: #166534;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-ok { background: #dcfce7; color: #166534; }
.status-off { background: #fee2e2; color: #991b1b; }
.status-warn { background: #fef3c7; color: #92400e; }

.item-carrinho {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.footer-actions {
  position: sticky;
  bottom: 0;
  background: rgba(246, 241, 234, .95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,.08);
  padding: 12px 0;
}
