/* ============================================================
   Algiz Relationship Hub — Design System
   Dark, tech, Linear/Vercel-inspired
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --bg:        #08090B;
  --bg-2:      #0C0E11;
  --surface:   #121418;
  --surface-2: #161920;
  --surface-3: #1C2028;
  --elevated:  #1A1D24;

  /* Lines */
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);

  /* Text */
  --text:      #ECEEF1;
  --text-2:    #9BA1AC;
  --text-3:    #646A75;
  --text-4:    #444A54;

  /* Accents */
  --blue:      #4D8DFF;   /* humano / primary */
  --blue-soft: rgba(77,141,255,0.14);
  --blue-glow: rgba(77,141,255,0.40);
  --violet:    #A78BFA;   /* IA */
  --violet-soft: rgba(167,139,250,0.14);
  --green:     #2FD27A;   /* online / saudável */
  --green-soft: rgba(47,210,122,0.14);
  --orange:    #FF9F45;   /* alerta */
  --orange-soft: rgba(255,159,69,0.14);
  --red:       #FF5F6D;   /* crítico */
  --red-soft:  rgba(255,95,109,0.14);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);

  --sans: 'Manrope', system-ui, sans-serif;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(77,141,255,0.07), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(167,139,250,0.05), transparent 55%),
    var(--bg);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2a2f3a; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

#root { height: 100%; }

/* ============================================================ LAYOUT */
.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  gap: 4px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(150deg, #1d2535, #11141a);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 24px rgba(77,141,255,0.15);
}
.brand-name { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; margin-top: 1px; }

.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-4); padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, var(--blue-soft), transparent 80%);
  color: var(--text);
  border-color: var(--line-2);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--blue); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--blue-glow);
}
.nav-badge { margin-left: auto; font-size: 10px; font-family: var(--mono); background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 99px; }
.nav-badge.alert { background: var(--orange-soft); color: var(--orange); }

