:root {
  --bg: #f6efe4;
  --bg-deep: #f1dcc6;
  --surface: rgba(255, 250, 244, 0.86);
  --surface-strong: #fff8f0;
  --ink: #1f2430;
  --muted: #66655f;
  --line: rgba(31, 36, 48, 0.1);
  --accent: #d85f32;
  --accent-soft: rgba(216, 95, 50, 0.14);
  --teal: #0f766e;
  --teal-soft: rgba(15, 118, 110, 0.12);
  --gold: #b88717;
  --shadow: 0 18px 48px rgba(97, 55, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 95, 50, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4ee 48%, var(--bg-deep) 100%);
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.92;
  font-weight: 400;
}

.hero-copy {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.control-card,
.panel,
.stat-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
}

.control-card {
  padding: 22px;
  border-radius: 24px;
}

.control-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.control-row {
  display: flex;
  gap: 12px;
}

.control-row input,
.control-row button {
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
}

.control-row input {
  flex: 1;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
}

.control-row button {
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.control-row button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.filter-context {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.summary-band {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
  border-radius: 22px;
}

.stat-label,
.stat-note {
  display: block;
}

.stat-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.stat-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  border-radius: 28px;
  padding: 22px;
}

.panel-heading {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.5rem;
}

.panel-badge {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.account-list,
.activity-list {
  display: grid;
  gap: 14px;
}

.account-card,
.activity-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.account-card::after,
.activity-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(216, 95, 50, 0.08);
}

.account-header,
.account-meta,
.account-needs,
.activity-meta {
  position: relative;
  z-index: 1;
}

.account-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.account-header h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.rank-pill,
.score-pill,
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.rank-pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.score-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.05);
  color: var(--muted);
  font-size: 0.8rem;
}

.account-needs {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.account-needs strong {
  color: var(--ink);
}

.activity-panel {
  grid-column: 1 / -1;
}

.activity-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
}

.channel-pill {
  align-self: start;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
}

.activity-card.email .channel-pill {
  background: rgba(216, 95, 50, 0.12);
  color: var(--accent);
}

.activity-card.calendar .channel-pill {
  background: rgba(184, 135, 23, 0.13);
  color: var(--gold);
}

.activity-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.activity-card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  padding: 32px 18px;
  text-align: center;
  border: 1px dashed rgba(31, 36, 48, 0.18);
  border-radius: 22px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .hero,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 20px;
  }

  .control-row,
  .panel-heading,
  .account-header,
  .activity-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .control-row button {
    width: 100%;
  }

  h1 {
    font-size: 3rem;
  }
}
