/* ==================================================
   RESET / GLOBALS
================================================== */

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

/* ==================================================
   DESIGN TOKENS
================================================== */

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #dbe4f0;
  --text: #0f172a;
  --muted: #64748b;

  --blue: #2563eb;
  --green: #15803d;
  --orange: #c2410c;
  --red: #b91c1c;

  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ==================================================
   BASE LAYOUT
================================================== */

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 28px;
}

/* ==================================================
   TOPBAR
================================================== */

.topbar {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: white;

  border-radius: 22px;

  padding: 30px 34px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 28px;

  box-shadow: var(--shadow);
}

.eyebrow {
  color: #bfdbfe;

  font-size: 13px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 1px;

  margin-bottom: 8px;
}

.topbar h1 {
  font-size: 36px;
  margin-bottom: 8px;
  font-weight: 800;
}

.topbar p {
  color: #dbeafe;

  font-size: 15px;
  line-height: 1.6;
}

.topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 10px;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;

  gap: 10px;

  min-width: 280px;
}

.customer-name {
  color: white;

  font-size: 15px;
  font-weight: 800;
}

.logged-in-user {
  font-size: 12px;
  font-weight: 700;

  color: #dbeafe;
}

.logged-in-user span {
  color: white;
  font-weight: 800;
}

.logged-in-user {
  margin-bottom: 10px;

  font-size: 12px;
  font-weight: 700;

  color: #dbeafe;
}

.logged-in-user span {
  color: white;
  font-weight: 800;
}

.updated {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.health-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  background: rgba(255, 255, 255, 0.12);

  padding: 14px 18px;

  border-radius: 14px;

  font-weight: 800;
  font-size: 15px;
}

.health-dot {
  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: #22c55e;
}

/* ==================================================
   TENANT EXPERIENCE
================================================== */

.tenant-experience {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.customer-selector-label {
  font-size: 11px;
  font-weight: 700;
  color: #dbeafe;
}

.customer-selector {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: white;
  font-weight: 700;
}

.customer-selector option {
  color: black;
}

.tenant-logo {
  max-height: 42px;
  max-width: 180px;
  object-fit: contain;
}




/* ==================================================
   GLOBAL ACTIONS
================================================== */

.alignment-toggle {
  margin-bottom: 12px;

  padding: 10px 14px;

  border: none;
  border-radius: 8px;

  background: var(--blue);
  color: white;

  font-weight: 700;

  cursor: pointer;
}

/* ==================================================
   CARD GRID
================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  gap: 24px;

  margin-bottom: 34px;
}

/* ==================================================
   EXECUTION CARD
================================================== */

.exec-card {
  background: var(--card);

  border-radius: 22px;
  border: 1px solid var(--border);

  padding: 24px;

  box-shadow: var(--shadow);

  transition: all 0.2s ease;

  position: relative;
  overflow: hidden;
}

.exec-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.exec-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  height: 5px;
  width: 100%;

  background: var(--blue);
}

.exec-card.healthy-card::before {
  background: #22c55e;
}

.exec-card.warning-card::before {
  background: #f59e0b;
}

.exec-card.risk-card::before {
  background: #dc2626;
}

/* ==================================================
   CARD HEADER
================================================== */

.card-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;

  align-items: start;

  gap: 12px;

  margin-bottom: 18px;
}

.card-icon {
  display: none;
}

/* ==================================================
   CARD TITLE
================================================== */

.card-title-wrap {
  grid-column: 1;

  justify-self: start;
  text-align: left;
  align-self: start;

  padding-top: 2px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;

  margin-bottom: 4px;
}

.card-source {
  font-size: 11px;
  color: var(--muted);
}

/* ==================================================
   STATUS PILL
================================================== */

.status-pill {
  grid-column: 2;

  justify-self: center;
  align-self: start;

  padding: 7px 14px;

  border-radius: 999px;

  font-size: 12px;
  font-weight: 800;

  white-space: nowrap;
}

.healthy {
  background: #dcfce7;
  color: var(--green);
}

.warning {
  background: #ffedd5;
  color: var(--orange);
}

.risk {
  background: #fee2e2;
  color: var(--red);
}

/* ==================================================
   REFRESH / UPDATED
================================================== */

.card-refresh-row {
  grid-column: 3;

  justify-self: end;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;

  gap: 8px;
}

.card-updated {
  font-size: 10px;
  color: var(--muted);

  white-space: nowrap;
  text-align: right;
}

.refresh-button {
  border: none;

  background: #e2e8f0;
  color: var(--text);

  border-radius: 999px;

  padding: 4px 8px;

  font-size: 10px;
  line-height: 1;
  font-weight: 800;

  cursor: pointer;

  transition: all 0.2s ease;
}

.refresh-button:hover {
  background: var(--blue);
  color: white;
}

.refresh-button.loading {
  opacity: 0.7;
  cursor: wait;
}

/* ==================================================
   VITAL FEW METRICS
================================================== */

