:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #faf9fd;
  --text: #25243a;
  --muted: #6f7185;
  --line: #e6e5ed;
  --line-strong: #d8d6e2;
  --purple: #765fb1;
  --purple-strong: #5d4899;
  --purple-soft: #eeeafa;
  --aqua: #62c5cb;
  --aqua-strong: #248d96;
  --aqua-soft: #e5f7f8;
  --rose: #dcaed1;
  --rose-strong: #a65a8f;
  --rose-soft: #faedf7;
  --gold: #d8ac50;
  --gold-soft: #fbf4e5;
  --green: #2f916e;
  --green-soft: #e9f6f1;
  --danger: #bd4d62;
  --danger-soft: #fbecef;
  --shadow: 0 10px 28px rgba(49, 43, 73, 0.07);
  --sidebar-width: 248px;
  --topbar-height: 78px;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(98, 197, 203, 0.28);
  outline-offset: 2px;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  width: 166px;
  height: auto;
}

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 14px;
}

.nav-section-label {
  display: block;
  padding: 8px 12px 3px;
  color: #9a9baa;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6071;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: #f5f3fb;
  color: var(--purple-strong);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.is-active {
  background: var(--purple-soft);
  color: var(--purple-strong);
}

.nav-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--aqua-soft);
  color: var(--aqua-strong);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose-strong);
  box-shadow: 0 0 0 4px var(--rose-soft);
}

.nav-count-warm {
  background: var(--rose-soft);
  color: var(--rose-strong);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.demo-note {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.demo-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 4px var(--aqua-soft);
}

.demo-note strong,
.demo-note span {
  display: block;
}

.demo-note strong {
  font-size: 0.82rem;
}

.demo-note span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.text-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.text-action:hover {
  color: var(--purple-strong);
}

.text-action svg {
  width: 16px;
  height: 16px;
}

.sidebar-scrim {
  display: none;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-title span,
.topbar-title h1 {
  display: block;
  margin: 0;
}

.topbar-title span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin-top: 1px;
  font-size: 1.18rem;
  line-height: 1.25;
}

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

.global-search,
.search-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.global-search {
  width: min(300px, 28vw);
}

.global-search svg,
.search-control svg {
  width: 18px;
  height: 18px;
}

.global-search input,
.search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 60;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}

.search-results button:last-child {
  border-bottom: 0;
}

.search-results button:hover {
  background: var(--surface-soft);
}

.search-results b,
.search-results small {
  display: block;
}

.search-results b {
  font-size: 0.86rem;
}

.search-results small {
  color: var(--muted);
  font-size: 0.74rem;
}

.icon-button {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.notification-button span {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--rose-strong);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}

.profile-chip strong,
.profile-chip span {
  display: block;
}

.profile-chip strong {
  font-size: 0.83rem;
}

.profile-chip span {
  color: var(--muted);
  font-size: 0.72rem;
}

.avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.avatar-small {
  width: 38px;
  height: 38px;
}

.avatar-large {
  width: 62px;
  height: 62px;
  font-size: 1rem;
}

.mobile-menu {
  display: none;
}

.content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.view {
  display: none;
  animation: view-in 220ms ease;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.page-heading h2,
.page-heading p,
.panel-heading h3,
.panel-heading p {
  margin: 0;
}

.page-heading h2 {
  margin-top: 3px;
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  line-height: 1.2;
}

.page-heading > div > p:not(.kicker) {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.94rem;
}

.kicker {
  color: var(--purple);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.heading-actions,
.form-actions-sticky > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.87rem;
  font-weight: 700;
  transition: background 160ms ease, border 160ms ease, transform 160ms ease;
}

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

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  border-color: var(--purple);
  background: var(--purple);
  color: white;
}

.button-primary:hover {
  border-color: var(--purple-strong);
  background: var(--purple-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--purple);
  color: var(--purple-strong);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
}

.button-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.button-danger {
  border-color: #f0ced5;
  background: var(--danger-soft);
  color: var(--danger);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 9px rgba(49, 43, 73, 0.025);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  font-size: 1rem;
}

