@font-face {
  font-family: "Exo 2";
  src: url("./exo2.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}
:root {
  font: 16px/1.5 "Exo 2", system-ui, sans-serif;
  color-scheme: light;
  color: #313534;
  background: #F6F6F6;
  --surface: #F6F6F6;
  --card: #FFFFFF;
  --lime: #89FB8A;
  --wash: #F4FFF5;
  --mint: #D3FCD7;
  --green: #2E5541;
  --leaf: #377652;
  --sage: #587B69;
  --ink: #313534;
  --silver: #E1E3EC;
  --muted: #54615B;
  --shadow: 0 12px 32px #2E55410D, 0 2px 5px #31353406;
  --radius: 18px;
}
.crm, .portal-workspace, .portal-auth, .portal-entry {
  background: radial-gradient(ellipse at 96% -8%, #D3FCD770, transparent 37%), var(--surface);
  color: var(--ink);
}
.crm .shell { grid-template-columns: 12.5rem minmax(0,1fr); }
.crm .shell aside {
  color: var(--ink); background: var(--card);
  border-right: 1px solid var(--silver); box-shadow: none;
}
.crm .brand { height: 90px; justify-content: center; border-color: var(--silver); }
.crm .brand img { width: 128px; height: 73px; }
.crm .departments { padding: 18px 12px; gap: 7px; }
.crm .departments a { padding: 10px 11px; font-weight: 400; color: var(--ink); }
.crm .departments a:hover, .crm .departments a:focus-visible { background: var(--wash); color: var(--green); }
.crm .departments a[aria-current=page] {
  background: linear-gradient(105deg,var(--mint),var(--wash));
  border-color: var(--mint); box-shadow: inset 3px 0 var(--lime); color: var(--green);
}
.crm .toolbar { background: #FFFFFFE8; border-color: var(--silver); backdrop-filter: blur(14px); }
.crm .toolbar #nav-toggle { color: var(--green); border-radius: 12px; }
.crm .toolbar #finder > summary, .crm .toolbar .profile > summary {
  padding: .42rem .75rem; border-radius: 999px; background: var(--card); border: 1px solid var(--silver);
}
.crm #workspace { max-width: 1560px; padding: clamp(18px,3vw,44px) clamp(16px,3vw,44px) 90px; }
.crm h1, .portal-workspace h1, .portal-entry h1, .portal-auth h1 {
  color: var(--ink); letter-spacing: -.042em; font-weight: 600;
}
.crm h1 { margin-bottom: clamp(14px,2vw,27px); font-size: clamp(1.95rem,3.2vw,3rem); }
.crm h2, .crm h3, .portal-workspace h2 { font-weight: 500; color: var(--ink); letter-spacing: -.03em; }
.crm .metric-area { padding: 0; border: 0; box-shadow: none; background: transparent; margin-bottom: 17px; }
.metric-head h2 { margin: 0; }
.crm .metrics { grid-template-columns: repeat(auto-fit,minmax(min(100%,156px),1fr)); gap: 12px; }
.crm .metric {
  position: relative; padding: 13px 15px 15px; background: linear-gradient(150deg,var(--card) 48%,var(--wash));
  border-color: var(--silver); box-shadow: var(--shadow);
}
.crm .metric span { color: var(--muted); font-weight: 400; font-size: .82rem; }
.crm .metric strong { color: var(--ink); font-size: clamp(1.25rem,2.5vw,1.8rem); font-weight: 600; overflow-wrap: anywhere; }
.crm .metric::after { content: ""; display: block; height: 3px; width: 26px; margin-top: 8px; border-radius: 99px; background: var(--lime); }
.crm .panel, .portal-workspace .panel, .crm .subcenter { border-color: var(--silver); box-shadow: var(--shadow); border-radius: var(--radius); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 15px; }
.dashboard-grid > div { min-width: 0; }
.dashboard-grid .panel, .plots .panel { padding: clamp(14px, 2vw, 23px); margin-bottom: 14px; }
.dashboard-primary .insight-panel { background: linear-gradient(170deg, var(--card) 60%, var(--wash)); }
.insight-body.with-dial { display: grid; grid-template-columns: minmax(105px, .8fr) minmax(0, 1.4fr); gap: clamp(10px,2vw,23px); align-items: center; }
.progress-dial { position: relative; max-width: 170px; width: 100%; aspect-ratio: 1; justify-self: center; }
.progress-dial svg { width: 100%; height: auto; transform: rotate(-90deg); }
.progress-dial circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.dial-track { stroke: var(--silver); stroke-dasharray: 1 1.6; }
.dial-fill { stroke: var(--leaf); }
.progress-dial > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.25; }
.progress-dial strong { font-size: clamp(1.5rem,3vw,2.5rem); font-weight: 600; letter-spacing: -.06em; }
.progress-dial small { font-size: .68rem; }
.insight-list { display: grid; gap: 10px; }
.insight-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; align-items: baseline; padding: 4px 6px; border-radius: 7px; font-size: .82rem; }
.insight-row:hover { background: var(--wash); }
.insight-row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.insight-track { height: 8px; border-radius: 4px; grid-column: 1/-1; overflow: hidden; background: repeating-linear-gradient(90deg,var(--silver) 0,var(--silver) 13px,var(--card) 13px,var(--card) 15px); }
.insight-track svg { display: block; width: 100%; height: 100%; }
.insight-fill { fill: var(--lime); transform-origin: left; animation: chart-reveal .55s cubic-bezier(.18,.7,.3,1) both; }
@keyframes chart-reveal { from { transform: scaleX(0); } }
.workspace-launch h2 { margin: 12px 0 8px; }
.crm .workspace-launch .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.crm .card-grid .department-card { display: flex; gap: 10px; padding: 11px; border: 1px solid var(--silver); }
.crm .department-card h2 { margin: 0; line-height: 1.2; }
.crm .department-card small { display: block; margin-top: 3px; color: var(--muted); }
.glyph-chip { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; color: var(--green); background: linear-gradient(140deg,var(--mint),var(--wash)); }
.workspace-glyph { width: 20px; height: 20px; }
.crm .subcenters { grid-template-columns: repeat(auto-fit,minmax(min(100%,248px),1fr)); gap: 12px; }
.crm .subcenter[open] { grid-column: 1 / -1; }
.crm .subcenter { background: var(--card); }
.crm .subcenter > summary { padding: 14px; align-items: flex-start; }
.subcenter-caption { display: grid; min-width: 0; gap: 3px; }
.subcenter-caption strong { font-weight: 600; }
.subcenter-caption small { font-weight: 300; }
.crm .subcenter-modules { gap: 6px; padding: 2px 12px 12px; }
.crm .subcenter-module { border: 0; border-top: 1px solid var(--silver); border-radius: 0; background: transparent; }
.crm .subcenter-module > summary { color: var(--green); font-weight: 600; padding: 10px; }
.crm .billing-area { margin-top: 22px; }
.crm .billing-row { display: block; margin-top: 5px; background: var(--wash); border: 1px solid var(--silver); border-radius: 12px; padding: 8px 12px; }
.crm .record-collection tr:not([hidden]) { border-radius: 15px; box-shadow: var(--shadow); border-color: var(--silver); }
.crm .record-collection td[data-card-field] .open-record, .crm .record-collection td[data-card-field$="_cents"] { font-weight: 600; }
.crm .record-collection td[data-card-field=status]>div,.crm .record-collection td[data-card-field=active]>div { background: var(--mint); color: var(--green); }
.crm input, .crm select, .crm textarea, .portal-workspace input, .portal-workspace textarea, .portal-workspace select, .portal-auth input { border-color: #AAB6AF; border-radius: 10px; }
.crm .document-actions a:first-child { background: var(--mint); border-color: #A3DCAF; color: var(--green); }

.portal-workspace .layout { max-width: 1160px; }
.portal-workspace .top { background: #FFFFFFE8; }
.portal-workspace .client-mini-grid a { background: var(--wash); }
.portal-auth main { width: min(calc(100% - 2rem), 34rem); margin: clamp(18px,7vw,76px) auto 1.35rem; padding: clamp(18px,5vw,38px); background: var(--card); border: 1px solid var(--silver); border-radius: 24px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.portal-auth .brand { width: 120px; height: auto; display: block; }
.portal-auth nav, .business-contacts { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.business-contacts { max-width: 1160px; margin: 0 auto; padding: 1.15rem 1rem; justify-content: center; font-size: .875rem; color: var(--muted); }
.business-contacts a { text-underline-offset: 3px; }
.crm [aria-busy=true], .portal-workspace [aria-busy=true] { opacity: .74; cursor: progress; }
.crm .shell .surface, .portal-workspace main, .portal-auth main, .portal-entry main { animation: studio-enter .28s ease-out both; }
.crm details[open] > .subcenter-modules, .crm details[open] > .row-action-content,
.crm #finder[open]>div,.crm .profile[open]>div { animation: studio-enter .2s ease-out both; }
@keyframes studio-enter { from { opacity: 0; transform: translateY(5px); } }
@media (hover:hover) {
  .crm .metric, .crm .subcenter, .portal-entry .portal { transition: transform .18s ease, box-shadow .18s ease; }
  .crm .metric:hover, .crm .subcenter:not([open]):hover, .portal-entry .portal:hover { transform: translateY(-2px); box-shadow: 0 15px 34px #2E55411B; }
}
.crm :is(button,a,summary):active, .portal-entry .portal:active { transform: translateY(1px); }
@media(max-width:900px){ .crm .shell,.crm.collapsed .shell { grid-template-columns:minmax(0,1fr); } }
@media(max-width:680px){
  .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .crm .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap: 9px; }
  .crm .workspace-launch .card-grid { gap: 8px; }
  .crm .card-grid .department-card { flex-direction: column; align-items: flex-start; }
  .crm :is(.toolbar button,.toolbar summary,.document-actions a) { min-height: 44px; }
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.business-contacts a { color: var(--green); }
.chart-day { border-radius: 12px; background: var(--wash); }
.chart-day[aria-pressed=true] { border-color: var(--leaf); background: var(--mint); }
.chart-meter meter { height: 13px; }
.chart-meter meter::-webkit-meter-bar { border: 0; border-radius: 99px; background: var(--silver); }
.chart-meter meter::-webkit-meter-optimum-value { border-radius: 99px; background: linear-gradient(90deg,var(--mint),var(--lime)); }
.chart-meter meter::-moz-meter-bar { border-radius: 99px; background: linear-gradient(90deg,var(--mint),var(--lime)); }
.crm .metric, .portal-entry .portal.admin { background-size: 145% 145%; }
@media(hover:hover){
  .crm .metric:hover,.portal-entry .portal.admin:hover { background-position: 100% 100%; }
}
@media(prefers-reduced-motion:no-preference){
  .crm .metric,.portal-entry .portal.admin { transition: background-position .36s ease,transform .18s ease,box-shadow .18s ease; }
}

/* Shared brand and command surfaces. */
.crm {
  --header-height: 68px;
  --rail-width: 12.5rem;
}
.crm .toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: var(--header-height);
  gap: clamp(7px, 1.5vw, 19px);
  padding-inline: clamp(9px, 2vw, 28px);
  background: #FFFFFFE8;
  box-shadow: 0 5px 26px #2E554109;
  backdrop-filter: saturate(1.2) blur(17px);
}
.crm .shell { min-height: calc(100dvh - var(--header-height)); grid-template-columns: var(--rail-width) minmax(0, 1fr); }
.crm .shell aside { top: var(--header-height); height: calc(100dvh - var(--header-height)); }
.crm .toolbar-brand, .portal-workspace .top > a, .portal-entry .brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.02;
}
.crm .toolbar > .toolbar-brand { font-size: 1.2rem; font-weight: 600; min-width: 0; }
.crm .toolbar-brand img, .portal-workspace .top > a img, .portal-entry .brand img {
  width: 76px;
  height: 52px;
  object-fit: contain;
  flex: none;
}
.crm .toolbar-brand small, .portal-workspace .top > a small, .portal-entry .brand small {
  display: block;
  margin-top: .25rem;
  color: var(--green);
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .02em;
}
.crm .toolbar-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.crm .toolbar :is(#nav-toggle, details > summary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  min-width: 42px;
  min-height: 42px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 1px solid var(--silver);
  border-radius: 13px;
  color: var(--green);
  background: #FFFFFFC9;
  list-style: none;
  font-weight: 500;
}
.crm .toolbar :is(#nav-toggle, details > summary):hover, .crm .toolbar details[open] > summary {
  background: var(--wash);
  border-color: #B5D9BF;
  box-shadow: 0 4px 12px #2E554112;
}
.crm .toolbar summary::-webkit-details-marker { display: none; }
.crm .toolbar #finder > summary { min-width: 155px; justify-content: flex-start; padding: 0 13px; }
.crm .toolbar .profile > summary { padding: 0; }
.crm .toolbar .agent-monitor { position: relative; inset: auto; z-index: auto; max-width: none; padding: 0; border: 0; box-shadow: none; background: transparent; }
.crm .agent-signal { position: absolute; width: 6px; height: 6px; top: 8px; right: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1px var(--sage); }
.crm .toolbar .toolbar-popover {
  position: absolute;
  inset: calc(100% + 10px) 0 auto auto;
  width: min(21rem, calc(100vw - 24px));
  max-height: min(65dvh, 450px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--silver);
  border-radius: 17px;
  background: #FFFFFFFA;
  box-shadow: 0 16px 40px #2E554120;
  backdrop-filter: blur(17px);
}
.crm .toolbar .toolbar-popover h2 { margin-bottom: .35rem; }
.crm .toolbar .toolbar-popover a { display: inline-flex; align-items: center; min-height: 32px; }
.crm .toolbar .toolbar-popover ul { list-style: none; padding: 0; margin: .2rem 0; }
.crm .toolbar .toolbar-popover li + li { border-top: 1px solid var(--silver); }
.crm .toolbar .toolbar-popover li { padding-block: .35rem; overflow-wrap: anywhere; }
.crm .toolbar :is(#notification-detail,#monitor-detail) { margin: .3rem 0; font-size: .9rem; color: var(--muted); }
.crm .toolbar .toolbar-popover p { margin: 0; }
.crm .toolbar details[open] > .toolbar-popover { animation: studio-enter .2s ease-out both; }
.crm .toolbar #finder input { margin-bottom: .45rem; }
.crm .toolbar .profile form { margin: .45rem 0 0; }
.crm .departments { padding-top: 13px; }
.crm .dashboard-grid { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 14px; align-items: start; }
.crm .dashboard-grid:has(> .dashboard-aside:empty) { grid-template-columns: minmax(0,1fr); }
.crm .dashboard-grid > .dashboard-aside:empty { display: none; }
.crm .dashboard-primary .insight-panel { min-height: 220px; background: linear-gradient(125deg,var(--card) 66%,var(--wash)); }
.crm .insight-panel h2 { font-weight: 500; }
.crm .metric-area { margin-top: 3px; }
.crm .work-grid { margin-top: 10px; }
.crm .metric[data-key] strong, .crm .insight-panel strong { font-weight: 600; }
.crm .subcenter-caption small, .crm .department-card small, .portal-entry .portal span, .portal-entry .intro p { font-weight: 300; }
.crm :is(button,summary,.document-actions a), .portal-workspace button, .portal-auth button { font-weight: 500; }
.crm .metric-head details > div { border-radius: 15px; }
.portal-entry .brand { display: flex; justify-content: flex-start; padding: 9px max(16px, calc((100vw - 52rem) / 2)); border-bottom: 1px solid var(--silver); background: #FFFFFFD9; }
.portal-entry .brand span, .portal-workspace .top > a span { font-weight: 600; }
.portal-workspace .top { position: sticky; top: 0; z-index: 3; padding-block: 8px; backdrop-filter: blur(14px); }
.portal-workspace .top-actions { gap: .55rem; }
.portal-workspace .top-actions button { border-radius: 12px; }
.portal-entry .portal { box-shadow: 0 12px 31px #2E55410E; }
.portal-entry .portal:hover { border-color: #B5D9BF; }
.crm :is(.subcenter-module,.panel[id]) { scroll-margin-top: calc(var(--header-height) + 10px); }
@media(max-width: 900px) {
  .crm { --header-height: 61px; }
  .crm .shell, .crm.collapsed .shell { grid-template-columns: minmax(0,1fr); }
  .crm.mobile-nav aside { top: var(--header-height); height: calc(100dvh - var(--header-height)); z-index: 10; }
}
@media(max-width: 720px) {
  .crm .toolbar #finder > summary { min-width: 44px; justify-content: center; padding: 0; }
  .crm .toolbar #finder > summary span { display: none; }
  .crm .toolbar :is(#nav-toggle, details > summary) { min-width: 44px; min-height: 44px; }
  .crm .toolbar .toolbar-popover, .crm .toolbar #finder > div { position: fixed; inset: calc(var(--header-height) + 6px) 8px auto auto; }
  .crm .toolbar { gap: 6px; padding-inline: 7px; }
  .crm .toolbar-brand img { width: 43px; height: 38px; }
  .portal-workspace .top > a img { width: 54px; height: 41px; }
  .crm .toolbar-brand .full-brand-prefix { display: none; }
  .crm .toolbar-brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crm .toolbar > .toolbar-brand { gap: 5px; font-size: .95rem; }
  .crm .toolbar-brand small { font-size: .58rem; }
  .crm .toolbar-controls { gap: 3px; }
  .crm .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
}
@media(max-width: 380px) {
  .crm .toolbar-brand > span { display: none; }
  .portal-workspace .top > a span { font-size: .86rem; }
  .portal-workspace .top-actions a { font-size: .81rem; }
}
@media(prefers-reduced-motion:no-preference) {
  .dial-fill { animation: dial-rise .55s ease-out; }
  @keyframes dial-rise { from { stroke-dasharray: 0 100; } }
}

.crm .toolbar .signed-in-account { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.crm button.insight-row {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  border-radius: 9px;
}
.crm button.insight-row:hover, .crm button.insight-row[aria-pressed=true] { background: var(--wash); border-color: var(--mint); }
@media(prefers-reduced-motion:no-preference){ .dial-fill { transition: stroke-dasharray .32s ease; } }
