:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1e2933;
  --muted: #637083;
  --line: #d9e0e8;
  --primary: #166b5f;
  --primary-dark: #0f5148;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #0f7b38;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}
a { color: var(--primary); }
.app-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-size: 22px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.container { width: min(1120px, 100%); margin: 0 auto; padding: 22px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--primary-dark); }
.button.secondary, button.secondary { background: #e7ecf1; color: var(--text); }
.button.danger, button.danger { background: var(--danger); }
.button.big { min-height: 92px; font-size: 23px; }
.button.full { width: 100%; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 18px;
  background: white;
}
textarea { min-height: 90px; }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 15px; text-transform: uppercase; }
.stock-large { font-size: clamp(38px, 8vw, 74px); font-weight: 800; color: var(--primary); line-height: 1; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); font-weight: 700; }
.warning-text { color: var(--warning); font-weight: 700; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 12px; background: #e7f6ee; border: 1px solid #b7e0c7; }
.flash.error { background: #fdecec; border-color: #f4b5b0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e7ecf1; font-size: 14px; }
.login { width: min(460px, 100%); margin: 60px auto; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .app-header { align-items: flex-start; flex-direction: column; }
  .container { padding: 14px; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: white; }
  td { border-bottom: 0; }
  td::before { content: attr(data-label); display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
}