.panel-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.link-button:hover {
  text-decoration: underline;
}

.link-button svg {
  width: 15px;
  height: 15px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-icon {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
}

.metric-card strong {
  margin-top: 2px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.metric-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.71rem;
}

.metric-aqua .metric-icon { background: var(--aqua-soft); color: var(--aqua-strong); }
.metric-lilac .metric-icon { background: var(--purple-soft); color: var(--purple-strong); }
.metric-rose .metric-icon { background: var(--rose-soft); color: var(--rose-strong); }
.metric-gold .metric-icon { background: var(--gold-soft); color: #967126; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.timeline {
  padding: 8px 20px 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px 4px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-time {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

.timeline-line {
  width: 4px;
  height: 40px;
  border-radius: 8px;
  background: var(--aqua);
}

.timeline-item:nth-child(2) .timeline-line { background: var(--purple); }
.timeline-item:nth-child(3) .timeline-line { background: var(--rose); }
.timeline-item:nth-child(4) .timeline-line { background: var(--gold); }

.timeline-info strong,
.timeline-info span {
  display: block;
}

.timeline-info strong {
  font-size: 0.88rem;
}

.timeline-info span {
  color: var(--muted);
  font-size: 0.74rem;
}

.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-active,
.status-confirmed,
.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.status-evaluation,
.status-draft {
  background: var(--purple-soft);
  color: var(--purple-strong);
}

.status-report,
.status-review,
.status-pending {
  background: var(--gold-soft);
  color: #88651d;
}

.status-pause,
.status-delivered {
  background: var(--rose-soft);
  color: var(--rose-strong);
}

.task-list {
  padding: 8px 18px 15px;
}

.task-item {
  display: grid;
  grid-template-columns: 9px 1fr 18px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 11px 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item:hover strong {
  color: var(--purple-strong);
}

.task-item strong,
.task-item small {
  display: block;
}

.task-item strong {
  font-size: 0.85rem;
}

.task-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.73rem;
}

.task-item > svg {
  width: 17px;
  height: 17px;
  color: #a6a5b2;
}

.task-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.task-marker-rose { background: var(--rose-strong); }
.task-marker-lilac { background: var(--purple); }
.task-marker-aqua { background: var(--aqua-strong); }

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #fbfbfd;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fdfcff;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.person-cell strong,
.person-cell small {
  display: block;
}

.person-cell strong {
  font-size: 0.84rem;
}

.person-cell small {
  color: var(--muted);
  font-size: 0.71rem;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--purple-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.table-action:hover {
  text-decoration: underline;
}

.progress-mini {
  display: flex;
  min-width: 110px;
  align-items: center;
  gap: 8px;
}

.progress-mini span {
  display: block;
  overflow: hidden;
  width: 70px;
  height: 6px;
  border-radius: 8px;
  background: #ecebf1;
}

.progress-mini i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--aqua-strong);
}

.progress-mini b {
  font-size: 0.73rem;
}

.agenda-toolbar-panel {
  margin-bottom: 16px;
  padding: 12px;
}

.agenda-toolbar,
.directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 7px;
  background: #f1f0f5;
}

.segmented button {
  min-width: 58px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
}

.segmented button span,
.segmented button small {
  display: block;
}

.segmented button small {
  font-size: 0.68rem;
  font-weight: 600;
}

.segmented button.is-active {
  background: white;
  color: var(--purple-strong);
  box-shadow: 0 2px 8px rgba(46, 40, 68, 0.08);
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

select,
input,
textarea {
  color: var(--text);
}

.filter-row select,
.plan-patient-bar select {
  min-height: 40px;
  padding: 7px 32px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  font-size: 0.8rem;
}

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 16px;
}

.agenda-list {
  padding: 6px 20px 18px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.agenda-item:last-child {
  border-bottom: 0;
}

.agenda-time strong,
.agenda-time span {
  display: block;
}

.agenda-time strong {
  font-size: 0.9rem;
}

.agenda-time span {
  color: var(--muted);
  font-size: 0.69rem;
}

.agenda-person {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 12px;
  align-items: center;
}

.agenda-accent {
  width: 4px;
  height: 43px;
  border-radius: 6px;
  background: var(--aqua);
}

.agenda-person strong,
.agenda-person span {
  display: block;
}

.agenda-person strong {
  font-size: 0.87rem;
}

.agenda-person span {
  color: var(--muted);
  font-size: 0.74rem;
}

.agenda-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.small-select {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-size: 0.74rem;
}

.agenda-summary {
  align-self: start;
}

.donut-row {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.donut {
  display: flex;
  width: 126px;
  height: 126px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: conic-gradient(var(--aqua) 0 57%, var(--purple) 57% 86%, var(--rose) 86% 100%);
}

.donut::before {
  position: absolute;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: white;
  content: "";
}

.donut span {
  position: relative;
  display: block;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
}

.donut small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

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

.legend span {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.legend b {
  color: var(--text);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-aqua { background: var(--aqua); }
.dot-lilac { background: var(--purple); }
.dot-rose { background: var(--rose-strong); }

.summary-divider {
  height: 1px;
  margin: 0 22px;
  background: var(--line);
}

.agenda-summary h4 {
  margin: 18px 22px 8px;
  font-size: 0.82rem;
}

.availability-list {
  display: grid;
  gap: 7px;
  padding: 0 22px 22px;
}

.availability-list span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.76rem;
}

.availability-list b {
  color: var(--green);
  font-weight: 700;
}

.patient-directory {
  overflow: hidden;
}

.directory-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.directory-toolbar .search-control {
  width: min(390px, 42vw);
}

.empty-state,
.preview-empty {
  padding: 52px 24px;
  text-align: center;
}

.empty-state svg,
.preview-empty svg {
  width: 38px;
  height: 38px;
  color: var(--purple);
}

.empty-state h3,
.preview-empty h3 {
  margin: 12px 0 3px;
  font-size: 1rem;
}

.empty-state p,
.preview-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.back-button {
  margin-bottom: 15px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--purple-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.patient-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.patient-identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.patient-identity strong,
.patient-identity span {
  display: block;
}

.patient-identity > div > span {
  color: var(--muted);
  font-size: 0.76rem;
}

.patient-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.patient-title-line h2 {
  margin: 0;
  font-size: 1.45rem;
}

.patient-hero p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.detail-tabs {
  display: flex;
  gap: 22px;
  margin: 18px 0 14px;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  position: relative;
  padding: 10px 2px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.detail-tab.is-active {
  color: var(--purple-strong);
}

.detail-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--purple);
  content: "";
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.summary-list > div {
  padding: 16px;
  background: white;
}

.summary-list span,
.summary-list strong {
  display: block;
}

.summary-list span {
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-list strong {
  margin-top: 3px;
  font-size: 0.84rem;
}

.clinical-summary {
  padding: 20px;
}

.clinical-summary h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.clinical-summary p {
  margin: 0;
  color: #555668;
  font-size: 0.86rem;
  line-height: 1.65;
}

.mini-goals {
  display: grid;
  gap: 14px;
  padding: 18px 20px 21px;
}

.mini-goal {
  display: grid;
  gap: 7px;
}

.mini-goal div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.77rem;
}

.mini-goal div span {
  color: var(--muted);
}

.progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 8px;
  background: #ecebf1;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--aqua-strong);
  transition: width 220ms ease;
}

.record-timeline {
  padding: 18px 22px;
}

.record-event {
  position: relative;
  display: grid;
  grid-template-columns: 92px 15px 1fr;
  gap: 10px;
  padding-bottom: 23px;
}

.record-event:last-child {
  padding-bottom: 0;
}

.record-event time {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
}

.record-event-marker {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 2px var(--purple-soft);
}

.record-event:not(:last-child) .record-event-marker::after {
  position: absolute;
  top: 12px;
  left: 2px;
  width: 2px;
  height: 42px;
  background: var(--line);
  content: "";
}

.record-event strong,
.record-event span {
  display: block;
}

.record-event strong {
  font-size: 0.85rem;
}

.record-event span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.document-list {
  display: grid;
  gap: 0;
}

.document-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.document-item:last-child {
  border-bottom: 0;
}

.document-icon {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--purple-soft);
  color: var(--purple-strong);
}

.document-icon svg {
  width: 18px;
  height: 18px;
}

.document-item strong,
.document-item span {
  display: block;
}

.document-item strong {
  font-size: 0.83rem;
}

.document-item span {
  color: var(--muted);
  font-size: 0.72rem;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
}

.save-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.session-form {
  display: grid;
  gap: 15px;
}

.form-section {
  padding: 22px;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-title > span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.section-title h3,
.section-title p {
  margin: 0;
}

.section-title h3 {
  font-size: 0.98rem;
}

.section-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-grid {
  display: grid;
  gap: 15px;
}

.form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-stack {
  display: grid;
  gap: 16px;
}

label > span,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: #4f5060;
  font-size: 0.78rem;
  font-weight: 700;
}

label input,
label select,
label textarea,
.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  color: var(--text);
  font-size: 0.87rem;
  transition: border 160ms ease, box-shadow 160ms ease;
}

label input,
label select,
.modal-body input,
.modal-body select {
  min-height: 43px;
  padding: 9px 11px;
}

label textarea,
.modal-body textarea {
  display: block;
  padding: 10px 11px;
  line-height: 1.55;
  resize: vertical;
}

label input:focus,
label select:focus,
label textarea:focus,
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--aqua-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(98, 197, 203, 0.17);
}

label small {
  display: block;
  margin-top: 6px;
}

.inline-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--purple-strong);
  font-size: 0.73rem;
  font-weight: 700;
}

