:root {
  --blue: #003060;
  --green: #80c850;
  --navy: #003060;
  --cyan: #00a6ff;
  --lime: #8bd400;
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(0, 107, 143, 0.14);
  --soft: #f4f9fb;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 80px rgba(7, 26, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 0%, rgba(139, 212, 0, 0.18), transparent 34%),
    radial-gradient(circle at 14% 8%, rgba(0, 166, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #f7fbfd 0%, #eff7f3 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background:
    linear-gradient(160deg, rgba(0, 107, 143, 0.96), rgba(7, 26, 61, 0.98)),
    var(--navy);
  color: #fff;
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-lockup span,
.eyebrow,
.panel-head span,
.publish-card span,
.kpi span {
  display: block;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-lockup strong {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 8px;
  font-weight: 800;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--green);
}

.publish-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.publish-card strong {
  display: block;
  margin: 6px 0;
}

.publish-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  line-height: 1.55;
}

.workspace {
  padding: 30px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.hero h1 {
  max-width: 890px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-meta {
  min-width: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: right;
}

.hero-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-meta strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 16px 50px rgba(7, 26, 61, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 70px rgba(7, 26, 61, 0.15);
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -40px -56px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(22, 130, 58, 0.12);
}

.primary-kpi::after {
  background: rgba(0, 166, 255, 0.14);
}

.kpi strong {
  display: block;
  margin-top: 14px;
  color: var(--navy);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1;
}

.kpi em {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.35;
}

.health strong {
  color: var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel.wide {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.panel-head h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 1.15rem;
}

.chart-wrap {
  position: relative;
  height: 340px;
  padding: 14px 18px 18px;
}

.chart-wrap.tall {
  height: 420px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active,
.segmented button:hover {
  background: var(--blue);
  color: #fff;
}

#clientSearch {
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

#clientSearch:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 107, 143, 0.12);
}

.client-panel {
  min-height: 420px;
}

.client-detail {
  padding: 18px;
}

.client-detail p {
  color: var(--muted);
  line-height: 1.6;
}

.client-detail dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.client-detail div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.client-detail dt {
  color: var(--muted);
  font-weight: 700;
}

.client-detail dd {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
  text-align: right;
}

.bni-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.bni-stats article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 107, 143, 0.07), rgba(22, 130, 58, 0.08));
}

.bni-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.bni-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 1.55rem;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .publish-card {
    position: static;
    margin-top: 18px;
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .hero,
  .panel-head {
    display: grid;
  }

  .hero-meta {
    text-align: left;
  }

  .kpi-grid,
  .bni-stats {
    grid-template-columns: 1fr;
  }
}