.sidebar-foot { margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: border-color .15s;
}
.user-card:hover { border-color: var(--line-2); }
.user-meta { line-height: 1.25; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-plan { font-size: 11px; color: var(--text-3); }

/* ---------- Main ---------- */
.main { overflow-y: auto; overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 18px 32px;
  background: rgba(8,9,11,0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.greeting h1 { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.greeting p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--surface);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 99px; }
.status-pill.on { color: #b7f3d2; }
.status-pill.on .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft), 0 0 10px var(--green); }
.status-pill.link { color: #bcd4ff; }
.status-pill.link .dot { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.status-pill .sub { color: var(--text-3); font-weight: 500; }

.sync { font-size: 12px; color: var(--text-3); font-family: var(--mono); display: flex; align-items: center; gap: 6px; }

.content { padding: 26px 32px 80px; max-width: 1320px; }

/* ============================================================ CARDS */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  position: relative;
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-title .muted { color: var(--text-3); font-weight: 500; }
.card-sub { font-size: 11.5px; color: var(--text-3); margin-top: -10px; margin-bottom: 14px; }
.card-tools { margin-left: auto; display: flex; gap: 6px; }

.seg {
  display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px;
}
.seg button {
  border: none; background: none; color: var(--text-3); font-family: var(--sans);
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button.active { background: var(--surface-3); color: var(--text); }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 16px; position: relative; overflow: hidden;
}
.kpi:hover { border-color: var(--line-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); }
.kpi-ico svg { width: 16px; height: 16px; stroke-width: 1.9; }
.kpi-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; line-height: 1.3; }
.kpi-value { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin-top: 4px; }
.kpi-value .unit { font-size: 15px; color: var(--text-3); margin-left: 2px; }
.kpi-delta { font-size: 11.5px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta .muted { color: var(--text-4); font-weight: 500; }
.kpi-spark { position: absolute; right: 10px; bottom: 10px; opacity: .8; }

/* progress bar inline */
.bar-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.bar-fill { height: 100%; border-radius: 99px; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: 1.6fr 1fr; }
.g-2e { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================================ DEPENDENCY MODULE */
.dep-row {
  display: grid; grid-template-columns: 150px 1fr 92px; align-items: center; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.dep-row:last-child { border-bottom: none; }
.dep-name { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.dep-bar { height: 9px; border-radius: 99px; overflow: hidden; display: flex; background: var(--surface-3); }
.dep-bar .you { background: linear-gradient(90deg, #4d8dff, #6aa0ff); }
.dep-bar .ia { background: linear-gradient(90deg, #8b6df5, #a78bfa); }
.dep-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.dep-legend b { color: var(--text); font-weight: 600; }
.dep-pct { font-family: var(--mono); font-size: 12px; text-align: right; }
.dep-pct .ai { color: var(--violet); }

/* Alerts */
.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); margin-bottom: 10px;
  background: var(--surface);
}
.alert.warn { border-color: rgba(255,159,69,0.28); background: linear-gradient(90deg, var(--orange-soft), transparent 70%); }
.alert.crit { border-color: rgba(255,95,109,0.30); background: linear-gradient(90deg, var(--red-soft), transparent 70%); }
.alert-ico { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; }
.alert.warn .alert-ico { background: var(--orange-soft); color: var(--orange); }
.alert.crit .alert-ico { background: var(--red-soft); color: var(--red); }
.alert-body { font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.alert-body b { color: var(--text); font-weight: 700; }
.alert-cta { margin-left: auto; align-self: center; }

/* ============================================================ TABLE / LIST */
.afn-row {
  display: grid; grid-template-columns: 1fr 130px 70px; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: var(--r-sm); cursor: pointer;
  transition: background .14s;
}
.afn-row:hover { background: var(--surface); }
.afn-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.afn-name { font-size: 13px; font-weight: 600; }
.afn-cat { font-size: 11px; color: var(--text-3); }
.afn-score { font-family: var(--display); font-size: 16px; font-weight: 600; text-align: right; }

/* Avatar */
.avatar {
  flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}
.avatar.ring-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--green); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 99px; text-transform: uppercase;
}
.badge.b-blue { background: var(--blue-soft); color: #9cc0ff; }
.badge.b-violet { background: var(--violet-soft); color: #c7b6fc; }
.badge.b-green { background: var(--green-soft); color: #84e6b3; }
.badge.b-orange { background: var(--orange-soft); color: #ffc488; }
.badge.b-red { background: var(--red-soft); color: #ff9aa4; }
.badge.b-gray { background: var(--surface-3); color: var(--text-2); }

.cat-chip {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface);
}

/* ============================================================ TOGGLE */
.toggle {
  --w: 40px; --h: 23px;
  width: var(--w); height: var(--h); border-radius: 99px;
  background: var(--surface-3); border: 1px solid var(--line-2);
  position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: calc(var(--h) - 6px); height: calc(var(--h) - 6px); border-radius: 50%;
  background: #c7ccd4; transition: transform .2s, background .2s;
}
.toggle.on { background: linear-gradient(90deg, #2c8a52, var(--green)); border-color: transparent; }
.toggle.on::after { transform: translateX(calc(var(--w) - var(--h))); background: #fff; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; stroke-width: 2; }
.btn.primary { background: linear-gradient(180deg, #4d8dff, #3d7af0); border-color: #3d7af0; color: #fff; box-shadow: 0 0 18px rgba(77,141,255,0.25); }
.btn.primary:hover { background: linear-gradient(180deg, #5a96ff, #4683f5); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.9; }

/* ============================================================ LEVEL SELECTOR */
.levels { display: flex; flex-direction: column; gap: 9px; }
.level {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.level:hover { border-color: var(--line-2); }
.level.active { border-color: var(--blue); background: linear-gradient(90deg, var(--blue-soft), transparent 75%); }
.level-num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 16px;
  background: var(--surface-3); color: var(--text-2);
}
.level.active .level-num { background: var(--blue); color: #fff; box-shadow: 0 0 16px var(--blue-glow); }
.level-txt h4 { font-size: 13.5px; font-weight: 700; }
.level-txt p { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.level-check { margin-left: auto; color: var(--blue); opacity: 0; }
.level.active .level-check { opacity: 1; }

/* ============================================================ PROFILE */
.profile-hero {
  display: flex; align-items: center; gap: 18px; padding: 24px;
}
.profile-hero h2 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.profile-hero .meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.profile-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; }
.pstat { background: var(--bg-2); padding: 15px 16px; }
.pstat .l { font-size: 11px; color: var(--text-3); font-weight: 600; }
.pstat .v { font-family: var(--display); font-size: 20px; font-weight: 600; margin-top: 5px; letter-spacing: -0.01em; }
.pstat .v small { font-size: 12px; color: var(--text-3); }

.mem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mem-item { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.mem-item .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-4); font-weight: 700; margin-bottom: 7px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
.mem-note { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -26px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); box-shadow: 0 0 10px var(--blue-glow); }
.tl-date { font-family: var(--mono); font-size: 11px; color: var(--blue); font-weight: 500; }
.tl-text { font-size: 13px; color: var(--text); margin-top: 3px; }
.tl-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* sentiment chip */
.senti { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.senti .dot { width: 8px; height: 8px; border-radius: 99px; }
.senti.pos { color: var(--green); } .senti.pos .dot { background: var(--green); }
.senti.neu { color: var(--text-2); } .senti.neu .dot { background: var(--text-3); }
.senti.neg { color: var(--orange); } .senti.neg .dot { background: var(--orange); }

/* contacts list */
.contacts-table { width: 100%; }
.ct-head, .ct-row {
  display: grid; grid-template-columns: 2fr 1.1fr 1.4fr 1fr 64px; align-items: center; gap: 14px;
  padding: 12px 14px;
}
.ct-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-4); font-weight: 700; border-bottom: 1px solid var(--line); }
.ct-row { border-bottom: 1px solid var(--line); cursor: pointer; transition: background .14s; }
.ct-row:hover { background: var(--surface); }
.ct-row:last-child { border-bottom: none; }

.mini-dep { display: flex; align-items: center; gap: 9px; }
.mini-dep .track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.mini-dep .you { background: var(--blue); } .mini-dep .ia { background: var(--violet); }
.mini-dep .v { font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 30px; text-align: right; }

/* misc */
.section-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.section-title h2 { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.section-title .count { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.dim { color: var(--text-3); }
.back-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 600; }
.back-btn:hover { color: var(--text); }

.fade-in { animation: fadeIn .32s ease; }
@keyframes fadeIn { from { transform: translateY(7px); } to { transform: none; } }

.legend-dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }

/* ---- Tweaks: glow + density ---- */
body.no-glow .brand-mark,
body.no-glow .status-pill .dot,
body.no-glow .nav-item.active::before,
body.no-glow .level.active .level-num,
body.no-glow .btn.primary,
body.no-glow .tl-dot { box-shadow: none !important; }
body.no-glow .bar-fill { filter: none; }

body[data-density="compact"] .content { padding: 18px 24px 60px; }
body[data-density="compact"] .card-pad { padding: 14px; }
body[data-density="compact"] .kpi { padding: 12px 13px; }
body[data-density="compact"] .kpi-grid { gap: 10px; margin-bottom: 16px; }
body[data-density="compact"] .grid { gap: 12px; }
body[data-density="compact"] .kpi-value { font-size: 23px; }
body[data-density="compact"] .dep-row { padding: 8px 0; }
body[data-density="compact"] .afn-row { padding: 7px 8px; }

/* chart tooltip */
.chart-tip {
  position: absolute; pointer-events: none; background: var(--elevated); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 8px 11px; font-size: 11.5px; box-shadow: var(--shadow-lg); z-index: 40; min-width: 110px;
  transform: translate(-50%, -118%); transition: opacity .1s;
}
.chart-tip .t-date { color: var(--text-3); font-family: var(--mono); font-size: 10.5px; margin-bottom: 5px; }
.chart-tip .t-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.chart-tip .t-row b { margin-left: auto; font-family: var(--mono); }

/* responsive squeeze */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .g-2, .g-2e { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================ MODAL QR */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal-box {
  background: var(--elevated); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 28px; width: 380px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.modal-title { font-family: var(--display); font-size: 17px; font-weight: 600; }
.modal-sub { font-size: 12.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.modal-close {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); flex-shrink: 0; transition: border-color .15s;
}
.modal-close:hover { border-color: var(--line-strong); color: var(--text); }

.modal-qr-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 14px; padding: 18px; min-height: 220px;
}
.modal-qr { width: 200px; height: 200px; border-radius: 4px; }
.qr-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #333; font-size: 13px; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #e0e0e0; border-top-color: #333;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.modal-foot { text-align: center; font-size: 11.5px; color: var(--text-4); margin-top: 14px; }

/* disconnected pill */
.status-pill.disconnected .dot { background: var(--orange) !important; box-shadow: 0 0 8px var(--orange) !important; }
