/* RC10.7A — License devices page */

.devices-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.devices-head h2,
.devices-head .lead {
  margin: 0;
}

.devices-head .lead {
  margin-top: 0.35rem;
}

.devices-head .dash-btn {
  flex: 0 0 auto;
}

.devices-summary-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border: 1px solid var(--dash-border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
}

.devices-page .devices-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.devices-summary-label {
  font-weight: 600;
  color: var(--dash-muted);
  font-size: 0.8125rem;
}

.devices-summary-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dash-navy);
  letter-spacing: 0.02em;
}

.devices-summary-hint {
  color: var(--dash-muted);
  font-size: 0.75rem;
}

.devices-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dash-border);
  border-radius: 0.75rem;
}

.devices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.devices-table th,
.devices-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--dash-border);
  vertical-align: middle;
}

.devices-table th {
  background: var(--dash-surface-2, #f8fafc);
  font-weight: 600;
  color: var(--dash-muted);
  white-space: nowrap;
}

.devices-table tbody tr:last-child td {
  border-bottom: none;
}

.devices-table tbody tr.devices-row-current {
  background: #f0fdf4;
}

.devices-table tbody tr.devices-row-current td:first-child {
  box-shadow: inset 3px 0 0 #22c55e;
}

.devices-col-revoke {
  width: 6.5rem;
  text-align: right;
  white-space: nowrap;
}

.devices-table th.devices-col-revoke {
  text-align: right;
}

.devices-table code {
  font-size: 0.75rem;
  word-break: break-all;
}

.devices-empty {
  text-align: center;
  color: var(--dash-muted);
  padding: 2rem 1rem !important;
}

.devices-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.devices-badge-current {
  background: #dcfce7;
  color: #166534;
}

.devices-badge-other {
  background: #e2e8f0;
  color: #475569;
}

.devices-muted {
  color: var(--dash-muted);
}

.dash-btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.devices-page .btn-revoke-device:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.dash-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.dash-btn-danger:hover {
  background: #b91c1c;
}

.devices-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 22, 40, 0.45);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.devices-modal.is-open {
  display: flex;
}

.devices-modal-panel {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.devices-modal-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.devices-modal-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--dash-muted);
  line-height: 1.45;
}

.devices-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .devices-table thead {
    display: none;
  }

  .devices-table tr {
    display: block;
    border-bottom: 1px solid var(--dash-border);
    padding: 0.75rem;
  }

  .devices-table td {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.35rem;
    border: none;
    padding: 0.35rem 0;
  }

  .devices-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--dash-muted);
    font-size: 0.75rem;
  }
}
