:root {
  --ink: #171a18;
  --muted: #6f746e;
  --faint: #a4aaa2;
  --line: #e1e4dd;
  --paper: #f4f5ef;
  --surface: #ffffff;
  --sidebar: #151916;
  --sidebar-muted: #959c94;
  --lime: #c7f36b;
  --lime-deep: #8ab934;
  --violet: #c9bdff;
  --sky: #b8dff1;
  --sand: #ead8bc;
  --coral: #ef9e82;
  --success: #367c45;
  --danger: #b65748;
  --radius-lg: 22px;
  --radius-md: 15px;
  --shadow: 0 12px 38px rgba(28, 34, 28, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(126, 166, 54, 0.32);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: 256px;
  flex-direction: column;
  padding: 26px 18px 18px;
  color: #f7f8f4;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
  color: #fff;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--lime);
  transform: rotate(-4deg);
}

.brand-mark span {
  position: absolute;
  width: 5px;
  border-radius: 5px;
  background: var(--ink);
  transform: rotate(24deg);
}

.brand-mark span:nth-child(1) { height: 14px; transform: translateX(-7px) rotate(24deg); }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 11px; transform: translateX(7px) rotate(24deg); }

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-label {
  margin: 8px 12px 10px;
  color: #666e66;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 13px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 580;
  text-decoration: none;
  transition: 160ms ease;
}

