@import url("https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-sans/style.css");
@import url("https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/fonts/geist-mono/style.css");

:root {
  --bg-primary: #09090b;
  --bg-surface: #18181b;
  --bg-hover: #27272a;
  --border: #27272a;
  --border-subtle: #1c1c1f;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.15);
  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.15);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font:
    "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "Consolas", monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

.sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #000;
  font-weight: 700;
  font-family: var(--mono);
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}
.nav-section {
  margin-bottom: 24px;
}
.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}
.sidebar-footer .org-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.sidebar-footer .org-plan {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  max-width: 1200px;
}
.page-header {
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 13px;
}
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Metric cards ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.metric-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.metric-value.accent {
  color: var(--accent);
}
.metric-value.success {
  color: var(--success);
}
.metric-value.warning {
  color: var(--warning);
}
.metric-value.danger {
  color: var(--danger);
}
.metric-change {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-change.up {
  color: var(--danger);
}
.metric-change.down {
  color: var(--success);
}
.metric-change.neutral {
  color: var(--text-muted);
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: var(--bg-hover);
}
.data-table .tool-name {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 12px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge.active {
  background: var(--success-dim);
  color: var(--success);
}
.badge.warning {
  background: var(--warning-dim);
  color: var(--warning);
}
.badge.critical {
  background: var(--danger-dim);
  color: var(--danger);
}
.badge.info {
  background: var(--accent-dim);
  color: var(--accent);
}
.badge.sub {
  background: var(--success-dim);
  color: var(--success);
}
.badge.api {
  background: var(--accent-dim);
  color: var(--accent);
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: #67e8f9;
}
.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
}
.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ── Alert cards ── */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  border-left: 3px solid;
  margin-bottom: 12px;
}
.alert-card.active-alert {
  border-left-color: var(--danger);
  background: var(--danger-dim);
}
.alert-card.escalating {
  border-left-color: var(--danger);
  background: var(--danger-dim);
}
.alert-card.acknowledged {
  border-left-color: var(--success);
  background: var(--success-dim);
}
.alert-card.resolved {
  border-left-color: var(--border);
  background: var(--bg-surface);
}

.alert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.alert-dot.pulsing {
  background: var(--danger);
  animation: alert-pulse 2s ease-in-out infinite;
}
.alert-dot.pulsing-fast {
  background: var(--danger);
  animation: alert-pulse 1s ease-in-out infinite;
}
.alert-dot.static-green {
  background: var(--success);
}
.alert-dot.static-muted {
  background: var(--text-muted);
}

@keyframes alert-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.alert-body {
  flex: 1;
}
.alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.alert-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.alert-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.alert-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.alert-escalation {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Tool breakdown bars ── */
.tool-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.tool-bar .tool-label {
  width: 140px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-bar .tool-track {
  flex: 1;
  height: 24px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}
.tool-bar .tool-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.8);
  transition: width 0.8s ease;
}
.tool-bar .tool-amount {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
}

/* ── Chart ── */
.chart-container {
  position: relative;
  height: 280px;
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Activity feed ── */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-content {
  flex: 1;
}
.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.activity-text strong {
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
}
.activity-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ── Utility ── */
.mono {
  font-family: var(--mono);
}
.text-muted {
  color: var(--text-muted);
}
.text-secondary {
  color: var(--text-secondary);
}

/* ── Landing page ── */
.landing-body {
  background: var(--bg-primary);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.landing-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.landing-nav .nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.landing-nav .nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.landing-nav .nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.hero {
  text-align: center;
  padding: 100px 48px 80px;
  max-width: 900px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero .highlight {
  color: var(--accent);
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.hero-cta .btn {
  padding: 12px 28px;
  font-size: 15px;
}

.hero-terminal {
  max-width: 660px;
  margin: 60px auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-subtle);
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}
.terminal-body {
  padding: 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.line-prompt {
  color: var(--success);
}
.line-cmd {
  color: var(--text-primary);
}
.line-output {
  color: var(--text-muted);
}
.line-cost {
  color: var(--warning);
}
.line-tool {
  color: var(--accent);
}

/* Feature grid */
.features-section {
  padding: 80px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-label {
  text-align: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.section-desc {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 200ms;
}
.feature-card:hover {
  border-color: var(--border);
}
.feature-card .feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* How it works */
.how-section {
  padding: 80px 48px;
  max-width: 900px;
  margin: 0 auto;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 48px;
}
.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  font-family: var(--mono);
}
.step-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.step-content code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
}

/* CTA */
.cta-section {
  text-align: center;
  padding: 100px 48px;
  max-width: 700px;
  margin: 0 auto;
}
.cta-section h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.cta-section p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 48px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 40px;
  }
}
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .main-content {
    margin-left: 0;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    padding: 60px 24px 40px;
  }
  .hero h1 {
    font-size: 32px;
  }
}
