/* ═══════════════════════════════════════════
   THE GONG Main Stylesheet
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #080c14;
  --surface:  #0f1623;
  --surface2: #161d2e;
  --surface3: #1c2538;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --accent:   #6c63ff;
  --accent-h: #5a52e0;
  --accent2:  #a78bfa;
  --text:     #f0f2f8;
  --text2:    #8b92a8;
  --text3:    #525870;
  --green:    #34d399;
  --green-bg: rgba(52,211,153,0.1);
  --red:      #f87171;
  --red-bg:   rgba(248,113,113,0.1);
  --yellow:   #fbbf24;
  --yellow-bg:rgba(251,191,36,0.1);
  --sidebar:  240px;
  --radius:   14px;
  --radius-lg:20px;
  --shadow:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:0 16px 48px rgba(0,0,0,0.5);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ── Layout ────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────── */
.sidebar {
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 28px 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}
.brand-icon svg { width: 22px; height: 22px; }

.brand-text { line-height: 1.2; }
.brand-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.brand-sub  { font-size: 0.72rem; color: var(--text3); font-weight: 400; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: rgba(108,99,255,0.15);
  border-color: rgba(108,99,255,0.25);
  color: var(--accent2);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-card:hover { background: var(--surface2); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.user-role { font-size: 0.72rem; color: var(--text3); }

/* ── Main Content ──────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text2);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.error { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-dot.idle  { background: var(--text3); box-shadow: none; animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.page {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: none;
}
.page.active { display: block; }

/* ── Page Header ───────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.page-header p  { color: var(--text2); font-size: 0.875rem; }

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border2); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Stats Grid ────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.purple { background: rgba(108,99,255,0.15); color: var(--accent2); }
.stat-icon.green  { background: rgba(52,211,153,0.15);  color: var(--green); }
.stat-icon.blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.stat-icon.orange { background: rgba(251,146,60,0.15);  color: #fb923c; }
.stat-icon svg    { width: 22px; height: 22px; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text2); margin-top: 4px; }

/* ── Grid Layouts ──────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px rgba(108,99,255,0.35);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108,99,255,0.45);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface3); border-color: var(--border2); }

.btn-success {
  background: rgba(52,211,153,0.15);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
}
.btn-success:hover:not(:disabled) { background: rgba(52,211,153,0.25); }

.btn-danger {
  background: rgba(248,113,113,0.1);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(248,113,113,0.2); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; border-radius: 12px; }

/* ── Status Badges ─────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
}
.badge-green  { background: var(--green-bg); color: var(--green);  }
.badge-green::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-red::before { background: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-yellow::before { background: var(--yellow); }
.badge-gray   { background: rgba(82,88,112,0.2); color: var(--text3); }
.badge-gray::before { background: var(--text3); }

/* ── Toggle Switch ─────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface3);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--text3);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.2s ease;
}
.toggle input:checked + .toggle-slider { background: rgba(108,99,255,0.2); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); background: var(--accent); box-shadow: 0 0 8px rgba(108,99,255,0.5); }

/* ── Forms ─────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s;
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-input::placeholder { color: var(--text3); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.75rem; color: var(--text3); margin-top: 5px; }

/* ── Integration Cards ─────────────────── */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.integration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
}
.integration-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }
.integration-card.connected { border-color: rgba(52,211,153,0.25); }

.integration-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.integration-logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.integration-info { flex: 1; min-width: 0; }
.integration-name { font-size: 0.95rem; font-weight: 700; }
.integration-desc { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

.integration-body {
  padding: 0 20px 20px;
  display: none;
}
.integration-body.open { display: block; }

.integration-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Speaker Cards ─────────────────────── */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.speaker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}
.speaker-card.enabled { border-color: rgba(108,99,255,0.25); }
.speaker-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.speaker-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(108,99,255,0.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
}
.speaker-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.speaker-room { font-size: 0.75rem; color: var(--text2); margin-bottom: 12px; }
.speaker-toggle { position: absolute; top: 16px; right: 16px; }

/* ── Event Feed ────────────────────────── */
.event-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: 10px;
  animation: slideIn 0.3s ease;
  border: 1px solid transparent;
}
.event-item.doorbell { border-color: rgba(108,99,255,0.15); }
.event-item.motion   { border-color: rgba(251,191,36,0.15); }
.event-item.error    { border-color: rgba(248,113,113,0.15); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.event-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.event-icon.doorbell { background: rgba(108,99,255,0.15); }
.event-icon.motion   { background: rgba(251,191,36,0.15); }
.event-icon.error    { background: rgba(248,113,113,0.15); }

.event-source { font-size: 0.82rem; font-weight: 600; }
.event-msg    { font-size: 0.78rem; color: var(--text2); }
.event-time   { margin-left: auto; font-size: 0.72rem; color: var(--text3); flex-shrink: 0; }

/* ── Volume Slider ─────────────────────── */
.volume-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--surface3);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(108,99,255,0.5);
  cursor: pointer;
  transition: transform 0.15s;
}
.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ── Test Button ───────────────────────── */
.test-btn {
  position: relative;
  overflow: hidden;
}
.test-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ── Gong Animation ────────────────────── */
.gong-ring {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
}
.gong-ring-circle {
  width: 60px; height: 60px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: gongRing 1s ease-out forwards;
}
.gong-ring-circle:nth-child(2) { animation-delay: 0.2s; }
.gong-ring-circle:nth-child(3) { animation-delay: 0.4s; }

