.device-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.device-head h1 {
  max-width: 780px;
}

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

.device-head button,
.job-form button[type="submit"],
#enqueueSelected {
  border: 0;
  background: linear-gradient(135deg, #6B35E8 0%, #5224B5 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 20px -4px rgba(107, 53, 232, 0.42);
}

#enqueueSelected:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.device-head button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.pair-panel {
  padding: 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: rgba(107, 53, 232, 0.28);
  background: linear-gradient(135deg, #ffffff 0%, #F3EEFF 100%);
}

.pair-panel[hidden] {
  display: none;
}

.pair-panel small {
  display: block;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.pair-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
}

.pair-panel code {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1A103C;
  color: #F3EEFF;
  word-break: break-all;
  font-size: 12.5px;
}

.section {
  padding: 24px;
  margin-bottom: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}

.section-title h2,
.job-form h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.device-list,
.job-list {
  display: grid;
  gap: 12px;
}

.device-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.16s ease;
}

.device-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.device-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #F3EEFF, #EDE8F5);
  border: 1px solid rgba(107, 53, 232, 0.2);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

.device-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.device-card p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 2px 0;
}

.device-card small {
  font-size: 12px;
  color: var(--muted);
}

.status {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status.online,
.status.completed,
.status.review {
  background: var(--green-soft);
  color: var(--green);
}

.status.offline,
.status.queued {
  background: #FEF9C3;
  color: #92400E;
}

.status.revoked,
.status.failed {
  background: var(--red-soft);
  color: var(--red);
}

.device-actions {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.device-actions br {
  display: none;
}

.device-actions button {
  height: 32px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 8px;
}

.jobs-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.job-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.job-form label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.job-row {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.16s ease;
}

.job-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.job-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.job-row h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
}

.job-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.progress {
  height: 6px;
  margin-top: 10px;
  background: #F3EEFF;
  border-radius: 99px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6B35E8, #F5B731);
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 960px) {
  .device-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .jobs-grid {
    grid-template-columns: 1fr;
  }
  .pair-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .device-card {
    grid-template-columns: 1fr;
  }
  .device-actions {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
}
