.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #cfe6f5;
  border-radius: 12px;
  background: #f2f9fe;
}

.selection-bar strong {
  color: #236f9f;
}

.record-select {
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin-bottom: 7px;
  color: #4f738c;
  font-size: 12px;
  font-weight: 800;
}

.record-select input {
  width: auto;
  accent-color: var(--blue);
}

.selected-record {
  border-color: #77b9df;
  box-shadow: 0 0 0 3px #e4f4fd;
}

.audit-filters {
  margin: 14px 0 10px;
}

.audit-search {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #577085;
  font-size: 12px;
  font-weight: 800;
}

.success-dialog {
  text-align: center;
}

.success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e7f7ef;
  color: #238052;
  font-size: 32px;
  font-weight: 900;
}

.success-dialog h3 {
  font-size: 20px;
}

.success-dialog p {
  line-height: 1.7;
}

.success-dialog .modal-footer {
  justify-content: center;
}

.admin-clear-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.admin-clear-panel p {
  margin: 7px 0 0;
}

.batch-progress-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.batch-progress-actions label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.batch-progress-actions select {
  width: auto;
  min-width: 112px;
  padding: 7px 30px 7px 9px;
}

.batch-progress-meta {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.latest-batch {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5f5ff;
  color: var(--blue);
  font-size: 10px;
  vertical-align: middle;
}

.quick-entry-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
  margin: 16px 0 4px;
}

.quick-entry-panel button {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(31, 90, 132, .05);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}

.quick-entry-panel button:hover {
  transform: translateY(-2px);
  border-color: #86c1e4;
  box-shadow: 0 10px 24px rgba(31, 90, 132, .11);
}

.quick-entry-panel span {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e8f5fd;
  color: var(--blue);
  font-size: 19px;
  font-weight: 900;
}

.quick-entry-panel b,
.quick-entry-panel small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-entry-panel b {
  font-size: 13px;
}

.quick-entry-panel small {
  color: var(--muted);
  font-size: 10px;
}

.record-status-stack {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 132px;
}

.quick-status {
  display: grid;
  gap: 4px;
  width: 132px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.quick-status select {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.allocation-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid #dcebf5;
  border-radius: 10px;
  background: #f8fcff;
}

.allocation-links > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.allocation-links button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e4f3fd;
  color: #17669e;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.allocation-links button:hover {
  background: #cfeafd;
}

.allocation-links.empty-links {
  color: var(--muted);
  font-size: 12px;
}

.record-card.mineral-sand {
  border-left: 5px solid #e67882;
  background: linear-gradient(90deg, #fff2f3 0, #fff 24%);
}

.record-card.mineral-lump {
  border-left: 5px solid #9fc9e7;
  background: linear-gradient(90deg, #f8fcff 0, #fff 24%);
}

.tag.amber {
  background: #fff2d9;
  color: #986013;
}

.excel-sync-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dceaf4;
  border-radius: 11px;
  background: #f8fcff;
}

.excel-sync-line > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.excel-sync-line small {
  color: var(--muted);
  text-align: right;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf1f4;
  color: #647784;
  font-size: 12px;
  font-weight: 900;
}

.sync-badge.syncing {
  background: #e2f2ff;
  color: #176aa2;
}

.sync-badge.success {
  background: #e7f7ee;
  color: #268052;
}

.sync-badge.retrying {
  background: #fff4d8;
  color: #95600f;
}

.sync-badge.failed {
  background: #fff0f1;
  color: #b53f49;
}

.excel-sync-button:disabled,
button:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.55;
}

.sync-device-panel {
  margin-top: 18px;
  margin-bottom: 18px;
}

.device-token-dialog {
  display: grid;
  gap: 13px;
}

.device-token-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.device-token-dialog input {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.token-warning {
  background: #fff8e9;
  border-color: #f1dfb5;
}

.preview-table tr.import-sand td {
  background: #fff1f2;
}

.compact-button {
  padding: 6px 9px;
  border-radius: 8px;
  white-space: nowrap;
}

.rate-config {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(2, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.rate-config label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.modal-footer {
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .quick-entry-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-bar .button-row {
    width: 100%;
  }

  .selection-bar .button-row button {
    flex: 1;
  }

  .audit-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-clear-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-progress-head,
  .batch-progress-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .batch-progress-actions {
    width: 100%;
    gap: 9px;
  }

  .record-status-stack {
    width: 100%;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: end;
    justify-items: stretch;
  }

  .quick-status {
    width: 100%;
  }

  .modal-footer button {
    flex: 1 1 132px;
  }

  .excel-sync-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .excel-sync-line small {
    text-align: left;
  }

  .rate-config {
    grid-template-columns: 1fr;
  }
}