.inline-suggestion svg {
  width: 14px;
  height: 14px;
}

.form-actions-sticky {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.plan-patient-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plan-patient-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-patient-bar label span {
  margin: 0;
}

.plan-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.5fr);
  gap: 14px;
  margin-bottom: 14px;
}

.plan-summary-card,
.plan-score {
  padding: 20px;
}

.plan-summary-card > span,
.plan-score > span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
}

.plan-summary-card h3 {
  max-width: 930px;
  margin: 8px 0 15px;
  font-size: 1rem;
  line-height: 1.55;
}

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

.plan-meta span {
  color: var(--muted);
  font-size: 0.75rem;
}

.plan-meta b {
  margin-left: 4px;
  color: var(--text);
}

.plan-score strong {
  display: block;
  margin: 7px 0 10px;
  color: var(--purple-strong);
  font-size: 2rem;
}

.plan-score small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.objective-list {
  display: grid;
  gap: 10px;
}

.objective-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) minmax(190px, 0.45fr);
  gap: 18px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.objective-area span,
.objective-area small {
  display: block;
}

.objective-area span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.objective-area small {
  margin-top: 5px;
  color: var(--purple-strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.objective-copy strong,
.objective-copy span {
  display: block;
}

.objective-copy strong {
  font-size: 0.88rem;
}

.objective-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.73rem;
}

.objective-progress label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 650;
}

