:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1d2330;
  --muted: #6b7280;
  --accent: #2563eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }

header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
header .logo { font-weight: 700; font-size: 1.2rem; color: var(--text); }
header nav { display: flex; gap: 1.2rem; margin-left: auto; align-items: center; }

main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

h1 { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.product .emoji { font-size: 3.5rem; text-align: center; display: block; }
.product h3 { margin: 0.6rem 0 0.3rem; font-size: 1.05rem; }
.price { font-weight: 700; font-size: 1.1rem; }
.stock { font-size: 0.85rem; color: var(--muted); }
.stock.low { color: #d97706; }
.stock.out { color: var(--danger); font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 0.8rem; }

button, .button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
}
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #e5e7eb; color: var(--text); }
button.danger { background: var(--danger); }

form { display: grid; gap: 0.8rem; max-width: 380px; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
input, select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.message { padding: 0.7rem 1rem; border-radius: 6px; margin: 1rem 0; }
.message.error { background: #fee2e2; color: #991b1b; }
.message.success { background: #dcfce7; color: #166534; }
.hint { font-size: 0.85rem; color: var(--muted); }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tile .value { font-size: 1.8rem; font-weight: 700; }
.tile .label { color: var(--muted); font-size: 0.85rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--ok); }
