:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef1f8;
  --line: #dde2ee;
  --text: #131a2e;
  --muted: #667089;
  /* HBBA identity: deep navy primary (from the mark) + mustard gold accent */
  --purple: #1f3a73;
  --purple-2: #2f57a8;
  --green: #0f9f6e;
  --orange: #f97316;
  --gold: #d4a02a;
  --red: #e54863;
  --blue: #2563eb;
  --shadow: 0 20px 48px rgba(18, 28, 56, 0.10);
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 430px;
  gap: 48px;
  min-height: 100vh;
  padding: 34px;
  background:
    radial-gradient(circle at 16% 16%, rgba(31, 58, 115, 0.16), transparent 32%),
    radial-gradient(circle at 84% 12%, rgba(212, 160, 42, 0.18), transparent 28%),
    radial-gradient(circle at 78% 88%, rgba(47, 87, 168, 0.12), transparent 30%),
    #f6f7fb;
}

.auth-screen.is-hidden {
  display: none;
}

.auth-brand {
  position: fixed;
  top: 28px;
  left: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand strong {
  display: block;
  font-size: 17px;
}

.auth-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.auth-hero {
  align-self: center;
  max-width: 720px;
  padding-left: 28px;
}

.auth-hero h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 48px;
  line-height: 1.04;
}

.auth-hero p {
  max-width: 620px;
  color: #4b5565;
  font-size: 18px;
  line-height: 1.55;
}

.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 30px;
}

.auth-proof div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.05);
}

.auth-proof strong,
.auth-proof span {
  display: block;
}

.auth-proof strong {
  font-size: 28px;
}

.auth-proof span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth-panel {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
  box-shadow: 0 24px 60px rgba(31, 41, 55, 0.12);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f8;
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.is-active {
  color: var(--purple);
  background: #fff;
  box-shadow: 0 6px 16px rgba(31, 41, 55, 0.07);
}

.auth-form {
  display: none;
  gap: 14px;
  padding: 24px 6px 4px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.auth-form p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 13px;
  color: var(--text);
  outline: 0;
}

.auth-form input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.auth-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(31, 58, 115, 0.12);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.auth-submit,
.auth-secondary {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.auth-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 16px 28px rgba(31, 58, 115, 0.22);
}

.auth-secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.auth-small {
  margin-bottom: 0;
  font-size: 12px;
}

.app-shell.is-hidden {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 10px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 18px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #1f3a73, #d4a02a);
  box-shadow: 0 16px 28px rgba(31, 58, 115, 0.22);
}

.brand strong,
.profile strong {
  display: block;
  font-size: 16px;
}

.brand span,
.profile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5565;
  text-align: left;
  font-weight: 600;
}

.metric-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.nav-item:hover,
.icon-button:hover,
.control:hover,
.secondary-action:hover,
.row-card:hover,
.compact-card:hover {
  background: var(--surface-soft);
}

.nav-item.is-active {
  color: var(--purple);
  background: #e9eff9;
  box-shadow: inset 4px 0 0 var(--purple);
}

.sidebar-card {
  margin: 18px 0 0;
  border-radius: 8px;
  background: #eef2fb;
  padding: 14px;
}

.sidebar-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 12px;
  font-size: 13px;
}

.secondary-action,
.text-button,
.chip,
.pill {
  border: 0;
  border-radius: 999px;
  color: var(--purple);
  background: #fff;
  font-weight: 700;
}

.secondary-action {
  width: 100%;
  min-height: 42px;
}

.text-button {
  padding: 0;
  background: transparent;
}

.help {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f3f6fb;
}

.main {
  min-width: 0;
  overflow-x: hidden;
  background: #f8fafc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 16px;
  align-items: center;
  height: 72px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(350px, 32vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.tenant-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 252px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 14px;
  text-align: left;
}

.tenant-switch small {
  display: block;
  margin-top: 2px;
  max-width: 178px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--purple);
  font-weight: 800;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

kbd {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--muted);
  background: #f7f8fb;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.icon-button,
.primary-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #15213a;
}

.primary-icon {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 10px 22px rgba(91, 53, 245, 0.24);
}

.has-badge i {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  color: #fff;
  background: #ef233c;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 12px 5px 5px;
}

