:root {
  --bg: #0f1220;
  --card: #151a2e;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent2: #22d3ee;
  --border: rgba(148, 163, 184, 0.2);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
}

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(circle at top left, #1f2440, #0b0d18 65%);
  color: var(--text);
  min-height: 100vh;
  padding: 40px 24px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header { margin-bottom: 32px; }

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 16px;
}

.back:hover { color: var(--accent2); }

h1 { font-size: 2rem; margin-bottom: 8px; }

.subtitle { color: var(--muted); font-size: 1rem; }

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.alert-icon { font-size: 1.5rem; }

.alert-title {
  font-weight: 600;
  color: var(--red);
}

.alert-message {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.stat-value.healthy { color: var(--green); }
.stat-value.at-risk { color: var(--yellow); }
.stat-value.stalled { color: var(--red); }

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tab:hover { background: rgba(124, 58, 237, 0.1); color: var(--text); }
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: rgba(21, 26, 46, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}

/* Chart Container */
.chart-container {
  width: 100%;
  overflow-x: auto;
}

canvas { max-width: 100%; }

/* Forecast Details */
.forecast-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.forecast-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.forecast-icon { font-size: 1.5rem; margin-bottom: 8px; }

.forecast-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent2);
}

.forecast-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Ship List */
.ship-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ship-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ship-card:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.ship-info h4 {
  margin-bottom: 4px;
}

.ship-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.healthy { background: var(--green); }
.progress-fill.at-risk { background: var(--yellow); }
.progress-fill.stalled { background: var(--red); }

.ship-metrics {
  display: flex;
  gap: 24px;
}

.metric { text-align: center; }

.metric-value {
  font-weight: 600;
  display: block;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.trend {
  font-size: 1.2rem;
  font-weight: bold;
}

.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--yellow); }

.ship-status { text-align: right; }

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.healthy { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.status-badge.at-risk { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.status-badge.stalled { background: rgba(239, 68, 68, 0.2); color: var(--red); }

.eta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Ship Selector */
.ship-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ship-selector button {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ship-selector button:hover { background: rgba(124, 58, 237, 0.1); color: var(--text); }
.ship-selector button.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Burndown Chart */
.burndown-chart {
  width: 100%;
  overflow-x: auto;
}

/* Two Column */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.status-item { text-align: center; }

.status-icon { font-size: 1.5rem; margin-bottom: 8px; }

.status-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent2);
}

.status-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.comparison-table td { font-size: 0.95rem; }

.comparison-table .mini-progress {
  width: 80px;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.comparison-table .mini-progress-fill {
  height: 100%;
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .forecast-details { grid-template-columns: 1fr; }
  .ship-card { grid-template-columns: 1fr; }
  .ship-metrics { justify-content: flex-start; }
  .ship-status { text-align: left; margin-top: 8px; }
}

@media (max-width: 600px) {
  .tabs { flex-wrap: wrap; }
  .tab { flex: 1; min-width: 100px; text-align: center; }
}
