:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #F3F4F6;
  background: #111827;
  --bg: #111827;
  --bg-2: #1F2937;
  --panel: #1F2937;
  --panel-2: #374151;
  --panel-3: #4B5563;
  --border: rgba(156, 163, 175, 0.2);
  --text: #F3F4F6;
  --muted: #9CA3AF;
  --accent: #3B82F6;
  --accent-2: #60A5FA;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --shadow: rgba(17, 24, 39, 0.6);
  --shadow-soft: rgba(17, 24, 39, 0.35);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 800px at -10% -10%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(900px 600px at 110% 0%, rgba(156, 163, 175, 0.16), transparent 65%),
    var(--bg);
  color: var(--text);
}
.layout {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
}
.sidebar {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(17, 24, 39, 0.88));
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px var(--shadow);
  padding: 22px 18px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(31, 41, 55, 0.9));
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}
.brand-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.brand-subtitle {
  color: var(--muted);
  font-size: 0.8rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.nav-item:hover {
  background: rgba(31, 41, 55, 0.85);
  color: #ffffff;
}
.nav-item.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.page {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(17, 24, 39, 0.96));
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 18px 40px var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 500px;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: #9aa0a6;
}
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
button:focus-visible {
  outline: 2px solid #9ca3af;
  outline-offset: 2px;
}
button:hover {
  transform: translateY(-2px);
}
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px var(--shadow);
}
.ghost {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
.status {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(17, 24, 39, 0.85));
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 15px 30px var(--shadow-soft);
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
}
.status-name {
  color: var(--text);
  font-weight: 600;
}
.status-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.cards-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.card-compact {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(17, 24, 39, 0.82));
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-compact .card-header h3 {
  font-size: 1rem;
  margin: 0;
}
.card-compact .card-subtitle {
  font-size: 0.8rem;
  margin: 2px 0 0;
}
.card-compact .gauge {
  font-size: 0.9rem;
}
.card-compact .gauge-meter {
  height: 8px;
}
.card-compact .card-meta {
  font-size: 0.75rem;
  gap: 8px;
}
.card-compact .card-actions {
  display: none;
}
.card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(17, 24, 39, 0.82));
  border-radius: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card h3 {
  margin: 0;
  font-size: 1.25rem;
}
.card-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.gauge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  color: var(--text);
}
.gauge span {
  font-weight: 600;
}
.gauge-meter {
  height: 12px;
  flex: 1;
  margin-left: 12px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  position: relative;
}
.gauge-meter::after {
  content: '';
  height: 100%;
  width: var(--percent, 50%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  display: block;
}
.gauge.is-empty span {
  color: var(--muted);
  font-weight: 500;
}
.gauge.is-empty .gauge-meter::after {
  width: 0;
  background: var(--panel-3);
}
.card-actions {
  display: flex;
  gap: 8px;
}
.card-actions button {
  flex: 1;
  min-height: 46px;
}
.card-actions .up {
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
}
.card-actions .down {
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}
.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.order-item {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.order-item strong {
  display: block;
  font-size: 0.95rem;
}
.log-panel {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(17, 24, 39, 0.85));
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow-soft);
  padding: 26px;
}
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.log-header h2 {
  margin: 0;
  font-size: 1.3rem;
}
.log-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.ai-panel {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(17, 24, 39, 0.86));
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
  padding: 26px;
}
.ai-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr;
  gap: 24px;
  min-height: 400px;
}
.chart-box {
  background: rgba(17, 24, 39, 0.75);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px var(--shadow-soft);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.chart-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.filter-select {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--shadow-soft);
}
.filter-select:hover {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 8px var(--shadow-soft);
}
.filter-select:focus {
  outline: none;
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.chart-box canvas {
  flex: 1;
  min-height: 320px;
}
.activity-box {
  background: rgba(17, 24, 39, 0.75);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  max-height: 500px;
  overflow: hidden;
  min-width: 340px;
}
.activity-header {
  margin-bottom: 16px;
}
.activity-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}
.activity-item {
  background: rgba(17, 24, 39, 0.75);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
  font-size: 0.98rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.activity-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-soft);
}
.activity-agent {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.agent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}
.activity-content {
  margin-left: 32px;
}
.activity-message {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
  font-size: 0.98rem;
}
.activity-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(31, 41, 55, 0.8);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.activity-toggle:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(31, 41, 55, 0.95);
  color: #ffffff;
}
.activity-list {
  scrollbar-color: #6B7280 transparent;
  scrollbar-width: thin;
}
.activity-list::-webkit-scrollbar {
  width: 8px;
}
.activity-list::-webkit-scrollbar-track {
  background: transparent;
}
.activity-list::-webkit-scrollbar-thumb {
  background: #6B7280;
  border-radius: 8px;
}
.activity-list::-webkit-scrollbar-thumb:hover {
  background: #4B5563;
}
.activity-detail {
  color: #f0f0f0;
  font-weight: 600;
  margin-bottom: 4px;
}
.activity-meta {
  display: flex;
  gap: 12px;
  color: #a6a6a6;
  font-size: 0.85rem;
}
.activity-meta span {
  display: inline-block;
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
}
@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .card-actions {
    flex-direction: column;
  }
  .log-list {
    grid-template-columns: 1fr;
  }
  .ai-grid {
    grid-template-columns: 1fr;
  }
}
