:root {
  --canvas-bg: #8f9ab1;
  --shell-bg: #eff1f3;
  --card-bg: #ffffff;
  --card-muted: #e6ebef;
  --panel-bg: #f8f9fa;
  --text-primary: #172033;
  --text-secondary: #68707c;
  --text-tertiary: #9aa2ad;
  --line-default: #d8dde3;
  --line-soft: #edf0f2;
  --accent-orange: #e85a2a;
  --accent-blue: #78a8d7;
  --accent-blue-soft: #dcebf6;
  --success: #7ba890;
  --radius-shell: 34px;
  --radius-card: 28px;
  --radius-panel: 18px;
  --radius-control: 999px;
  --shadow-shell: 0 34px 90px rgba(18, 28, 48, 0.18);
  --shadow-card: 0 24px 70px rgba(17, 25, 45, 0.08);
  --shadow-float: 0 14px 32px rgba(17, 25, 45, 0.2);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body,
.northstar-premium-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text-primary);
  background: radial-gradient(circle at 50% 0%, #a5aec1 0%, var(--canvas-bg) 46%, #7f8ca5 100%);
}

body:not(.wp-admin) { padding: 38px; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
a { color: inherit; }

.screen-reader-text,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  top: 18px;
  left: 18px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 999;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.northstar-page {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
}

.dashboard {
  width: min(1180px, 100%);
  min-height: 760px;
  background: var(--shell-bg);
  border-radius: var(--radius-shell);
  padding: 24px;
  box-shadow: var(--shadow-shell);
  border: 1px solid rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent-orange);
  box-shadow: 0 12px 24px rgba(232, 90, 42, 0.24);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-control);
  list-style: none;
}

.nav-links li { list-style: none; margin: 0; }
.nav-links a {
  display: inline-flex;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 15px;
  border-radius: var(--radius-control);
}
.nav-links a.active,
.nav-links .current-menu-item > a,
.nav-links a:hover {
  color: var(--text-primary);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(17, 25, 45, 0.08);
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.northstar-search-form { margin: 0; }
.search {
  width: 218px;
  height: 42px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-default);
  background: rgba(255, 255, 255, 0.72);
  padding: 0 16px;
  color: var(--text-primary);
  outline: none;
}
.search::placeholder { color: var(--text-tertiary); }
.search:focus,
.icon-button:focus-visible,
.pill:focus-visible,
.cta:focus-visible,
.expand:focus-visible,
.add-button:focus-visible,
.see-all:focus-visible {
  outline: 3px solid rgba(120, 168, 215, 0.35);
  outline-offset: 2px;
}