.objective-progress label b {
  color: var(--text);
}

.objective-progress input[type="range"] {
  width: 100%;
  height: 5px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  accent-color: var(--aqua-strong);
}

.reports-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
}

.report-list {
  display: grid;
}

.report-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  color: var(--text);
  text-align: left;
}

.report-item:last-child {
  border-bottom: 0;
}

.report-item:hover,
.report-item.is-active {
  background: #faf9fd;
}

.report-item.is-active {
  box-shadow: inset 0 0 0 1px var(--purple-soft);
}

.report-item strong,
.report-item small {
  display: block;
}

.report-item strong {
  font-size: 0.83rem;
}

.report-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.71rem;
}

.report-preview {
  min-height: 510px;
  overflow: hidden;
}

.report-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.report-preview-toolbar strong,
.report-preview-toolbar span {
  display: block;
}

.report-preview-toolbar strong {
  font-size: 0.88rem;
}

.report-preview-toolbar span {
  color: var(--muted);
  font-size: 0.72rem;
}

.report-document {
  width: min(720px, calc(100% - 38px));
  margin: 22px auto;
  padding: 32px 38px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 8px 24px rgba(49, 43, 73, 0.07);
}

.report-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  border-bottom: 2px solid var(--purple-soft);
}

.report-brand img {
  width: 145px;
  height: auto;
}

