:root {
  --bg: #0d0f14;
  --bg2: #13161e;
  --bg3: #1a1e29;
  --border: #252836;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --text: #e2e8f0;
  --muted: #64748b;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ── Layout ── */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.topbar-brand .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.3);
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section { margin-bottom: 4px; }

.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(99,102,241,0.08);
  border-left-color: var(--accent);
}

.nav-item .icon { width: 16px; text-align: center; opacity: 0.7; }

/* ── Main ── */
.main {
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
}

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

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.page-sub {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.card-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-change {
  font-size: 0.75rem;
  margin-top: 4px;
}

.metric-change.up { color: var(--green); }
.metric-change.down { color: var(--red); }

/* ── Grid layouts ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.three-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Terminal ── */
.terminal {
  background: #0a0c10;
  border: 1px solid #252836;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.terminal-titlebar {
  background: #181b23;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #252836;
}

.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  font-size: 0.72rem;
  color: #6b7280;
  letter-spacing: 0.03em;
}

.terminal-body {
  padding: 16px 18px;
  font-size: 0.82rem;
  line-height: 1.8;
}

.term-line { display: flex; gap: 8px; }
.term-prompt { color: var(--accent); }
.term-cmd    { color: #e2e8f0; }
.term-arrow  { color: #6b7280; }
.term-time   { color: #374151; min-width: 42px; }
.term-info   { color: #6b7280; }
.term-success { color: var(--green); }
.term-meta    { color: #374151; font-style: italic; }
.term-cursor  {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--accent);
  animation: blink 1.1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Asset list ── */
.asset-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  transition: all 0.15s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.asset-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.asset-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(37,40,54,0.5);
  vertical-align: middle;
}

.asset-table tr:hover td { background: rgba(99,102,241,0.04); }

.file-icon { font-size: 1em; margin-right: 6px; }

.type-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-html       { background: rgba(239,68,68,0.15);  color: #f87171; }
.type-css        { background: rgba(59,130,246,0.15); color: #60a5fa; }
.type-javascript { background: rgba(245,158,11,0.15); color: #fbbf24; }
.type-json       { background: rgba(16,185,129,0.15); color: #34d399; }
.type-image      { background: rgba(139,92,246,0.15); color: #a78bfa; }
.type-text       { background: rgba(100,116,139,0.15);color: #94a3b8; }
.type-file       { background: rgba(100,116,139,0.1); color: #64748b; }

.file-size { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Chart canvas ── */
.chart-wrap { position: relative; height: 200px; }

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(37,40,54,0.5);
}

.data-table tr:hover td { background: rgba(99,102,241,0.05); }

.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.active  { background: var(--green); }
.status-dot.trial   { background: var(--yellow); }
.status-dot.churned { background: var(--red); }

.plan-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.plan-Enterprise { background: rgba(99,102,241,0.15); color: var(--accent); }
.plan-Pro        { background: rgba(16,185,129,0.15); color: var(--green); }
.plan-Starter    { background: rgba(100,116,139,0.12);color: var(--muted); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