.icon-button, .avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid rgba(216, 221, 227, 0.75);
  box-shadow: 0 10px 25px rgba(17, 25, 45, 0.06);
}
.avatar {
  background: linear-gradient(135deg, #172033, #5e6878);
  color: #ffffff;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.85fr);
  grid-template-rows: auto auto;
  gap: 18px;
}
.bottom-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  border: 1px solid rgba(216, 221, 227, 0.72);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.hero { min-height: 440px; position: relative; overflow: hidden; }
.hero-head, .section-head, .metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.icon-tile {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #f3f5f6;
  border: 1px solid var(--line-soft);
  color: var(--accent-orange);
  margin-bottom: 18px;
}
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.07em;
  max-width: 560px;
}
h2 { font-size: 22px; letter-spacing: -0.04em; }
h3 { font-size: 16px; letter-spacing: -0.025em; }
.muted { color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.pill {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  background: #f6f7f8;
  border: 1px solid var(--line-default);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.hero-metric {
  margin-top: 30px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}
.metric-number {
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.08em;
  font-weight: 850;
}
.metric-label {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.trend { color: var(--success); font-size: 14px; font-weight: 750; }
.chart {
  position: relative;
  height: 155px;
  margin-top: 35px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 13px;
  padding: 0 4px;
}
.bar {
  height: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  position: relative;
}
.line {
  width: 2px;
  height: var(--h);
  border-radius: var(--radius-control);
  background: linear-gradient(to top, #ccd3dc, #eef2f5);
  position: relative;
}
.bar.active::before {
  content: "";
  position: absolute;
  bottom: 48px;
  width: 56px;
  height: 128px;
  border-radius: 24px;
  background: var(--accent-blue-soft);
  opacity: 0.65;
  z-index: 0;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-blue);
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 5px rgba(120, 168, 215, 0.14);
}
.day {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f5f6f7;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.day.selected { background: var(--text-primary); color: #ffffff; }
.value-pill {
  position: absolute;
  left: 57%;
  bottom: 170px;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #ffffff;
  padding: 11px 14px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-float);
  z-index: 3;
  white-space: nowrap;
}
.value-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 3px;
}
.projects { min-height: 440px; }
.see-all { color: var(--accent-orange); background: transparent; font-size: 13px; font-weight: 800; }
.project-list, .contact-list { display: grid; gap: 12px; }
.project-item {
  padding: 16px;
  border-radius: var(--radius-panel);
  background: var(--panel-bg);
  border: 1px solid var(--line-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.project-item:hover { transform: translateY(-1px); }
.project-item.expanded { background: #ffffff; box-shadow: inset 0 0 0 1px var(--line-soft); }
.project-row, .contact-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.project-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}
.status {
  border-radius: var(--radius-control);
  background: #fff2ed;
  color: var(--accent-orange);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.expand {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line-default);
  color: var(--text-secondary);
}
.connect-card, .promo-card, .progress-card { min-height: 228px; }
.contact-row {
  min-height: 54px;
  padding: 8px 10px 8px 8px;
  border-radius: var(--radius-control);
  background: #f7f8f9;
  border: 1px solid var(--line-soft);
}
.person { display: flex; align-items: center; gap: 10px; }
.mini-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-blue-soft);
  color: #315f86;
  font-size: 13px;
  font-weight: 850;
}
.badge { color: var(--text-tertiary); font-size: 12px; font-weight: 750; }
.add-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-orange);
  border: 1px solid var(--line-default);
  font-size: 20px;
  line-height: 1;
}
.promo-card { position: relative; background: var(--card-muted); overflow: hidden; }
.promo-card::before,
.promo-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(23, 32, 51, 0.08);
  width: 210px;
  height: 210px;
  right: -74px;
  top: -80px;
}
.promo-card::after { width: 140px; height: 140px; right: 42px; top: 64px; }
.promo-content { position: relative; z-index: 1; display: grid; gap: 16px; }
.promo-content .pill { width: fit-content; }
.cta {
  height: 46px;
  border-radius: var(--radius-control);
  background: var(--text-primary);
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 18px 32px rgba(23, 32, 51, 0.2);
}
.progress-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.progress-item { padding-right: 12px; border-right: 1px solid var(--line-soft); }
.progress-item:last-child { border-right: 0; padding-right: 0; }
.progress-number { font-size: 26px; font-weight: 850; letter-spacing: -0.05em; }
.ticks { height: 72px; display: flex; align-items: end; gap: 5px; margin-top: 16px; }
.tick { width: 8px; height: var(--h); border-radius: var(--radius-control); background: #d5dbe2; transition: height 220ms ease; }
.tick.hot { background: var(--accent-orange); }

.northstar-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1000;
  background: var(--text-primary);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.northstar-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  body:not(.wp-admin) { padding: 18px; }
  .northstar-page { min-height: calc(100vh - 36px); }
  .dashboard { padding: 18px; border-radius: 26px; }
  .topbar, .nav-links, .top-actions { flex-wrap: wrap; height: auto; }
  .topbar { align-items: flex-start; }
  .search { width: min(100%, 260px); }
  .grid, .bottom-grid { grid-template-columns: 1fr; }
  .hero, .projects, .connect-card, .promo-card, .progress-card { min-height: auto; }
}

@media (max-width: 620px) {
  .nav-links { width: 100%; justify-content: space-between; border-radius: 24px; }
  .nav-links a { padding: 9px 10px; font-size: 13px; }
  .top-actions { width: 100%; }
  .northstar-search-form { flex: 1 1 100%; }
  .search { width: 100%; }
  .card { padding: 18px; border-radius: 22px; }
  .hero-head, .section-head, .metric-head, .hero-metric { flex-direction: column; align-items: flex-start; }
  .chart { gap: 6px; }
  .value-pill { display: none; }
  .project-meta { flex-wrap: wrap; }
  .progress-metrics { grid-template-columns: 1fr; }
  .progress-item { border-right: 0; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
  .progress-item:last-child { border-bottom: 0; }
}
