:root {
  --bg-primary: #0a0e14;
  --bg-card: #111318;
  --bg-input: #0d1117;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.header {
  display: flex;
  align-items: center;
  padding: 1rem;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 40px;
}

.main-content {
  padding: 1.5rem 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.info-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.info-box svg {
  flex-shrink: 0;
  color: var(--accent-orange);
}

.info-box p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.current-device {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.current-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.device-card {
  background: rgba(13, 17, 23, 0.9) !important;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.device-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.device-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(13, 17, 23, 0.9) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.current-device .device-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.device-info {
  flex: 1;
  min-width: 0;
}

.device-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.device-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.device-actions {
  display: flex;
  gap: 0.5rem;
}

.device-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.device-btn.rename {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.device-btn.revoke {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.meta-item svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.9) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.revoke-all-btn {
  width: 100%;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 0.75rem;
  color: var(--accent-red);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}

.revoke-all-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #1a1a1a;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 340px;
  width: 100%;
  transform: scale(0.9);
  transition: transform 0.25s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-orange);
}

.modal-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.modal-btn.primary {
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  color: #fff;
}

.modal-btn.danger {
  background: var(--accent-red);
  color: #fff;
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-green);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}