input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  min-height: 80px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

label {
  font-weight: 800;
  display: block;
  margin-bottom: 6px;
}

.form-row {
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  color: var(--text);
}

th,
td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
  font-weight: 800;
  text-align: left;
}

tr:hover td {
  background: var(--surface-hover);
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

summary {
  cursor: pointer;
  padding: 12px 14px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 800;
}

details > *:not(summary) {
  padding: 12px 14px;
}

/* Radio Logs v2 Upload page */
.upload-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(300px, .9fr);
  gap: 24px;
  align-items: start;
}

.upload-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.upload-side-panel {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.upload-section-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.upload-section-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.upload-grid {
  display: grid;
  gap: 18px;
}

.upload-field label {
  display: block;
  font-size: 13px;
  font-weight: 850;
  color: var(--text);
  margin-bottom: 7px;
}

.upload-help {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.upload-file-box {
  border: 1px dashed var(--border-strong);
  background: var(--surface-muted);
  border-radius: 16px;
  padding: 18px;
}

.upload-file-box input {
  background: var(--surface);
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.upload-primary {
  min-width: 160px;
}

.upload-checklist {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.upload-check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.upload-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.upload-check strong {
  display: block;
  font-size: 14px;
}

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

.upload-station-preview {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface);
  margin-top: 18px;
}

.upload-station-preview strong {
  display: block;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.upload-station-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

html[data-theme="dark"] .upload-file-box {
  background: var(--surface-muted);
}

@media (max-width: 950px) {
  .upload-shell {
    grid-template-columns: 1fr;
  }
}

/* Traffic Review v2 */
.traffic-v2-page {
  display: grid;
  gap: 20px;
}

.traffic-v2-page .page-card,
.traffic-v2-page .app-card,
.traffic-v2-page .info-card,
.traffic-v2-page .status-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.traffic-v2-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
}

.traffic-v2-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  margin: 18px 0;
}

.traffic-v2-metric {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.traffic-v2-metric:last-child {
  border-right: 0;
}

.traffic-v2-metric strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.traffic-v2-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.traffic-v2-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.traffic-v2-page table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.traffic-v2-page thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.traffic-v2-page td,
.traffic-v2-page th {
  border-left: 0 !important;
  border-right: 0 !important;
}

.traffic-v2-page tbody tr:hover td {
  background: var(--surface-hover) !important;
}

.traffic-v2-page tbody tr:focus-within td {
  background: rgba(37, 99, 235, 0.07) !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

html[data-theme="dark"] .traffic-v2-page tbody tr:focus-within td {
  background: rgba(96, 165, 250, 0.12) !important;
}

.traffic-v2-page input,
.traffic-v2-page select,
.traffic-v2-page textarea {
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

.traffic-v2-page textarea {
  min-height: 48px;
  resize: vertical;
}

.traffic-v2-page input:focus,
.traffic-v2-page select:focus,
.traffic-v2-page textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
}

.traffic-v2-actions,
.traffic-v2-page form .action-row:last-child,
.traffic-v2-page form .toolbar:last-child {
  position: sticky;
  bottom: 12px;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

html[data-theme="dark"] .traffic-v2-actions,
html[data-theme="dark"] .traffic-v2-page form .action-row:last-child,
html[data-theme="dark"] .traffic-v2-page form .toolbar:last-child {
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

@media (max-width: 900px) {
  .traffic-v2-metrics {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .traffic-v2-metric:nth-child(2) {
    border-right: 0;
  }

  .traffic-v2-metric:nth-child(1),
  .traffic-v2-metric:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .traffic-v2-toolbar {
    position: static;
  }
}

/* Discrepancy Reports v2 */
.report-v2-page {
  display: grid;
  gap: 20px;
}

.report-v2-page .page-card,
.report-v2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.report-v2-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}

.report-v2-filterbar label {
  font-size: 13px;
  font-weight: 850;
}

.report-v2-filterbar input,
.report-v2-filterbar select {
  min-width: 180px;
}

.report-v2-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.report-v2-page .pill,
.report-v2-page .summary-pill,
.report-v2-page .badge {
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
  opacity: 1 !important;
}

.report-v2-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.report-v2-page table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
}

.report-v2-page thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.report-v2-page th,
.report-v2-page td {
  border-left: 0 !important;
  border-right: 0 !important;
}

.report-v2-page tbody tr:hover td {
  background: var(--surface-hover) !important;
}

.report-v2-empty {
  color: var(--muted);
  padding: 18px;
  font-weight: 700;
}

html[data-theme="dark"] .report-v2-page .pill:not(.pill-success):not(.pill-warn):not(.pill-danger):not(.pill-info),
html[data-theme="dark"] .report-v2-page .summary-pill:not(.pill-success):not(.pill-warn):not(.pill-danger):not(.pill-info),
html[data-theme="dark"] .report-v2-page .badge:not(.badge-success):not(.badge-warning):not(.badge-warn):not(.badge-danger):not(.badge-error):not(.badge-info) {
  background: #e5e7eb !important;
  color: #111827 !important;
  border-color: #cbd5e1 !important;
}

@media (max-width: 800px) {
  .report-v2-filterbar {
    display: grid;
  }

  .report-v2-filterbar input,
  .report-v2-filterbar select {
    min-width: 100%;
  }
}

/* Compliance Digest v2 */
.compliance-v2-page {
  display: grid;
  gap: 20px;
}

.compliance-v2-page .page-card,
.compliance-v2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.compliance-v2-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}

.compliance-v2-filterbar label {
  font-size: 13px;
  font-weight: 850;
}

.compliance-v2-filterbar input,
.compliance-v2-filterbar select {
  min-width: 180px;
}

.compliance-v2-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  margin: 18px 0;
}

.compliance-v2-metric {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.compliance-v2-metric:last-child {
  border-right: 0;
}

.compliance-v2-metric strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.compliance-v2-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.compliance-v2-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.compliance-v2-page table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
}

.compliance-v2-page thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.compliance-v2-page th,
.compliance-v2-page td {
  border-left: 0 !important;
  border-right: 0 !important;
}

.compliance-v2-page tbody tr:hover td {
  background: var(--surface-hover) !important;
}

.compliance-v2-page .pill,
.compliance-v2-page .summary-pill,
.compliance-v2-page .digest-pill,
.compliance-v2-page .badge {
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
  opacity: 1 !important;
}

html[data-theme="dark"] .compliance-v2-page .pill:not(.pill-success):not(.pill-warn):not(.pill-danger):not(.pill-info),
html[data-theme="dark"] .compliance-v2-page .summary-pill:not(.pill-success):not(.pill-warn):not(.pill-danger):not(.pill-info),
html[data-theme="dark"] .compliance-v2-page .digest-pill:not(.pill-success):not(.pill-warn):not(.pill-danger):not(.pill-info),
html[data-theme="dark"] .compliance-v2-page .badge:not(.badge-success):not(.badge-warning):not(.badge-warn):not(.badge-danger):not(.badge-error):not(.badge-info) {
  background: #e5e7eb !important;
  color: #111827 !important;
  border-color: #cbd5e1 !important;
}

@media (max-width: 900px) {
  .compliance-v2-summary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .compliance-v2-metric:nth-child(2) {
    border-right: 0;
  }

  .compliance-v2-metric:nth-child(1),
  .compliance-v2-metric:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .compliance-v2-filterbar {
    display: grid;
  }

  .compliance-v2-filterbar input,
  .compliance-v2-filterbar select {
    min-width: 100%;
  }
}

/* Traffic Review verify-all + notation collapse */
.notation-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 12px;
}

.notation-review-heading h2 {
  margin: 0 0 4px;
}

.notation-preview-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notation-expand-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 18px;
}

.notation-row {
  transition: background 150ms ease, opacity 150ms ease;
}

html[data-theme="dark"] .notation-preview-note {
  background: rgba(15, 23, 42, .72);
  border-color: #334155;
  color: #a8b4c5;
}

@media (max-width: 800px) {
  .notation-review-heading {
    display: grid;
  }
}
