:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #1b2420;
  --muted: #6b7671;
  --line: #dfe6e1;
  --green: #176b4d;
  --green-soft: #e4f4eb;
  --blue: #245f9f;
  --blue-soft: #e6f0fb;
  --amber: #a95d14;
  --amber-soft: #fff1df;
  --red: #b33131;
  --red-soft: #ffe8e8;
  --shadow: 0 16px 42px rgba(24, 36, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.company-page {
  background: #f6f8f6;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.site-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-header nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.site-header nav a:hover {
  color: var(--green);
  background: var(--green-soft);
}

.company-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 78px);
  padding: clamp(28px, 5vw, 72px);
  color: #ffffff;
  background:
    linear-gradient(rgba(14, 33, 27, 0.82), rgba(14, 33, 27, 0.76)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.hero-logo {
  width: 104px;
  height: 104px;
  margin-bottom: 22px;
  border-radius: 24px;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.hero-copy span {
  color: #bce7cf;
  font-weight: 900;
}

.hero-copy h1 {
  margin: 14px 0 16px;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.95;
}

.hero-copy p {
  max-width: 660px;
  margin: 0;
  color: #e7f0eb;
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions .main-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.hero-panel {
  align-self: end;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-panel img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #ffffff;
}

.hero-panel span {
  display: block;
  margin-top: 6px;
  color: #dce9e2;
}

.company-band,
.company-flow,
.quick-links {
  padding: clamp(28px, 5vw, 64px);
}

.company-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  background: #ffffff;
}

.company-band article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.company-band span {
  color: var(--green);
  font-weight: 900;
}

.company-band h2,
.company-flow h2 {
  margin: 10px 0;
}

.company-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flow-grid div {
  padding: 22px;
  border-radius: 8px;
  color: #ffffff;
  background: #14221b;
  font-size: 20px;
  font-weight: 900;
}

.flow-grid span {
  display: block;
  margin-top: 8px;
  color: #c6d3cc;
  font-size: 13px;
  font-weight: 700;
}

.quick-links {
  background: #ffffff;
}

.quick-links h2 {
  margin: 0 0 18px;
}

.quick-links > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-links a {
  display: grid;
  gap: 8px;
  min-height: 120px;
  align-content: center;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.quick-links a:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.quick-links strong {
  font-size: 22px;
}

.quick-links span {
  color: var(--muted);
  line-height: 1.5;
}

.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  min-height: 100vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  color: #ffffff;
  background:
    linear-gradient(rgba(20, 34, 27, 0.86), rgba(20, 34, 27, 0.86)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
}

.mini-logo {
  border-radius: 10px;
}

.brand-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.login-brand h1 {
  margin: 24px 0 10px;
  font-size: 54px;
}

.login-brand p {
  max-width: 560px;
  margin: 0;
  color: #d7e3dc;
  font-size: 18px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 36px;
  background: var(--panel);
}

.login-form h2 {
  margin: 0 0 12px;
}

label,
small,
.page-title span,
.card p,
.item span,
.summary span {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

.compact-search {
  min-height: 40px;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

.login-form button,
.main-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 800;
}

.secondary-button {
  margin-bottom: 12px;
  color: var(--green);
  background: var(--green-soft);
}

.error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.app {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 78px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  color: #ffffff;
  background: #14221b;
}

.app-header > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 10px;
  align-items: center;
}

.mini-logo {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: #ffffff;
}

.app-header span {
  color: #c6d3cc;
  font-size: 13px;
}

.plain-button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 -10px 32px rgba(24, 36, 31, 0.08);
}

.bottom-nav button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.bottom-nav button.active {
  color: #ffffff;
  background: var(--green);
}

.screen {
  display: none;
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 16px;
}

.screen.active {
  display: block;
}

.page-title {
  margin-bottom: 16px;
}

.page-title h2 {
  margin: 4px 0 0;
  font-size: 26px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary article,
.card,
.item,
.order-total {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary article {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.summary strong {
  font-size: 22px;
}

.list {
  display: grid;
  gap: 10px;
}

.daily-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-list {
  margin-top: 10px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.report-row:last-child {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.item {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.good {
  color: var(--green);
  background: var(--green-soft);
}

.status.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.status.bad {
  color: var(--red);
  background: var(--red-soft);
}

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

.item-actions button,
.item-actions a,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #edf0ee;
  font-weight: 700;
  text-decoration: none;
}

.search,
.filters,
.form-card,
.order-total,
.message {
  margin-bottom: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.view-toggle button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: #edf0ee;
  font-weight: 800;
}

.view-toggle button.active {
  color: #ffffff;
  background: var(--green);
}

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

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.document-row.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.document-row div {
  display: grid;
  gap: 3px;
}

.document-row span {
  color: var(--muted);
  font-size: 13px;
}

.order-price-card {
  margin-bottom: 12px;
  box-shadow: none;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--green-soft);
}

.product-card div {
  display: grid;
  gap: 5px;
}

.catalog-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 54px minmax(160px, 1fr) 120px 90px 90px 70px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-row img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.table-row div {
  display: grid;
  gap: 4px;
}

.card {
  padding: 14px;
}

.form-card {
  display: grid;
  gap: 10px;
}

.client-picker {
  display: grid;
  gap: 8px;
}

.client-choice {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.client-choice span {
  color: var(--muted);
  font-size: 13px;
}

.client-choice.selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.product-line {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 10px;
  align-items: center;
}

.order-product {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.order-product img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.order-product-main {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 122px 78px;
  gap: 8px;
  align-items: center;
}

.order-product-main div:first-child {
  display: grid;
  gap: 4px;
}

.qty-box {
  display: grid;
  grid-template-columns: 30px 50px 30px;
  gap: 6px;
  align-items: center;
}

.qty-box button {
  width: 30px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.qty-box input {
  min-height: 34px;
  padding: 0 6px;
  text-align: center;
}

.line-sum {
  justify-self: end;
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

.line-sum::before {
  content: "Сумма ";
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--green-soft);
}

.order-client-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.order-client-bar div {
  display: grid;
  gap: 4px;
}

.order-client-bar span {
  color: var(--muted);
  font-size: 13px;
}

.order-total strong {
  font-size: 24px;
}

.message {
  padding: 12px;
  border-radius: 8px;
  color: var(--amber);
  background: var(--amber-soft);
  font-weight: 800;
}

@media (min-width: 900px) {
  body {
    background:
      linear-gradient(90deg, #edf2ee 0, #f4f6f3 18%, #f4f6f3 82%, #edf2ee 100%);
  }

  .app {
    max-width: 1180px;
    margin: 0 auto;
    padding-bottom: 28px;
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(24, 36, 31, 0.06), 0 24px 60px rgba(24, 36, 31, 0.08);
  }

  .app-header {
    border-radius: 0 0 8px 8px;
  }

  .bottom-nav {
    position: sticky;
    top: 66px;
    right: auto;
    bottom: auto;
    left: auto;
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 16px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(24, 36, 31, 0.06);
  }

  .bottom-nav button {
    min-height: 42px;
  }

  .screen {
    max-width: 1120px;
    padding: 28px 22px;
  }

  .summary {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 760px) {
  .site-header,
  .company-hero,
  .company-band,
  .flow-grid,
  .quick-links > div {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
  }

  .site-header nav {
    justify-content: flex-start;
  }

  .company-hero {
    min-height: auto;
  }

  .hero-panel {
    grid-template-columns: 54px 1fr;
  }

  .hero-panel img {
    width: 54px;
    height: 54px;
  }

  .login {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 42vh;
    padding: 28px;
  }

  .login-brand h1 {
    font-size: 42px;
  }

  .login-form {
    padding: 24px;
  }

  .bottom-nav button {
    min-height: 44px;
    font-size: 11px;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .daily-report {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 54px 1fr;
  }

  .table-row > span,
  .table-row > strong {
    grid-column: 2;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .document-row > strong,
  .document-row button {
    justify-self: stretch;
  }

  .order-product {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .order-product img {
    width: 56px;
    height: 56px;
  }

  .order-product-main {
    grid-template-columns: minmax(100px, 1fr) 98px 64px;
    gap: 6px;
  }

  .qty-box {
    grid-template-columns: 26px 38px 26px;
    gap: 4px;
  }

  .qty-box button {
    width: 26px;
    height: 32px;
  }

  .qty-box input {
    min-height: 32px;
    padding: 0 4px;
  }

  .line-sum {
    justify-self: end;
    font-size: 15px;
  }
}
