:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #617069;
  --line: #dbe2de;
  --paper: #ffffff;
  --wash: #f4f7f5;
  --accent: #1f684b;
  --low: #9a5b00;
  --review: #a33434;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .18em; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 3px; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-weight: 800; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 18px; }
nav a { font-weight: 650; }
.nav-logout { display: inline; }
.nav-logout button { padding: 0; color: var(--accent); background: none; border: 0; font-weight: 650; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.page-header { padding: 54px 0 24px; max-width: 760px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, th, td, .brand, .alert-card { overflow-wrap: anywhere; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.04em; }
h2 { margin-bottom: 6px; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)) auto auto; align-items: end; gap: 12px; margin-bottom: 28px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.filters--history { grid-template-columns: repeat(5, minmax(130px, 1fr)) auto auto; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.catalog-list, .operation-grid { display: grid; gap: 14px; }
.catalog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.form-card { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.form-card form { display: grid; gap: 12px; }
.form-card form p { margin: 0; }
.form-card textarea { width: 100%; }
.message { padding: 12px 16px; color: #245c3c; background: #e8f5ed; border: 1px solid #b9dbc6; border-radius: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 700; }
select, input { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--paper); border: 1px solid #aebbb4; border-radius: 9px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 16px; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 10px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button--quiet { color: var(--ink); background: var(--paper); border-color: #aebbb4; }
section { margin: 28px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.section-heading > p { max-width: 420px; color: var(--muted); }
.unit { padding: 5px 10px; background: #e4eee8; border-radius: 99px; font-weight: 700; }
.selected-product, .empty-state { padding: clamp(20px, 4vw, 34px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state { border-left: 5px solid #8b9a92; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.metrics article { padding: 18px; background: var(--wash); border-radius: 12px; }
.metrics span, .metrics small, td small, th small { display: block; color: var(--muted); }
.metrics strong { display: block; margin-top: 8px; font-size: clamp(1.2rem, 3vw, 1.8rem); }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); background: #eef3f0; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child > * { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 800; }
.status::before { width: 9px; height: 9px; content: ""; background: #4e7b66; border-radius: 50%; }
.status--low_stock { color: var(--low); }
.status--low_stock::before { background: #d6870c; }
.status--needs_review { color: var(--review); }
.status--needs_review::before { background: #c64f4f; }
.status--not_configured { color: #5d6670; }
.status--not_configured::before { background: #8b949e; }
.inline-empty { padding: 18px; color: var(--muted); background: var(--paper); border: 1px dashed #aebbb4; border-radius: 12px; }
.alert-list { display: grid; gap: 10px; }
.alert-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.alert-card p { margin-bottom: 4px; }
.mobile-cards { display: none; }
.data-card { min-width: 0; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.data-card__head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.data-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.data-card dl div { min-width: 0; }
.data-card dt { color: var(--muted); font-size: .76rem; }
.data-card dd { margin: 2px 0 0; font-weight: 750; }
.pagination { align-items: center; justify-content: center; margin: 18px 0 40px; }
.auth-card { width: min(440px, 100%); margin: 64px auto; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-card form { display: grid; gap: 16px; }
.form-error { padding: 12px; color: var(--review); background: #fff0f0; border-radius: 9px; }
@media (max-width: 920px) {
  .filters, .filters--history { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-table { display: none; }
  .mobile-cards { display: grid; gap: 10px; }
  .operation-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); }
  .site-header__inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  nav { gap: 12px; font-size: .9rem; }
  .page-header { padding-top: 36px; }
  .filters, .filters--history, .metrics { grid-template-columns: 1fr; }
  .section-heading, .alert-card { align-items: flex-start; flex-direction: column; }
  .data-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .button { width: 100%; }
  .catalog-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