.vital-few-container {
  display: grid;

  gap: 12px;

  margin-bottom: 22px;
}

.vital-few-1 {
  grid-template-columns: 140px;
  justify-content: center;
}

.vital-few-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vital-few-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vital-few-tile {
  width: 100%;
  min-height: 108px;

  padding: 16px 12px;

  border: 2px solid var(--border);
  border-radius: 14px;

  background: #ffffff;
  color: var(--text);

  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  transition: all 0.2s ease;
}

.vital-few-1 .vital-few-tile {
  min-height: 92px;
  max-width: 140px;
}

.vital-few-tile:hover {
  background: #f4f7fb;
  border-color: #94a3b8;

  transform: translateY(-1px);
}

.vital-few-value {
  font-size: 42px;
  font-weight: 900;

  line-height: 1;
  letter-spacing: -0.5px;
}

.vital-few-label {
  margin-top: 10px;

  color: var(--muted);

  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.vital-few-tile.risk-healthy {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
}

.vital-few-tile.risk-warning {
  background: #ffedd5 !important;
  border-color: #f59e0b !important;
}

.vital-few-tile.risk-danger {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
}

.vital-few-tile.risk-danger .vital-few-label,
.vital-few-tile.risk-danger .vital-few-value {
  color: #b91c1c !important;
  font-weight: 900;
}

/* ==================================================
   LEGACY PRIMARY METRIC
================================================== */

.primary-metric {
  margin-bottom: 22px;
  text-align: center;
}

.metric-value {
  font-size: 50px;
  font-weight: 850;

  line-height: 1;

  margin-bottom: 10px;

  letter-spacing: -1px;
}

.metric-value-button {
  width: 72px;
  height: 72px;

  margin: 0 auto 10px;
  padding: 0;

  border: 2px solid var(--border);
  border-radius: 12px;

  background: #ffffff;
  color: var(--text);

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  line-height: 1;

  font: inherit;

  transition: all 0.2s ease;
}

.metric-value-button:hover {
  background: #f4f7fb;
  border-color: #94a3b8;

  transform: translateY(-1px);
}

.metric-value-button--question {
  font-size: 42px;
  font-weight: 900;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

/* ==================================================
   STATUS MESSAGE
================================================== */

.status-message {
  margin-top: 10px;

  font-size: 13px;
  font-weight: 800;

  color: var(--blue);
}

/* ==================================================
   SUPPORTING METRICS
================================================== */

.supporting-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 10px;

  margin-bottom: 20px;
}

.supporting-item {
  min-height: 76px;

  padding: 13px;

  background: #f8fafc;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  text-align: center;
  text-decoration: none;

  color: inherit;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  transition: all 0.2s ease;
}

.supporting-item:hover {
  background: #eff6ff;
  border-color: var(--blue);

  transform: translateY(-2px);
}

.supporting-item .label {
  font-size: 11px;
  line-height: 1.25;

  margin-bottom: 6px;
}

.supporting-item .value {
  font-size: 20px;
  line-height: 1;
}

.pending-load {
  font-size: 14px !important;
  line-height: 1.35;
  font-weight: 700;
  color: var(--muted);
}

/* ==================================================
   STATUS COUNTS
================================================== */

.status-counts {
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 700;
  white-space: pre-line;
}

/* ==================================================
   RISK STATES
================================================== */

.supporting-item.risk-healthy {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
}

.supporting-item.risk-warning {
  background: #ffedd5 !important;
  border-color: #f59e0b !important;
}

.supporting-item.risk-danger {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
}

.supporting-item.risk-danger .label,
.supporting-item.risk-danger .value {
  color: #b91c1c !important;
  font-weight: 900;
}

/* ==================================================
   ALIGNMENT SECTION
================================================== */

.operations-note {
  background: #f8fbff;

  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--blue);

  border-radius: 14px;

  padding: 15px;

  margin-bottom: 20px;
}

.operations-note h4 {
  color: var(--blue);

  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;

  margin-bottom: 9px;
}

.operations-note p,
.operations-list li {
  color: #1e293b;

  font-size: 13px;
  line-height: 1.5;
}

.operations-list {
  margin-top: 6px;
  padding-left: 18px;
}

.operations-list li {
  margin-bottom: 8px;
}

.alignment-link {
  display: inline-block;

  margin-top: 8px;

  font-size: 13px;
  font-weight: 700;

  color: var(--blue);

  text-decoration: none;
}

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

.alignment-section {
  transition: all 0.25s ease;
}

.alignment-section.collapsed {
  display: none;
}

/* ==================================================
   CARD ACTIONS
================================================== */

.card-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;

  gap: 10px;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;

  padding: 0 13px;

  background: var(--blue);
  color: white;

  text-decoration: none;

  border-radius: 8px;

  font-weight: 700;
  font-size: 12px;

  white-space: nowrap;

  transition: all 0.2s ease;
}

