/* Base Design System (css/base.css) */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --primary-navy: #1e3a8a;
  --primary-blue: #2563eb;
  --accent-cyan: #0284c7;
  --accent-gold: #d97706;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --status-red: #ef4444;
  --status-green: #10b981;
  --status-purple: #8b5cf6;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
}

.app-container { max-width: 1380px; margin: 0 auto; padding: 24px 20px; }

/* Top Header */
.top-header {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff; padding: 24px 30px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); margin-bottom: 20px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo-badge {
  font-size: 38px; background: rgba(255, 255, 255, 0.15);
  padding: 10px; border-radius: 12px;
}
.main-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { font-size: 13px; color: #dbeafe; margin-top: 4px; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.status-pill {
  font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 20px;
  background: #ef4444; color: #fff;
}
.pulse-pill { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { transform: scale(1); }
  70% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.tag-pill { font-size: 11px; background: rgba(255, 255, 255, 0.2); padding: 4px 10px; border-radius: 12px; }

/* Metrics Ribbon */
.metrics-ribbon {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 16px 20px; box-shadow: var(--shadow-sm);
}
.metric-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.metric-value { font-size: 24px; font-weight: 800; margin: 6px 0 4px; }
.metric-sub { font-size: 11.5px; color: var(--text-muted); }

.text-red { color: var(--status-red); }
.text-blue { color: var(--primary-blue); }
.text-gold { color: var(--accent-gold); }
.text-purple { color: var(--status-purple); }
.text-green { color: var(--status-green); }

/* Navigation Tabs */
.nav-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  margin-bottom: 20px; border-bottom: 1px solid var(--border-light);
}
.tab-btn {
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text-dark); font-size: 14px; font-weight: 600; padding: 10px 18px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.tab-btn:hover { background: #f1f5f9; }
.tab-btn.active {
  background: var(--primary-navy); color: #fff; border-color: var(--primary-navy);
}

/* Panels & Cards */
.content-area { min-height: 520px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #f1f5f9; padding-bottom: 14px; margin-bottom: 18px;
}
.card-header h2 { font-size: 18px; font-weight: 700; color: var(--primary-navy); }
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: #dbeafe; color: #1e40af; }
.bg-gold { background: #fef3c7; color: #92400e; }
.bg-red { background: #fee2e2; color: #991b1b; }
.bg-blue { background: #e0e7ff; color: #3730a3; }
.bg-amber { background: #fef3c7; color: #78350f; }

.app-footer {
  margin-top: 40px; text-align: center; font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border-light); padding-top: 20px;
}
@media (max-width: 900px) {
  .top-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .header-right { align-items: flex-start; }
}
