/* ====== NEXARA V5 ADDITIONS ====== */

/* ---------- Universal explainer chip ---------- */
.nx-explain {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted, #8a93a3);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  vertical-align: middle;
  flex-shrink: 0;
}
[data-theme="light"] .nx-explain {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
  color: #6b7280;
}
.nx-explain:hover {
  background: rgba(10,132,255,0.18);
  border-color: rgba(10,132,255,0.5);
  color: #4d8bff;
  transform: scale(1.1);
}
.nx-explain svg { width: 12px; height: 12px; }
.nx-explain-pulse {
  animation: nxPulse 1.4s ease-out;
}
@keyframes nxPulse {
  0%   { box-shadow: 0 0 0 0 rgba(10,132,255,0.6); }
  60%  { box-shadow: 0 0 0 10px rgba(10,132,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(10,132,255,0); }
}

/* ---------- Modal ---------- */
.modal-host { display: none; }
.modal-host.open {
  display: flex; position: fixed; inset: 0;
  align-items: center; justify-content: center;
  z-index: 1100;
}
.nx-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 7, 13, 0.7);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease-out;
}
.nx-modal {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  background: var(--surface-1, #111726);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
[data-theme="light"] .nx-modal {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}
.nx-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .nx-modal-head { border-color: rgba(0,0,0,0.06); }
.nx-modal-eyebrow {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted, #8a93a3); margin-bottom: 4px;
}
.nx-modal-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.nx-modal-close {
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: inherit; width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}
.nx-modal-close:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .nx-modal-close { border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .nx-modal-close:hover { background: rgba(0,0,0,0.04); }
.nx-modal-body { padding: 20px 24px; line-height: 1.6; }
.nx-modal-body p { margin: 0 0 14px; color: var(--text-1, #c7ced9); font-size: 15px; }
.nx-modal-points { list-style: none; padding: 0; margin: 0; }
.nx-modal-points li {
  position: relative; padding: 10px 0 10px 26px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 14px; color: var(--text-1, #c7ced9);
}
[data-theme="light"] .nx-modal-points li { border-color: rgba(0,0,0,0.05); }
.nx-modal-points li:before {
  content: "";
  position: absolute; left: 0; top: 16px;
  width: 16px; height: 16px;
  background: radial-gradient(circle, #22c55e 35%, transparent 36%);
  border-radius: 50%;
}
.nx-modal-foot {
  padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: flex-end; gap: 10px;
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] .nx-modal-foot { border-color: rgba(0,0,0,0.06); background: rgba(0,0,0,0.02); }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Welcome variant ---------- */
.nx-welcome { width: min(720px, calc(100vw - 32px)); }
.nx-welcome-head { padding: 28px 28px 16px; text-align: center; }
.nx-welcome-eyebrow { font-size: 11px; letter-spacing: .14em; color: #4d8bff; font-weight: 700; }
.nx-welcome-head h2 { font-size: 32px; margin: 8px 0 6px; font-weight: 700; line-height: 1.1; }
.nx-welcome-head p { color: var(--text-1, #c7ced9); margin: 0; font-size: 15px; }
.nx-welcome-grid {
  padding: 12px 28px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.nx-welcome-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px;
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] .nx-welcome-card { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
.nx-welcome-num {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #4d8bff, #7cc4ff);
  color: white; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; margin-bottom: 10px;
}
.nx-welcome-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.nx-welcome-card p { margin: 0; font-size: 13px; color: var(--text-1, #c7ced9); line-height: 1.5; }
.nx-welcome-foot {
  padding: 16px 28px 24px;
  display: flex; justify-content: center; gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 640px) {
  .nx-welcome-grid { grid-template-columns: 1fr; }
}

/* ---------- v5 Page head ---------- */
.v5-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 0 0 24px; flex-wrap: wrap;
}
.v5-page-eyebrow {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted, #8a93a3); font-weight: 600; margin-bottom: 4px;
}
.v5-page-title {
  font-size: 28px; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 4px;
}
.v5-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- v5 Stats row ---------- */
.v5-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 24px;
}
.v5-stat {
  background: var(--surface-1, #111726);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 16px 18px;
  position: relative; overflow: hidden;
}
.v5-stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, #0a84ff);
}
[data-theme="light"] .v5-stat {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.v5-stat-label {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted, #8a93a3); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 6px;
}
.v5-stat-value {
  font-size: 28px; font-weight: 700; line-height: 1.1;
  margin-bottom: 4px;
}
.v5-stat-sub { font-size: 12px; color: var(--text-muted, #8a93a3); }

/* ---------- v5 Panels and grids ---------- */
.v5-panel {
  background: var(--surface-1, #111726);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}
[data-theme="light"] .v5-panel {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.v5-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  gap: 12px; flex-wrap: wrap;
}
.v5-panel-head h3 {
  font-size: 14px; font-weight: 600; margin: 0;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-1, #c7ced9);
  display: flex; align-items: center; gap: 4px;
}
[data-theme="light"] .v5-panel-head { border-color: rgba(0,0,0,0.06); }
.v5-grid { display: grid; gap: 24px; margin-bottom: 24px; }
.v5-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) {
  .v5-stats-row { grid-template-columns: repeat(2, 1fr); }
  .v5-grid-2 { grid-template-columns: 1fr; }
}

/* ---------- v5 Chips ---------- */
.v5-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.v5-chip {
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-1, #c7ced9);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.v5-chip:hover { background: rgba(255,255,255,0.06); }
.v5-chip.active {
  background: rgba(10,132,255,0.18);
  border-color: rgba(10,132,255,0.4);
  color: #7cc4ff;
}
[data-theme="light"] .v5-chip {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #4b5563;
}
[data-theme="light"] .v5-chip.active {
  background: rgba(10,132,255,0.1);
  color: #1d4ed8;
  border-color: rgba(10,132,255,0.3);
}

.v5-empty { padding: 28px; text-align: center; color: var(--text-muted, #8a93a3); }

/* ---------- Appointments ---------- */
.v5-appt-list { padding: 6px 0; }
.v5-appt-row {
  display: grid;
  grid-template-columns: 64px 36px 1fr 80px 110px;
  gap: 14px; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: background .15s ease;
}
[data-theme="light"] .v5-appt-row { border-color: rgba(0,0,0,0.05); }
.v5-appt-row:last-child { border-bottom: none; }
.v5-appt-row:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .v5-appt-row:hover { background: rgba(0,0,0,0.02); }
.v5-appt-h { font-weight: 700; font-size: 15px; }
.v5-appt-dur { font-size: 11px; color: var(--text-muted, #8a93a3); }
.v5-appt-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4d8bff, #7c3aed);
  color: white; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.v5-appt-name { font-weight: 600; font-size: 14px; }
.v5-appt-sub { font-size: 12px; color: var(--text-muted, #8a93a3); }
.v5-appt-val { font-weight: 600; color: #22c55e; font-size: 14px; text-align: right; }
.v5-appt-status {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; text-align: center;
  letter-spacing: .04em;
}
.v5-appt-status.done { background: rgba(34,197,94,0.15); color: #22c55e; }
.v5-appt-status.live { background: rgba(10,132,255,0.18); color: #4d8bff; }
.v5-appt-status.wait { background: rgba(255,255,255,0.06); color: var(--text-1, #c7ced9); }
[data-theme="light"] .v5-appt-status.wait { background: rgba(0,0,0,0.05); color: #4b5563; }

@media (max-width: 700px) {
  .v5-appt-row { grid-template-columns: 56px 30px 1fr 90px; gap: 10px; padding: 12px 14px; }
  .v5-appt-val { display: none; }
}

/* Calendar */
.v5-cal {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: rgba(255,255,255,0.06);
  padding: 1px;
}
[data-theme="light"] .v5-cal { background: rgba(0,0,0,0.06); }
.v5-cal-day {
  background: var(--surface-1, #111726);
  padding: 10px 8px; min-height: 120px;
}
[data-theme="light"] .v5-cal-day { background: #fff; }
.v5-cal-day.is-today { background: rgba(10,132,255,0.06); }
.v5-cal-day-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.v5-cal-dow { font-size: 10px; text-transform: uppercase; color: var(--text-muted, #8a93a3); font-weight: 600; }
.v5-cal-num { font-size: 14px; font-weight: 700; }
.v5-cal-day.is-today .v5-cal-num { color: #4d8bff; }
.v5-cal-items { display: flex; flex-direction: column; gap: 3px; }
.v5-cal-item {
  font-size: 10px; padding: 4px 6px;
  background: rgba(10,132,255,0.18); color: #7cc4ff;
  border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="light"] .v5-cal-item { background: rgba(10,132,255,0.1); color: #1d4ed8; }
.v5-cal-empty { font-size: 10px; color: var(--text-muted, #8a93a3); }

.v5-svc-bars { padding: 14px 20px 18px; }
.v5-svc-row {
  display: grid; grid-template-columns: 160px 1fr 30px;
  align-items: center; gap: 12px;
  padding: 6px 0;
}
.v5-svc-label { font-size: 13px; }
.v5-svc-bar {
  height: 8px; background: rgba(255,255,255,0.05);
  border-radius: 999px; overflow: hidden;
}
[data-theme="light"] .v5-svc-bar { background: rgba(0,0,0,0.05); }
.v5-svc-fill {
  height: 100%;
  background: linear-gradient(90deg, #4d8bff, #7cc4ff);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.v5-svc-num { font-size: 13px; font-weight: 600; text-align: right; }

/* ---------- Conversations ---------- */
.v5-conv-shell {
  display: grid; grid-template-columns: 360px 1fr;
  height: calc(100vh - 320px); min-height: 540px;
  background: var(--surface-1, #111726);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px; overflow: hidden;
}
[data-theme="light"] .v5-conv-shell { background: #fff; border-color: rgba(0,0,0,0.08); }
.v5-conv-list {
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; min-height: 0;
}
[data-theme="light"] .v5-conv-list { border-color: rgba(0,0,0,0.06); }
.v5-conv-search { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="light"] .v5-conv-search { border-color: rgba(0,0,0,0.06); }
.v5-conv-search input {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; font-size: 13px;
}
[data-theme="light"] .v5-conv-search input { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
.v5-conv-channels { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="light"] .v5-conv-channels { border-color: rgba(0,0,0,0.06); }
.v5-conv-rows { flex: 1; overflow-y: auto; }
.v5-conv-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: background .15s ease;
  position: relative;
}
[data-theme="light"] .v5-conv-row { border-color: rgba(0,0,0,0.04); }
.v5-conv-row:hover { background: rgba(255,255,255,0.03); }
.v5-conv-row.active { background: rgba(10,132,255,0.08); }
.v5-conv-row.is-unread .v5-conv-name { font-weight: 700; }
.v5-conv-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4d8bff, #7c3aed);
  color: white; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.v5-conv-mid { flex: 1; min-width: 0; }
.v5-conv-line1 { display: flex; justify-content: space-between; gap: 8px; }
.v5-conv-name { font-size: 14px; font-weight: 500; }
.v5-conv-time { font-size: 11px; color: var(--text-muted, #8a93a3); flex-shrink: 0; }
.v5-conv-line2 { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.v5-conv-ch {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text-1, #c7ced9);
  text-transform: uppercase; letter-spacing: .05em;
  flex-shrink: 0;
}
[data-theme="light"] .v5-conv-ch { background: rgba(0,0,0,0.05); color: #4b5563; }
.v5-conv-msg {
  font-size: 12px; color: var(--text-muted, #8a93a3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v5-conv-dot {
  position: absolute; right: 14px; top: 16px;
  width: 8px; height: 8px; background: #4d8bff; border-radius: 50%;
}

.v5-conv-thread { display: flex; flex-direction: column; min-height: 0; }
.v5-conv-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted, #8a93a3); font-size: 14px;
}
.v5-thread-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
[data-theme="light"] .v5-thread-head { border-color: rgba(0,0,0,0.06); }
.v5-thread-meta { display: flex; align-items: center; gap: 12px; }
.v5-thread-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #4d8bff, #7c3aed);
  color: white; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.v5-thread-name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.v5-thread-sub { font-size: 12px; color: var(--text-muted, #8a93a3); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.v5-thread-actions { display: flex; gap: 8px; }
.v5-tier-pill {
  font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
  letter-spacing: .04em;
}
.v5-tier-hot { background: rgba(239,68,68,0.18); color: #f87171; }
.v5-tier-warm { background: rgba(245,158,11,0.18); color: #fbbf24; }
.v5-tier-cold { background: rgba(96,165,250,0.18); color: #93c5fd; }

.v5-thread-msgs {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.v5-msg { max-width: 70%; }
.v5-msg-cust { align-self: flex-end; }
.v5-msg-bubble {
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.05); font-size: 14px; line-height: 1.5;
}
.v5-msg-cust .v5-msg-bubble { background: rgba(10,132,255,0.2); }
[data-theme="light"] .v5-msg-bubble { background: rgba(0,0,0,0.04); }
[data-theme="light"] .v5-msg-cust .v5-msg-bubble { background: rgba(10,132,255,0.12); }
.v5-msg-meta {
  font-size: 10px; color: var(--text-muted, #8a93a3);
  margin-top: 4px; padding: 0 4px;
}
.v5-msg-cust .v5-msg-meta { text-align: right; }

.v5-thread-input {
  padding: 14px 20px; display: flex; gap: 10px; align-items: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .v5-thread-input { border-color: rgba(0,0,0,0.06); }
.v5-thread-input input {
  flex: 1; padding: 10px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; font-size: 14px;
}
[data-theme="light"] .v5-thread-input input { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }

@media (max-width: 900px) {
  .v5-conv-shell { grid-template-columns: 1fr; height: auto; }
  .v5-conv-thread { display: none; }
}

/* ---------- SMS ---------- */
.v5-sms-compose { padding: 18px 20px; }
.v5-sms-compose label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted, #8a93a3); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .06em;
}
.v5-sms-compose input,
.v5-sms-compose select,
.v5-sms-compose textarea {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; border-radius: 8px;
  font-family: inherit; font-size: 14px;
  margin-top: 6px; text-transform: none; letter-spacing: normal;
}
[data-theme="light"] .v5-sms-compose input,
[data-theme="light"] .v5-sms-compose select,
[data-theme="light"] .v5-sms-compose textarea {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1);
}
.v5-sms-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted, #8a93a3);
  margin: 8px 0 14px;
}
.v5-sms-meta b { color: var(--text-0, #f5f7fb); }
.v5-sms-actions { display: flex; gap: 8px; justify-content: flex-end; }

.v5-tpl-list { padding: 6px 0; }
.v5-tpl-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: background .15s ease;
}
[data-theme="light"] .v5-tpl-row { border-color: rgba(0,0,0,0.05); }
.v5-tpl-row:hover { background: rgba(255,255,255,0.03); }
.v5-tpl-row:last-child { border: none; }
.v5-tpl-meta { flex: 1; min-width: 0; }
.v5-tpl-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.v5-tpl-body { font-size: 12px; color: var(--text-muted, #8a93a3); line-height: 1.4; }
.v5-tpl-stats { display: flex; gap: 18px; }
.v5-tpl-stats > div { text-align: center; }
.v5-tpl-stats b { display: block; font-size: 16px; font-weight: 700; }
.v5-tpl-stats span { font-size: 10px; text-transform: uppercase; color: var(--text-muted, #8a93a3); }

/* ---------- Integrations ---------- */
.v5-int-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 18px 20px;
}
.v5-int-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px;
  cursor: pointer; transition: all .15s ease;
  display: flex; flex-direction: column; gap: 6px;
}
[data-theme="light"] .v5-int-card { background: #fafafa; border-color: rgba(0,0,0,0.08); }
.v5-int-card:hover {
  border-color: rgba(10,132,255,0.4);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.v5-int-top { display: flex; justify-content: space-between; align-items: center; }
.v5-int-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #4d8bff, #7c3aed);
  color: white; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.v5-int-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .04em;
}
.v5-int-status.ok { background: rgba(34,197,94,0.18); color: #22c55e; }
.v5-int-status.warn { background: rgba(245,158,11,0.18); color: #f59e0b; }
.v5-int-status.off { background: rgba(244,63,94,0.18); color: #f43f5e; }
.v5-int-name { font-weight: 600; font-size: 15px; margin-top: 8px; }
.v5-int-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #8a93a3); }
.v5-int-desc { font-size: 12px; color: var(--text-1, #c7ced9); line-height: 1.5; min-height: 36px; }
.v5-int-foot {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted, #8a93a3);
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
}
[data-theme="light"] .v5-int-foot { border-color: rgba(0,0,0,0.05); }
.v5-int-actions { display: flex; gap: 6px; margin-top: 4px; }
.v5-int-actions .btn { width: 100%; }

/* ---------- Automations ---------- */
.v5-auto-list { padding: 4px 0; }
.v5-auto-row {
  display: grid;
  grid-template-columns: 50px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .v5-auto-row { border-color: rgba(0,0,0,0.05); }
.v5-auto-row:last-child { border: none; }
.v5-auto-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.v5-auto-flow {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.v5-auto-trig {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: rgba(10,132,255,0.18); color: #7cc4ff; font-weight: 500;
}
[data-theme="light"] .v5-auto-trig { background: rgba(10,132,255,0.1); color: #1d4ed8; }
.v5-auto-act {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: rgba(255,255,255,0.05); color: var(--text-1, #c7ced9);
}
[data-theme="light"] .v5-auto-act { background: rgba(0,0,0,0.05); color: #4b5563; }
.v5-auto-arrow { color: var(--text-muted, #8a93a3); font-size: 12px; }
.v5-auto-stats { display: flex; gap: 18px; }
.v5-auto-stats > div { text-align: center; }
.v5-auto-stats b { display: block; font-size: 16px; font-weight: 700; }
.v5-auto-stats span { font-size: 10px; text-transform: uppercase; color: var(--text-muted, #8a93a3); }
.v5-auto-edit {
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-1, #c7ced9);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.v5-auto-edit:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .v5-auto-edit { border-color: rgba(0,0,0,0.1); color: #374151; }

/* Switch (used in automations + settings) */
.v5-switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.v5-switch input { opacity: 0; width: 0; height: 0; }
.v5-switch span {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  transition: .15s;
}
.v5-switch span:before {
  content: ""; position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}
[data-theme="light"] .v5-switch span { background: rgba(0,0,0,0.15); }
.v5-switch input:checked + span { background: #22c55e; }
.v5-switch input:checked + span:before { transform: translateX(16px); }

/* Builder */
.v5-builder {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 18px 20px; flex-wrap: wrap;
}
.v5-builder-step { flex: 1; min-width: 180px; }
.v5-builder-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted, #8a93a3);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.v5-builder-input {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; border-radius: 8px; font-size: 13px;
}
[data-theme="light"] .v5-builder-input { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
.v5-builder-arrow {
  font-size: 24px; color: var(--text-muted, #8a93a3);
  padding-bottom: 6px;
}
@media (max-width: 800px) {
  .v5-auto-row { grid-template-columns: 50px 1fr; }
  .v5-auto-stats, .v5-auto-edit { display: none; }
  .v5-builder-arrow { display: none; }
}

/* ---------- Settings ---------- */
.v5-settings-shell {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 24px;
}
.v5-settings-nav {
  display: flex; flex-direction: column; gap: 4px;
}
.v5-settings-link {
  text-align: left; padding: 10px 12px;
  background: transparent; border: none;
  color: var(--text-1, #c7ced9);
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all .15s ease;
}
.v5-settings-link:hover { background: rgba(255,255,255,0.04); }
.v5-settings-link.active {
  background: rgba(10,132,255,0.18); color: #7cc4ff;
}
[data-theme="light"] .v5-settings-link { color: #374151; }
[data-theme="light"] .v5-settings-link:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .v5-settings-link.active {
  background: rgba(10,132,255,0.1); color: #1d4ed8;
}

.v5-settings-pane {
  background: var(--surface-1, #111726);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 24px 28px;
  min-height: 480px;
}
[data-theme="light"] .v5-settings-pane { background: #ffffff; border-color: rgba(0,0,0,0.08); }
.v5-pane-head { margin-bottom: 24px; }
.v5-pane-head h3 {
  font-size: 20px; font-weight: 700; margin: 0 0 4px;
  display: flex; align-items: center; gap: 4px;
}
.v5-pane-head p { font-size: 13px; color: var(--text-muted, #8a93a3); margin: 0; }
.v5-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.v5-form label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted, #8a93a3);
  text-transform: uppercase; letter-spacing: .06em;
}
.v5-form input,
.v5-form select,
.v5-form textarea {
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; border-radius: 8px;
  font-family: inherit; font-size: 14px;
  margin-top: 6px; text-transform: none; letter-spacing: normal;
}
[data-theme="light"] .v5-form input,
[data-theme="light"] .v5-form select,
[data-theme="light"] .v5-form textarea {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1);
}
.v5-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v5-row-flex { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.v5-row-flex span { font-size: 13px; color: var(--text-1, #c7ced9); text-transform: none; letter-spacing: normal; font-weight: normal; }

.v5-hours { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin-bottom: 18px; }
.v5-hours-row {
  display: grid;
  grid-template-columns: 50px 60px 1fr 30px 1fr;
  align-items: center; gap: 10px;
  padding: 8px 0;
}
.v5-hours-day { font-weight: 600; font-size: 13px; }
.v5-hours-row > span { text-align: center; color: var(--text-muted, #8a93a3); font-size: 12px; }
.v5-hours-row input[type="time"] {
  padding: 6px 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; border-radius: 6px; font-size: 12px;
}
[data-theme="light"] .v5-hours-row input[type="time"] { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }

.v5-svcs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-width: 720px; }
.v5-svc-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  align-items: end; gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] .v5-svc-card { background: #fafafa; border-color: rgba(0,0,0,0.08); }
.v5-svc-card label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted, #8a93a3); font-weight: 600;
}
.v5-svc-card input {
  width: 100%; padding: 6px 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: inherit; border-radius: 6px; font-size: 13px;
  margin-top: 4px;
}
[data-theme="light"] .v5-svc-card input { background: #fff; border-color: rgba(0,0,0,0.1); }

.v5-notif-table, .v5-team-table, .v5-invoice-table {
  width: 100%; border-collapse: collapse; margin-bottom: 18px;
}
.v5-notif-table th, .v5-notif-table td,
.v5-team-table th, .v5-team-table td,
.v5-invoice-table th, .v5-invoice-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}
[data-theme="light"] .v5-notif-table th, [data-theme="light"] .v5-notif-table td,
[data-theme="light"] .v5-team-table th, [data-theme="light"] .v5-team-table td,
[data-theme="light"] .v5-invoice-table th, [data-theme="light"] .v5-invoice-table td {
  border-color: rgba(0,0,0,0.06);
}
.v5-notif-table th, .v5-team-table th, .v5-invoice-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted, #8a93a3); font-weight: 600;
}
.v5-team-av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #4d8bff, #7c3aed);
  color: white; font-size: 11px; font-weight: 600; margin-right: 8px;
  vertical-align: middle;
}
.v5-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.v5-pill.ok { background: rgba(34,197,94,0.18); color: #22c55e; }

.v5-billing-card {
  background: linear-gradient(135deg, rgba(10,132,255,0.1), rgba(124,58,237,0.06));
  border: 1px solid rgba(10,132,255,0.2);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.v5-billing-eyebrow {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: #7cc4ff; font-weight: 700;
}
.v5-billing-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.v5-billing-price { font-size: 32px; font-weight: 700; margin: 8px 0 4px; }
.v5-billing-price span { font-size: 14px; color: var(--text-muted, #8a93a3); font-weight: 400; }
.v5-billing-renew { font-size: 12px; color: var(--text-muted, #8a93a3); }
.v5-billing-actions { display: flex; gap: 8px; flex-direction: column; }

.v5-billing-usage {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 22px;
}
.v5-billing-usage .v5-stat::before { background: #7c3aed; }

.v5-audit { list-style: none; padding: 0; margin: 0; }
.v5-audit li {
  padding: 10px 0; font-size: 13px; color: var(--text-1, #c7ced9);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .v5-audit li { border-color: rgba(0,0,0,0.05); }
.v5-audit li:last-child { border: none; }

@media (max-width: 880px) {
  .v5-settings-shell { grid-template-columns: 1fr; }
  .v5-billing-usage { grid-template-columns: 1fr; }
  .v5-svc-card { grid-template-columns: 1fr; }
}

/* Hide rearrange/widget chrome on rebuilt tabs to keep cleaner */
.tab-host:has(.v5-page-head) ~ * .widget-toolbar { display: none; }