.card-actions a.secondary {
  background: #e2e8f0;
  color: var(--text);
}

.card-actions a:hover,
.card-actions a.secondary:hover {
  background: #1d4ed8;
  color: white;
}

/* ==================================================
   NEW REQUEST BADGE
================================================== */

.new-request {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.new-request span {
  margin-top: 4px;

  width: 80px;

  text-align: center;

  position: relative;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;

  color: var(--blue);
}

.new-request span::before,
.new-request span::after {
  content: "";

  position: absolute;

  top: 50%;

  width: 24px;
  height: 2px;

  background: var(--blue);
}

.new-request span::before {
  left: 0;
}

.new-request span::after {
  right: 0;
}

/* ==================================================
   INSIGHTS / PANELS
================================================== */

.insights-section {
  display: grid;
  grid-template-columns: 2fr 1fr;

  gap: 24px;
}

.panel {
  background: var(--card);

  border-radius: 22px;
  border: 1px solid var(--border);

  padding: 24px;

  box-shadow: var(--shadow);
}

.panel h3 {
  font-size: 23px;
  margin-bottom: 18px;
}

.insight-item {
  padding: 17px 0;

  border-bottom: 1px solid #e2e8f0;
}

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

.insight-item strong {
  display: block;

  margin-bottom: 8px;

  font-size: 15px;
}

.insight-item p {
  color: var(--muted);

  line-height: 1.7;
  font-size: 14px;
}

/* ==================================================
   TIMELINE
================================================== */

.timeline-item {
  display: flex;
  gap: 14px;

  margin-bottom: 22px;
}

.timeline-dot {
  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: var(--blue);

  margin-top: 6px;

  flex-shrink: 0;
}

.timeline-content strong {
  display: block;

  margin-bottom: 6px;

  font-size: 14px;
}

.timeline-content p {
  color: var(--muted);

  font-size: 13px;
  line-height: 1.6;
}

/* ==================================================
   MODALS
================================================== */

/* ==================================================
   MODALS
================================================== */

.metric-modal {
  position: fixed;
  inset: 0;

  background: rgba(15, 23, 42, 0.45);

  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.metric-modal.hidden {
  display: none;
}

.metric-modal-content {
  position: relative;

  z-index: 10000;

  width: 96vw;
  max-width: 1400px;

  max-height: 85vh;

  background: #ffffff;

  border-radius: 18px;

  overflow: hidden;

  box-shadow:
    0 24px 80px rgba(15, 23, 42, 0.35);

  display: flex;
  flex-direction: column;
}

.metric-modal-header {
  background: #ffffff;

  padding: 18px 22px;

  border-bottom: 1px solid #e2e8f0;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-modal-header h3 {
  font-size: 24px;
  font-weight: 800;
}

.metric-modal-close {
  border: none;
  background: none;

  font-size: 24px;
  line-height: 1;

  cursor: pointer;

  color: #475569;

  transition: color 0.2s ease;
}

.metric-modal-close:hover {
  color: #0f172a;
}

.metric-modal-body {
  background: #ffffff;

  max-height: calc(85vh - 72px);

  overflow: auto;
}

.metric-table {
  width: 100%;

  border-collapse: collapse;

  background: #ffffff;
}

.metric-table thead {
  background: #f8fafc;
}

.metric-table th {
  position: sticky;
  top: 0;

  z-index: 2;

  background: #f8fafc;

  text-align: left;

  padding: 14px 12px;

  border-bottom: 2px solid #dbe4f0;

  font-size: 12px;
  font-weight: 800;

  color: #0f172a;

  white-space: nowrap;
}

.metric-table td {
  background: #ffffff;

  padding: 12px;

  border-bottom: 1px solid #e2e8f0;

  font-size: 12px;

  color: #0f172a;

  vertical-align: top;
}

.metric-table tbody tr:hover td {
  background: #f8fbff;
}

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

.platform-footer {
  margin-top: 28px;
  padding-top: 18px;

  border-top: 1px solid #dbe4f0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 20px;

  font-size: 11px;
  color: #64748b;

  font-style: italic;
}

.platform-attribution {
  font-weight: 500;
}

.platform-data-note {
  opacity: 0.8;
}

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

@media (max-width: 1250px) {

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 1000px) {

  .insights-section {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {

  body {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;

    gap: 20px;
  }

  .topbar-right {
    text-align: left;
  }

  .card-grid,
  .supporting-metrics {
    grid-template-columns: 1fr;
  }

  .vital-few-1,
  .vital-few-2,
  .vital-few-3 {
    grid-template-columns: 1fr;
  }

  .card-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;

    align-items: start;

    gap: 12px;

    margin-bottom: 10px;
  }

  .card-header .refresh-button,
  .card-title-wrap,
  .card-updated {
    grid-column: 1;

    justify-self: center;
    text-align: center;
  }

  .card-actions {
    flex-wrap: wrap;
  }

}
