/* Batch page styles. The shared frame is in site.css; reotemp-ds/tokens.css and
   reotemp-ds/bundle.css come from the design system unchanged. This file covers the
   upload drop zone, the row table, the progress bar and the report fields. */

.wf-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wf-section .rt-section {
  margin: 0;
}

.wf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Upload: a dashed box that is also the file input's label */
.wf-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  border: 2px dashed var(--grey-200);
  border-radius: var(--radius-lg);
  background: var(--grey-25);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wf-drop:hover,
.wf-drop.is-over {
  border-color: var(--green-700);
  background: var(--green-50);
}

.wf-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.wf-drop:focus-within {
  outline: var(--focus-ring) solid var(--focus);
  outline-offset: 2px;
}

.wf-drop-text strong {
  color: var(--green-700);
}

.wf-drop-text,
.wf-lead {
  max-width: 720px;
}

/* Report fields side by side */
.wf-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.wf-report-grid .rt-input {
  width: 100%;
}

/* Row table: many columns, scrolls sideways, header stays put */
.table-container {
  overflow: auto;
  max-height: 70vh;
  border: var(--hairline) solid var(--grey-100);
  border-radius: var(--radius-sm);
}

.wf-batch {
  min-width: 1100px;
  font-size: 12px;
  line-height: 16px;
}

.wf-batch th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
  font-size: 12px;
  white-space: nowrap;
}

.wf-batch th .wf-unit {
  display: block;
  font-weight: 400;
  color: var(--gray-500);
}

.wf-batch th,
.wf-batch td {
  padding: var(--space-1) var(--space-2);
  vertical-align: top;
}

.wf-batch td.tag {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.wf-batch td.code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.wf-batch td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wf-batch td.status {
  min-width: 220px;
}

.wf-batch .wf-note {
  display: block;
  margin-top: 2px;
  color: var(--gray-500);
}

.wf-batch tr.is-issue td {
  background: var(--yellow-50);
}

.wf-batch td.missing {
  color: var(--gray-500);
}

/* Progress bar for the calculation and the report assembly */
.wf-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--grey-100);
  overflow: hidden;
}

.wf-progress-bar {
  height: 100%;
  width: 0;
  background: var(--green-700);
  transition: width 0.2s ease;
}

#progress-text:empty {
  display: none;
}

.rt-btn svg.wf-spin {
  animation: wf-spin 0.9s linear infinite;
}

@keyframes wf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Wells saved from the calculator */
.wf-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.wf-saved-text {
  margin: 0;
  color: var(--ink);
}

.wf-batch .wf-remove {
  min-height: 24px;
  padding: 0 var(--space-1);
  font-size: 12px;
}

/* Read by screen readers only */
.wf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
