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

:root {
  --bg: #f4f6fb;
  --bg-2: #eef2f8;
  --card: #ffffff;
  --text: #0b1320;
  --text-2: #2a3650;
  --muted: #6b7793;
  --muted-2: #98a2b9;
  --border: #ebeef5;
  --border-2: #d8dde9;
  --primary: #2f6bff;
  --primary-d: #1f4fd9;
  --primary-soft: #eaf0ff;
  --primary-fg: #1a3a99;
  --accent: #25d366;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fef5e2;
  --danger: #e11d48;
  --danger-soft: #ffe6ec;
  --premium: #f59e0b;
  --premium-soft: #fff6e2;
  --sidebar-bg: #0d1b2a;
  --sidebar-bg-2: #14253a;
  --sidebar-text: #aeb8cb;
  --sidebar-text-active: #ffffff;
  --sidebar-section: #5a6580;
  --sidebar-hover: rgba(255,255,255,.06);
  --shadow-xs: 0 1px 2px rgba(11,19,32,.04);
  --shadow-sm: 0 2px 6px rgba(11,19,32,.05);
  --shadow: 0 6px 20px -8px rgba(11,19,32,.10), 0 4px 12px -6px rgba(11,19,32,.06);
  --shadow-lg: 0 20px 40px -12px rgba(11,19,32,.18), 0 10px 16px -8px rgba(11,19,32,.08);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

[data-theme="dark"] {
  --bg: #0a1322;
  --bg-2: #0e1a2e;
  --card: #11203a;
  --text: #f1f5fb;
  --text-2: #c8d2e6;
  --muted: #8593b0;
  --muted-2: #5b6884;
  --border: #1c2c47;
  --border-2: #2a3b5c;
  --primary-soft: rgba(47,107,255,.18);
  --primary-fg: #9bb6ff;
  --ok-soft: rgba(22,163,74,.18);
  --warn-soft: rgba(217,119,6,.18);
  --danger-soft: rgba(225,29,72,.18);
  --premium-soft: rgba(245,158,11,.18);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.4);
  --shadow: 0 6px 20px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 20px 40px -12px rgba(0,0,0,.7);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ App layout ============ */
.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

/* ============ Sidebar ============ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 6px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
  font-weight: 700;
  font-size: 17px;
  color: var(--sidebar-text-active);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 6px 14px -4px rgba(37,211,102,.5);
}

.sidebar-account {
  background: var(--sidebar-bg-2);
  border-radius: var(--radius);
  padding: 14px;
  margin: 6px 0 22px;
  display: flex; gap: 12px; align-items: center;
}
.sidebar-account-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #6f9bff 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.sidebar-account-info { min-width: 0; }
.sidebar-account-name {
  color: var(--sidebar-text-active);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-account-sub {
  color: var(--sidebar-section);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-section {
  color: var(--sidebar-section);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 12px 6px;
  font-weight: 600;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--sidebar-text);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); text-decoration: none; }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(47,107,255,.15) 0%, rgba(47,107,255,.05) 100%);
  color: var(--sidebar-text-active);
  font-weight: 500;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-link svg, .sidebar-link .icon {
  width: 18px; height: 18px; flex-shrink: 0; opacity: .85;
}
.sidebar-link.active svg { opacity: 1; color: var(--primary); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  font-size: 11px;
  color: var(--sidebar-section);
  line-height: 1.5;
}

/* ============ Main + Topbar ============ */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.topbar-greet {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.topbar-greet-avatar {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 14px;
}
.topbar-greet-text { min-width: 0; }
.topbar-greet-text h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex; gap: 8px; align-items: center;
}
.topbar-greet-text .role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.topbar-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.topbar-icon-btn {
  width: 40px; height: 40px;
  border: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background .12s, color .12s, border-color .12s;
}
.topbar-icon-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--border-2); }
.topbar-icon-btn svg { width: 18px; height: 18px; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #6f9bff 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  transition: transform .15s;
}
.avatar:hover { transform: scale(1.05); }

/* Profile popover */
.profile-pop {
  position: absolute;
  top: 70px;
  right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 280px;
  z-index: 100;
  overflow: hidden;
}
.profile-pop-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.profile-pop-name { font-weight: 600; font-size: 15px; }
.profile-pop-email { color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-all; }
.profile-pop-item {
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 14px;
  border: none;
  background: transparent;
  width: 100%; text-align: left;
  color: var(--text);
  font-family: inherit;
}
.profile-pop-item + .profile-pop-item { border-top: 1px solid var(--border); }
.profile-pop-item:hover { background: var(--bg-2); }
.profile-pop-item.danger { color: var(--danger); }
.profile-pop-item svg { width: 18px; height: 18px; }

.content {
  padding: 24px 28px 40px;
  flex: 1;
  min-width: 0;
}
.page-header { margin-bottom: 22px; }
.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.page-header p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}
.page-header.with-action {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}

/* ============ Cards ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.card-h svg { width: 22px; height: 22px; color: var(--primary); }
.card-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Hero card (dark feature) - inspirado en la imagen referencia */
.card-feature {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2d4a 100%);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}
.card-feature::after {
  content: ''; position: absolute; right: -50px; top: -50px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47,107,255,.4) 0%, transparent 70%);
  pointer-events: none;
}
.card-feature .muted, .card-feature p { color: rgba(255,255,255,.75); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-2); text-decoration: none; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 6px 14px -6px rgba(47,107,255,.5);
}
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: white; }
.btn-pill { border-radius: 999px; }
.btn-danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
.btn-danger:hover { background: #ffd5dd; }
.btn-danger-fill {
  background: var(--danger); border-color: var(--danger); color: white;
}
.btn-danger-fill:hover { background: #be1639; color: white; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon {
  padding: 8px;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-2); }

