:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --accent: #0ea5e9;
  --accent-2: #7c3aed;
  --text: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
  --good: #16a34a;
  --bad: #dc2626;
  --warning: #f59e0b;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.08), transparent 25%),
    radial-gradient(circle at 85% 10%, rgba(124, 58, 237, 0.08), transparent 25%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  padding: 0 16px 48px;
}

header {
  max-width: 1200px;
  margin: 32px auto;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.year-selector {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.year-selector label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.year-selector select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.title h1 {
  margin: 8px 0 4px;
  font-size: 32px;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 12px;
  margin: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.card .label {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px;
}

.card .value {
  font-size: 24px;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.card .desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card.priority-card {
  border-left: 4px solid var(--bad);
}

.card.success-card {
  border-left: 4px solid var(--good);
}

.card[data-info] {
  cursor: pointer;
}

.priority-panel {
  border: 2px solid var(--accent);
}



.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.panel.priority-panel {
  border: 2px solid var(--accent);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

tr:hover td {
  background: #f8fafc;
}

.uni-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.good { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.badge.bad { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.badge.warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.badge.neutral { background: rgba(71, 85, 105, 0.12); color: #475569; }

.chart-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.report {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  border: 1px solid #e2e8f0;
}

.report h1, .report h2, .report h3 {
  margin-top: 12px;
}

.report ul {
  padding-left: 20px;
}

.report-content h1,
.report-content h2,
.report-content h3 {
  margin: 12px 0 6px;
}

.report-content p {
  margin: 8px 0;
}

.report-content ul,
.report-content ol {
  padding-left: 20px;
  margin: 8px 0;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.control-group label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.control-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.input-row button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.input-row button:hover {
  background: #0284c7;
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}

.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* GAP Progress Bars */
.gap-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gap-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-metric {
  font-weight: 600;
  font-size: 14px;
}

.gap-values {
  font-size: 13px;
  color: var(--muted);
}

.gap-bar-container {
  height: 24px;
  background: #e2e8f0;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.gap-bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
}

.gap-bar-fill.good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.gap-bar-fill.warning { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.gap-bar-fill.bad { background: linear-gradient(90deg, #f87171, #dc2626); }

.gap-bar-target {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px;
  background: #0f172a;
  z-index: 1;
}

.gap-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.gap-status.ok { background: rgba(22, 163, 74, 0.15); color: #15803d; }
.gap-status.warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.gap-status.critical { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }

/* Peer Tabs */
.peer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.peer-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.peer-tab:hover {
  background: #e2e8f0;
}

.peer-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}


/* Action Plan Table */
#table-actions tr td:first-child {
  font-weight: 700;
  text-align: center;
}

#table-actions .difficulty-high { color: var(--bad); }
#table-actions .difficulty-medium { color: var(--warning); }
#table-actions .difficulty-low { color: var(--good); }

/* Highlight row */
tr.highlight td {
  background: rgba(14, 165, 233, 0.08);
}

tr.omu-row td {
  background: rgba(14, 165, 233, 0.12);
  font-weight: 600;
}

@media (max-width: 720px) {
  body {
    padding: 0 12px 36px;
  }
  .grid.wide {
    grid-template-columns: 1fr;
  }
  .header-content {
    flex-direction: column;
  }
}

/* Band Change Styles moved to components/movement-analysis.css */

/* Monte Carlo Simulation Styles */
#monte-carlo-section {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.03), rgba(124, 58, 237, 0.03));
}

.mc-band-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-band-selector label {
  font-size: 13px;
  color: var(--muted);
}

.mc-band-selector select {
  padding: 8px 24px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.mc-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.mc-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.mc-card.priority {
  border-color: var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
}

.mc-card.success {
  border-color: var(--good);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(22, 163, 74, 0.02));
}

.mc-card-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

.mc-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.mc-card.priority .mc-card-value {
  color: var(--warning);
}

.mc-card.success .mc-card-value {
  color: var(--good);
}

.mc-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.mc-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.mc-chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.mc-chart-panel h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 16px;
}

.mc-scenario-comparison {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.mc-scenario-comparison h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
}

.mc-scenario-comparison .note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}

#table-mc-scenario {
  width: 100%;
}

#table-mc-scenario th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

#table-mc-scenario td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

#table-mc-scenario td.desc-cell {
  font-size: 12px;
  color: var(--muted);
  max-width: 300px;
}

#table-mc-scenario tr.baz-row {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.05));
}

.mc-chart-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.mc-chart-container h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 16px;
}

.mc-historical {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.mc-historical h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
}

.mc-historical .note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}

#table-mc-historical {
  width: 100%;
}

#table-mc-historical th,
#table-mc-historical td {
  padding: 10px 12px;
  text-align: center;
}

#table-mc-historical th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

#table-mc-historical td:first-child {
  text-align: left;
}

#table-mc-historical td {
  border-bottom: 1px solid var(--border);
}

.mc-sensitivity-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.mc-sensitivity-section h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
}

.mc-sensitivity-section .note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}

.mc-sensitivity-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.mc-chart-small {
  min-height: 200px;
}

#table-mc-sensitivity {
  width: 100%;
}

#table-mc-sensitivity th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

#table-mc-sensitivity td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
  .mc-sensitivity-grid {
    grid-template-columns: 1fr;
  }
  
  .mc-charts-grid {
    grid-template-columns: 1fr;
  }
}
