/* Mission Control - Enterprise Security Dashboard */
/* Firm D (Spatial Studios) - v20.0.0 */
/* Clean, flat, data-dense - Inspired by BurpSuite/Claude Security */

:root {
  /* Colors */
  --bg-main: #0a0a0a;
  --bg-panel: #141414;
  --bg-elevated: #1a1a1a;
  --bg-hover: #222222;
  
  --border-main: #2a2a2a;
  --border-light: #333333;
  --border-highlight: #444444;
  
  --text-primary: #e5e5e5;
  --text-secondary: #999999;
  --text-tertiary: #666666;
  
  --accent: #00b8ff;
  --accent-dim: #0088cc;
  
  --success: #00ff66;
  --warning: #ffaa00;
  --danger: #ff3333;
  
  /* Typography */
  --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ====== TOP BAR ====== */
.top-bar {
  height: 52px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-main);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.status-pill.operational {
  border-color: var(--success);
  color: var(--success);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-tab.active {
  color: var(--accent);
  background: var(--bg-elevated);
  border-color: var(--accent-dim);
}

/* Top Bar Right */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--success);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 70px;
}

.refresh-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-main);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.refresh-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.refresh-btn svg {
  fill: var(--text-secondary);
}

.refresh-btn:hover svg {
  fill: var(--text-primary);
}

/* ====== MAIN CONTENT ====== */
.main-content {
  padding: 20px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ====== KPI BAR ====== */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: 4px;
  padding: 14px 16px;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-value.success {
  color: var(--success);
}

.kpi-value.warning {
  color: var(--warning);
}

.kpi-value.danger {
  color: var(--danger);
}

/* ====== GRID LAYOUTS ====== */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ====== PANELS ====== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: 4px;
  overflow: hidden;
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

.panel-body {
  padding: 16px;
}

/* ====== TABLES ====== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table thead {
  background: var(--bg-elevated);
}

.table th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-main);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-main);
  color: var(--text-primary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--bg-elevated);
}

/* Status Badges in Tables */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  border-radius: 2px;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(0, 255, 102, 0.15);
  color: var(--success);
}

.badge.warning {
  background: rgba(255, 170, 0, 0.15);
  color: var(--warning);
}

.badge.danger {
  background: rgba(255, 51, 51, 0.15);
  color: var(--danger);
}

.badge.neutral {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* ====== SERVICE GRID ====== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.service-item {
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-main);
  border-radius: 3px;
  text-align: center;
}

.service-name {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.service-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.service-status.up {
  color: var(--success);
}

.service-status.down {
  color: var(--danger);
}

/* ====== ACTIVITY LIST ====== */
.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-text {
  font-size: 12px;
  color: var(--text-primary);
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ====== GEO GRID ====== */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.geo-node {
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-main);
  border-radius: 3px;
}

.geo-location {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.geo-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--success);
}

/* ====== STATS GRID ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: 4px;
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.success {
  color: var(--success);
}

.stat-value.warning {
  color: var(--warning);
}

.stat-value.danger {
  color: var(--danger);
}

/* ====== TIMELINE ====== */
.timeline {
  max-height: 400px;
  overflow-y: auto;
}

.timeline-item {
  padding: 12px 0;
  border-left: 2px solid var(--border-main);
  padding-left: 16px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.timeline-text {
  font-size: 12px;
  color: var(--text-primary);
}

/* ====== COST BARS ====== */
.cost-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cost-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cost-label {
  width: 80px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cost-bar {
  flex: 1;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-main);
  border-radius: 3px;
  overflow: hidden;
}

.cost-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.cost-value {
  width: 80px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

/* ====== CHARTS ====== */
canvas {
  max-width: 100%;
  height: auto !important;
}

/* ====== FOOTER ====== */
.footer {
  height: 40px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin-top: 20px;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.footer-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

.footer-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-updated {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ====== UTILITIES ====== */
.mt {
  margin-top: 20px;
}

/* ====== SCROLLBARS ====== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-highlight);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1400px) {
  .kpi-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .kpi-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-bar,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .geo-grid {
    grid-template-columns: 1fr;
  }
}
