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

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --border:      #e4e8ee;
  --border-lt:   #eef1f5;
  --accent:      #3b6fd4;
  --accent-lt:   #eef3fb;
  --accent-dark: #2e59aa;

  --text-1:  #0f172a;
  --text-2:  #4b5563;
  --text-3:  #94a3b8;

  --green:     #16a34a;
  --green-bg:  #dcfce7;
  --green-str: #22c55e;
  --yellow:    #b45309;
  --yellow-bg: #fef3c7;
  --yellow-str:#f59e0b;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --red-str:   #ef4444;
  --gray:      #64748b;
  --gray-bg:   #f1f5f9;
  --gray-str:  #cbd5e1;

  --sidebar-w:  210px;
  --topbar-h:   52px;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;

  --shadow-card: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.04);
  --shadow-hover: 0 4px 20px rgba(15,23,42,.10), 0 1px 4px rgba(15,23,42,.06);
  --shadow-modal: 0 24px 72px rgba(15,23,42,.16), 0 4px 16px rgba(15,23,42,.08);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── App shell ──────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  padding: 18px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-lt);
}

.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59,111,212,.35);
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.25;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 1px;
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s, color .12s;
}

.snav-btn svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: .8;
}

.snav-btn:hover { background: var(--bg); color: var(--text-1); }
.snav-btn:hover svg { opacity: 1; }
.snav-btn.active { background: var(--accent-lt); color: var(--accent); font-weight: 600; }
.snav-btn.active svg { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-lt);
}

.demo-badge-sidebar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 600;
}

.demo-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fef3c7;
}

.sidebar-footer-note {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 55;
}

/* ── Main wrapper ───────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.01em;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.week-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  letter-spacing: .02em;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-2);
  border-radius: var(--radius-xs);
  transition: background .12s;
}

.mobile-menu-btn:hover { background: var(--bg); }

/* ── Main content ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 24px;
}

.view { display: none; }
.view.active { display: block; }

/* ── Mode banner (Draft / Publish) ──────────────────────────────────── */
.mode-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-radius: var(--radius);
  border: 1px solid;
  padding: 14px 16px;
  margin-bottom: 20px;
  transition: background .35s, border-color .35s;
  box-shadow: var(--shadow-card);
}

.mode-banner.draft {
  background: #fffbeb;
  border-color: #fde68a;
}

.mode-banner.publish {
  background: #f0fdf4;
  border-color: #86efac;
}

.mode-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .35s;
}

