/**
 * Общая тема UI (Figma Guidelines): Inter, primary #1D72D2, нейтрали.
 * Подключать первым; локальные страницы могут переопределять .shell, body и т.д. ниже по каскаду.
 */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #e1e4e8;
  --border-hover: #b9d1eb;
  --text: #1a2332;
  --muted: #6b7280;
  --accent: #1d72d2;
  --accent-hover: #1558a8;
  --accent-soft: rgba(29, 114, 210, 0.1);
  --danger: #f85c69;
  --danger-bg: #fef2f2;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Inter", ui-monospace, monospace;
  --radius: 6px;
  --radius-panel: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: clamp(16px, 3vw, 28px);
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 400;
}

.hint code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
}

.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

input,
select,
button {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-hover);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 114, 210, 0.2);
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: 600;
  border-radius: var(--radius);
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
}

button.secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

table.items {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.items th,
table.items td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

table.items thead th {
  background: #f5f6f8;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
}

.err {
  color: #b42318;
  background: var(--danger-bg);
  border: 1px solid rgba(248, 92, 105, 0.45);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin: 8px 0;
  font-size: 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

td.num input {
  text-align: right;
  max-width: 100px;
  font-family: var(--mono);
}

a.export {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

a.export:hover {
  text-decoration: underline;
}

td.muted {
  color: var(--muted);
  font-size: 11px;
}

input.inp-sm {
  max-width: 88px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
}

input.inp-unit {
  max-width: 64px;
  font-size: 11px;
}

input.qty-write::placeholder {
  color: #a8a29e;
  font-size: 10px;
}

button.icon-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

button.icon-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--border-hover);
}

input[type="number"] {
  text-align: right;
}
