:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #262033;
  background: #f8f7fa;
  font-synthesis: none;
  --muted: #6b6376;
  --line: #e8e3ed;
  --primary: #634394;
  --primary-dark: #4e317b;
  --side: 242px;
  --top: 64px;
  --focus: #9169c3;
  accent-color: var(--primary);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: #e6d7f8; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.5; }
.skip { position: fixed; z-index: 6; top: 12px; left: 12px; padding: 12px; background: #fff; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sidebar { position: fixed; z-index: 3; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 13px; align-items: center; margin: 21px 20px 16px; padding: 3px 5px; }
.brand img { width: 40px; height: 52px; object-fit: contain; }
.brand strong { display: block; font-weight: 700; font-size: 1.42rem; letter-spacing: -.035em; }
.brand small { display: block; color: var(--muted); font-size: .875rem; }
nav { padding: 0 12px; overflow-y: auto; }
.nav-section { margin-bottom: 17px; }
.nav-heading { display: block; margin: 0 12px 6px; color: var(--muted); font-size: .8rem; font-weight: 650; }
nav a { display: flex; gap: 10px; align-items: center; min-height: 41px; padding: 7px 10px; border-radius: 8px; color: #51485d; font-size: .875rem; }
nav a:hover, .quiet:hover { background: #f6f2fa; }
nav a[aria-current] { color: #553481; background: #efe7f8; font-weight: 700; }
nav a svg { width: 18px; height: 18px; }
nav a small { margin-left: auto; min-width: 19px; text-align: center; font-size: .75rem; font-weight: 700; background: #f0eaf5; color: #5e4677; border-radius: 5px; padding: 1px 4px; }
.sidebar-end { margin-top: auto; padding: 12px 15px; border-top: 1px solid var(--line); }
.demo-tag { display: block; margin: 0 7px 7px; color: var(--muted); font-size: .8rem; }
.quiet { display: flex; gap: 10px; align-items: center; border: 0; background: transparent; border-radius: 8px; padding: 8px; color: #51485d; font-size: .875rem; }
.topbar { position: sticky; top: 0; z-index: 2; height: var(--top); margin-left: var(--side); display: flex; align-items: center; gap: 14px; padding-inline: 29px; background: #fff; border-bottom: 1px solid var(--line); }
#breadcrumb { margin-right: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .875rem; }
#breadcrumb b { color: #3c304a; border-left: 1px solid var(--line); padding-left: 12px; font-weight: 650; }
.account-role { border-radius: 6px; background: #eee7f6; color: #583981; font-size: .8rem; font-weight: 700; padding: 5px 8px; }
.icon-button { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 37px; height: 37px; color: #5d506b; }
.icon-button:hover { background: #f5f0fa; }
#mobile-menu { display: none; }
main { margin-left: var(--side); padding: 30px 29px 42px; }
main:focus { outline: none; }
.page-head, .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head { margin-bottom: 20px; }
h1 { font-size: 2.12rem; line-height: 1.15; letter-spacing: -.035em; font-weight: 700; }
.page-head p, .panel-head p { color: var(--muted); margin-top: 5px; }
.panel-head p { font-size: .875rem; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.primary { color: #fff; background: var(--primary); }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #fff; color: #504360; border-color: #ded6e7; }
.secondary:hover, .compact:hover { background: #f3ecf8; }
.compact { color: #59417a; background: transparent; border-color: #e5ddec; min-height: 33px; padding: 5px 9px; }
.demo-notice { display: flex; gap: 9px; align-items: center; background: #f0ebf6; color: #58466b; border: 1px solid #eae1f2; padding: 10px 13px; border-radius: 9px; font-size: .875rem; margin-bottom: 19px; }
.demo-notice svg { width: 17px; height: 17px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 21px; }
.metric { display: flex; gap: 11px; align-items: center; padding: 15px; }
.metric + .metric { border-left: 1px solid var(--line); }
[data-role="professional"] .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric:hover { background: #faf7fc; }
.metric b { display: block; font-size: 1.65rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric small { display: block; color: var(--muted); font-size: .875rem; margin-top: 3px; }
.metric-icon, .priority-icon { display: grid; flex: none; place-items: center; width: 39px; height: 39px; border-radius: 10px; }
.lavender, .info { background: #eee7f8; color: #604087; }
.mint, .success { background: #e7f4ec; color: #266345; }
.blue { background: #e9f0fa; color: #345d8d; }
.amber, .warning { background: #fff1da; color: #80520e; }
.danger { background: #fbebed; color: #92374a; }
.neutral { background: #f0edf2; color: #645b6b; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(295px, 1fr); gap: 17px; align-items: start; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.panel + .panel { margin-top: 16px; }
.panel-head { min-height: 65px; padding: 15px 17px; }
h2 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.text-link { flex: none; color: #64448e; font-weight: 700; font-size: .875rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-scroll { overflow: auto; border-radius: 0 0 13px 13px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th { background: #f8f6fa; color: #61586c; font-weight: 650; white-space: nowrap; }
th, td { padding: 11px 13px; border-top: 1px solid #eeeaf1; }
th:first-child, td:first-child { padding-left: 17px; }
tbody tr:hover { background: #fcfafd; }
td small, .priorities small { display: block; color: var(--muted); margin-top: 3px; font-size: .8rem; }
td .time { font-variant-numeric: tabular-nums; }
.badge { display: inline-block; border-radius: 5px; padding: 4px 7px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.priorities { padding: 0 15px; margin: 0; list-style: none; }
.priorities li { border-top: 1px solid #eeeaf1; padding: 13px 1px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.priorities strong { display: block; font-size: .875rem; }
.priority-icon { width: 33px; height: 33px; }
.priority-icon svg { width: 17px; height: 17px; }
.priority-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.connection { padding: 2px 17px 17px; display: flex; gap: 9px; align-items: flex-start; }
.connection p, .panel-body p { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.panel-body { padding: 0 17px 17px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 0 17px 15px; }
.date-controls { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; }
.date-controls .button { min-height: 39px; }
label { display: grid; gap: 5px; color: #574b62; min-width: 0; font-size: .875rem; font-weight: 650; }
input, select { min-width: 0; max-width: 100%; min-height: 39px; padding: 7px 10px; border: 1px solid #ddd5e5; border-radius: 7px; background: #fff; color: #32283b; font-weight: 400; }
select { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23584869' stroke-width='1.6'/%3E%3C/svg%3E") right 8px center / 16px no-repeat; }
.empty { padding: 21px 17px; color: var(--muted); border-top: 1px solid var(--line); }
.steps { margin: 0; padding: 0 17px; list-style: none; }
.steps li { display: grid; grid-template-columns: minmax(140px, 225px) 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.steps span { color: var(--muted); }
dialog { width: min(490px, calc(100% - 26px)); max-height: calc(100% - 26px); padding: 23px; border: 1px solid var(--line); border-radius: 14px; color: inherit; }
dialog::backdrop { background: #2a1e3c65; }
dialog h2 { font-size: 1.45rem; padding-right: 40px; }
.close { position: absolute; top: 14px; right: 14px; font-size: 1.4rem; line-height: 1; }
.detail-subtitle { color: var(--muted); margin: 4px 0 17px; }
.details-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 15px; }
.details-list dt { color: var(--muted); font-size: .875rem; }
.details-list dd { margin: 2px 0 0; font-weight: 650; }
dialog form:not([method]) { display: grid; gap: 13px; }
dialog form .primary { justify-self: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { color: #92374a; font-size: .875rem; }
.treatment + .treatment { border-top: 1px solid var(--line); padding-top: 13px; }
.treatment h3 { margin-bottom: 8px; }
.history { color: var(--muted); font-size: .875rem; margin: 8px 0 0; padding-left: 20px; }
#presence-form + h3 { margin-top: 18px; }
.toast { position: fixed; z-index: 5; bottom: 16px; right: 16px; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 8px; background: #433358; color: #fff; }
.sidebar-collapsed { --side: 67px; }
.sidebar-collapsed .brand { margin-inline: 8px; }
.sidebar-collapsed .brand span, .sidebar-collapsed nav a span, .sidebar-collapsed nav a small, .sidebar-collapsed .nav-heading, .sidebar-collapsed .demo-tag, .sidebar-collapsed .quiet span { display: none; }
.sidebar-collapsed nav a { justify-content: center; }
@media (min-width: 1540px) {
  main { padding-inline: 40px; }
}
@media (max-width: 1180px) {
  .dashboard { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: start; }
  .dashboard-side .panel { margin: 0; }
}
@media (max-width: 940px) {
  .metric { padding: 12px 9px; gap: 8px; }
  .dashboard-side { display: block; }
  .dashboard-side .panel + .panel { margin-top: 15px; }
}
@media (max-width: 780px) {
  [data-role="professional"] .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar, .sidebar-collapsed .sidebar { display: none; width: 242px; top: var(--top); box-shadow: 6px 8px 20px #34204920; }
  .menu-open .sidebar { display: flex; }
  .sidebar-collapsed .brand { margin-inline: 20px; }
  .sidebar-collapsed .brand span, .sidebar-collapsed nav a span, .sidebar-collapsed nav a small, .sidebar-collapsed .nav-heading, .sidebar-collapsed .demo-tag { display: initial; }
  .sidebar-collapsed .nav-heading { display: block; }
  .sidebar-collapsed nav a { justify-content: flex-start; }
  .sidebar-end .quiet { display: none; }
  #mobile-menu { display: inline-grid; }
  .topbar, main { margin-left: 0; padding-inline: 16px; }
  .topbar { gap: 8px; }
  main { padding-top: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric { padding: 13px; }
  .page-head { align-items: flex-start; }
  h1 { font-size: 1.75rem; }
  .table-scroll table { min-width: 560px; }
}
@media (max-width: 480px) {
  #breadcrumb > span { display: none; }
  #breadcrumb b { border: 0; padding-left: 0; }
  .page-head { flex-wrap: wrap; }
  .page-head .primary { margin-top: 3px; }
  .steps li { grid-template-columns: 1fr; gap: 4px; }
  .priority-actions { grid-column: 2 / 4; justify-content: flex-start; }
}