.mode-banner.draft  .mode-icon-wrap { background: #fef3c7; color: #92400e; }
.mode-banner.publish .mode-icon-wrap { background: #dcfce7; color: #15803d; }

.mode-content { flex: 1; min-width: 0; }

.mode-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  transition: color .35s;
}

.mode-banner.draft  .mode-title { color: #92400e; }
.mode-banner.publish .mode-title { color: #14532d; }

.mode-desc {
  font-size: 12px;
  line-height: 1.6;
  transition: color .35s;
}

.mode-banner.draft  .mode-desc { color: #a16207; }
.mode-banner.publish .mode-desc { color: #166534; }

/* Mode switch buttons */
.mode-switch {
  display: flex;
  background: rgba(255,255,255,.65);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  align-self: center;
  backdrop-filter: blur(4px);
}

.mode-banner.draft   .mode-switch { border: 1px solid #fde68a; }
.mode-banner.publish .mode-switch { border: 1px solid #86efac; }

.mswitch-btn {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-2);
  transition: background .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}

.mswitch-btn.active {
  background: var(--surface);
  color: var(--text-1);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Editable summary in Draft mode ─────────────────────────────────── */
.card-summary.editable {
  cursor: text;
  /* Show full text in draft (no line-clamp — variable height is intentional) */
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  border-radius: 6px;
  padding: 6px 8px;
  margin: -6px -8px;
  outline: 1.5px dashed transparent;
  transition: outline-color .15s, background .15s;
  -webkit-user-modify: read-write;
}

.card-summary.editable:hover {
  outline-color: #f59e0b;
  background: rgba(254,243,199,.5);
}

.card-summary.editable:focus {
  outline: 2px solid #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 4px rgba(245,158,11,.12);
}

.card-summary.editable:empty::before {
  content: "Noch keine Summary — hier klicken um zu schreiben…";
  color: var(--text-3);
  font-style: italic;
  pointer-events: none;
}

/* Draft edit hint badge on card */
.draft-hint {
  font-size: 10px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: .02em;
}

/* ── Stats bar ──────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

.stat-chip.green .stat-num { color: var(--green); }
.stat-chip.yellow .stat-num { color: var(--yellow); }
.stat-chip.red .stat-num { color: var(--red); }
.stat-chip.gray .stat-num { color: var(--gray); }

/* ── Account grid ───────────────────────────────────────────────────── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── Account card ───────────────────────────────────────────────────── */
.account-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow .18s, transform .15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Health color strip at top */
.card-strip { height: 4px; }
.account-card.health-Green  .card-strip { background: var(--green-str); }
.account-card.health-Yellow .card-strip { background: var(--yellow-str); }
.account-card.health-Red    .card-strip { background: var(--red-str); }
.account-card.health-nodata .card-strip { background: var(--gray-str); }

.card-body {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}

/* Health badge */
.health-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.health-badge.Green  { background: var(--green-bg);  color: var(--green); }
.health-badge.Yellow { background: var(--yellow-bg); color: var(--yellow); }
.health-badge.Red    { background: var(--red-bg);    color: var(--red); }
.health-badge.nodata { background: var(--gray-bg);   color: var(--gray); }

.card-meta-line {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* Summary text on card */
.card-summary {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 60px;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--border-lt);
  font-size: 11.5px;
}

.card-arr { font-weight: 600; color: var(--text-2); }

.card-signals {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
}

.card-ticket-open  { color: var(--red);   font-weight: 600; }
.card-ticket-none  { color: var(--text-3); }
.card-nps          { color: var(--text-3); }

.card-cta {
  margin-left: 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  opacity: 0;
  transition: opacity .15s;
}

.account-card:hover .card-cta { opacity: 1; }

/* ── Skeleton state ─────────────────────────────────────────────────── */
.account-card.skeleton {
  cursor: default;
  pointer-events: none;
}

.account-card.skeleton:hover {
  box-shadow: var(--shadow-card);
  transform: none;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--bg) 25%, #e8ebef 50%, var(--bg) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-block {
  height: 10px;
  margin-bottom: 6px;
}

.skeleton-summary {
  height: 58px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg) 25%, #e8ebef 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-not-ready {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 200;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex; }

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: panelIn .2s cubic-bezier(.4,0,.2,1);
}

@keyframes panelIn {
  from { transform: translateX(16px) scale(.99); opacity: 0; }
  to   { transform: translateX(0)    scale(1);   opacity: 1; }
}

.modal-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title-block { flex: 1; min-width: 0; }

.modal-account-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

.modal-meta-sep { color: var(--border); }

.modal-close {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background .12s, color .12s;
}

.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: #fca5a5; }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Modal detail sections ──────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.summary-text {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.75;
  background: var(--accent-lt);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sources-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.source-header {
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-body { padding: 12px; }

/* Tickets table */
.tickets-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tickets-table th {
  text-align: left;
  color: var(--text-3);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
.tickets-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border-lt);
  color: var(--text-1);
  vertical-align: top;
}
.tickets-table tr:last-child td { border-bottom: none; }

.sev-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.sev-badge.High   { background: var(--red-bg);    color: var(--red); }
.sev-badge.Medium { background: var(--yellow-bg); color: var(--yellow); }
.sev-badge.Low    { background: var(--gray-bg);   color: var(--gray); }

.status-dot-sm {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.status-dot-sm.Open     { background: var(--red); }
.status-dot-sm.Resolved { background: var(--green); }

/* NPS */
.nps-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.nps-score {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.nps-score .nps-denom { font-size: 14px; font-weight: 400; color: var(--text-3); }
.nps-score.high   { color: var(--green); }
.nps-score.medium { color: var(--yellow); }
.nps-score.low    { color: var(--red); }
.nps-date { font-size: 12px; color: var(--text-3); }

.nps-comment {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.6;
}
.nps-comment::before { content: "\201C"; }
.nps-comment::after  { content: "\201D"; }

/* Usage grid */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.usage-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border-lt);
}
.usage-val { font-size: 22px; font-weight: 800; color: var(--text-1); letter-spacing: -.03em; }
.usage-lbl { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.usage-delta { font-size: 11px; font-weight: 600; color: var(--red); margin-top: 3px; }

/* Email */
.churn-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}

.email-excerpt {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.65;
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  border: 1px solid var(--border-lt);
}
.email-from {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 7px;
}

.no-data-notice {
  text-align: center;
  padding: 14px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ── Analytics view ─────────────────────────────────────────────────── */
.analytics-section {}

.section-header { margin-bottom: 14px; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.01em;
  margin-bottom: 3px;
}

.section-desc {
  font-size: 12.5px;
  color: var(--text-3);
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.chart-card-header {
  margin-bottom: 12px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-container { position: relative; }

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.select-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.account-select {
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath fill='%2394a3b8' d='M5.5 7.5L1 3h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 280px;
  box-shadow: var(--shadow-card);
}

.account-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* ── Connections view ───────────────────────────────────────────────── */
.connections-header { margin-bottom: 20px; }

.connections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 700px;
}

.conn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
}

.conn-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.conn-info { flex: 1; min-width: 0; }

.conn-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}

.conn-note {
  font-size: 11.5px;
  color: var(--text-3);
}

.conn-note.degraded { color: #92400e; font-weight: 500; }

.conn-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conn-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.conn-badge.ok {
  background: var(--green-bg);
  color: var(--green);
}

.conn-badge.degraded {
  background: #fef3c7;
  color: #92400e;
}

.conn-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.conn-sync {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 24px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .accounts-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 210px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0; }
  .mobile-menu-btn { display: flex; }

  .main-content { padding: 16px; }
  .accounts-grid { grid-template-columns: 1fr; gap: 12px; }
  .modal-panel { width: 100%; max-height: 92vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .account-select { min-width: 100%; }
  .toggle-hint { display: none; }
  .usage-grid { grid-template-columns: 1fr 1fr; }

  .conn-card { flex-wrap: wrap; }
  .conn-status { flex-direction: row; align-items: center; }
}

@media (max-width: 480px) {
  .stats-bar { gap: 8px; }
  .stat-chip { padding: 8px 14px; }
  .stat-num { font-size: 18px; }
}
