/* Focal ME Weekly Dashboard styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --focal-blue: #1D4EC6;
  --focal-navy: #011541;
  --rag-green: #16A34A;
  --rag-amber: #F59E0B;
  --rag-red: #DC2626;
  --canvas-bg: #F2F4F7;
  --page-bg: #DCDFE5;
  --card-border: #E5E7EB;
  --table-row-alt: #F9FAFB;
  --muted: #6B7280;
  --text: #1F2937;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-canvas: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-toolbar: 0 1px 3px rgba(0,0,0,0.06);
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  background: var(--page-bg);
  color: var(--text);
}

.page {
  min-height: 100vh;
}

/* ============================== TOOLBAR ============================== */

.toolbar {
  background: white;
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-toolbar);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toolbar-logo {
  height: 36px;
  width: auto;
}

.toolbar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: 0.01em;
}

.toolbar-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 1px;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar-select {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--focal-navy);
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.toolbar-meta {
  font-size: 11px;
  color: var(--muted);
  font-feature-settings: 'tnum' 1;
}

/* ============================== CANVAS ============================== */

.canvas {
  max-width: 1920px;
  margin: 24px auto;
  background: var(--canvas-bg);
  border: 1px solid #D1D5DB;
  box-shadow: var(--shadow-canvas);
  padding: 20px;
}

.card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.dashboard-section {
  margin-bottom: 14px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--focal-blue);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: 0.01em;
}

.section-meta {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  padding-right: 4px;
}

.section-grid {
  display: grid;
  gap: 14px;
}

.section-01-grid { grid-template-columns: 30% 1fr; }
.section-02-grid { grid-template-columns: 1fr 1fr; }
.section-bottom-grid { grid-template-columns: 1fr 1fr 1fr; }

/* ============================== HEADER BAND ============================== */

.header-band {
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-logo {
  height: 56px;
  width: auto;
  display: block;
}

.header-divider {
  width: 1px;
  height: 56px;
  background: var(--card-border);
}

.header-project-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.header-subtitle {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.header-meta-grid {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 28px;
  flex: 1;
  justify-content: center;
  padding-left: 32px;
}

.header-meta-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-meta-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--focal-navy);
  margin-top: 2px;
}

.num { font-feature-settings: 'tnum' 1; }

/* ============================== OVERALL RAG ============================== */

.overall-rag-card {
  border-radius: 4px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 150px;
  color: white;
}