.profile img,
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.content {
  padding: 20px 24px 32px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-head > div:first-child {
  max-width: 680px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 26px;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #7d8494;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-head p,
.muted,
.card-subtitle,
.activity span,
.event-meta,
.table td {
  color: var(--muted);
}

.head-actions,
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.head-actions {
  justify-content: flex-end;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2937;
  background: #fff;
  padding: 0 14px;
  font-weight: 600;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  padding: 0 16px;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(31, 58, 115, 0.24);
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  border: 1px solid #f5c97d;
  border-radius: 12px;
  background: #fff7ea;
  padding: 11px 16px;
  font-size: 15px;
}

.notice-bar button {
  margin-left: auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.briefing-card {
  position: relative;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  min-height: 150px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 10%, rgba(71, 210, 221, 0.28), transparent 34%),
    radial-gradient(circle at 20% 8%, rgba(139, 92, 246, 0.22), transparent 26%),
    linear-gradient(135deg, #fff 0%, #f6f4ff 62%, #e6defe 100%);
  padding: 22px 60px 22px 22px;
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.07);
}

.briefing-left {
  display: flex;
  gap: 14px;
}

.briefing-left small {
  display: block;
  color: #4b5565;
  font-size: 14px;
}

.briefing-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 14px 30px rgba(31, 58, 115, 0.24);
}

.briefing-body h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 8px 28px;
}

.briefing-grid p {
  color: #4b5565;
  font-size: 15px;
  margin-bottom: 0;
}

.briefing-grid i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--purple);
}

.briefing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.briefing-tags span,
.briefing-tags button {
  border: 0;
  border-radius: 999px;
  color: var(--purple);
  background: rgba(31, 58, 115, 0.12);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, transform .12s;
}
.briefing-tags button:hover { background: rgba(31, 58, 115, 0.2); }
.briefing-tags button:active { transform: translateY(1px); }
.briefing-tags button:disabled { opacity: .7; cursor: default; }

.refresh-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.09);
  font-size: 18px;
}

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

.card,
.metric-card,
.row-card,
.compact-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.metric-card {
  padding: 16px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.05);
}

.metric-top,
.card-title,
.split-row,
.task-item,
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: var(--purple);
  background: #f0eaff;
}

.metric-card h3 {
  margin: 12px 0 2px;
  font-size: 28px;
}

.metric-card small,
.event-meta,
.task-item {
  font-size: 13px;
}

.trend {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.9fr 1fr;
  gap: 14px;
}

.lower-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.05fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.card {
  padding: 16px;
  min-width: 0;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.04);
}

.card-title {
  margin-bottom: 12px;
}

.card-title h2 {
  margin: 0;
  font-size: 17px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 700;
}