@keyframes gongRing {
  from { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  to   { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

/* ── Toast ─────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 260px;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ── Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.modal p  { color: var(--text2); font-size: 0.875rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Setup Wizard ──────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.wizard-step {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text3);
}
.wizard-step.active { color: var(--text); }
.wizard-step.done   { color: var(--green); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.wizard-step.active .step-num { border-color: var(--accent); color: var(--accent); }
.wizard-step.done   .step-num { border-color: var(--green); background: var(--green); color: white; }
.step-connector { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.wizard-step.done + .step-connector { background: var(--green); }

/* ── Divider ───────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Empty State ───────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--text2); margin-bottom: 8px; font-size: 1rem; }
.empty-state p { font-size: 0.85rem; margin-bottom: 24px; }

/* ── Code / URL display ────────────────── */
.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--accent2);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 10px;
}
.copy-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 6px;
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.copy-btn:hover { background: rgba(108,99,255,0.25); }

/* ── Mobile menu (hamburger) ────────── */
.mobile-menu-toggle { display: none; }
.mobile-menu-backdrop { display: none; }

@media (max-width: 768px) {
  :root { --sidebar: 0px; }
  /* Sidebar: hidden by default, slides in when .is-open. */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 201;
    transform: translateX(-110%);
    transition: transform 0.24s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.35);
  }
  .sidebar.is-open { transform: translateX(0); }

  /* Floating hamburger (top-left). */
  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface, #1a1830);
    color: var(--text, #e8eaf6);
    align-items: center;
    justify-content: center;
    z-index: 202;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  }

  /* Dark overlay behind the drawer. */
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .mobile-menu-backdrop.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Give main content room for the floating button. */
  .page { padding: 60px 16px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Customer Management ─────────────────────────── */
.customer-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.customer-table-header {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr 1.3fr 0.9fr 1fr;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.customer-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr 1.3fr 0.9fr 1fr;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.customer-row:last-child { border-bottom: none; }
.customer-row:hover { background: var(--surface2); }
.customer-name { font-weight: 500; font-size: 0.875rem; display: flex; align-items: center; gap: 8px; }

.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.online-dot.online  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.18); }
.online-dot.offline { background: #4b5563; }

.customer-integrations { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.int-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.int-chip.int-sonos  { background: rgba(96,165,250,0.14); color:#93c5fd; border-color: rgba(96,165,250,0.3); }
.int-chip.int-ring   { background: rgba(59,130,246,0.14); color:#60a5fa; border-color: rgba(59,130,246,0.3); }
.int-chip.int-google { background: rgba(251,113,133,0.14); color:#fda4af; border-color: rgba(251,113,133,0.3); }
.int-chip.int-nest   { background: rgba(34,197,94,0.14);   color:#86efac; border-color: rgba(34,197,94,0.3); }
.int-chip.int-eufy   { background: rgba(251,191,36,0.14);  color:#fde68a; border-color: rgba(251,191,36,0.3); }
.int-chip.int-doorbird { background: rgba(52,211,153,0.14); color:#a7f3d0; border-color: rgba(52,211,153,0.3); }
.int-chip.int-reolink  { background: rgba(239,68,68,0.14);  color:#fca5a5; border-color: rgba(239,68,68,0.3); }
.int-chip.int-unifi    { background: rgba(14,165,233,0.14); color:#7dd3fc; border-color: rgba(14,165,233,0.3); }

/* Subscription badges */
.sub-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.sub-badge-trial {
  background: rgba(251,191,36,0.12);
  color: var(--yellow);
  border: 1px solid rgba(251,191,36,0.25);
}
.sub-badge-active {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
}
.sub-badge-expired {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
}
.sub-badge-none {
  background: rgba(255,255,255,0.05);
  color: var(--text3);
  border: 1px solid var(--border);
}

/* Extra badge variant */
.badge-purple {
  background: rgba(108,99,255,0.15);
  color: var(--accent2);
  border: 1px solid rgba(108,99,255,0.25);
}

.sub-badge-free { background: rgba(56,189,248,0.12); color: #38bdf8; }

/* Admin: × unlink button inside each integration chip */
.int-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.18);
  color: inherit;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.int-chip-x:hover {
  opacity: 1;
  background: rgba(248,113,113,0.4);
  color: #fff;
}
