/* =========================================
   app.css v8.0 — Vizbix SaaS Dashboard
   All dashboard, sidebar, simulator,
   chat, paywall, and component styles.
   Depends on main.css for :root vars.
   ========================================= */

/* ─── APP SHELL ──────────────────────────── */
.app-wrapper {
  display: flex;
  height: calc(100vh - 67px);
  overflow: hidden;
  background: var(--slate-50);
  position: relative;
}

/* ─── SIDEBAR ────────────────────────────── */
.app-sidebar {
  width: 244px;
  background: white; 
  color: var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 40;
  border-right: 1px solid var(--slate-100); 
}

.sidebar-nav {
  padding: 18px 10px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Section dividers inside nav */
.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 16px 5px;
  font-family: 'Inter', sans-serif;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 9px;
  color: var(--slate-400);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.14s ease;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  font-family: 'Inter', sans-serif;
}

.nav-item:hover {
  background: var(--slate-50);
  color: var(--ink);
}

.nav-item.active {
  background: #eff6ff; 
  color: #5b5ef6; 
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2.5px;
  height: 18px;
  background: #5b5ef6;
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0.75;
}
.nav-item.active svg { opacity: 1; }

/* Pro badge */
.nav-pro-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  background: linear-gradient(135deg, #5b5ef6, #8b5cf6);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

.sidebar-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 7px 10px;
}

/* Sidebar profile block */
.sidebar-profile {
  margin: 10px;
  padding: 14px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 12px;
  overflow: hidden;
}

.profile-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
  font-family: 'Inter', sans-serif;
}

.profile-email {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 10px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.profile-plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f3ff;
  border: 1px solid #ede9fe;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #7c3aed;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.profile-plan::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ─── MAIN CONTENT AREA ──────────────────── */
.app-main {
  overflow-x: hidden;
  flex: 1;
  overflow-y: auto;
  padding: 28px 30px;
  position: relative;
  background: var(--slate-50);
}

/* Page header pattern */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.04em;
}

/* ─── DATA CARD ──────────────────────────── */
.data-card {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(8,9,13,0.04), 0 8px 32px rgba(8,9,13,0.03);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.demo-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--indigo);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 5px 10px;
  background: var(--indigo-light);
  border-radius: 6px;
  transition: background 0.18s;
  font-family: 'Inter', sans-serif;
}
.demo-link:hover { background: #dddeff; }

/* ─── DATA INPUT TABLE ───────────────────── */
.data-table-headers {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 44px;
  gap: 12px;
  padding: 0 12px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  border-bottom: 1px solid var(--slate-50);
  margin-bottom: 6px;
  font-family: 'Inter', sans-serif;
}

.data-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 44px;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.data-row input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--slate-100);
  background: var(--slate-50);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.18s;
  color: var(--ink);
  font-weight: 500;
}
.data-row input:focus {
  border-color: var(--indigo);
  background: white;
  box-shadow: 0 0 0 3px var(--indigo-glow);
}
.data-row input::placeholder { color: var(--slate-200); }

.delete-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--slate-200);
  font-size: 16px;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.18s;
  line-height: 1;
}
.delete-btn:hover { background: var(--red-bg); color: var(--red); }

.add-row-btn {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1.5px dashed var(--slate-100);
  border-radius: 9px;
  color: var(--slate-300);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.18s;
  font-family: 'Inter', sans-serif;
}
.add-row-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-light);
}

.action-buttons-wrap {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-50);
}

