:root {
  --brand-primary: #EE8E25;
  --bg-dark: #0F0F0F;
  --bg-card: #212226;
  --neutral-0: #FFFFFF;
  --neutral-10: #E9EAEA;
  --neutral-30: #B3B5B6;
  --neutral-40: #9B9E9F;
  --neutral-50: #838688;
  --neutral-60: #6C6F71;
  --neutral-80: #3C4144;
  --neutral-90: #222426;
  --neutral-100: #0D1316;
  --success: #43C363;
  --error: #EB655E;
  --warning: #F59E0B;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --radius-3xl: 100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-dark); color: var(--neutral-0); min-height: 100vh; }

/* Nav */
.demo-nav { display: flex; align-items: center; height: 48px; padding: 0 20px; background: #16151A; border-bottom: 1px solid var(--neutral-90); gap: 24px; }
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo { height: 14px; }
.nav-title { font-size: 14px; font-weight: 500; }
.nav-badge { font-size: 10px; background: var(--brand-primary); color: #fff; padding: 2px 8px; border-radius: var(--radius-3xl); }
.nav-tabs { display: flex; gap: 4px; }
.nav-tab { background: none; border: none; color: var(--neutral-50); font-size: 13px; padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.nav-tab:hover { color: var(--neutral-30); background: var(--neutral-90); }
.nav-tab.active { color: var(--brand-primary); background: rgba(238,142,37,0.1); }

/* Content */
.demo-content { padding: 24px; max-width: 1400px; margin: 0 auto; }
.view-panel { display: none; }
.view-panel.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Flow Overview */
.flow-overview { max-width: 900px; margin: 0 auto; }
.flow-overview h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.flow-subtitle { color: var(--neutral-40); font-size: 13px; margin-bottom: 24px; }
.flow-diagram { display: flex; flex-direction: column; gap: 0; }
.flow-row { display: flex; align-items: center; gap: 16px; }
.flow-actor { width: 100px; text-align: center; font-size: 11px; color: var(--neutral-30); flex-shrink: 0; padding: 8px; border-radius: var(--radius-lg); }
.flow-actor.installer { background: rgba(238,142,37,0.08); }
.flow-actor.cloud { background: rgba(14,165,233,0.08); }
.flow-actor.powerdash { background: rgba(167,139,250,0.08); }
.flow-action { flex: 1; background: var(--bg-card); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; align-items: flex-start; gap: 12px; }
.flow-step-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.flow-step-num.s1 { background: var(--brand-primary); color: #fff; }
.flow-step-num.s2 { background: var(--brand-primary); color: #fff; }
.flow-step-num.s3 { background: #0EA5E9; color: #fff; }
.flow-step-num.s4 { background: #0EA5E9; color: #fff; }
.flow-step-num.s5 { background: #A78BFA; color: #fff; }
.action-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.action-desc { font-size: 11px; color: var(--neutral-40); line-height: 1.6; }
.flow-arrow-down { width: 100px; display: flex; justify-content: center; padding: 4px 0; }
.flow-arrow-down::after { content: '↓'; color: var(--neutral-60); font-size: 14px; }
.flow-legend { display: flex; gap: 16px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.flow-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--neutral-40); }
.flow-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.flow-key-points { margin-top: 20px; padding: 16px; background: var(--bg-card); border-radius: var(--radius-lg); }
.flow-key-points h4 { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.flow-key-points p { font-size: 11px; color: var(--neutral-30); line-height: 1.8; }

/* FleetView */
.fv-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.fv-header h2 { font-size: 18px; font-weight: 600; }
.fv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; }
.stat-card .stat-label { font-size: 11px; color: var(--neutral-40); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; }
.stat-card .stat-sub { font-size: 11px; color: var(--neutral-50); margin-top: 2px; }

.fv-table { width: 100%; background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; }
.fv-table th, .fv-table td { padding: 12px 16px; text-align: left; font-size: 12px; border-bottom: 1px solid var(--neutral-90); }
.fv-table th { background: var(--neutral-90); color: var(--neutral-40); font-weight: 500; font-size: 11px; letter-spacing: 0.5px; }
.fv-table td { color: var(--neutral-30); }
.fv-table tr:last-child td { border-bottom: none; }
.fv-table tr:hover td { background: rgba(238,142,37,0.03); }

/* Toggle */
.toggle { position: relative; width: 36px; height: 20px; background: var(--neutral-60); border-radius: 10px; cursor: pointer; transition: background 0.2s; }
.toggle.active { background: var(--success); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle.active::after { transform: translateX(16px); }
.toggle.disabled { background: var(--neutral-80); opacity: 0.4; cursor: not-allowed; }
.toggle.disabled:hover .toggle-tooltip { opacity: 1; visibility: visible; }
.toggle-tooltip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--neutral-80); color: var(--neutral-0); font-size: 11px; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s; pointer-events: none; z-index: 10; }

/* Status badge */
.status-badge { padding: 2px 8px; border-radius: var(--radius-3xl); font-size: 11px; font-weight: 500; }
.status-badge.active { background: rgba(67,195,99,0.15); color: var(--success); }
.status-badge.stopped { background: rgba(235,101,94,0.15); color: var(--error); }
.status-badge.not-enabled { background: rgba(131,134,136,0.15); color: var(--neutral-50); }

/* Detail modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; animation: fadeIn 0.2s; }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; width: 480px; max-height: 80vh; overflow-y: auto; }
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 { font-size: 12px; color: var(--neutral-40); font-weight: 500; margin-bottom: 8px; letter-spacing: 0.5px; }
.modal-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; }
.modal-row .label { color: var(--neutral-50); }
.modal-row .value { color: var(--neutral-0); font-weight: 500; }
.modal-close { background: none; border: 1px solid var(--neutral-60); color: var(--neutral-30); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; margin-top: 12px; }
.modal-close:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-card); border: 1px solid var(--neutral-80); color: var(--neutral-0); padding: 10px 20px; border-radius: var(--radius-lg); font-size: 13px; opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* CSV section */
.csv-section { margin-top: 24px; padding: 16px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px dashed var(--neutral-60); }
.csv-section h4 { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.csv-section p { font-size: 11px; color: var(--neutral-40); line-height: 1.6; }
.csv-section code { background: var(--neutral-90); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 10px; }