.nav-link svg {
  width: 18px;
  fill: currentColor;
  stroke: none;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-link.active {
  color: #111510;
  background: var(--lime);
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 9px;
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
  text-align: center;
}

.nav-link.active .nav-count {
  background: rgba(20, 25, 20, 0.12);
}

.sidebar-bottom {
  margin-top: auto;
}

.capacity-card {
  margin: 18px 5px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.capacity-head {
  display: flex;
  justify-content: space-between;
  color: #c5cbc4;
  font-size: 11px;
}

.capacity-head strong {
  color: var(--lime);
}

.meter {
  height: 5px;
  margin: 12px 0 9px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
}

.capacity-card p {
  margin: 0;
  color: #6f776f;
  font-size: 10px;
}

.profile-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 11px 9px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.profile-button > svg {
  width: 16px;
  margin-left: auto;
  color: #687068;
}

.avatar {
  display: inline-grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #34352f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.avatar-sand { background: var(--sand); }
.avatar-violet { background: var(--violet); }
.avatar-sky { background: var(--sky); }
.avatar-coral { background: var(--coral); }
.avatar-lime { background: var(--lime); }

.profile-copy {
  display: grid;
}

.profile-copy strong {
  font-size: 11px;
  font-weight: 650;
}

.profile-copy small {
  color: #7d847d;
  font-size: 9px;
}

.main-content {
  min-width: 0;
  margin-left: 256px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 54px);
  border-bottom: 1px solid rgba(215, 219, 211, 0.85);
  background: rgba(244, 245, 239, 0.9);
  backdrop-filter: blur(14px);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 570;
}

.status-pill > span,
.chat-agent small span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #63af63;
  box-shadow: 0 0 0 4px rgba(99, 175, 99, 0.13);
}

.topbar-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button,
.icon-button,
.text-button,
.panel-footer-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button svg {
  width: 16px;
}

.button-primary {
  color: #151a14;
  background: var(--lime);
  box-shadow: 0 5px 14px rgba(121, 155, 61, 0.16);
}

.button-primary:hover { background: #d1fa7c; }

.button-dark {
  color: #fff;
  background: var(--ink);
}

.button-ghost {
  border: 1px solid var(--line);
  color: #4f554f;
  background: rgba(255, 255, 255, 0.55);
}

.icon-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #5b615b;
  background: transparent;
}

.icon-button:hover { background: rgba(22, 26, 23, 0.06); }
.icon-button-small { width: 34px; height: 34px; border: 1px solid var(--line); }
.icon-button-small svg { width: 16px; }
.icon-button-inverse { color: #bbc2bb; }
.icon-button-inverse:hover { background: rgba(255, 255, 255, 0.08); }

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: #d7745f;
}

.mobile-menu {
  display: none;
}

.content-wrap {
  width: 100%;
  max-width: 1510px;
  margin: 0 auto;
  padding: 43px clamp(22px, 4vw, 54px) 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: #858b84;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-subtitle strong {
  color: var(--ink);
  font-weight: 690;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.18fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 39px;
}

.metric-card {
  position: relative;
  min-height: 171px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid #e3e6df;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(24, 29, 25, 0.025);
}

.metric-dark {
  color: #fff;
  border-color: #202621;
  background: #1b211d;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.metric-dark .metric-top { color: #929a92; }

.trend {
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 760;
}

.trend-positive {
  color: var(--success);
  background: #edf7e8;
}

.metric-dark .trend-positive {
  color: var(--lime);
  background: rgba(199, 243, 107, 0.1);
}

.trend-negative {
  color: var(--danger);
  background: #fbefec;
}

.metric-value {
  display: block;
  margin-top: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.metric-note {
  margin: 22px 0 0;
  color: #9a9f99;
  font-size: 9px;
}

.metric-note b { color: #565c56; }

.metric-icon {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 9px;
}

.metric-icon svg { width: 16px; }
.icon-lime { background: #e7f8c6; }
.icon-violet { background: #eeeaff; }
.icon-sky { background: #e4f4fa; }

.mini-chart {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 55px;
  opacity: 0.9;
}

.mini-chart svg { width: 100%; height: 100%; }
.mini-chart .chart-fill { fill: url("#none"); stroke: none; fill: rgba(199, 243, 107, 0.09); }
.mini-chart .chart-line { fill: none; stroke: var(--lime); stroke-width: 2; vector-effect: non-scaling-stroke; }

.section-block {
  margin-bottom: 38px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading { margin-bottom: 15px; }

.text-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: #747a74;
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}

.text-button:hover { color: var(--ink); }

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.workflow-card {
  position: relative;
  min-height: 198px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #e2e5de;
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.workflow-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.workflow-card.paused { opacity: 0.66; }

.workflow-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.workflow-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
}

.workflow-icon svg { width: 18px; }

.toggle {
  position: relative;
  width: 34px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #d8dcd5;
  cursor: pointer;
  transition: 150ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: 150ms ease;
}

.toggle.active { background: #79a930; }
.toggle.active::after { transform: translateX(15px); }

.workflow-card h3 {
  margin: 18px 0 4px;
  font-size: 12px;
  font-weight: 720;
}

.workflow-card p {
  min-height: 31px;
  margin: 0;
  color: #8a9089;
  font-size: 9px;
}

.workflow-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #eef0eb;
  color: #9da29c;
  font-size: 9px;
}

.workflow-meta strong { color: #515751; }

.run-workflow {
  padding: 3px 7px;
  border: 0;
  border-radius: 7px;
  color: #596058;
  background: #f2f4ef;
  font-size: 9px;
  cursor: pointer;
}

.run-workflow:hover { color: #172016; background: var(--lime); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid #e2e5de;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel-heading { margin-bottom: 19px; }

.segmented-control {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #f1f3ee;
}

.segmented-control button {
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  color: #999e98;
  background: transparent;
  font-size: 9px;
  font-weight: 680;
  cursor: pointer;
}

.segmented-control button.active {
  color: #333833;
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 27, 23, 0.08);
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.search-box {
  display: flex;
  width: min(260px, 70%);
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #e5e8e1;
  border-radius: 9px;
  background: #fafbf8;
}

.search-box svg { width: 14px; color: #9ca19b; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #a4aaa3; }
.result-count { margin-left: auto; color: #a1a69f; font-size: 9px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  padding: 9px 8px;
  color: #a0a59f;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 11px 8px;
  border-top: 1px solid #eef0eb;
  color: #777d76;
  font-size: 9px;
}

.lead-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lead-person .avatar { width: 29px; height: 29px; font-size: 8px; }
.lead-person div { display: grid; }
.lead-person strong { color: #363b36; font-size: 10px; }
.lead-person small { color: #a0a59f; font-size: 8px; }

.tag {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 8px;
  font-weight: 720;
  text-transform: capitalize;
}

.tag-hot { color: #9c493c; background: #fbe9e4; }
.tag-warm { color: #8c6d20; background: #fbf3d8; }
.tag-new { color: #546d91; background: #e9f0fa; }
.tag-qualified { color: #397046; background: #e8f5e9; }
.tag-contacted { color: #68608f; background: #efecfb; }
.tag-nurturing { color: #82612e; background: #f7f0e4; }

.more-button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #9ba09a;
  background: transparent;
  cursor: pointer;
}

.more-button:hover { color: #222722; background: #f0f2ed; }

.empty-row td {
  padding: 30px;
  color: #999f98;
  text-align: center;
}

.panel-footer-button {
  width: 100%;
  margin-top: 9px;
  padding: 10px;
  border-top: 1px solid #eef0eb;
  color: #777d76;
  background: transparent;
  font-size: 9px;
  font-weight: 650;
}

.panel-footer-button:hover { color: var(--ink); }

.date-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 18px;
}

.date-button {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 3px;
  border: 0;
  border-radius: 9px;
  color: #a0a59f;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.date-button strong { color: #545a54; font-size: 11px; }
.date-button.active { color: #405322; background: var(--lime); }
.date-button.active strong { color: #172015; }

.appointment-list {
  min-height: 263px;
}

.appointment-item {
  position: relative;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #eef0eb;
}

.appointment-item:first-child { border-top: 0; }
.appointment-item::before { content: ""; position: absolute; left: -22px; width: 3px; height: 28px; border-radius: 3px; background: var(--appointment-color, var(--lime)); }
.appointment-time { color: #727872; font-size: 9px; font-weight: 680; }
.appointment-detail { display: grid; min-width: 0; }
.appointment-detail strong { overflow: hidden; color: #3e433e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.appointment-detail small { color: #a0a59f; font-size: 8px; }

.appointment-action {
  padding: 4px 7px;
  border: 1px solid #e5e8e1;
  border-radius: 7px;
  color: #7e847e;
  background: #fff;
  font-size: 8px;
  cursor: pointer;
}

.appointment-action:hover { border-color: var(--lime-deep); color: #3b4c22; }
.appointment-action.complete { color: var(--success); background: #eff7ed; }
.appointment-empty { padding: 70px 20px; color: #9aa099; font-size: 10px; text-align: center; }

.lower-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.select-control {
  padding: 7px 27px 7px 9px;
  border: 1px solid #e4e7e0;
  border-radius: 8px;
  color: #777d76;
  background: #fff;
  font-size: 9px;
}

.activity-list { min-height: 310px; }

.activity-item {
  display: grid;
  grid-template-columns: 29px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid #eef0eb;
}

.activity-item:first-child { border-top: 0; }

.activity-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  color: #505650;
  background: #edf0e9;
}

.activity-icon svg { width: 13px; }
.activity-copy { display: grid; }
.activity-copy strong { color: #4a504a; font-size: 9px; font-weight: 650; }
.activity-copy small { color: #9ea39d; font-size: 8px; }
.activity-time { color: #a5aaa4; font-size: 8px; }
.activity-empty { padding: 80px 20px; color: #999f98; font-size: 10px; text-align: center; }

.chat-panel {
  display: flex;
  min-height: 414px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #252b26;
  border-radius: var(--radius-lg);
  color: #fff;
  background: #1a1f1b;
  box-shadow: 0 14px 38px rgba(20, 25, 21, 0.12);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-agent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-orb {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: var(--lime);
}

.agent-orb::before,
.agent-orb::after,
.agent-orb i {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 3px;
  background: #182016;
}

.agent-orb::before { height: 9px; transform: translateX(-6px); }
.agent-orb i { height: 15px; }
.agent-orb::after { height: 6px; transform: translateX(6px); }
.chat-agent div { display: grid; }
.chat-agent strong { font-size: 11px; }
.chat-agent small { display: flex; align-items: center; gap: 6px; color: #7f887f; font-size: 8px; }
.chat-agent small span { width: 5px; height: 5px; box-shadow: none; }

.chat-messages {
  display: flex;
  min-height: 196px;
  max-height: 250px;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 17px 18px 8px;
  scrollbar-width: thin;
  scrollbar-color: #3f4740 transparent;
}

.message {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  color: #c9cfc9;
  background: #282e29;
  font-size: 9px;
  line-height: 1.55;
  animation: message-in 220ms ease;
}

.message.user {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  color: #1a2018;
  background: var(--lime);
}

.message strong { color: #fff; }
.message.user strong { color: inherit; }

@keyframes message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.typing-indicator {
  display: flex;
  width: 42px;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 12px 12px 12px 4px;
  background: #282e29;
}

.typing-indicator span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #838c83;
  animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 150ms; }
.typing-indicator span:nth-child(3) { animation-delay: 300ms; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-3px); }
}

.quick-prompts {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 18px;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar { display: none; }

.quick-prompts button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #3a423b;
  border-radius: 20px;
  color: #929b92;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.quick-prompts button:hover { border-color: #778d52; color: var(--lime); }

.chat-form {
  display: flex;
  gap: 8px;
  margin: 3px 17px 17px;
  padding: 5px 5px 5px 12px;
  border: 1px solid #394039;
  border-radius: 12px;
  background: #222823;
}

.chat-form:focus-within { border-color: #66823c; }

.chat-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #eef0ec;
  background: transparent;
  font-size: 9px;
}

.chat-form input::placeholder { color: #697169; }

.chat-form button {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #182016;
  background: var(--lime);
  cursor: pointer;
}

.chat-form button:hover { background: #d3fb7e; }
.chat-form button svg { width: 14px; }

.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 17px 2px 0;
  color: #a2a7a1;
  font-size: 8px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 8px;
}

.toast {
  display: flex;
  min-width: 230px;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid #303730;
  border-radius: 11px;
  color: #e9ece8;
  background: #1b211c;
  box-shadow: 0 12px 30px rgba(19, 24, 20, 0.2);
  font-size: 10px;
  animation: toast-in 200ms ease;
}

.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: 200ms ease; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal {
  width: min(500px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(18, 22, 18, 0.24);
}

.modal::backdrop { background: rgba(15, 19, 16, 0.58); backdrop-filter: blur(4px); }

.modal-card {
  padding: 24px;
  border-radius: 20px;
  background: #fff;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #555b55;
  font-size: 10px;
  font-weight: 650;
}

.form-grid input,
.form-grid select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #dfe3db;
  border-radius: 9px;
  outline: 0;
  color: #303530;
  background: #fafbf8;
  font-size: 10px;
}

.form-grid input:focus,
.form-grid select:focus { border-color: var(--lime-deep); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.mobile-overlay { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
  .appointment-list { min-height: auto; }
}

@media (max-width: 820px) {
  .sidebar {
    width: min(285px, 84vw);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .sidebar.open { transform: none; }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(15, 19, 16, 0.44);
    transition: 220ms ease;
  }

  .mobile-overlay.visible { visibility: visible; opacity: 1; }
  .main-content { margin-left: 0; }
  .mobile-menu { display: grid; }
  .status-pill { position: absolute; left: 50%; transform: translateX(-50%); }
  .topbar { padding: 0 18px; }
  .content-wrap { padding: 32px 18px 24px; }
  .hero { align-items: flex-start; }
}

@media (max-width: 620px) {
  .topbar { height: 62px; }
  .status-pill { display: none; }
  .topbar-actions .button { width: 38px; padding: 0; }
  .topbar-actions .button svg { width: 18px; }
  .topbar-actions .button { font-size: 0; }
  .hero { display: block; margin-bottom: 25px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .button { flex: 1; }
  h1 { font-size: 37px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 157px; padding: 17px; border-radius: 16px; }
  .metric-dark { grid-column: 1 / -1; min-height: 164px; }
  .metric-grid .metric-card:last-child { grid-column: 1 / -1; min-height: 142px; }
  .metric-value { font-size: 27px; }
  .workflow-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 7px; }
  .workflow-card { min-width: 82%; scroll-snap-align: start; }
  .panel { padding: 18px 15px; border-radius: 17px; }
  .panel-heading { align-items: flex-start; }
  .leads-panel .panel-heading { display: grid; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none; }
  .lower-grid { margin-top: 9px; }
  .chat-panel { min-height: 430px; border-radius: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-footer { display: grid; gap: 3px; }
  .toast-region { right: 14px; bottom: 14px; left: 14px; }
  .toast { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