.overall-rag-card.amber { background: linear-gradient(135deg, var(--rag-amber) 0%, #B45309 100%); }
.overall-rag-card.green { background: linear-gradient(135deg, var(--rag-green) 0%, #065F46 100%); }
.overall-rag-card.red { background: linear-gradient(135deg, var(--rag-red) 0%, #7F1D1D 100%); }

.overall-rag-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  opacity: 0.9;
}

.overall-rag-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.overall-rag-week {
  font-size: 10px;
  opacity: 0.9;
  margin-top: 2px;
}

/* ============================== KPI ============================== */

.kpi-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--focal-navy);
  font-feature-settings: 'tnum' 1;
  line-height: 1.1;
  margin-top: 4px;
}

.kpi-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================== RAG ============================== */

.rag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rag-dot-large { width: 14px; height: 14px; }

.rag-green { background: var(--rag-green); }
.rag-amber { background: var(--rag-amber); }
.rag-red { background: var(--rag-red); }

.rag-headline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.rag-headline-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: 0.02em;
}

.commentary-block {
  font-size: 11px;
  color: var(--text);
  line-height: 1.55;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #F3F4F6;
}

.rag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rag-pill.green { background: #ECFDF5; color: #065F46; }
.rag-pill.amber { background: #FFFBEB; color: #92400E; }
.rag-pill.red { background: #FEF2F2; color: #991B1B; }

/* ============================== MILESTONE BAR ============================== */

.milestone-card {
  display: flex;
  flex-direction: column;
}

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

.milestone-range {
  font-size: 10px;
  color: var(--muted);
}

.milestone-track {
  position: relative;
  margin-top: 16px;
  padding: 0 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.milestone-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  background: #E5E7EB;
  transform: translateY(-1px);
}

.milestone-line-progress {
  position: absolute;
  left: 8px;
  top: 50%;
  height: 2px;
  background: var(--focal-blue);
  transform: translateY(-1px);
}

.milestone-row {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
  text-align: center;
}

.milestone-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--focal-navy);
  margin-bottom: 8px;
  line-height: 1.25;
  height: 28px;
}

.milestone-node {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 1.5px #D1D5DB;
  z-index: 2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.milestone-node.complete {
  background: var(--rag-green);
  box-shadow: 0 0 0 1.5px var(--rag-green);
}

.milestone-node.complete::after {
  content: "";
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.milestone-node.in-flight {
  background: var(--rag-amber);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.20);
}

.milestone-node.upcoming {
  background: white;
  box-shadow: 0 0 0 1.5px #D1D5DB;
}

.milestone-date {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  font-feature-settings: 'tnum' 1;
  font-weight: 500;
}

.milestone-status {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.ms-status-complete { color: var(--rag-green); }
.ms-status-in-flight { color: var(--rag-amber); }
.ms-status-upcoming { color: var(--muted); }

/* ============================== COST AND COMMERCIAL CARDS ============================== */

.cc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cc-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: 0.02em;
}

.cc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

.cc-commentary {
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
  font-size: 11px;
  color: var(--text);
  line-height: 1.45;
}

.cc-commentary-label {
  display: block;
  margin-bottom: 4px;
}

/* ============================== DISCIPLINE GRID ============================== */

.discipline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.discipline-card {
  background: white;
  border: 1px solid var(--card-border);
  border-left: 3px solid;
  border-radius: 3px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.discipline-card.green { border-left-color: var(--rag-green); }
.discipline-card.amber { border-left-color: var(--rag-amber); }
.discipline-card.red { border-left-color: var(--rag-red); }

.discipline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F3F4F6;
}

.discipline-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--focal-navy);
  letter-spacing: 0.02em;
}

.discipline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discipline-bullets li {
  font-size: 10.5px;
  color: var(--text);
  line-height: 1.4;
  padding-left: 10px;
  position: relative;
}

.discipline-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--focal-blue);
}

/* ============================== TABLES ============================== */

.table-card {
  padding: 0;
  overflow: hidden;
}

.pbi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pbi-table thead th {
  background: var(--focal-navy);
  color: white;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  text-align: left;
}

.pbi-table thead th:first-child { padding-left: 14px; }

.pbi-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #F3F4F6;
  color: var(--text);
  vertical-align: middle;
  font-size: 11px;
  line-height: 1.4;
}

.pbi-table tbody td:first-child { padding-left: 14px; }
.pbi-table tbody tr:nth-child(even) { background: var(--table-row-alt); }
.pbi-table tbody tr:last-child td { border-bottom: none; }

.rank-cell {
  font-weight: 600;
  color: var(--focal-navy);
  font-feature-settings: 'tnum' 1;
}

.variance-amber { color: var(--rag-amber); }
.variance-red { color: var(--rag-red); }
.variance-green { color: var(--rag-green); }

/* ============================== FOOTER ============================== */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 4px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* ============================== RESPONSIVE FALLBACK ============================== */

@media (max-width: 1700px) {
  .canvas { max-width: 100%; padding: 16px; }
}

@media (max-width: 1200px) {
  .section-bottom-grid { grid-template-columns: 1fr; gap: 14px; }
  .discipline-grid { grid-template-columns: repeat(2, 1fr); }
  .header-meta-grid { grid-template-columns: repeat(3, auto); gap: 16px; }
  .section-01-grid { grid-template-columns: 1fr; }
  .section-02-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .toolbar { flex-direction: column; gap: 12px; padding: 12px 16px; }
  .header-band { flex-direction: column; align-items: flex-start; gap: 14px; }
  .header-meta-grid { grid-template-columns: repeat(2, 1fr); padding-left: 0; }
  .discipline-grid { grid-template-columns: 1fr; }
  .cc-kpi-grid { grid-template-columns: 1fr; }
  .milestone-row { flex-wrap: wrap; gap: 14px; justify-content: flex-start; }
  .milestone-line, .milestone-line-progress { display: none; }
}
