:root {
  --bg: #F7FAF9;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #0A0A0A;
  --muted: #6b7280;
  --accent: #FF6503;
  --accent-hover: #F05D00;
  --accent-light: rgba(255, 101, 3, 0.08);
  --dark: #1F1A17;
  --grey: #9ca3af;
  --blue: #2563eb;
  --green: #16a34a;
  --yellow: #ca8a04;
  --red: #dc2626;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 560px;
  margin: 32px auto;
  padding: 0 16px;
}

.header { margin-bottom: 20px; }
.header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 0 0;
  color: var(--text);
  word-break: break-all;
}
.header .muted { font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: 0.3px; }

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

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

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

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0;
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  min-height: 24px;
}

.row + .row { border-top: 1px solid var(--border); }

.row.tags { gap: 6px; flex-wrap: wrap; justify-content: flex-start; }

.label { color: var(--muted); }

.value-with-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-grey   { background: #f3f4f6; color: #4b5563; }
.tag-blue   { background: #eff6ff; color: var(--blue); }
.tag-green  { background: #ecfdf5; color: var(--green); }
.tag-yellow { background: #fefce8; color: #a16207; }
.tag-red    { background: #fef2f2; color: var(--red); }
.tag-orange { background: var(--accent-light); color: var(--accent); }

.copy {
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--muted);
  cursor: pointer;
}
.copy:hover { color: var(--text); border-color: #cbd5e1; }

.aum-total .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.aum-total-value { font-size: 18px; color: var(--green); }

.days { font-weight: 600; }
.days-red    { color: var(--red); }
.days-yellow { color: var(--yellow); }
.days-grey   { color: var(--muted); }

.score { font-weight: 600; font-size: 16px; }
.score-red    { color: var(--red); }
.score-yellow { color: var(--yellow); }
.score-green  { color: var(--green); }
.score-grey   { color: var(--muted); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.error {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.error h1 { font-size: 18px; color: var(--red); margin: 0 0 8px 0; }

.button {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.button:hover { background: var(--accent-hover); }

.links { text-align: center; }

/* ── Workspace Vitally Health Dashboard ────────────────────────────────── */

.container-wide { max-width: 1000px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.kpi-tile:hover {
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive: shrink large currency values on smaller tiles */
.kpi-value-lg {
  font-size: 19px;
}

.kpi-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* KPI value color modifiers */
.kpi-value-green { color: var(--green); }
.kpi-value-yellow { color: var(--yellow); }
.kpi-value-red { color: var(--red); }
.kpi-value-muted { color: var(--muted); }

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  transition: background 0.1s ease;
}

.account-row + .account-row { border-top: 1px solid var(--border); }

.account-name {
  font-weight: 500;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
}

.account-name a { color: var(--text); text-decoration: none; }
.account-name a:hover { color: var(--accent); }

.account-csm {
  margin-left: 6px;
  font-weight: 400;
  font-size: 12px;
}

.account-reason {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status badge pill for health status */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.3;
}

.badge-red {
  background: #fef2f2;
  color: var(--red);
}

.badge-yellow {
  background: #fefce8;
  color: #a16207;
}

.badge-green {
  background: #ecfdf5;
  color: var(--green);
}

.badge-grey {
  background: #f3f4f6;
  color: #6b7280;
}

.badge-orange {
  background: var(--accent-light);
  color: var(--accent);
}

/* Reason text (secondary info beside badge) */
.reason-text {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.account-empty { padding: 12px 0; margin: 0; font-size: 13px; }

/* Dashboard footer */
.dashboard-footer {
  text-align: center;
  padding: 16px 0 32px;
  font-size: 11px;
  color: var(--grey);
}

.dashboard-footer .accent-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 4px;
  vertical-align: middle;
}