/* ─── METRIC CARDS ───────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 14px;
  padding: 20px 20px 18px;
  box-shadow: 0 1px 3px rgba(8,9,13,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--slate-100);
  border-radius: 14px 14px 0 0;
}
.metric-card:hover {
  box-shadow: 0 4px 18px rgba(8,9,13,0.07);
  transform: translateY(-1px);
}

.metric-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 0 0 10px 0;
}

.metric-card .value {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

/* Card accent colors */
.metric-card:nth-child(1)::after { background: linear-gradient(90deg, var(--indigo), #818cf8); }
.metric-card.highlight::after    { background: linear-gradient(90deg, var(--green), #34d399); }
.metric-card:nth-child(3)::after { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.metric-card:nth-child(4)::after { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.metric-card.highlight {
  background: var(--ink-900);
  border-color: var(--ink-800);
}
.metric-card.highlight h4 { color: rgba(255,255,255,0.45); }
.metric-card.highlight .value { color: #ecf5ff; }

/* ─── DASHBOARD LAYOUT ───────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 14px;
  align-items: start;
}

/* ─── HEALTH SCORE BADGE ─────────────────── */
#health-circle {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 13px;
  border-radius: 99px;
  background: var(--slate-100);
  color: var(--slate-400);
  transition: all 0.4s ease;
  letter-spacing: -0.02em;
}

/* ─── REPORT TABLE ───────────────────────── */
.report-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.report-table th {
  padding: 13px 16px;
  text-align: left;
  background: var(--slate-50);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
}

.report-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--slate-50);
  font-size: 13.5px;
  color: var(--ink-600);
  font-family: 'Inter', sans-serif;
}

.report-table tbody tr { transition: background 0.14s; }
.report-table tbody tr:hover { background: #fafbff; }
.report-table tbody tr:last-child td { border-bottom: none; }

/* Margin bar */
.margin-bar { display: flex; align-items: center; gap: 8px; }
.margin-bar-track {
  flex: 1;
  height: 4px;
  background: var(--slate-100);
  border-radius: 99px;
  overflow: hidden;
  min-width: 48px;
}
.margin-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.margin-label { min-width: 38px; font-weight: 700; font-size: 13px; }

.status-pill {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.2px;
}
.status-healthy { background: var(--green-bg); color: #059669; }
.status-leak    { background: var(--red-bg);   color: var(--red); }

/* ─── PROFIT LAB SIMULATOR ───────────────── */
.sim-controls {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(8,9,13,0.04);
}

.slider-group { margin-bottom: 26px; }
.slider-group:last-of-type { margin-bottom: 0; }

.slider-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}

.slider-val {
  color: var(--indigo);
  font-weight: 600;
  font-size: 14px;
  background: var(--indigo-light);
  padding: 2px 10px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
}

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 20px;
  display: block;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--slate-100);
  border-radius: 3px;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px; width: 20px;
  border-radius: 50%;
  background: var(--indigo);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 2px 8px rgba(91,94,246,0.35);
  border: 2px solid white;
  transition: transform 0.14s, box-shadow 0.14s;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(91,94,246,0.45);
}

.sim-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sim-card {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 26px 22px;
  text-align: center;
  transition: all 0.28s ease;
  box-shadow: 0 1px 3px rgba(8,9,13,0.04);
}

.sim-card.active {
  background: linear-gradient(145deg, #f8f7ff, #ede9fe);
  border-color: #c4b5fd;
  box-shadow: 0 8px 28px rgba(91,94,246,0.1);
}

.sim-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 0 0 12px 0;
}

.sim-card .big-num {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.sim-delta {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
}
.delta-pos { color: #059669; background: var(--green-bg); }
.delta-neg { color: var(--red);  background: var(--red-bg); }

/* ─── AI CHAT ────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 170px);
  background: white;
  border-radius: 16px;
  border: 1px solid var(--slate-100);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(8,9,13,0.04);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--slate-50);
  scrollbar-width: thin;
  scrollbar-color: var(--slate-200) transparent;
}
.chat-history::-webkit-scrollbar { width: 3px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 4px; }

.chat-msg {
  max-width: 78%;
  padding: 13px 17px;
  border-radius: 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  position: relative;
}

.msg-ai {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--slate-100);
  color: var(--ink-600);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(8,9,13,0.05);
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(91,94,246,0.28);
}

.msg-ai strong { color: var(--ink); }

/* Copy button */
.msg-ai .copy-btn {
  display: none;
  position: absolute;
  top: 8px; right: 8px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--slate-400);
  transition: background 0.18s;
  font-family: 'Inter', sans-serif;
}
.msg-ai:hover .copy-btn { display: block; }
.copy-btn:hover { background: var(--slate-100); color: var(--ink); }

/* Suggestion chips */
.chat-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  background: white;
  border-top: 1px solid var(--slate-50);
}

.chip {
  background: var(--slate-50);
  border: 1.5px solid var(--indigo-light);
  border-radius: 99px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--indigo);
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.chip:hover { background: var(--indigo-light); border-color: #a5b4fc; }

/* Typing indicator */
.ai-typing {
  font-size: 13px;
  font-weight: 600;
  color: var(--indigo);
  padding: 7px 14px;
  display: none;
  background: #f5f3ff;
  border-top: 1px solid #ede9fe;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}

.chat-input-row {
  display: flex;
  padding: 12px 14px;
  background: white;
  border-top: 1px solid var(--slate-50);
  gap: 9px;
  align-items: center;
}

.chat-input-row input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid var(--slate-100);
  border-radius: 11px;
  outline: none;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: var(--slate-50);
  transition: all 0.18s;
  color: var(--ink);
}
.chat-input-row input:focus {
  border-color: var(--indigo);
  background: white;
  box-shadow: 0 0 0 3px var(--indigo-glow);
}
.chat-input-row input::placeholder { color: var(--slate-200); }

.chat-input-row button {
  background: var(--indigo);
  color: white;
  border: none;
  width: 44px; height: 44px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(91,94,246,0.3);
}
.chat-input-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(91,94,246,0.4);
}
.chat-input-row button:disabled {
  opacity: 0.4;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── PAYWALL OVERLAY ────────────────────── */
.pro-lock-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,9,13,0.6);
  backdrop-filter: blur(6px);
  animation: vzFadeIn 0.2s ease;
}

.pro-lock-hidden { display: none !important; }

.pro-lock-card {
  background: white;
  border-radius: 20px;
  padding: 36px 30px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);
  text-align: center;
  position: relative;
  animation: vzSlideUp 0.3s ease;
}

.pro-lock-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--slate-50);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 15px;
  color: var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  line-height: 1;
}
.pro-lock-close:hover { background: var(--slate-100); color: var(--slate-400); }

