* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fa;
  color: #18202a;
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.brand {
  font-size: 13px;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 5px;
}

h1 {
  margin: 0;
  font-size: 28px;
}

.status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status span {
  background: #fff;
  border: 1px solid #d9dee6;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
}

.status .ok {
  background: #eef9f1;
  border-color: #b8dec0;
  color: #246a35;
  font-weight: 700;
}

.status .readonly {
  background: #fff7df;
  border-color: #ead395;
  color: #775b0b;
  font-weight: 700;
}

#error {
  display: none;
  background: #fff1f1;
  border: 1px solid #efb7b7;
  color: #8b2020;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.cards > div {
  background: #fff;
  border: 1px solid #dde2e9;
  border-radius: 10px;
  padding: 14px 16px;
}

.cards small {
  display: block;
  color: #6b7280;
  margin-bottom: 5px;
}

.cards strong {
  display: block;
  font-size: 22px;
}

#snapshotTime {
  font-size: 15px;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #dde2e9;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 320px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

input,
select {
  height: 40px;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
  background: #fff;
  padding: 0 11px;
  font-size: 14px;
}

.table-box {
  background: #fff;
  border: 1px solid #dde2e9;
  border-radius: 10px;
  overflow: hidden;
}

.table-top {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e9ef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #667085;
}

button {
  border: 1px solid #cfd5dd;
  background: #fff;
  border-radius: 6px;
  padding: 6px 11px;
  cursor: pointer;
}

button:disabled {
  opacity: .4;
  cursor: default;
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 330px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #f6f8fa;
  color: #4b5563;
  font-size: 12px;
}

td.number {
  text-align: right;
  white-space: nowrap;
}

td.name {
  min-width: 300px;
  font-weight: 600;
}

td.code,
td.article {
  font-family: Consolas, monospace;
  white-space: nowrap;
  font-size: 12px;
}

.stock-positive {
  font-weight: 700;
}

.stock-zero {
  color: #9aa1ab;
}

.channel-off {
  color: #98a0aa;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .page {
    padding: 12px;
  }

  header {
    flex-direction: column;
  }

  .status {
    justify-content: flex-start;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-scroll {
    max-height: none;
  }
}

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