.event-row {
  display: grid;
  grid-template-columns: 58px 78px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.event-row:last-child,
.activity:last-child,
.sponsor-row:last-child,
.task-item:last-child {
  border-bottom: 0;
}

.date-tile {
  display: grid;
  place-items: center;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
}

.date-tile strong {
  color: var(--text);
  font-size: 21px;
}

.event-row img {
  width: 78px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.event-row h3,
.sponsor-row h3,
.activity h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.event-meta {
  display: block;
  margin-bottom: 8px;
}

.chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  background: #efe9ff;
  font-size: 12px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 1fr 155px;
  align-items: center;
  gap: 20px;
}

.donut {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  margin: 0 auto;
  background: conic-gradient(var(--gold) 0 36%, #cfd3dc 36% 76%, #bd6425 76% 100%);
  position: relative;
}

.donut::after {
  content: "1,250\A Total Members";
  white-space: pre;
  display: grid;
  place-items: center;
  position: absolute;
  inset: 36px;
  border-radius: 50%;
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.legend {
  display: grid;
  gap: 14px;
}

.legend span {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 7px;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-stats div {
  padding: 12px;
}

.mini-stats div + div {
  border-left: 1px solid var(--line);
}

.mini-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.activity {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
}

.sponsor-row,
.task-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.sponsor-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
}

.sponsor-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: #164e82;
  font-weight: 800;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 34px;
  height: 170px;
  padding: 16px 22px 0;
  border-bottom: 1px solid var(--line);
}

.bar {
  display: grid;
  align-items: end;
  height: 100%;
  background: linear-gradient(to top, var(--purple) var(--sold), #d9cffb var(--sold));
  border-radius: 5px 5px 0 0;
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 10px 12px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.task-item label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.pill {
  min-height: 28px;
  padding: 6px 10px;
  background: #fff2df;
  color: var(--orange);
  font-size: 12px;
}

.pill.blue {
  background: #e9efff;
  color: var(--blue);
}

.pill.red {
  background: #ffe7ec;
  color: var(--red);
}

.page-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.row-card,
.compact-card {
  padding: 16px;
}

.row-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 99px;
  padding: 0 10px;
  color: var(--green);
  background: #e7f8f0;
  font-size: 12px;
  font-weight: 800;
}

.status.warn {
  color: #b45309;
  background: #fff5df;
}

.status.danger {
  color: var(--red);
  background: #ffe7ec;
}

.stat-line {
  display: grid;
  gap: 14px;
}

.progress {
  height: 9px;
  border-radius: 99px;
  background: #ecf0f6;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--green));
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  max-width: 320px;
  border-radius: 8px;
  padding: 14px 16px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

.activity-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

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

  .dashboard-grid .card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 880px) {
  .auth-screen {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 88px 16px 24px;
  }

  .auth-brand {
    top: 20px;
    left: 16px;
  }

  .auth-hero {
    padding-left: 0;
  }

  .auth-hero h1 {
    font-size: 34px;
  }

  .auth-hero p {
    font-size: 16px;
  }

  .auth-proof {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    align-self: start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 8;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 292px;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .search {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .search kbd {
    display: none;
  }

  .top-actions .icon-button,
  .profile span {
    display: none;
  }

  .content {
    padding: 22px 16px 34px;
  }

  .page-head {
    display: grid;
  }

  .head-actions .control:first-child {
    flex: 1 1 220px;
  }

  .head-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .control {
    min-width: 0;
  }

  .metric-grid,
  .dashboard-grid,
  .lower-grid,
  .page-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .card:first-child {
    grid-column: auto;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .event-row,
  .row-card {
    grid-template-columns: 54px 1fr;
  }

  .event-row img,
  .row-card .chip,
  .row-card .status,
  .row-card > strong {
    display: none;
  }
}

@media (max-width: 480px) {
  .head-actions .control:last-child {
    width: 48px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    color: transparent;
  }

  .head-actions .control:last-child [data-icon] {
    color: #1f2937;
  }
}

/* === Dark theme === */
body[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #141a2e;
  --surface-soft: #1a2138;
  --line: #283150;
  --text: #e6e9f4;
  --muted: #8c95b1;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .main,
body[data-theme="dark"] .auth-screen {
  background: var(--bg);
}

body[data-theme="dark"] .topbar {
  background: rgba(20, 26, 46, 0.9);
}

body[data-theme="dark"] .search,
body[data-theme="dark"] .tenant-switch,
body[data-theme="dark"] .profile,
body[data-theme="dark"] .control,
body[data-theme="dark"] .auth-form input,
body[data-theme="dark"] kbd {
  background: var(--surface);
  color: var(--text);
}

body[data-theme="dark"] .nav-item {
  color: #b6bdd5;
}

body[data-theme="dark"] .nav-item.is-active {
  color: #c9c0ff;
  background: rgba(31, 58, 115, 0.18);
}

body[data-theme="dark"] .sidebar-card {
  background: rgba(31, 58, 115, 0.12);
}

body[data-theme="dark"] .help {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .briefing-card,
body[data-theme="dark"] .donut::after,
body[data-theme="dark"] .mini-stats {
  background: var(--surface);
}

body[data-theme="dark"] .briefing-card {
  background:
    radial-gradient(circle at 72% 10%, rgba(71, 210, 221, 0.18), transparent 34%),
    radial-gradient(circle at 20% 8%, rgba(139, 92, 246, 0.22), transparent 26%),
    linear-gradient(135deg, #1a2138 0%, #1d1c3d 100%);
}

body[data-theme="dark"] .briefing-grid p,
body[data-theme="dark"] .briefing-left small,
body[data-theme="dark"] .auth-hero p {
  color: #b6bdd5;
}

body[data-theme="dark"] .progress { background: #1d2540; }
body[data-theme="dark"] .chip { background: rgba(139, 92, 246, 0.22); color: #c9c0ff; }
body[data-theme="dark"] .pill { background: rgba(249, 115, 22, 0.18); }
body[data-theme="dark"] .pill.blue { background: rgba(37, 99, 235, 0.22); }
body[data-theme="dark"] .pill.red { background: rgba(229, 72, 99, 0.22); }
body[data-theme="dark"] .status { background: rgba(15, 159, 110, 0.18); }
body[data-theme="dark"] .status.warn { background: rgba(245, 158, 11, 0.18); }
body[data-theme="dark"] .status.danger { background: rgba(229, 72, 99, 0.18); }

/* === Dropdowns === */
.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 300px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: dropIn 0.16s ease;
}
.dropdown[hidden] { display: none; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.notif-panel { width: 360px; }
.notif-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.notif-head h3 { margin: 0; font-size: 15px; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-soft); }
.notif-item.unread { background: rgba(31, 58, 115, 0.06); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); margin-top: 6px; justify-self: end; }
.notif-item h4 { margin: 0 0 4px; font-size: 13px; }
.notif-item p { margin: 0; font-size: 12px; color: var(--muted); }
.notif-item small { color: var(--muted); font-size: 11px; }
.notif-foot { padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; }

.profile-menu { width: 240px; padding: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); text-align: left;
  font-size: 14px; font-weight: 600;
}
.menu-item:hover { background: var(--surface-soft); }
.menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }

/* === Overlays === */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(15, 18, 32, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Modal */
.modal {
  width: min(560px, 92vw);
  border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: popIn 0.2s ease;
  display: grid; grid-template-rows: auto 1fr auto;
  max-height: 90vh;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal-head, .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2, .drawer-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.modal-body label, .drawer-body label, .form-grid label {
  display: grid; gap: 6px; margin-bottom: 14px;
  color: var(--text); font-size: 13px; font-weight: 700;
}
.modal-body input, .modal-body select, .modal-body textarea,
.drawer-body input, .drawer-body select, .drawer-body textarea {
  width: 100%; min-height: 40px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0 12px; color: var(--text); outline: 0;
  font: inherit;
}
.modal-body textarea, .drawer-body textarea { min-height: 80px; padding: 10px 12px; resize: vertical; }
.modal-body input:focus, .drawer-body input:focus,
.modal-body select:focus, .drawer-body select:focus,
.modal-body textarea:focus, .drawer-body textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(31, 58, 115, 0.14);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error {
  display: block; margin-top: 4px; color: var(--red); font-size: 12px; font-weight: 600;
}
label.has-error input, label.has-error select { border-color: var(--red); }
label.has-success input { border-color: var(--green); }

/* Drawer */
.drawer-overlay { justify-items: end; }
.drawer {
  width: min(480px, 96vw);
  height: 100vh; background: var(--surface);
  border-left: 1px solid var(--line);
  display: grid; grid-template-rows: auto 1fr;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-body { padding: 20px; overflow-y: auto; }
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.drawer-kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.drawer-kv dt { color: var(--muted); }
.drawer-kv dd { margin: 0; font-weight: 600; }

/* Command palette */
.command-overlay { align-items: start; padding-top: 14vh; }
.command-palette {
  width: min(640px, 92vw);
  border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; animation: popIn 0.18s ease;
}
.command-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.command-head input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.command-results { max-height: 380px; overflow-y: auto; padding: 8px; }
.command-group { padding: 8px 8px 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.command-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); text-align: left;
  font-size: 14px; font-weight: 600;
}
.command-item:hover, .command-item.is-focused { background: var(--surface-soft); }
.command-item kbd { margin-left: auto; font-size: 11px; }
.command-empty { padding: 28px; text-align: center; color: var(--muted); }

/* Confirm */
.confirm {
  width: min(420px, 92vw);
  padding: 24px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-align: center;
  animation: popIn 0.2s ease;
}
.confirm-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; margin: 0 auto 14px;
  color: var(--red); background: #ffe7ec;
}
.confirm h2 { font-size: 18px; margin-bottom: 6px; }
.confirm p { color: var(--muted); margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.primary-action.danger {
  background: linear-gradient(135deg, var(--red), #c93146);
  box-shadow: 0 16px 28px rgba(229, 72, 99, 0.24);
}

/* === Toast variants === */
.toast-stack {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: grid; gap: 10px; max-width: 360px;
  pointer-events: none;
}
.toast {
  position: static; transform: translateY(18px); opacity: 0;
  border-radius: 10px; padding: 12px 16px; color: #fff;
  background: #111827; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.22s ease forwards;
}
.toast.success { background: linear-gradient(135deg, #0f9f6e, #0c805a); }
.toast.error   { background: linear-gradient(135deg, #e54863, #b6354b); }
.toast.warn    { background: linear-gradient(135deg, #f97316, #c95709); }
.toast.info    { background: linear-gradient(135deg, var(--purple), var(--purple-2)); }
.toast .close { margin-left: auto; background: transparent; border: 0; color: rgba(255,255,255,0.85); cursor: pointer; }
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }

/* === Bottom nav (mobile) === */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px rgba(0,0,0,0.06);
  padding: 6px 4px env(safe-area-inset-bottom);
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.bottom-nav button {
  display: grid; place-items: center; gap: 4px;
  padding: 8px 4px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 700;
}
.bottom-nav button.is-active { color: var(--purple); background: rgba(31, 58, 115, 0.1); }
.bottom-nav [data-icon] { width: 20px; height: 20px; }

@media (max-width: 880px) {
  .bottom-nav { display: grid; }
  .content { padding-bottom: 84px; }
}

/* === Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--surface-soft) 0%, #e9eef7 50%, var(--surface-soft) 100%);
  background-size: 200% 100%;
  animation: skel 1.1s ease infinite;
  border-radius: 8px;
}
body[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1a2138 0%, #232c4a 50%, #1a2138 100%);
  background-size: 200% 100%;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-row { height: 14px; margin: 8px 0; }
.skel-block { height: 120px; margin: 10px 0; }
.skel-circle { width: 44px; height: 44px; border-radius: 50%; }

/* === Filter / sort bar === */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.filterbar .search-input {
  flex: 1; min-width: 200px; min-height: 38px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0 12px 0 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
  outline: 0; color: var(--text);
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600;
}
.filter-chip.is-active { border-color: var(--purple); background: rgba(31, 58, 115, 0.1); color: var(--purple); }
.filter-chip i { font-style: normal; padding: 2px 7px; border-radius: 99px; background: var(--surface-soft); font-size: 11px; }

/* === Pagination === */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 0; gap: 10px; flex-wrap: wrap;
}
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages button {
  min-width: 34px; height: 34px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font-weight: 700;
}
.pagination .pages button.is-active { color: #fff; background: var(--purple); border-color: var(--purple); }
.pagination .pages button:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Empty states === */
.empty-state {
  display: grid; place-items: center; gap: 8px;
  padding: 60px 24px; text-align: center; color: var(--muted);
}
.empty-state .emoji { font-size: 38px; }
.empty-state h3 { margin: 0; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; max-width: 320px; }
.empty-state button { margin-top: 8px; }

/* === Avatar group + presence === */
.avatar-group { display: inline-flex; }
.avatar-group .avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface);
  margin-left: -8px; object-fit: cover;
}
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .more {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  margin-left: -8px; border: 2px solid var(--surface);
  background: var(--surface-soft); color: var(--muted);
  font-size: 11px; font-weight: 800;
}
.presence {
  position: relative; display: inline-block;
}
.presence::after {
  content: ''; position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--muted); border: 2px solid var(--surface);
}
.presence.online::after { background: var(--green); }
.presence.away::after { background: var(--gold); }
.presence.busy::after { background: var(--red); }

/* === CRM === */
.crm-layout {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.contact-row {
  display: grid; grid-template-columns: 44px 1.6fr 1fr 1fr 0.7fr auto;
  gap: 14px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.contact-row:hover { background: var(--surface-soft); }
.contact-row .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.contact-row h4 { margin: 0; font-size: 14px; }
.contact-row small { color: var(--muted); font-size: 12px; }

.pipeline {
  display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px; overflow-x: auto; padding-bottom: 6px;
}
.pipe-col {
  background: var(--surface-soft); border-radius: 12px; padding: 12px;
  border: 1px solid var(--line);
}
.pipe-col-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.pipe-col-head strong { font-size: 13px; }
.pipe-col-head span { color: var(--muted); font-size: 12px; }
.pipe-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 8px;
  cursor: grab; box-shadow: 0 2px 6px rgba(31,41,55,0.04);
}
.pipe-card h5 { margin: 0 0 4px; font-size: 13px; }
.pipe-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* === Tier cards (memberships, sponsors) === */
.tier-grid {
  display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.tier-card {
  position: relative; padding: 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.tier-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0;
  height: 6px; background: var(--tier-color, var(--purple));
}
.tier-card.gold { --tier-color: var(--gold); }
.tier-card.silver { --tier-color: #94a3b8; }
.tier-card.bronze { --tier-color: #bd6425; }
.tier-card h3 { margin: 8px 0 4px; font-size: 20px; }
.tier-card .price { font-size: 26px; font-weight: 800; }
.tier-card ul { padding: 0; margin: 12px 0; list-style: none; font-size: 13px; }
.tier-card ul li { padding: 4px 0; color: var(--muted); }

/* === Calendar (renewals) === */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-grid .head {
  text-align: center; padding: 6px; font-size: 11px;
  color: var(--muted); font-weight: 800; text-transform: uppercase;
}
.cal-day {
  position: relative; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; font-size: 12px; background: var(--surface);
}
.cal-day.muted { color: var(--muted); opacity: 0.5; }
.cal-day.today { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }
.cal-day .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple); margin-right: 4px;
}
.cal-day .events {
  position: absolute; bottom: 4px; left: 6px; right: 6px;
  display: flex; gap: 3px;
}

/* === Events grid === */
.event-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.event-card {
  display: grid; grid-template-rows: 140px auto;
  border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(31,41,55,0.05);
  cursor: pointer; transition: transform 0.15s ease;
}
.event-card:hover { transform: translateY(-2px); }
.event-card img { width: 100%; height: 100%; object-fit: cover; }
.event-card .body { padding: 14px; }
.event-card h3 { margin: 0 0 6px; font-size: 16px; }
.event-card .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.event-card footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }

/* === Tickets check-in === */
.checkin-grid {
  display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px;
}
.qr-placeholder {
  display: grid; place-items: center; aspect-ratio: 1;
  border: 2px dashed var(--line); border-radius: 14px;
  background: var(--surface); color: var(--muted);
  background-image:
    linear-gradient(45deg, var(--line) 25%, transparent 25%),
    linear-gradient(-45deg, var(--line) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--line) 75%),
    linear-gradient(-45deg, transparent 75%, var(--line) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

/* === Networking graph + intro inbox === */
.intro-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; }
.graph-card svg { width: 100%; height: 320px; }
.intro-item {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.intro-item:last-child { border-bottom: 0; }
.intro-item p { margin: 0; font-size: 13px; color: var(--muted); }
.intro-actions { display: flex; gap: 6px; }
.intro-actions button {
  border: 0; border-radius: 8px; padding: 6px 10px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.intro-actions .accept { background: var(--green); color: #fff; }
.intro-actions .decline { background: var(--surface-soft); color: var(--muted); }

/* === Kanban === */
.kanban {
  display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 14px; overflow-x: auto;
}
.kanban-col {
  background: var(--surface-soft); border-radius: 12px; padding: 12px;
  border: 1px solid var(--line);
}
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 13px;
}
.kanban-col-head .count {
  background: var(--surface); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 99px; font-size: 11px; color: var(--muted);
}
.kanban-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: grab;
  box-shadow: 0 2px 6px rgba(31,41,55,0.04);
}
.kanban-card h5 { margin: 0 0 6px; font-size: 13px; }
.kanban-card .footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}

/* === Email marketing === */
.email-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 14px; }
/* A grid item defaults to min-width:auto, so a wide table widens its column and
   slides under the neighbouring panel. Let the columns shrink and scroll the
   table inside its own card instead. */
.email-grid > * { min-width: 0; }
.table-scroll { overflow-x: auto; }
.template-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; cursor: pointer; transition: 0.15s ease;
}
.template-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.template-thumb {
  height: 120px; border-radius: 8px;
  background: linear-gradient(135deg, #f0eaff, #d9e7ff);
  margin-bottom: 10px;
  display: grid; place-items: center;
  color: var(--purple); font-weight: 800;
}
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* === Support thread === */
.support-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 14px; }
.support-queue { max-height: 540px; overflow-y: auto; }
.support-item {
  padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.support-item:hover, .support-item.is-active { background: var(--surface-soft); }
.support-item h4 { margin: 0 0 4px; font-size: 13px; }
.support-item p { margin: 0; font-size: 12px; color: var(--muted); }
.support-thread { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.thread-msg {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px;
  margin-bottom: 12px;
}
.thread-msg .bubble {
  background: var(--surface-soft); padding: 10px 12px;
  border-radius: 12px; font-size: 13px;
}
.thread-msg.me .bubble { background: rgba(31, 58, 115, 0.12); color: var(--purple); }
.thread-reply {
  display: flex; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.thread-reply input {
  flex: 1; min-height: 40px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--text); outline: 0;
}

/* === Invoices === */
.invoice-status {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 800;
}
.invoice-status.paid { background: #e7f8f0; color: var(--green); }
.invoice-status.due { background: #fff5df; color: #b45309; }
.invoice-status.overdue { background: #ffe7ec; color: var(--red); }
.invoice-status.draft { background: var(--surface-soft); color: var(--muted); }
.invoice-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* === Reports === */
.reports-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.reports-grid .full { grid-column: 1 / -1; }
.line-chart {
  width: 100%; height: 220px;
}

/* === Settings tabs === */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px; overflow-x: auto;
}
.tabs button {
  padding: 10px 16px; border: 0; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.is-active { color: var(--purple); border-bottom-color: var(--purple); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid .full { grid-column: 1 / -1; }
.toggle {
  position: relative; display: inline-block; width: 38px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0; background: var(--surface-soft);
  border: 1px solid var(--line); border-radius: 99px; transition: 0.2s;
}
.toggle .slider::before {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: 0.2s;
}
.toggle input:checked + .slider { background: var(--purple); border-color: var(--purple); }
.toggle input:checked + .slider::before { transform: translateX(16px); background: #fff; }

.role-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.role-row:last-child { border-bottom: 0; }

/* === Wave anim === */
.wave {
  display: inline-block;
  animation: wave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

/* === Responsive overrides === */
@media (max-width: 1100px) {
  .pipeline, .kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .reports-grid, .email-grid, .intro-grid, .support-grid, .settings-grid, .checkin-grid {
    grid-template-columns: 1fr;
  }
  .tier-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .contact-row { grid-template-columns: 38px 1fr auto; }
  .contact-row > :nth-child(3), .contact-row > :nth-child(4), .contact-row > :nth-child(5) { display: none; }
  .tier-grid { grid-template-columns: 1fr; }
  .pipeline, .kanban { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* === Brand logo (replaces HB mark) === */
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}
.sidebar .brand { padding: 4px 14px 18px; }
.sidebar .brand-logo { height: 38px; }

.auth-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.auth-brand .brand-logo { height: 48px; max-width: 220px; }
.auth-brand .brand-tag {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

body[data-theme="dark"] .brand-logo {
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}

/* ===================== Role portals ===================== */
body[data-role="member"] .content > .page-head .head-actions,
body[data-role="sponsor"] .content > .page-head .head-actions { display: none; }

.demo-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.demo-hint > span { display: block; margin-bottom: 8px; }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chips button {
  flex: 1;
  min-width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.demo-chips button:hover { border-color: var(--brand, #5b35f5); background: #5b35f510; }

/* ===================== Motion + live feel ===================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -468px 0; } 100% { background-position: 468px 0; } }

#pageRoot.page-enter > * { animation: fadeInUp .42s cubic-bezier(.22,.61,.36,1) both; }
#pageRoot.page-enter > *:nth-child(2) { animation-delay: .05s; }
#pageRoot.page-enter > *:nth-child(3) { animation-delay: .1s; }
#pageRoot.page-enter > *:nth-child(4) { animation-delay: .15s; }
#pageRoot.page-enter > *:nth-child(5) { animation-delay: .2s; }

/* Cards lift + respond */
.metric-card, .compact-card, .event-card, .tier-card, .card {
  transition: transform .18s cubic-bezier(.22,.61,.36,1), box-shadow .18s, border-color .18s;
}
.metric-card:hover, .compact-card:hover, .event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -12px rgba(20, 20, 60, .28);
}
.primary-action, .secondary-action, .control, .nav-item, .auth-submit, .link-button { transition: transform .12s, background .15s, box-shadow .15s, color .15s; }
.primary-action:active, .secondary-action:active, .control:active, .auth-submit:active { transform: translateY(1px) scale(.985); }
.nav-item:hover { transform: translateX(2px); }

/* Animated number roll */
.count-anim { font-variant-numeric: tabular-nums; }

/* Empty states — add entrance + dashed frame on top of existing base styling */
.empty-state { animation: popIn .4s both; border: 1px dashed var(--line); border-radius: 14px; padding: 30px 18px; }

/* Toast entrance */
.toast { animation: popIn .25s cubic-bezier(.22,.61,.36,1) both; }

/* Skeleton shimmer (used during data load) */
.skeleton, .skel-block {
  background: linear-gradient(90deg, var(--line) 25%, rgba(255,255,255,.55) 37%, var(--line) 63%);
  background-size: 938px 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: 12px;
}
body[data-theme="dark"] .skeleton, body[data-theme="dark"] .skel-block {
  background: linear-gradient(90deg, #20243a 25%, #2a2f4a 37%, #20243a 63%);
  background-size: 938px 100%;
}

@media (prefers-reduced-motion: reduce) {
  #pageRoot.page-enter > *, .empty-state, .toast { animation: none; }
  .metric-card, .compact-card, .event-card, .nav-item, .primary-action { transition: none; }
}

/* ===================== HBBA visual identity ===================== */
/* Display face on the headlines that carry the brand voice */
.auth-hero h1, #pageTitle, .auth-panel h2, .page-head h1, .brand-tag {
  font-family: var(--display);
}
.auth-hero h1 { letter-spacing: -0.03em; line-height: 1.05; font-weight: 800; }
#pageTitle, .page-head h1 { letter-spacing: -0.02em; font-weight: 800; }
.auth-panel h2 { letter-spacing: -0.015em; font-weight: 700; }

/* Eyebrows pick up the navy; a small gold square echoes the logo mark */
.eyebrow { color: var(--purple); letter-spacing: .14em; font-weight: 700; }
.page-head .eyebrow::before {
  content: ""; display: inline-block; width: 9px; height: 9px;
  background: var(--gold); border-radius: 2px; margin-right: 9px; vertical-align: middle;
}
.brand-tag { color: var(--gold) !important; letter-spacing: .12em; }

/* Quieter, more premium depth + roundness */
.card, .metric-card, .compact-card, .event-card, .auth-panel { border-radius: 16px; }
.primary-action, .auth-submit { box-shadow: 0 10px 22px -10px rgba(31, 58, 115, .55); }
.metric-card:hover, .compact-card:hover, .event-card:hover {
  box-shadow: 0 16px 34px -14px rgba(31, 58, 115, .30);
}
/* Gold accent on the active nav item instead of flat purple bar */
.nav-item.is-active { box-shadow: inset 3px 0 0 var(--gold); }

/* ===================== Invoice document ===================== */
.invoice-doc { color: var(--text); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid var(--purple); margin-bottom: 18px; }
.inv-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; font-size: 14px; }
.inv-table th { text-align: left; }
.inv-totals { margin: 16px 0 0 auto; width: 280px; display: grid; gap: 7px; font-size: 14px; }
.inv-totals > div { display: flex; justify-content: space-between; }
.inv-totals .grand { border-top: 1px solid var(--line); padding-top: 9px; font-size: 18px; }
.inv-notes { margin-top: 16px; font-size: 13px; }
.inv-item input { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); }
#invTotals strong { font-size: 17px; }

@media print {
  body * { visibility: hidden !important; }
  #modalOverlay, #modalOverlay * { visibility: visible !important; }
  #modalOverlay { position: absolute; inset: 0; background: #fff; display: block !important; }
  #modalOverlay .modal { box-shadow: none; max-width: 100%; width: 100%; border: 0; }
  #modalOverlay .modal-head, #modalOverlay .modal-foot { display: none !important; }
}

/* rows hidden by the search box or a filter chip */
.filtered-out { display: none !important; }

/* Event with no artwork: keep the card layout without a broken image. */
.event-thumb-empty {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, var(--line), rgba(31, 58, 115, 0.12));
}

/* ===================== Campaigns ===================== */

/* The message is the point of the form, so give it room that does not collapse.
   Scoped through .modal-body to outrank the generic textarea rule above. */
.modal-body textarea.campaign-message {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.campaign-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.consent-row input {
  width: auto;
  margin: 0;
}

@media (max-width: 480px) {
  /* Stack the row actions rather than squeezing them off the edge. */
  .campaign-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .modal-body textarea.campaign-message {
    min-height: 120px;
  }
}

/* ===================== IDENTITY ===================== */

/* Somebody who has not uploaded a picture gets their initials, never a stock
   photo of a stranger. */
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}

#profilePic {
  display: inline-flex;
  flex: 0 0 auto;
}

/* ===================== INVOICE BUILDER ===================== */

/* Form on the left, the document's figures on the right, so the effect of an
   edit is visible without leaving the page. */
.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.builder-grid > div > .card {
  margin-bottom: 18px;
}

.inv-preview-card {
  position: sticky;
  top: 18px;
}

.inv-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.inv-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  color: #fff;
}

.table.builder-items th {
  white-space: nowrap;
}

.table.builder-items td {
  vertical-align: top;
  padding: 10px 8px;
}

.table.builder-items input,
.table.builder-items select {
  width: 100%;
  min-width: 0;
}

.table.builder-items td:nth-child(2) { width: 120px; }
.table.builder-items td:nth-child(3) { width: 78px; }
.table.builder-items td:nth-child(4) { width: 110px; }

@media (max-width: 1060px) {
  .builder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .inv-preview-card {
    position: static;
  }
}
