.collect-data-table {
  min-width: 1760px;
}

.result-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-view-tab {
  appearance: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(31, 50, 74, .04);
  transition: border-color .18s, box-shadow .18s, transform .18s, background-color .18s;
}

.result-view-tab:hover {
  border-color: #9eb9dd;
  box-shadow: 0 7px 20px rgba(31, 76, 132, .09);
  transform: translateY(-1px);
}

.result-view-tab.active {
  border-color: #2f76d2;
  background: linear-gradient(135deg, #f4f8ff, #fff 72%);
  box-shadow: 0 0 0 2px rgba(47, 118, 210, .09), 0 8px 22px rgba(31, 76, 132, .1);
}

.result-view-tab:focus-visible { outline: 3px solid rgba(47, 118, 210, .25); outline-offset: 2px; }
.result-view-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}
.result-view-icon svg,
.today-heading-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.result-view-icon.today { color: #087b5c; background: #e5f7f0; }
.result-view-icon.history { color: #315fcc; background: #eaf0ff; }
.result-view-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.result-view-copy strong { font-size: 15px; }
.result-view-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.result-view-count {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0f3f7;
  color: #536273;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.result-view-tab.active .result-view-count { color: #245fab; background: #e5effc; }
.result-view { display: none; }
.result-view.active { display: block; }
.today-machine-panel,
.history-result-panel { margin: 0; }
.today-heading-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 2px;
  border-radius: 8px;
  color: #087b5c;
  background: #e5f7f0;
}
.today-heading-icon svg { width: 17px; height: 17px; }
.today-machine-wrap { max-height: calc(100vh - 335px); min-height: 280px; }
.history-result-panel .table-wrap { max-height: calc(100vh - 425px); min-height: 260px; }
.today-machine-table { min-width: 980px; }
.today-machine-table th,
.today-machine-table td { text-align: center; white-space: nowrap; }
.today-machine-table th:nth-child(2),
.today-machine-table td:nth-child(2),
.today-machine-table th:nth-child(4),
.today-machine-table td:nth-child(4) { text-align: left; }
.today-machine-hint { color: var(--muted); font-size: 11px; }
.today-count { font-weight: 750; }
.today-count.has-data { color: #16845c; }
.today-count.no-data { color: #c2414f; }

.collect-data-table th,
.collect-data-table td {
  text-align: center;
  white-space: nowrap;
}

.collect-data-table th:nth-child(3),
.collect-data-table td:nth-child(3) {
  text-align: left;
}

.data-number {
  font-variant-numeric: tabular-nums;
}

.data-time {
  white-space: nowrap;
}

/* History filters and SQL-backed result pagination */
.result-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #e4e9f0);
}
.result-filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 170px;
  flex: 1 1 180px;
  font-size: 13px;
}
.result-filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.result-filters input,
.result-filters select {
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  outline: 0;
  background-color: var(--panel);
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.result-filters input:hover,
.result-filters select:hover {
  border-color: #aebdce;
  background-color: #fbfcfe;
}
.result-filters input:focus,
.result-filters select:focus {
  border-color: var(--blue);
  background-color: var(--panel);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .12);
}
.result-filters .result-select-field {
  position: relative;
}
.result-filters .result-select-field::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.result-filters select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.result-filters select option {
  color: var(--ink);
  background: var(--panel);
}
.result-filters button { min-height: 36px; }
.collect-data-table .result-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 7px 5px;
  white-space: nowrap;
}
.collect-data-table .result-sort:hover,
.collect-data-table .result-sort.selected { color: #2563eb; }
.collect-data-table .result-sort:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.collect-data-table .sort-indicator { font-size: 11px; opacity: .75; }
.result-pagination {
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid #e4e9f0;
  font-size: 13px;
}
.result-page-actions, .result-page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.result-pagination .btn { padding: 6px 11px; min-width: 34px; }
.result-page-numbers .btn.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

@media (max-width: 820px) {
  .result-view-switch { grid-template-columns: 1fr; }
  .result-view-tab { min-height: 74px; }
}

@media (max-width: 560px) {
  .result-view-tab { grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 13px; }
  .result-view-icon { width: 42px; height: 42px; }
  .result-view-count { grid-column: 2; justify-self: start; }
}