.report-brand span {
  color: var(--muted);
  font-size: 0.68rem;
}

.report-document h2 {
  margin: 27px 0 20px;
  text-align: center;
  font-size: 1.18rem;
}

.report-document h3 {
  margin: 20px 0 7px;
  color: var(--purple-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.report-document p,
.report-document li {
  color: #4e4e5e;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  line-height: 1.65;
}

.report-document ul {
  margin: 6px 0;
  padding-left: 18px;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 20px;
  padding: 13px;
  background: #faf9fd;
}

.report-meta-grid span {
  color: var(--muted);
  font-size: 0.72rem;
}

.report-meta-grid b {
  margin-left: 4px;
  color: var(--text);
}

.notification-popover {
  position: fixed;
  top: 68px;
  right: 80px;
  z-index: 70;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.popover-heading {
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.popover-heading span {
  color: var(--purple-strong);
  font-size: 0.7rem;
}

.notification-popover button {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  text-align: left;
}

.notification-popover button:last-child {
  border-bottom: 0;
}

.notification-popover button:hover {
  background: var(--surface-soft);
}

.notification-popover b,
.notification-popover small {
  display: block;
}

.notification-popover b {
  font-size: 0.8rem;
}

.notification-popover small {
  color: var(--muted);
  font-size: 0.71rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 31, 48, 0.46);
}

.modal {
  width: min(650px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 28px 70px rgba(26, 20, 48, 0.28);
  animation: modal-in 180ms ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.modal-header span,
.modal-header h2 {
  display: block;
  margin: 0;
}

.modal-header span {
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.modal-header h2 {
  margin-top: 2px;
  font-size: 1.2rem;
}

.modal-body {
  padding: 20px;
}

.modal-form {
  display: grid;
  gap: 15px;
}

.modal-form .form-grid-2 {
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 5px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #cfe9de;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease;
}

.toast > span {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 0.82rem;
}

.toast small {
  color: var(--muted);
  font-size: 0.71rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.operations-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.operation-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 16px;
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  text-align: left;
  transition: border 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.operation-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(49, 43, 73, 0.06);
  transform: translateY(-1px);
}

.operation-card > span:nth-child(2),
.operation-card strong,
.operation-card small {
  display: block;
  min-width: 0;
}

.operation-card strong {
  font-size: 0.82rem;
}

.operation-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.operation-card > svg {
  width: 16px;
  height: 16px;
  color: #aaa9b7;
}

.operation-icon,
.heading-icon,
.template-icon,
.visual-panel-icon,
.module-hero-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}

.operation-icon {
  width: 42px;
  height: 42px;
}

.operation-aqua { background: var(--aqua-soft); color: var(--aqua-strong); }
.operation-lilac { background: var(--purple-soft); color: var(--purple-strong); }
.operation-rose { background: var(--rose-soft); color: var(--rose-strong); }
.operation-gold { background: var(--gold-soft); color: #967126; }

.template-library {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.section-heading-with-icon,
.visual-panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}

.section-heading-with-icon {
  margin-bottom: 14px;
}

.section-heading-with-icon h3,
.section-heading-with-icon p,
.visual-panel-heading h3,
.visual-panel-heading p {
  margin: 0;
}

.section-heading-with-icon h3,
.visual-panel-heading h3 {
  font-size: 0.95rem;
}

.section-heading-with-icon p,
.visual-panel-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.heading-icon,
.visual-panel-icon {
  width: 42px;
  height: 42px;
  background: var(--purple-soft);
  color: var(--purple-strong);
}

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

.template-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fdfdfe;
  color: var(--text);
  text-align: left;
}

.template-card:hover {
  border-color: var(--purple);
  background: #fbfafe;
}

.template-icon {
  width: 40px;
  height: 40px;
}

.template-purple { background: var(--purple-soft); color: var(--purple-strong); }
.template-aqua { background: var(--aqua-soft); color: var(--aqua-strong); }
.template-rose { background: var(--rose-soft); color: var(--rose-strong); }
.template-gold { background: var(--gold-soft); color: #967126; }

.template-card > span:nth-child(2),
.template-card strong,
.template-card small,
.template-card em {
  display: block;
  min-width: 0;
}

.template-card strong {
  font-size: 0.77rem;
  line-height: 1.3;
}

.template-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.template-card em {
  margin-top: 5px;
  color: var(--purple-strong);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 700;
}

.template-card > svg {
  width: 16px;
  height: 16px;
  color: #aaa9b7;
}

.module-hero {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.module-hero::after {
  position: absolute;
  top: -42px;
  right: 260px;
  width: 150px;
  height: 150px;
  background: url("assets/psicokaro-mark.png") center / contain no-repeat;
  content: "";
  opacity: 0.045;
  pointer-events: none;
}

.module-hero-icon {
  width: 58px;
  height: 58px;
  background: var(--aqua-soft);
  color: var(--aqua-strong);
}

.module-hero-icon svg {
  width: 28px;
  height: 28px;
}

.module-hero > div:nth-child(2) > span,
.module-hero h3,
.module-hero p {
  display: block;
  margin: 0;
}

.module-hero > div:nth-child(2) > span {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
}

.module-hero h3 {
  margin-top: 2px;
  font-size: 1.06rem;
}

.module-hero p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.module-hero label {
  min-width: 230px;
}

.data-module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

.progress-chart {
  min-height: 252px;
  padding: 20px 24px 8px;
}

.progress-chart svg {
  display: block;
  width: 100%;
  height: 225px;
  overflow: visible;
}

.chart-grid-line {
  stroke: #ebeaf0;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--aqua-strong);
  stroke-width: 3;
}

.chart-area {
  fill: rgba(98, 197, 203, 0.11);
  stroke: none;
}

.chart-point {
  fill: white;
  stroke: var(--aqua-strong);
  stroke-width: 3;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 22px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.chart-legend-row span {
  display: flex;
  gap: 7px;
  align-items: center;
}

.chart-legend-row strong {
  color: var(--aqua-strong);
  font-size: 1.1rem;
}

.compact-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.compact-form input[type="range"] {
  width: 100%;
  padding: 0;
  border: 0;
  accent-color: var(--aqua-strong);
}

.compact-form label > span b {
  float: right;
  color: var(--aqua-strong);
}

.compact-form .button {
  width: 100%;
}

.lower-data-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  margin-bottom: 0;
}

.monthly-report-panel {
  padding: 20px;
}

.monthly-report-panel .visual-panel-heading {
  margin-bottom: 18px;
}

.monthly-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.monthly-metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.monthly-metrics span,
.monthly-metrics strong {
  display: block;
}

.monthly-metrics span {
  color: var(--muted);
  font-size: 0.68rem;
}

.monthly-metrics strong {
  margin-top: 3px;
  font-size: 0.94rem;
}

.data-entry-list {
  display: grid;
  padding: 6px 18px 13px;
}

.data-entry-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.data-entry-item:last-child {
  border-bottom: 0;
}

.data-entry-item > span:first-child {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--aqua-soft);
  color: var(--aqua-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.data-entry-item strong,
.data-entry-item small {
  display: block;
}

.data-entry-item strong { font-size: 0.78rem; }
.data-entry-item small { color: var(--muted); font-size: 0.68rem; }
.data-entry-item > b { color: var(--aqua-strong); font-size: 0.82rem; }

.group-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
}

.group-list {
  display: grid;
}

.group-list-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  color: var(--text);
  text-align: left;
}

.group-list-item:last-child { border-bottom: 0; }
.group-list-item:hover,
.group-list-item.is-active { background: var(--surface-soft); }
.group-list-item.is-active { box-shadow: inset 0 0 0 1px var(--purple-soft); }

.group-list-item strong,
.group-list-item small { display: block; }
.group-list-item strong { font-size: 0.81rem; }
.group-list-item small { margin-top: 2px; color: var(--muted); font-size: 0.68rem; }

.group-detail-panel {
  overflow: hidden;
}

.group-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #faf9fd;
}

.group-banner::after {
  position: absolute;
  right: 26px;
  width: 120px;
  height: 120px;
  background: url("assets/psicokaro-mark.png") center / contain no-repeat;
  content: "";
  opacity: 0.05;
}

.group-banner h3,
.group-banner p { margin: 0; }
.group-banner h3 { font-size: 1.1rem; }
.group-banner p { margin-top: 4px; color: var(--muted); font-size: 0.76rem; }

.group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.71rem;
}

.group-session-body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: 18px;
  padding: 18px 20px 20px;
}

.group-session-body h4 {
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.attendance-list {
  display: grid;
  gap: 7px;
}

.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.attendance-row span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.77rem;
  font-weight: 700;
}

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

.group-note-form {
  display: grid;
  gap: 12px;
}

.finance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.finance-metric {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.finance-metric div > span,
.finance-metric strong,
.finance-metric small { display: block; }
.finance-metric div > span { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.finance-metric strong { margin-top: 2px; font-size: 1.35rem; }
.finance-metric small { color: var(--muted); font-size: 0.68rem; }

.finance-panel { overflow: hidden; }

.finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.finance-toolbar .search-control { width: 280px; }
.finance-toolbar .segmented button { min-width: 150px; }

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: 14px;
}

.team-directory { overflow: hidden; }
.team-directory .data-table { min-width: 760px; }

.requirement-panel {
  align-self: start;
  padding: 19px;
}

.alert-visual {
  background: var(--rose-soft);
  color: var(--rose-strong);
}

.requirement-list {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.requirement-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.requirement-item.is-resolved { opacity: 0.6; }

.requirement-item strong,
.requirement-item span,
.requirement-item small { display: block; }
.requirement-item strong { font-size: 0.77rem; }
.requirement-item span { margin-top: 2px; color: var(--muted); font-size: 0.69rem; }
.requirement-item small { margin-top: 7px; color: var(--rose-strong); font-size: 0.67rem; font-weight: 700; }

.requirement-item .table-action {
  margin-top: 6px;
  padding-left: 0;
}

.modal.modal-wide {
  width: min(920px, 100%);
}

.template-builder-intro {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.template-builder-intro .template-icon {
  width: 54px;
  height: 54px;
}

.template-builder-intro h3,
.template-builder-intro p { margin: 0; }
.template-builder-intro h3 { font-size: 0.95rem; }
.template-builder-intro p { margin-top: 3px; color: var(--muted); font-size: 0.74rem; }

.template-section-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.template-section-list span {
  padding: 5px 8px;
  border-radius: 20px;
  background: var(--purple-soft);
  color: var(--purple-strong);
  font-size: 0.66rem;
  font-weight: 700;
}

.template-form-sections {
  display: grid;
  gap: 12px;
}

.template-form-section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.template-form-section h4 {
  margin: 0 0 13px;
  font-size: 0.82rem;
}

.template-form-section .form-grid {
  margin-bottom: 12px;
}

.template-form-section .form-grid:last-child,
.template-form-section label:last-child {
  margin-bottom: 0;
}

.attendance-form-rows {
  display: grid;
  gap: 8px;
}

.attendance-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 8px;
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; }
  .content { padding: 24px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-strip,
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .objective-card { grid-template-columns: 120px minmax(0, 1fr); }
  .objective-progress { grid-column: 1 / -1; }
  .team-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 248px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(35, 31, 48, 0.38);
  }
  .sidebar-scrim.is-visible { display: block; }
  .app-main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 12px 20px; }
  .topbar-title { margin-right: auto; }
  .profile-chip > div { display: none; }
  .global-search { width: min(250px, 34vw); }
  .dashboard-grid,
  .agenda-layout,
  .detail-grid,
  .reports-layout,
  .data-module-grid,
  .group-layout { grid-template-columns: 1fr; }
  .agenda-summary { order: -1; }
  .plan-overview { grid-template-columns: 1fr; }
  .group-session-body { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar {
    min-height: 68px;
    padding: 10px 14px;
  }
  .topbar-title span { display: none; }
  .topbar-title h1 { font-size: 1rem; }
  .global-search { display: none; }
  .notification-button { display: none; }
  .profile-chip { margin-left: 0; }
  .content { padding: 20px 14px 90px; }
  .page-heading,
  .patient-hero,
  .plan-patient-bar,
  .agenda-toolbar,
  .directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .page-heading { margin-bottom: 18px; }
  .dashboard-heading .heading-actions,
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr; }
  .operations-strip,
  .template-grid,
  .finance-metrics { grid-template-columns: 1fr; }
  .metric-card { grid-template-columns: 42px 1fr; padding: 15px; }
  .dashboard-grid { gap: 14px; }
  .panel-heading { padding: 16px; }
  .link-button { font-size: 0; }
  .link-button svg { width: 18px; height: 18px; }
  .timeline { padding: 7px 16px 14px; }
  .timeline-item { grid-template-columns: 58px 4px 1fr; gap: 10px; }
  .timeline-item .status { grid-column: 3; }
  .patients-panel { overflow: hidden; }
  .data-table { min-width: 760px; }
  .patient-table { min-width: 880px; }
  .segmented { overflow-x: auto; }
  .segmented button { min-width: 52px; }
  .filter-row { width: 100%; }
  .filter-row select { min-width: 0; flex: 1; }
  .agenda-item { grid-template-columns: 62px 1fr; gap: 10px; }
  .agenda-actions { grid-column: 2; }
  .donut-row { grid-template-columns: 110px 1fr; padding: 18px; }
  .donut { width: 110px; height: 110px; }
  .donut::before { width: 74px; height: 74px; }
  .directory-toolbar .search-control { width: 100%; }
  .patient-hero .heading-actions { width: 100%; }
  .detail-tabs { overflow-x: auto; gap: 18px; }
  .detail-tab { white-space: nowrap; }
  .summary-list { grid-template-columns: 1fr; }
  .form-grid-4,
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-section { padding: 17px; }
  .form-actions-sticky {
    align-items: stretch;
    flex-direction: column-reverse;
    bottom: 8px;
  }
  .form-actions-sticky > div { width: 100%; }
  .form-actions-sticky .button { flex: 1; }
  .plan-patient-bar label { align-items: stretch; flex-direction: column; }
  .objective-card { grid-template-columns: 1fr; gap: 10px; }
  .objective-progress { grid-column: auto; }
  .report-document { width: calc(100% - 22px); padding: 24px 18px; }
  .report-meta-grid { grid-template-columns: 1fr; }
  .notification-popover { top: 62px; right: 12px; }
  .modal-backdrop { padding: 10px; }
  .modal-form .form-grid-2 { grid-template-columns: 1fr; }
  .module-hero { grid-template-columns: 50px 1fr; }
  .module-hero label { grid-column: 1 / -1; min-width: 0; }
  .module-hero::after { right: -35px; }
  .monthly-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-toolbar { align-items: stretch; flex-direction: column; }
  .finance-toolbar .search-control { width: 100%; }
  .finance-toolbar .segmented { overflow: visible; }
  .finance-toolbar .segmented button { min-width: 0; flex: 1; }
  .attendance-form-row { grid-template-columns: 1fr 1fr; }
  .template-library { padding: 14px; }
}

@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;
  }
}