/* ============ Forms ============ */
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  margin-top: 14px;
}
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.textarea { min-height: 70px; resize: vertical; }
.input-help { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Toggle */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background-color: var(--border-2);
  border-radius: 26px;
  transition: .3s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ============ Tags / Pills (con dot) ============ */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-fg);
}
.tag::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.tag-no-dot::before { display: none; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-premium { background: var(--premium-soft); color: var(--premium); }
.tag-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.tag-outline::before { display: none; }
.tag-live {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.tag-live::before {
  background: white;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .4 } }

/* ============ Banners ============ */
.banner {
  border: 1px solid var(--border);
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex; gap: 14px;
}
.banner-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.banner-body strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 14px; }
.banner-body p { color: var(--text-2); font-size: 13px; line-height: 1.55; }
.banner-info { background: var(--primary-soft); border-color: #cfdcff; }
.banner-warn { background: var(--warn-soft); border-color: #f3d59a; }
.banner-danger { background: var(--danger-soft); border-color: #ffc1ce; }
.banner-ok { background: var(--ok-soft); border-color: #b8e6c8; }

/* ============ KPIs ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.kpi-label {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.kpi-label svg { width: 18px; height: 18px; opacity: .8; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-ok .kpi-label { color: var(--ok); }
.kpi-warn .kpi-label { color: var(--warn); }
.kpi-danger .kpi-label { color: var(--danger); }

/* ============ Plan bar ============ */
.plan-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.plan-bar-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.plan-bar-info { flex: 1; min-width: 200px; }
.plan-bar-info .row1 {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
}
.plan-bar-info .row1 .clock {
  font-size: 13px; color: var(--text-2); font-weight: 500;
  background: var(--bg);
  padding: 4px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}
.plan-bar-info .row2 { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ============ Plan cards (pricing) ============ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  background: var(--card);
  text-align: center;
  position: relative;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.plan-card:hover { border-color: var(--border-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card.popular { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan-card.popular::before {
  content: 'Popular';
  position: absolute;
  top: -11px;
  left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.plan-card h3 { font-size: 17px; margin-bottom: 6px; }
.plan-card .price { font-size: 32px; color: var(--primary); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.plan-card .price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan-card .feat { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ============ Quick actions ============ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.quick-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  text-decoration: none;
  color: var(--text);
  display: block;
  min-width: 0;
}
.quick-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.quick-card-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.quick-card-icon svg { width: 22px; height: 22px; }
.quick-card h3 { font-size: 16px; margin-bottom: 4px; font-weight: 600; }
.quick-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ============ Tables ============ */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; }
th {
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-2); }

/* ============ Tabs ============ */
.tabs {
  display: flex; gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count {
  font-size: 11px;
  background: var(--bg);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
}
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary-fg); }

/* ============ Modal ============ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(11, 19, 32, .6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn .15s;
  backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0 } }
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 760px; }
.modal h2 { margin-bottom: 12px; }
.modal ul { margin: 12px 0 16px 22px; }
.modal li { margin-bottom: 6px; font-size: 14px; }

/* ============ Group selector ============ */
.group-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.group-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.group-item:last-child { border-bottom: none; }
.group-item:hover { background: var(--bg-2); }

/* ============ Health panel ============ */
.health-card {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.health-score {
  width: 140px; height: 140px;
  position: relative;
  margin: 0 auto;
}
.health-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.health-score-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.health-score-num { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.health-score-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.health-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; min-width: 0; }
.health-stat { font-size: 13px; }
.health-stat strong { color: var(--text); display: block; font-size: 18px; font-weight: 700; }
.health-stat span { color: var(--muted); }

/* ============ Mode selector (Variación humana) ============ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.mode-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  background: var(--card);
  font-family: inherit;
  transition: border-color .15s, background .15s;
  position: relative;
}
.mode-card:hover { border-color: var(--border-2); }
.mode-card.active { border: 2px solid var(--primary); background: var(--primary-soft); }
.mode-card.disabled { opacity: .55; cursor: not-allowed; background: var(--bg-2); }
.mode-card .mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--bg);
  color: var(--muted);
  margin-bottom: 8px;
}
.mode-card[data-level="off"] .mode-badge { background: var(--danger-soft); color: var(--danger); }
.mode-card[data-level="low"] .mode-badge { background: var(--warn-soft); color: var(--warn); }
.mode-card[data-level="med"] .mode-badge { background: var(--ok-soft); color: var(--ok); }
.mode-card[data-level="high"] .mode-badge { background: var(--primary-soft); color: var(--primary); }
.mode-card h4 { font-size: 14px; margin-bottom: 4px; }
.mode-card p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ============ Public pages ============ */
.public-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.public-nav .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.public-nav .brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 36px 24px; }
.container-sm { max-width: 460px; margin: 0 auto; padding: 24px; }

.hero h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  line-height: 1.6;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; cursor: pointer; }

.qr { text-align: center; padding: 20px; }
.qr img {
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: white;
}

/* ============ Steps ============ */
.steps { list-style: none; padding: 0; margin: 12px 0 0 0; }
.step {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  background: var(--primary-soft);
  color: var(--primary-fg);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    width: 260px; z-index: 200;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-toggle { display: inline-flex !important; }
  .content { padding: 16px; }
  .topbar { padding: 14px 16px; }
  .health-card { grid-template-columns: 1fr; text-align: center; }
}
@media (min-width: 901px) { .topbar-toggle { display: none; } }

.topbar-toggle {
  display: none;
  border: none; background: transparent;
  padding: 8px; cursor: pointer; color: var(--text);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(11,19,32,.4);
  z-index: 150;
}
.sidebar-overlay.show { display: block; }