.pro-lock-card .lock-icon {
  font-size: 42px;
  display: block;
  margin-bottom: 8px;
}

.pro-lock-card h2 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 7px 0;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.pro-lock-card > p {
  color: var(--slate-400);
  font-size: 14px;
  margin: 0 0 18px 0;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
}

.pro-price-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: var(--ink);
  color: white;
  border-radius: 99px;
  padding: 5px 16px;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}
.pro-price-badge strong {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.pro-feature-list {
  list-style: none;
  padding: 0; margin: 0 0 20px 0;
  text-align: left;
}
.pro-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-600);
  padding: 6px 0;
  border-bottom: 1px solid var(--slate-50);
  font-family: 'Inter', sans-serif;
}
.pro-feature-list li:last-child { border-bottom: none; }
.pro-feature-list .check {
  width: 20px; height: 20px;
  background: var(--green-bg);
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.pro-social-proof {
  font-size: 12px;
  color: var(--slate-300);
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
}

/* Upgrade button */
.btn-upgrade {
  background: linear-gradient(135deg, var(--indigo) 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(91,94,246,0.3);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}
.btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(91,94,246,0.4);
}

/* ─── TOAST NOTIFICATIONS ────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-900);
  color: white;
  padding: 11px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  animation: vzToastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 300px;
  pointer-events: all;
  cursor: pointer;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--indigo); }

/* ─── SKELETON LOADERS ───────────────────── */
@keyframes vzShimmer {
  0%   { background-position: -500px 0; }
  100% { background-position:  500px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e4eaf2 50%, #f0f4f8 75%);
  background-size: 500px 100%;
  animation: vzShimmer 1.5s infinite;
  border-radius: 7px;
}
.skeleton-text  { height: 13px; margin-bottom: 7px; }
.skeleton-value { height: 30px; width: 55%; }
.skeleton-card  {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--slate-100);
}

/* ─── SETTINGS ───────────────────────────── */
.settings-section {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 13px;
  padding: 18px;
  margin-bottom: 14px;
}
.settings-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-300);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 10px;
}

