:root {
  color: #1f2933;
  background: #f5f7fa;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

body.keyboard-visible {
  padding-bottom: 288px;
}

.display-dim-overlay {
  background: #020617;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 180ms ease;
  z-index: 1100;
}

.screen-sleep-overlay {
  align-items: center;
  background: rgb(2 6 23 / 96%);
  color: #e5e7eb;
  cursor: pointer;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  text-align: center;
  z-index: 1300;
}

.screen-sleep-overlay div {
  display: grid;
  gap: 10px;
}

.screen-sleep-overlay strong {
  font-size: 1.7rem;
}

.screen-sleep-overlay span {
  color: #bcccdc;
  font-size: 1rem;
  font-weight: 700;
}

.device-status-bar {
  align-items: center;
  background: #1f2933;
  color: white;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  min-height: 34px;
  padding: 5px 14px;
  text-align: left;
}

.device-status-bar strong,
.status-item {
  font-size: 0.82rem;
  line-height: 1.2;
}

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

.status-item {
  align-items: center;
  display: inline-flex;
  min-height: 24px;
  position: relative;
  white-space: nowrap;
}

.status-indicator {
  display: inline-flex;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  min-width: 30px;
}

.status-indicator:not(.battery-status) {
  width: 30px;
}

.wifi-icon {
  align-items: end;
  display: inline-flex;
  gap: 2px;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.wifi-icon span {
  background: #9aa5b1;
  border-radius: 999px;
  display: block;
  width: 4px;
}

.wifi-icon span:nth-child(1) {
  height: 5px;
}

.wifi-icon span:nth-child(2) {
  height: 10px;
}

.wifi-icon span:nth-child(3) {
  height: 15px;
}

.wifi-status.online .wifi-icon span,
.wifi-status.connecting .wifi-icon span {
  background: #86efac;
}

.wifi-status.offline .wifi-icon span {
  background: #9aa5b1;
  opacity: 0.35;
}

.wifi-status.offline::after {
  color: #f59e0b;
  content: "!";
  font-size: 0.7rem;
  font-weight: 700;
  position: absolute;
  right: -6px;
  top: -4px;
}

.wifi-status.connecting .wifi-icon span {
  animation: wifi-pulse 900ms ease-in-out infinite;
}

.wifi-status.connecting .wifi-icon span:nth-child(2) {
  animation-delay: 120ms;
}

.wifi-status.connecting .wifi-icon span:nth-child(3) {
  animation-delay: 240ms;
}

.cloud-icon {
  color: #7dd3fc;
  display: inline-block;
  height: 20px;
  position: relative;
  width: 28px;
}

.cloud-lobe,
.cloud-base {
  background: currentColor;
  position: absolute;
}

.cloud-mark {
  display: block;
}

.cloud-lobe {
  border-radius: 999px;
}

.cloud-lobe.left {
  height: 10px;
  left: 3px;
  top: 8px;
  width: 10px;
}

.cloud-lobe.center {
  height: 15px;
  left: 9px;
  top: 3px;
  width: 15px;
}

.cloud-lobe.right {
  height: 11px;
  right: 2px;
  top: 7px;
  width: 11px;
}

.cloud-base {
  border-radius: 999px;
  bottom: 1px;
  height: 9px;
  left: 5px;
  width: 20px;
}

.sync-status.synced .cloud-mark {
  border-bottom: 2px solid #0f766e;
  border-right: 2px solid #0f766e;
  height: 8px;
  left: 12px;
  position: absolute;
  top: 5px;
  transform: rotate(40deg);
  width: 5px;
  z-index: 2;
}

.sync-status.syncing .cloud-spinner {
  animation: sync-spin 1s linear infinite;
  border: 2px solid #bae6fd;
  border-left-color: transparent;
  border-radius: 999px;
  height: 24px;
  left: 2px;
  position: absolute;
  top: -2px;
  width: 24px;
  z-index: 3;
}

.sync-status.pending .cloud-icon,
.sync-status.failed .cloud-icon {
  color: #c2410c;
}

.sync-status.pending .cloud-mark,
.sync-status.failed .cloud-mark {
  color: #fff7ed;
  content: "";
  font-size: 0.75rem;
  font-weight: 700;
  left: 13px;
  position: absolute;
  top: 4px;
  z-index: 2;
}

.sync-status.pending .cloud-mark::after,
.sync-status.failed .cloud-mark::after {
  content: "!";
}

.plug-icon {
  border: 2px solid #cbd5e1;
  border-radius: 3px;
  display: inline-block;
  height: 13px;
  position: relative;
  width: 14px;
}

.power-status.plugged .plug-icon,
.power-status.plugged .plug-icon::before,
.power-status.plugged .plug-icon::after {
  border-color: #86efac;
}

.power-status.plugged .plug-icon::before,
.power-status.plugged .plug-icon::after {
  background: #86efac;
}

.power-status.unplugged .plug-icon {
  opacity: 0.4;
}

.plug-icon::before,
.plug-icon::after {
  background: #cbd5e1;
  content: "";
  height: 5px;
  position: absolute;
  top: -7px;
  width: 2px;
}

.plug-icon::before {
  left: 3px;
}

.plug-icon::after {
  right: 3px;
}

.battery-icon {
  border: 2px solid #cbd5e1;
  border-radius: 3px;
  display: inline-block;
  flex: 0 0 auto;
  height: 13px;
  overflow: visible;
  position: relative;
  width: 25px;
}

.battery-icon::after {
  background: #cbd5e1;
  border-radius: 0 2px 2px 0;
  content: "";
  height: 7px;
  position: absolute;
  right: -5px;
  top: 1px;
  width: 3px;
}

.battery-fill {
  appearance: none;
  background: transparent;
  border: 0;
  bottom: 0;
  display: block;
  height: 100%;
  left: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  width: 100%;
}

.battery-fill::-webkit-progress-bar {
  background: transparent;
}

.battery-fill::-webkit-progress-value {
  background: #86efac;
  transition: width 200ms ease;
}

.battery-fill::-moz-progress-bar {
  background: #86efac;
  transition: width 200ms ease;
}

.battery-status.charging .battery-fill::-webkit-progress-value {
  animation: battery-charge 1.8s ease-in-out infinite;
}

.battery-status.charging .battery-fill::-moz-progress-bar {
  animation: battery-charge 1.8s ease-in-out infinite;
}

.battery-bolt {
  background: #facc15;
  clip-path: polygon(55% 0, 100% 0, 62% 42%, 100% 42%, 32% 100%, 48% 56%, 8% 56%);
  display: none;
  height: 10px;
  left: 8px;
  position: absolute;
  top: 0;
  width: 7px;
  z-index: 1;
}

.battery-status.charging .battery-bolt {
  display: block;
}

.battery-percent {
  align-items: center;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 28px;
  margin-left: 5px;
}

.battery-status {
  gap: 0;
  min-width: 50px;
}

@keyframes wifi-pulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

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

@keyframes battery-charge {
  0%,
  100% {
    opacity: 0.65;
  }

  50% {
    opacity: 1;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  padding: 0 16px;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  background: #9aa5b1;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #9aa5b1;
}

.secondary-button {
  background: #52606d;
}

.secondary-button:hover {
  background: #3e4c59;
}

.danger-button {
  background: #dc2626;
}

.danger-button:hover {
  background: #b91c1c;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.center-layout,
.idle-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-panel {
  width: min(100%, 520px);
}

.setup-panel h1 {
  font-size: 2rem;
}

.setup-panel input {
  min-height: 56px;
  font-size: 1.1rem;
}

.setup-panel button,
.idle-panel button {
  min-height: 64px;
  font-size: 1.15rem;
}

.idle-panel {
  width: min(100%, 680px);
  text-align: center;
}

.main-dashboard-panel {
  width: min(100%, 860px);
}

.processing-panel {
  width: min(100%, 680px);
  text-align: center;
}

.idle-panel h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin-bottom: 32px;
}

.processing-panel h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.device-name {
  color: #52606d;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.current-device {
  color: #52606d;
  font-weight: 700;
}

.main-dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
}

.dashboard-choice {
  align-items: flex-start;
  background: #2563eb;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-end;
  min-height: 190px;
  padding: 22px;
  text-align: left;
}

.dashboard-choice span {
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  font-weight: 800;
}

.dashboard-choice small {
  color: rgb(255 255 255 / 88%);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-choice.trade-plate-choice {
  background: #0891b2;
}

.dashboard-choice.outstanding-choice {
  background: #475569;
  grid-column: 1 / -1;
  min-height: 132px;
}

.trade-plate-dashboard-grid {
  max-width: 880px;
}

.scanner-panel {
  display: grid;
  gap: 18px;
}

.scanner-ready,
.trade-plate-readout {
  background: #f8fafc;
  border: 2px dashed #9aa5b1;
  border-radius: 10px;
  color: #1f2933;
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 24px;
  text-align: center;
}

.trade-plate-readout {
  display: grid;
  gap: 6px;
  letter-spacing: 0;
}

.trade-plate-readout span {
  color: #52606d;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trade-plate-readout strong {
  font-size: clamp(2rem, 7vw, 4rem);
}

.trade-plate-match-summary {
  border-block: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-block: 18px;
}

.trade-plate-match-summary h2,
.trade-plate-warning h2 {
  font-size: 1.25rem;
  margin: 0;
}

.trade-plate-warning {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.trade-plate-warning p {
  margin: 0;
}

.trade-plate-conflict {
  max-width: 680px;
  width: min(100%, 680px);
}

.trade-plate-table {
  min-width: 1040px;
}

.trade-plate-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-plate-summary-item {
  background: rgb(37 99 235 / 18%);
  border: 1px solid rgb(96 165 250 / 45%);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 16px 20px;
}

.trade-plate-summary-item.overdue {
  background: rgb(220 38 38 / 22%);
  border-color: rgb(248 113 113 / 65%);
}

.trade-plate-summary-item span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.trade-plate-summary-item strong {
  font-size: 2rem;
}

.trade-plate-status {
  border: 1px solid rgb(96 165 250 / 50%);
  border-radius: 999px;
  display: inline-block;
  font-weight: 800;
  min-width: 104px;
  padding: 7px 10px;
  text-align: center;
}

.trade-plate-status.overdue {
  background: rgb(220 38 38 / 30%);
  border-color: rgb(248 113 113 / 75%);
  color: #fecaca;
}

.trade-plate-overdue-row td {
  background: rgb(127 29 29 / 28%);
}

@media (max-width: 640px) {
  .trade-plate-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-header {
  margin-bottom: 24px;
}

.settings-hub-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 680px;
}

.settings-hub-button {
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 68px;
  padding: 12px 18px;
  text-align: left;
  width: 100%;
}

.settings-hub-button.developer-button {
  background: #374151;
}

.settings-hub-button.developer-button:hover {
  background: #1f2937;
}

.developer-area-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-management-grid {
  align-items: start;
  grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.35fr);
}

.admin-table-panel {
  min-width: 0;
}

.admin-users-table {
  min-width: 1280px;
}

.admin-departments-table {
  min-width: 760px;
}

.admin-allocations-table,
.admin-audit-table {
  min-width: 1080px;
}

.admin-check-list {
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-check-list h3 {
  margin: 0;
}

.admin-checkbox-row {
  font-weight: 700;
}

.capability-list-text {
  display: inline-block;
  max-width: 360px;
  word-break: break-word;
}

.settings-form button {
  min-height: 56px;
}

.reports-settings-layout {
  display: grid;
  gap: 20px;
}

.reports-section {
  display: grid;
  gap: 18px;
}

.reports-section h2 {
  font-size: 1.5rem;
  margin: 0;
}

.reports-settings-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reports-settings-fields .wide {
  grid-column: 1 / -1;
}

.reports-trade-plate-fields {
  grid-template-columns: minmax(0, 420px);
}

.reports-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reports-actions button {
  min-height: 62px;
  width: 100%;
}

.reports-actions button:only-child {
  grid-column: 1 / -1;
}

.display-power-form {
  max-width: 760px;
}

.brightness-control {
  gap: 10px;
}

.brightness-control span {
  color: #1f2933;
  font-size: 1.05rem;
}

.brightness-control input[type="range"] {
  accent-color: #2563eb;
  min-height: 44px;
  padding: 0;
}

.helper-text {
  color: #52606d;
  font-weight: 700;
  margin-bottom: 0;
}

.device-time-status {
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 4px 14px;
}

.device-time-status .detail-row:last-child {
  border-bottom: 0;
}

.wifi-network-list {
  display: grid;
  gap: 10px;
}

.wifi-network-option {
  background: #edf2f7;
  color: #1f2933;
  min-height: 58px;
  text-align: left;
}

.wifi-network-option:hover {
  background: #d9e2ec;
}

.wifi-network-option.selected {
  background: #2563eb;
  color: white;
}

.recovery-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 620px);
}

.admin-page-actions {
  margin-bottom: 8px;
}

.admin-connection-area {
  border-top: 1px solid #d9e2ec;
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
}

.admin-connection-area button {
  min-height: 56px;
}

.admin-storage-area {
  border-top: 1px solid #d9e2ec;
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
}

.storage-status {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.storage-status.full {
  background: #fee2e2;
  border-color: #fca5a5;
}

.admin-report-area {
  border-top: 1px solid #d9e2ec;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
}

.admin-report-area input,
.admin-report-area select {
  min-height: 56px;
}

.admin-report-area button {
  min-height: 56px;
}

.report-result {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  word-break: break-word;
}

.report-download-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 0;
}

.download-link {
  align-items: center;
  background: #2563eb;
  border-radius: 6px;
  color: white;
  display: inline-flex;
  min-height: 48px;
  padding: 0 16px;
  text-decoration: none;
  width: fit-content;
}

.download-link:hover {
  background: #1d4ed8;
}

header {
  margin-bottom: 20px;
}

.nav-button {
  min-width: 160px;
  margin-top: 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.panel {
  background: white;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 18px;
}

.review-panel {
  display: grid;
  gap: 18px;
}

.review-grid {
  display: grid;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  overflow: hidden;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 14px 16px;
}

.review-row:nth-child(odd) {
  background: #f8fafc;
}

.review-row span {
  color: #52606d;
}

.review-row input {
  background: transparent;
  border: 0;
  color: #1f2933;
  font-weight: 700;
  padding: 0;
  word-break: break-word;
}

.edit-transaction-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-panel {
  display: grid;
  gap: 18px;
}

.filter-form {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.table-scroll {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid #d9e2ec;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.history-table th {
  background: #f8fafc;
  color: #52606d;
  font-size: 0.9rem;
}

.small-button {
  min-height: 42px;
  padding: 0 12px;
}

.empty-table-cell {
  color: #52606d;
  font-weight: 700;
  text-align: center;
}

.detail-grid {
  align-items: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  display: grid;
  gap: 12px;
}

.dashboard-card h2 {
  margin-bottom: 0;
}

.dashboard-rows {
  display: grid;
  gap: 4px;
}

.dashboard-errors {
  grid-column: 1 / -1;
}

.developer-error-table {
  min-width: 900px;
}

.detail-panel {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 0;
}

.detail-row span {
  color: #52606d;
}

.detail-row strong {
  word-break: break-word;
}

.receipt-preview {
  width: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.barcode-preview {
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  overflow-x: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.device-logs-table {
  min-width: 980px;
}

.metadata-preview {
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  margin: 0;
  max-width: 360px;
  overflow-x: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.update-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.progress-track {
  background: #d9e2ec;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.progress-fill {
  appearance: none;
  background: transparent;
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.progress-fill::-webkit-progress-bar {
  background: transparent;
}

.progress-fill::-webkit-progress-value {
  background: #2563eb;
  border-radius: 999px;
  transition: width 200ms ease;
}

.progress-fill::-moz-progress-bar {
  background: #2563eb;
  border-radius: 999px;
  transition: width 200ms ease;
}

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

form h2,
.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  min-height: auto;
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 12px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions.vertical {
  flex-direction: column;
  margin-top: 16px;
}

.receipt-list {
  display: grid;
  gap: 10px;
}

.receipt-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  min-height: 58px;
  text-align: left;
  background: #edf2f7;
  color: #1f2933;
}

.receipt-row:hover {
  background: #d9e2ec;
}

.receipt-row small {
  grid-column: 1 / -1;
  color: #52606d;
}

.message,
.error {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.message {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
}

.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

#report-output {
  margin-top: 16px;
}

.on-screen-keyboard {
  background: white;
  border-top: 1px solid #bcccdc;
  bottom: 0;
  box-shadow: 0 -8px 28px rgb(31 41 51 / 18%);
  left: 0;
  padding: 10px;
  position: fixed;
  right: 0;
  z-index: 1000;
}

.on-screen-keyboard[hidden] {
  display: none;
}

.keyboard-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto 8px;
  max-width: 760px;
}

.keyboard-rows {
  display: grid;
  gap: 6px;
  margin: 0 auto;
  max-width: 760px;
}

.keyboard-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.keyboard-key {
  background: #edf2f7;
  color: #1f2933;
  flex: 1 1 42px;
  font-size: 0.95rem;
  min-height: 44px;
  min-width: 0;
  padding: 0 8px;
}

.keyboard-key:hover {
  background: #d9e2ec;
}

.keyboard-key.action-key {
  background: #52606d;
  color: white;
}

.keyboard-key.action-key:hover {
  background: #3e4c59;
}

/* Reference Trade Plate UI skin. Keep behaviour/classes, prefer the new package visual system. */
:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-soft: #1f2937;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: rgb(255 255 255 / 14%);
  --button: #2563eb;
  --button-alt: #334155;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --focus: #fbbf24;
  --radius: 22px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.device-status-bar {
  background: #020617;
  border-bottom: 1px solid var(--line);
}

.layout,
.center-layout,
.idle-layout {
  background: var(--bg);
  color: var(--text);
}

.layout {
  max-width: 980px;
  min-height: calc(100vh - 34px);
  padding: 28px;
}

.center-layout,
.idle-layout {
  min-height: calc(100vh - 34px);
}

.panel,
.idle-panel,
.processing-panel {
  background: linear-gradient(180deg, rgb(255 255 255 / 6%), rgb(255 255 255 / 2%));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 70px rgb(0 0 0 / 28%);
  color: var(--text);
  padding: 28px;
}

.setup-panel {
  width: min(100%, 620px);
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.08;
}

h1 {
  font-size: clamp(34px, 7vw, 62px);
}

h2 {
  font-size: clamp(28px, 5vw, 44px);
}

p,
.helper-text,
.device-name,
.current-device,
.detail-row span,
.review-row span,
.receipt-row small,
.empty-table-cell,
label {
  color: var(--muted);
}

button,
.download-link {
  background: var(--button);
  border: 0;
  border-radius: 16px;
  color: white;
  cursor: pointer;
  font-weight: 800;
  min-height: 62px;
  padding: 14px 22px;
}

button:hover,
.download-link:hover {
  background: #1d4ed8;
}

.secondary-button,
.settings-hub-button.developer-button {
  background: var(--button-alt);
}

.secondary-button:hover,
.settings-hub-button.developer-button:hover {
  background: #1e293b;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #b91c1c;
}

button:disabled {
  background: #64748b;
  color: #cbd5e1;
}

input,
select,
textarea {
  background: rgb(255 255 255 / 8%);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  min-height: 62px;
  padding: 18px;
}

input::placeholder,
textarea::placeholder {
  color: rgb(203 213 225 / 72%);
}

select option {
  background: #111827;
  color: var(--text);
}

.main-dashboard-grid,
.dashboard-grid,
.grid,
.settings-hub-grid,
.review-panel,
.history-panel,
.detail-panel,
.recovery-panel,
.wifi-network-list {
  gap: 18px;
}

.dashboard-choice {
  background: var(--button);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgb(0 0 0 / 24%);
  min-height: 230px;
  padding: 28px;
}

.dashboard-choice.trade-plate-choice {
  background: #0891b2;
}

.dashboard-choice.outstanding-choice {
  background: #475569;
}

.dashboard-choice span {
  font-size: clamp(30px, 5vw, 46px);
}

.dashboard-choice small {
  color: rgb(255 255 255 / 90%);
  font-size: 18px;
}

.settings-hub-button {
  border-radius: 16px;
  min-height: 62px;
  padding: 14px 22px;
}

.scanner-ready,
.trade-plate-readout,
.storage-status,
.device-time-status,
.admin-check-list,
.barcode-preview,
.metadata-preview,
.receipt-preview {
  background: rgb(255 255 255 / 8%);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
}

.scanner-ready,
.trade-plate-readout {
  border-style: dashed;
}

.trade-plate-readout span {
  color: var(--muted);
}

.storage-status.full,
.error {
  background: rgb(220 38 38 / 18%);
  border: 1px solid rgb(220 38 38 / 50%);
  color: var(--text);
}

.message {
  background: rgb(37 99 235 / 20%);
  border: 1px solid rgb(37 99 235 / 45%);
  color: var(--text);
}

.review-grid {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.table-scroll {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.review-row:nth-child(odd),
.history-table th,
.receipt-row,
.wifi-network-option,
.progress-track {
  background: rgb(255 255 255 / 8%);
}

.review-row input {
  background: transparent;
  border: 0;
  color: var(--text);
  min-height: auto;
  padding: 0;
}

.history-table th,
.history-table td,
.detail-row {
  border-bottom: 1px solid var(--line);
}

.history-table th {
  color: var(--text);
}

.history-table td,
.detail-row strong {
  color: var(--text);
}

.receipt-row,
.wifi-network-option {
  color: var(--text);
}

.receipt-row:hover,
.wifi-network-option:hover {
  background: rgb(255 255 255 / 12%);
}

.wifi-network-option.selected {
  background: var(--button);
}

.admin-connection-area,
.admin-storage-area,
.admin-report-area {
  border-top: 1px solid var(--line);
}

.on-screen-keyboard {
  background: #111827;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgb(0 0 0 / 38%);
  color: var(--text);
}

.keyboard-key {
  background: #1f2937;
  color: var(--text);
}

.keyboard-key:hover {
  background: #334155;
}

.keyboard-key.action-key {
  background: var(--button-alt);
}

@media (max-width: 820px) {
  .device-status-bar {
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
  }

  .layout {
    padding: 14px;
  }

  .grid,
  .main-dashboard-grid,
  .dashboard-grid,
  .admin-management-grid,
  .settings-hub-grid,
  form,
  .admin-report-area,
  .filter-form,
  .edit-transaction-form,
  .review-row,
  .detail-row {
    grid-template-columns: 1fr;
  }

  .dashboard-choice,
  .dashboard-choice.outstanding-choice {
    min-height: 170px;
  }

  .storage-status {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .reports-settings-fields,
  .reports-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .reports-section {
    gap: 16px;
    padding: 20px;
  }

  .reports-section h2 {
    font-size: 1.3rem;
  }
}