/* Feature comparison */
.feature-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--slate-50);
  font-size: 13px;
  color: var(--ink-600);
  font-family: 'Inter', sans-serif;
}
.feature-row:last-child { border-bottom: none; }
.feature-checks { display: flex; gap: 28px; }
.feature-check-yes { color: var(--green); font-weight: 600; font-size: 14px; }
.feature-check-no  { color: var(--slate-200); font-size: 14px; }

/* ─── HISTORY ────────────────────────────── */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 11px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: all 0.18s;
}
.history-item:hover {
  border-color: #c4b5fd;
  box-shadow: 0 4px 14px rgba(91,94,246,0.08);
}

/* ─── CHART CONTAINMENT ──────────────────── */
.chart-card { box-sizing: border-box; }
.chart-wrap { box-sizing: border-box; }
.chart-wrap canvas { display: block; max-width: 100% !important; }

/* ─── MOBILE-ONLY ELEMENTS (hidden on desktop) ── */
.mobile-app-bar { display: none; }
.mobile-overlay  { display: none; }

/* ─── KEYBOARD SHORTCUT HINT ─────────────── */
.kbd {
  display: inline-block;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-100);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: monospace;
  color: var(--slate-400);
}

/* ─── ANIMATIONS ─────────────────────────── */
@keyframes vzFadeIn   { from { opacity: 0; }                              to { opacity: 1; } }
@keyframes vzSlideUp  { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes vzToastIn  { from { opacity: 0; transform: translateY(10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ─── ONBOARDING TOOLTIP ─────────────────── */
.onboarding-tooltip {
  position: fixed;
  background: var(--ink-900);
  color: white;
  border-radius: 12px;
  padding: 16px 18px;
  max-width: 268px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 14px 48px rgba(0,0,0,0.32);
  z-index: 400;
  animation: vzSlideUp 0.22s ease;
  font-family: 'Inter', sans-serif;
}
.onboarding-tooltip h4 {
  font-family: 'Inter', sans-serif;
  margin: 0 0 5px 0;
  font-size: 13px;
  font-weight: 700;
  color: #a5b4fc;
}
.onboarding-tooltip p { margin: 0 0 12px 0; color: var(--slate-300); font-size: 13px; }
.onboarding-nav { display: flex; align-items: center; justify-content: space-between; }
.onboarding-dots { display: flex; gap: 4px; }
.onboarding-dot { width: 6px; height: 6px; border-radius: 50%; background: #263347; transition: background 0.2s; }
.onboarding-dot.active { background: var(--indigo); }
.onboarding-btn {
  background: var(--indigo); color: white; border: none;
  border-radius: 7px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.18s;
}
.onboarding-btn:hover { background: var(--indigo-hover); }
.onboarding-skip {
  background: none; border: none; color: #566a8a;
  font-size: 12px; cursor: pointer; padding: 6px;
  font-family: 'Inter', sans-serif;
}
.onboarding-highlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.52);
  z-index: 350;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* ─── MOBILE RESPONSIVE ──────────────────── */
@media (max-width: 860px) {
  /* ── Shell ── */
  .app-wrapper {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 67px);
    overflow: visible;
  }

  /* ── Mobile top bar ── */
  .mobile-app-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 13px 16px;
    border-bottom: 1px solid var(--slate-100);
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 12px;
  }
  .mobile-app-bar button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--ink);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .mobile-app-bar .page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
  }

  /* ── Overlay & sidebar ── */
  .mobile-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(8,9,13,0.6);
    backdrop-filter: blur(3px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }
  .mobile-overlay.active { opacity: 1; pointer-events: auto; }

  .app-sidebar {
    position: fixed;
    top: 0; left: -100%;
    width: 272px !important;
    height: 100vh;
    z-index: 100;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  }
  .app-sidebar.mobile-open { left: 0; }
  .sidebar-nav { flex-direction: column !important; width: 100% !important; }
  .nav-item { width: 100% !important; }

  /* ── Main layout ── */
  .app-main { padding: 0; }
  .app-view { padding: 12px; }

  /* ── Dashboard: health score row ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-header h2 { font-size: 17px; }

  /* Health score badge — full width pill */
  .page-header > div:last-child {
    width: 100%;
    justify-content: space-between;
    border-radius: 10px;
    padding: 8px 14px;
  }

  /* ── Metrics grid: 2 cols, contained ── */
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .metric-card {
    padding: 13px 12px 11px;
    border-radius: 11px;
    min-width: 0; /* prevent overflow */
  }
  .metric-card .value {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .metric-card h4 { font-size: 9.5px; margin-bottom: 5px; }

  /* ── Dash grid: single column ── */
  .dash-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Chart card: prevent horizontal bleed */
  .dash-grid > .data-card:first-child {
    padding: 14px 12px;
    overflow: hidden;
  }
  .dash-grid > .data-card:first-child > div[style] {
    height: 200px !important;
    max-width: 100%;
    overflow: hidden;
  }

  /* Force chart canvas to stay inside its box */
  #profitChart {
    max-width: 100% !important;
    height: 200px !important;
  }

  /* Action plan card */
  .dash-grid > .data-card:last-child {
    padding: 14px;
    word-break: break-word;
  }
  .dash-grid > .data-card:last-child > div { word-break: break-word; }

  /* ── Sim results ── */
  .sim-results { grid-template-columns: 1fr !important; gap: 10px; }
  .sim-card { padding: 18px 16px; }
  .sim-card .big-num { font-size: 24px; }

  /* ── Data input ── */
  .action-buttons-wrap { flex-direction: column; gap: 8px; }
  .data-table-headers { display: none; }
  .data-card { padding: 16px; border-radius: 13px; }
  .data-row {
    grid-template-columns: 1fr 1fr;
    background: var(--slate-50);
    padding: 12px;
    border-radius: 10px;
    gap: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--slate-100);
  }
  .data-row input:nth-child(1) { grid-column: span 2; font-weight: 600; }
  .delete-btn {
    grid-column: span 2;
    background: var(--red-bg);
    color: var(--red);
    justify-content: center;
    width: 100%;
    border-radius: 7px;
    height: 34px;
  }

  /* ── Report table: allow horizontal scroll, smaller text ── */
  .report-table th, .report-table td { padding: 10px 12px; font-size: 12px; }
  .margin-bar-track { min-width: 30px; }
  #reportSummaryBar { gap: 8px; }
  #reportSummaryBar > div { min-width: 80px; padding: 8px 10px; }

  /* ── AI chat ── */
  .chat-container { height: calc(100vh - 180px); border-radius: 12px; }
  .chat-msg { max-width: 90%; font-size: 13.5px; }
  .chat-suggestion-chips { gap: 6px; padding: 8px 12px; }
  .chip { font-size: 11.5px; padding: 4px 10px; }

  /* ── Settings ── */
  .settings-section { padding: 14px; }

  /* ── Paywall ── */
  .pro-lock-card { padding: 24px 16px; }
  .pro-feature-list li { font-size: 13px; }

  /* ── Toast ── */
  #toastContainer { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

/* Extra small phones */
@media (max-width: 400px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card .value { font-size: 20px; }
}
