:root {
  --bg-0: #dbe8ee;
  --bg-1: #d3e1e9;
  --bg-2: #cfdde5;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --line: #d7ddeb;
  --line-2: #e6ebf4;
  --text: #142034;
  --muted: #667085;
  --accent: #1ca3d9;
  --accent-2: #2fb3e8;
  --accent-soft: #e8f8ff;
  --secondary: #3f4f67;
  --danger: #b13636;
  --sidebar: #08152f;
  --sidebar-2: #0b1b3a;
  --sidebar-muted: #94a9c8;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-2: 0 12px 28px rgba(8, 20, 50, 0.12);
  --shadow-3: 0 18px 40px rgba(8, 20, 50, 0.18);
  --topbar-height: 64px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  padding: 1.5rem;
  background:
    radial-gradient(980px 420px at 14% -10%, #e8f1f6 0%, transparent 65%),
    radial-gradient(820px 420px at 100% -20%, #d7e4ed 0%, transparent 70%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: 0.015em;
}

h2 {
  margin-bottom: 0.82rem;
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

h3 {
  margin: 0 0 0.62rem;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: #2d4b6d;
}

.dashboard-body {
  min-height: 100vh;
}

.admin-body {
  background:
    radial-gradient(1100px 520px at 10% -15%, #eef4fb 0%, transparent 62%),
    radial-gradient(900px 520px at 100% -25%, #e1ebf7 0%, transparent 68%),
    linear-gradient(160deg, #e7eef6, #dee8f2 52%, #d8e3ee);
}

.admin-body .app-shell {
  border-color: #c6d5e5;
  box-shadow: 0 24px 60px rgba(10, 28, 60, 0.18);
  background: #f6f8fb;
}

.admin-body .sidebar {
  background: linear-gradient(180deg, #0a2142, #0e315e 55%, #0c294f);
  border-right-color: #163a66;
}

.admin-body .brand {
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.admin-body .menu-group {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}

.admin-body .menu-toggle {
  letter-spacing: 0.08em;
}

.admin-body .side-link {
  border-radius: 12px;
}

.admin-body .side-link.active {
  background: linear-gradient(90deg, rgba(91, 177, 255, 0.26), rgba(255, 255, 255, 0.05));
  border-color: rgba(91, 177, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(91, 177, 255, 0.12);
}

.admin-body .side-link.active::before {
  background: #7ad3ff;
  box-shadow: 0 0 12px rgba(122, 211, 255, 0.7);
}

.admin-body .content-area {
  background: linear-gradient(180deg, #f4f7fb, #eef3f8 65%, #e9eff7);
}

.admin-body .topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 246, 255, 0.78));
  border-bottom-color: #d6e2f1;
  box-shadow: 0 10px 24px rgba(10, 28, 60, 0.08);
}

.admin-body .panel {
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  border-color: #d5e1f0;
  box-shadow: 0 14px 26px rgba(14, 30, 60, 0.1);
}

.admin-body .panel:hover {
  box-shadow: 0 18px 34px rgba(14, 30, 60, 0.14);
}

.admin-body .panel > h2::before {
  background: linear-gradient(180deg, #4fa2ff, #2f7ad9);
}

.admin-body .table-wrap {
  border-color: #d6e2f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 18px rgba(16, 30, 60, 0.05);
}

.admin-body th {
  background: linear-gradient(180deg, #eef4ff, #e2ecfb);
  color: #2f4a6a;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: calc(100vh - 3rem);
  max-width: 1460px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-3);
  border: 1px solid #c5d4df;
  background: #f2f4f8;
}

.sidebar {
  position: relative;
  align-self: stretch;
  background: linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: #fff;
  border-right: 1px solid #122c52;
  padding: 1.25rem 0.9rem;
}

.mobile-menu-toggle {
  position: static;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(10, 24, 50, 0.18);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(10, 24, 50, 0.18);
  color: #132a4a;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.mobile-menu-toggle:hover {
  transform: translateY(-1px);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 26, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  margin-bottom: 1.15rem;
  padding: 0.45rem 0.45rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  display: block;
  width: 170px;
  max-width: 100%;
  height: auto;
  margin: 0 0 0.55rem;
  filter: drop-shadow(0 6px 10px rgba(6, 18, 40, 0.18));
}

.login-panel .brand-logo {
  width: 230px;
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 8px 16px rgba(10, 24, 50, 0.15));
}

.brand h1 {
  font-size: 1.03rem;
  font-weight: 800;
}

.brand p {
  margin: 0.38rem 0 0;
  font-size: 0.84rem;
  color: var(--sidebar-muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.side-nav::-webkit-scrollbar {
  width: 8px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.side-nav::-webkit-scrollbar-track {
  background: transparent;
}

.menu-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.menu-toggle {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0.64rem 0.74rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b6c6de;
  background: transparent;
  cursor: pointer;
}

.menu-toggle:hover {
  color: #eaf2ff;
  background: rgba(255, 255, 255, 0.05);
}

.menu-items {
  display: none;
  padding: 0.34rem;
}

.menu-group.open .menu-items {
  display: grid;
  gap: 0.28rem;
}

.menu-group.open .menu-toggle {
  color: #eaf2ff;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.side-link {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #e8f0fe;
  text-align: left;
  border-radius: 11px;
  padding: 0.66rem 0.78rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: block;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

.side-link:active {
  transform: translateY(1px);
}

.side-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #f5fbff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.side-link.active::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #63d0ff;
  box-shadow: 0 0 10px rgba(99, 208, 255, 0.8);
  vertical-align: middle;
}

.content-area {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: linear-gradient(180deg, #f3f4f7, #eff1f6);
}

.topbar {
  z-index: 10;
  padding: 1rem 1.2rem 0.72rem;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.88), rgba(244, 248, 254, 0.72));
  border-bottom: 1px solid #dde6f3;
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.topbar .actions {
  margin-left: auto;
  justify-content: flex-end;
}

.topbar h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #162842;
}

main {
  padding: 0.95rem 1.2rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

.single-col {
  min-height: calc(100vh - 64px);
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
  align-content: center;
}

.app-main {
  padding: 1.06rem;
}

.app-page {
  display: none;
  gap: 1rem;
}

.app-page.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-layout {
  grid-template-columns: minmax(360px, 1.45fr) minmax(300px, 1fr);
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid #e2e7f0;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(16, 32, 70, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: panel-in 0.34s ease both;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(16, 32, 70, 0.12);
  border-color: #d7e2f2;
}

.panel > h2 {
  position: relative;
  padding-left: 0.72rem;
}

.panel > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.17rem;
  bottom: 0.17rem;
  width: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #45baec, #1f7fcd);
}

.login-panel {
  position: relative;
  margin-top: 0.5rem;
  border: 1px solid #d8e3f3;
  box-shadow: var(--shadow-3);
  padding: 1.4rem 1.5rem 1.2rem;
  max-width: 480px;
  width: min(92vw, 480px);
}

.login-centered {
  min-height: 100vh;
  align-content: center;
}

.login-body {
  background:
    radial-gradient(900px 420px at 20% -10%, #eaf1fb 0%, transparent 65%),
    radial-gradient(880px 420px at 100% -20%, #d7e6f6 0%, transparent 70%),
    linear-gradient(160deg, #e6eef6, #dde8f2 52%, #d7e3ee);
}

.login-branding {
  text-align: center;
  margin-bottom: 0.8rem;
}

.login-panel .brand-logo {
  width: 240px;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.login-brand {
  font-size: 1.32rem;
  color: #14365f;
  margin-bottom: 0.2rem;
}

.login-panel h2 {
  margin-top: 0.85rem;
  margin-bottom: 0.7rem;
}

.login-subtitle {
  margin: 0 0 0.95rem;
  color: #5b6f86;
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-form button {
  width: 100%;
  justify-content: center;
  padding: 0.64rem 1rem;
}

.login-footer {
  margin-top: 0.9rem;
  text-align: center;
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
  align-items: center;
}

.panel .actions {
  margin: 0.35rem 0 0.65rem;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.inline-check input {
  margin: 0;
}

.expense-group-table th:first-child,
.expense-group-table td:first-child {
  width: 32px;
}

#sessions-table th:first-child,
#sessions-table td:first-child {
  width: 32px;
}

.modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(92vw, 760px);
  box-shadow: 0 24px 60px rgba(13, 25, 43, 0.35);
}

.modal::backdrop {
  background: rgba(12, 20, 34, 0.55);
  backdrop-filter: blur(2px);
}

.modal-form {
  padding: 1rem 1.1rem 1.1rem;
}

.modal-title {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  color: #1b3556;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

button,
.nav-button {
  border: 1px solid #1ea7de;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  border-radius: 999px;
  padding: 0.52rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover,
.nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(25, 99, 180, 0.3);
}

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

button.secondary {
  background: linear-gradient(180deg, #4a5b70, var(--secondary));
  border-color: var(--secondary);
}

button.danger {
  background: linear-gradient(180deg, #cb4a4a, var(--danger));
  border-color: var(--danger);
}

.sidebar .menu-toggle {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0.64rem 0.74rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b6c6de;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
}

.sidebar .menu-toggle:hover {
  transform: none;
  color: #eaf2ff;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.sidebar .menu-toggle:active {
  transform: none;
}

.side-nav .side-link {
  background: transparent;
  border: 1px solid transparent;
  color: #e8f0fe;
  box-shadow: none;
}

.side-nav .side-link:hover {
  box-shadow: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0.68rem;
}

.card {
  border: 1px solid #e7ebf3;
  border-radius: 12px;
  padding: 0.78rem;
  background: linear-gradient(180deg, #ffffff, #f7f9fd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: #d6e3f5;
  box-shadow: 0 10px 18px rgba(24, 48, 84, 0.1);
}

.card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #173a63;
}

.dashboard-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(320px 160px at 90% -20%, rgba(35, 165, 220, 0.18), transparent 70%),
    radial-gradient(260px 140px at 10% -30%, rgba(25, 99, 180, 0.12), transparent 60%),
    linear-gradient(180deg, #ffffff, #f3f7fd);
  border-color: #d3e3f4;
}

.dashboard-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 110, 190, 0.18), transparent 70%);
  pointer-events: none;
}

.dashboard-panel .cards {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-panel .kpi-card {
  position: relative;
  padding: 0.95rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #d6e4f3;
  background:
    linear-gradient(140deg, rgba(30, 120, 190, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff, #f5f9ff);
  box-shadow: 0 14px 26px rgba(16, 35, 70, 0.08);
}

.dashboard-panel .kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(36, 120, 190, 0.18);
  pointer-events: none;
}

.dashboard-panel .kpi-card p {
  font-size: 0.72rem;
  color: #4b6a8d;
}

.dashboard-panel .kpi-card strong {
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}

.kpi-card.kpi-turnover {
  border-color: #cfe2f7;
  background:
    linear-gradient(140deg, rgba(30, 120, 190, 0.2), transparent 55%),
    linear-gradient(180deg, #ffffff, #f2f7ff);
}

.kpi-card.kpi-turnover strong {
  color: #1c4f88;
}

.kpi-card.kpi-expenses {
  border-color: #f0d2c2;
  background:
    linear-gradient(140deg, rgba(232, 108, 64, 0.2), transparent 55%),
    linear-gradient(180deg, #ffffff, #fff4ee);
}

.kpi-card.kpi-expenses strong {
  color: #a94b1f;
}

.kpi-card.kpi-profit {
  border-color: #cfe9d7;
  background:
    linear-gradient(140deg, rgba(47, 158, 92, 0.2), transparent 55%),
    linear-gradient(180deg, #ffffff, #f2fbf5);
}

.kpi-card.kpi-profit strong {
  color: #1f6b3b;
}

.kpi-card.kpi-available {
  border-color: #c9e6ea;
  background:
    linear-gradient(140deg, rgba(16, 140, 150, 0.2), transparent 55%),
    linear-gradient(180deg, #ffffff, #effafb);
}

.kpi-card.kpi-available strong {
  color: #0f5f6a;
}

.dashboard-panel .overview-detail {
  border-color: #d7e5f4;
  box-shadow: 0 10px 20px rgba(16, 35, 70, 0.08);
}

.dashboard-panel .overview-detail summary {
  background: linear-gradient(180deg, #f2f7ff, #e7f0fb);
}

.dashboard-panel .chart-card {
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  border-color: #d9e7f7;
}

.finance-page .panel {
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  border-color: #d7e4f3;
  box-shadow: 0 18px 36px rgba(15, 35, 70, 0.08);
}

.finance-page h2 {
  font-size: 1.12rem;
  color: #1e3e5f;
}

.finance-page .actions {
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: #f0f6ff;
  border: 1px solid #d5e4f6;
}

.finance-page .table-wrap {
  border-color: #d7e4f3;
}

.finance-page .expense-group summary {
  background: linear-gradient(180deg, #eff7ff, #e5f1ff);
  color: #2a4b6f;
}

.finance-page .expense-group {
  box-shadow: 0 12px 22px rgba(18, 38, 72, 0.08);
}

.finance-page .expense-group table tr:hover td {
  background: #eef5ff;
}

.finance-page #therapist-expense-table tr:hover td {
  background: #f0f6ff;
}

.kpi-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.kpi-card:focus-visible {
  outline: 3px solid rgba(64, 132, 212, 0.35);
  outline-offset: 2px;
}

.overview-detail-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.overview-detail-grid + .chart-grid {
  margin-top: 0.85rem;
}

.overview-detail {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.overview-detail summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, #f3f7ff, #e8effb);
  color: #2c4a6a;
  font-weight: 700;
}

.overview-detail summary::-webkit-details-marker {
  display: none;
}

.overview-detail summary::after {
  content: "▾";
  color: #5b7ca6;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.overview-detail[open] summary::after {
  transform: rotate(180deg);
}

.overview-detail-body {
  padding: 0.75rem 0.9rem 0.9rem;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.stat-chip {
  border: 1px solid #d6e5f5;
  background: #f2f7ff;
  color: #375571;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.stat-chip strong {
  margin-left: 0.25rem;
  color: #173a63;
}

.overview-detail.pulse {
  box-shadow: 0 0 0 3px rgba(64, 132, 212, 0.22);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.nested-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.62rem;
  margin-bottom: 0.8rem;
}

.full-row {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.27rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #274361;
}

label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.56rem 0.62rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input,
select {
  min-height: 38px;
}

input::placeholder,
textarea::placeholder {
  color: #8ba0bb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8bb3e6;
  box-shadow: 0 0 0 3px rgba(64, 132, 212, 0.18);
  outline: none;
  background: #fcfeff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  -webkit-overflow-scrolling: touch;
}

.expense-breakdown {
  display: grid;
  gap: 0.8rem;
}

.expense-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.expense-group summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto 1.2rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, #f0f6ff, #e8f1fb);
  color: #2c4a6a;
  font-weight: 700;
}

.expense-group summary::-webkit-details-marker {
  display: none;
}

.expense-group summary::after {
  content: "▾";
  color: #5b7ca6;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  justify-self: end;
}

.expense-group[open] summary::after {
  transform: rotate(180deg);
}

.expense-group-title {
  font-weight: 800;
  text-transform: capitalize;
}

.expense-group-count {
  font-size: 0.8rem;
  color: #6a84a6;
}

.expense-group-total {
  font-weight: 800;
  color: #1f4f86;
}

.expense-group .table-wrap {
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 0 0 14px 14px;
}

.therapist-breakdown {
  display: grid;
  gap: 0.8rem;
}

.therapist-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.therapist-group summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1.2fr auto auto auto 1.2rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, #f6f2ff, #eee8ff);
  color: #3a2c6a;
  font-weight: 700;
}

.therapist-group summary::-webkit-details-marker {
  display: none;
}

.therapist-group summary::after {
  content: "▾";
  color: #6f62a6;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  justify-self: end;
}

.therapist-group[open] summary::after {
  transform: rotate(180deg);
}

.therapist-group-title {
  font-weight: 800;
}

.therapist-group-rate {
  font-size: 0.8rem;
  color: #6d5e96;
}

.therapist-group-total {
  font-weight: 800;
  color: #3d356d;
}

.therapist-group-profit {
  font-weight: 800;
  color: #1e5f3e;
}

.therapist-group .table-wrap {
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 0 0 14px 14px;
}

.therapist-group-table tbody tr[data-month] {
  cursor: pointer;
  transition: background 0.2s ease;
}

.therapist-group-table tbody tr[data-month]:hover {
  background: #f1f6ff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.54rem 0.6rem;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  white-space: nowrap;
}

th {
  background: linear-gradient(180deg, #ecf4fe, #e5f0fc);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3a567a;
}

tr:nth-child(even) td {
  background: #fcfdff;
}

tr:hover td {
  background: #f3f8ff;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #1e62a9;
  padding: 0;
  text-decoration: underline;
  font-weight: 700;
}

.link-btn.danger-text {
  color: var(--danger);
}

#me-label {
  color: #45607f;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.status-pill.ok {
  background: #e9f8ef;
  color: #1f6e3f;
  border: 1px solid #c7ecd6;
}

.status-pill.alert {
  background: #ffe8e8;
  color: #9a1f1f;
  border: 1px solid #f6b4b4;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18), 0 0 16px rgba(220, 38, 38, 0.45);
  animation: red-pulse 1.3s ease-in-out infinite;
}

.muted-text {
  color: var(--muted);
  margin: 0;
  font-size: 0.8rem;
}

.profile-panel {
  grid-column: span 1;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
  border-color: #dbe5f3;
}

.profile-head {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.avatar-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0e2b49;
  background: radial-gradient(circle at 30% 30%, #e7f7ff, #b7e6fb 62%, #8fd4f5);
  border: 4px solid #29ace2;
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.mini-kpis div {
  border: 1px solid #e6ebf3;
  border-radius: 10px;
  padding: 0.42rem 0.45rem;
  background: #fbfdff;
}

.mini-kpis span {
  display: block;
  font-size: 0.7rem;
  color: #69809e;
}

.mini-kpis strong {
  font-size: 0.95rem;
  color: #17345b;
}

.appointment-list {
  display: grid;
  gap: 0.4rem;
}

.appointment-item {
  border: 1px solid #e5ebf5;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.45rem 0.55rem;
}

.appointment-item span {
  font-size: 0.72rem;
  color: #5f7897;
}

.appointment-item strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.84rem;
}

.appointment-item small {
  color: #6e86a3;
}

.body-map-wrap {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(250px, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.body-3d-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 0.85rem;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.body-3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.body-3d-toolbar h3 {
  margin: 0;
  font-size: 1rem;
  color: #17345b;
}

.body-3d-toolbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.body-3d-viewer {
  position: relative;
  height: 460px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #d9e5f4;
  cursor: grab;
  background:
    radial-gradient(180px 140px at 20% 10%, rgba(255, 255, 255, 0.8), transparent 65%),
    radial-gradient(240px 200px at 70% 0%, rgba(99, 208, 255, 0.18), transparent 70%),
    linear-gradient(180deg, #f5f9ff, #e8f1ff);
}

.body-3d-viewer:active {
  cursor: grabbing;
}

.body-3d-viewer canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.body-3d-overlay {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
}

.body-3d-badge,
.body-3d-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 32, 54, 0.78);
  color: #f5fbff;
  font-size: 0.7rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.body-3d-status {
  background: rgba(13, 29, 49, 0.62);
}

.body-3d-viewer.is-error {
  border-color: #f0b3b3;
  background: linear-gradient(180deg, #fff1f1, #ffe2e2);
}

.body-3d-viewer.is-error .body-3d-status {
  background: rgba(176, 52, 52, 0.85);
}

.body-map-figure {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(180px 120px at 15% 5%, #fff7f3, transparent 70%),
    linear-gradient(180deg, #fffaf7, #f3e2da);
  padding: 0.7rem;
  box-shadow: var(--shadow-1);
}

.body-map-figure .body-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  fill: #7a5b52;
  stroke: none;
  text-transform: uppercase;
}

.body-map-figure .silhouette-base {
  stroke: #b07a6d;
  stroke-width: 1.6px;
}

.body-map-figure .silhouette-base.back {
  stroke: #a97266;
}

.body-map-figure .muscle-line {
  fill: none;
  stroke: rgba(140, 78, 66, 0.35);
  stroke-width: 1.2px;
  stroke-linecap: round;
}

.body-map-figure .muscle-fill {
  fill: rgba(200, 110, 90, 0.18);
}

.body-hotspot {
  fill: #b23b3b;
  stroke: #fff6f3;
  stroke-width: 2.2px;
  cursor: pointer;
  opacity: 0.9;
  transition: transform 0.15s ease, fill 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.body-hotspot:hover {
  transform: scale(1.08);
  opacity: 1;
}

.body-hotspot.active {
  fill: #e04141;
  filter: drop-shadow(0 0 7px rgba(224, 65, 65, 0.7));
}

.body-map-regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
}

.onboarding-panel .body-map-regions {
  max-height: 360px;
  overflow: auto;
}

.onboarding-panel .body-3d-toolbar button {
  white-space: nowrap;
}

.body-region {
  border: 1px solid #c5d7ef;
  background: #f6fbff;
  color: #274667;
  font-weight: 700;
}

.body-region:hover,
.body-region.hover {
  border-color: #2d6fb9;
  background: linear-gradient(180deg, #3f83d4, #1963b4);
  color: #fff;
}

.body-region.active {
  border-color: #2d6fb9;
  background: linear-gradient(180deg, #3f83d4, #1963b4);
  color: #fff;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.reservation-calendar .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.cal-head {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
  padding: 0.2rem 0;
}

.cal-cell {
  min-height: 92px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fbff;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
}

.cal-cell.blank {
  border-color: transparent;
  background: transparent;
}

.cal-cell.booked {
  background: linear-gradient(180deg, #eef6ff, #dcecff);
  border-color: #b6d2f2;
}

.cal-cell.available {
  background: #fbfdff;
}

.cal-cell.selected {
  box-shadow: 0 0 0 2px rgba(25, 99, 180, 0.28);
}

.cal-cell .day {
  font-weight: 800;
  font-size: 0.9rem;
  color: #244566;
}

.cal-cell .badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #48698b;
}

.cal-slot-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.26rem;
}

.cal-slot-preview span {
  border-radius: 999px;
  border: 1px solid #9dc1e7;
  background: #f2f8ff;
  color: #30587f;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.65rem;
  color: #496789;
  font-size: 0.8rem;
  font-weight: 700;
}

.calendar-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.calendar-legend .dot.booked {
  background: #3f83d4;
}

.calendar-legend .dot.available {
  background: #cddbeb;
}

.calendar-day-panel {
  margin-top: 0.75rem;
  border: 1px solid #d7e5f5;
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.6rem;
}

.calendar-day-panel strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #2d4e70;
}

.calendar-day-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.45rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.45rem;
}

.slot-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.slot-item span {
  font-size: 0.78rem;
  color: #4e6887;
}

.slot-item.booked {
  background: #eaf3ff;
  border-color: #b4cef0;
}

.slot-item.available {
  background: #fbfdff;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.68rem;
  background:
    radial-gradient(120px 80px at 10% 0%, rgba(72, 130, 255, 0.12), transparent 70%),
    radial-gradient(160px 90px at 90% 10%, rgba(36, 180, 160, 0.12), transparent 70%),
    linear-gradient(180deg, #ffffff, #f5f8ff);
  box-shadow: 0 12px 20px rgba(16, 35, 70, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.chart-card--wide {
  grid-column: span 2;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: #4c6280;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.chart-card-header select {
  min-width: 140px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-item::before {
  content: "";
  width: 12px;
  height: 8px;
  border-radius: 999px;
  background: #c9d6ee;
}

.legend-item.turnover::before {
  background: linear-gradient(90deg, #2f7ff6, #5bb0ff);
}

.legend-item.expenses::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.legend-item.profit::before {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.month-chart {
  display: grid;
  gap: 0.5rem;
}

.month-row {
  display: grid;
  grid-template-columns: 68px minmax(140px, 1fr) minmax(150px, 220px);
  gap: 0.55rem;
  align-items: center;
  font-size: 0.78rem;
  color: #425a76;
}

.month-row--single {
  grid-template-columns: 80px minmax(160px, 1fr) minmax(180px, 260px);
}

.month-label {
  font-weight: 600;
  color: #2f4a6a;
}

.month-bars {
  display: grid;
  gap: 0.28rem;
}

.month-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2fb;
  overflow: hidden;
}

.month-bar i {
  display: block;
  height: 100%;
}

.month-bar.turnover i {
  background: linear-gradient(90deg, #2f7ff6, #5bb0ff);
}

.month-bar.expenses i {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.month-bar.profit i {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.month-bar.loss i {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.month-values {
  text-align: right;
  color: #566b86;
}

.patient-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.stat-card {
  border-radius: 14px;
  border: 1px solid rgba(22, 40, 66, 0.08);
  padding: 0.85rem 0.95rem;
  background: linear-gradient(160deg, #ffffff, #f2f7ff);
  box-shadow: 0 10px 22px rgba(16, 35, 70, 0.08);
}

.stat-card span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #577089;
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.25rem;
  color: #12365c;
}

.stat-card--blue {
  background: linear-gradient(160deg, #ffffff, #eaf3ff 60%, #e3f0ff);
  border-color: #cfe2fb;
}

.stat-card--green {
  background: linear-gradient(160deg, #ffffff, #e9fbf5 60%, #dcf5ec);
  border-color: #c9eee1;
}

.stat-card--orange {
  background: linear-gradient(160deg, #ffffff, #fff3e5 60%, #ffe8d1);
  border-color: #f7dcc1;
}

.patient-chart-grid .chart-card {
  border-color: #d7e4f3;
  background:
    radial-gradient(140px 90px at 10% 0%, rgba(90, 150, 255, 0.16), transparent 70%),
    radial-gradient(180px 100px at 92% 12%, rgba(32, 190, 155, 0.14), transparent 70%),
    linear-gradient(180deg, #ffffff, #f4f8ff);
}

.patient-chart-grid .chart-card h3 {
  font-size: 0.82rem;
  color: #2c4c6f;
}

.chart-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  color: #2b4768;
}

.donut {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(#2f7ad9 calc(var(--pct) * 1%), #dfe8f6 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  background: #fff;
  border-radius: 50%;
}

.donut-meta {
  margin-top: 0.55rem;
}

.donut-meta p {
  margin: 0.2rem 0;
  font-size: 0.8rem;
  color: #3f5d7f;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.36rem;
}

.bar-row span,
.bar-row strong {
  font-size: 0.78rem;
}

.bar {
  background: linear-gradient(90deg, #eef2fb, #f7fbff);
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
}

.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f7ad9, #22b3a6, #6f7cff);
}

.bar-row.tone-blue .bar i {
  background: linear-gradient(135deg, #2f7ff6, #5bb0ff);
}

.bar-row.tone-green .bar i {
  background: linear-gradient(135deg, #1fb581, #6ee7b7);
}

.bar-row.tone-orange .bar i {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.bar-row.tone-purple .bar i {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
}

.trend-bars {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.45rem;
  align-items: end;
}

.trend-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 0.25rem;
}

.trend-bar i {
  width: 100%;
  background: linear-gradient(180deg, #3d8fe6, #4fc3b2);
  border-radius: 8px 8px 3px 3px;
  min-height: 8%;
}

.trend-bar span {
  font-size: 0.68rem;
  color: #4c6989;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.72rem;
}

.module-link {
  display: block;
  text-decoration: none;
  border: 1px solid #d7e2f1;
  border-radius: 14px;
  padding: 0.84rem 0.86rem;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  color: #143052;
  box-shadow: 0 6px 14px rgba(15, 36, 70, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-link:hover {
  transform: translateY(-2px);
  border-color: #bcd3ee;
  box-shadow: 0 12px 24px rgba(15, 36, 70, 0.14);
}

.module-link strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.module-link span {
  display: block;
  font-size: 0.8rem;
  color: #567290;
}

@keyframes red-pulse {
  0% {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.14), 0 0 10px rgba(220, 38, 38, 0.26);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2), 0 0 18px rgba(220, 38, 38, 0.5);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.14), 0 0 10px rgba(220, 38, 38, 0.26);
  }
}

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

@media (max-width: 1020px) {
  body {
    padding: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-radius: 0;
    max-width: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    min-height: var(--topbar-height);
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    right: 0;
    left: auto;
    height: calc(100vh - var(--topbar-height));
    width: min(320px, 86vw);
    border-right: 0;
    border-left: 1px solid #122c52;
    border-bottom: 0;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    z-index: 50;
  }

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

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .side-nav {
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
  }

  .sidebar-overlay {
    top: var(--topbar-height);
  }

  .topbar h2 {
    font-size: 1rem;
  }

  .panel .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel .actions > * {
    width: 100%;
  }

  .panel .actions .inline-check {
    justify-content: flex-start;
  }

  .panel .actions button {
    justify-content: center;
  }

  main,
  .app-page.active,
  .dashboard-layout,
  .cards,
  .chart-grid,
  .grid-form,
  .nested-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .dashboard-panel .cards {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-width: 0;
  }

  .chart-card--wide {
    grid-column: span 1;
  }

  .bar-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .bar-row span,
  .bar-row strong {
    white-space: normal;
  }

  .bar-row strong {
    justify-self: start;
  }

  .overview-detail summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-detail summary::after {
    align-self: flex-end;
  }
}

@media (max-width: 760px) {
  main {
    grid-template-columns: 1fr;
  }

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    white-space: normal;
    word-break: break-word;
  }

  .chart-card h3 {
    font-size: 0.78rem;
  }

  .daily-form {
    gap: 0.75rem;
  }

  .daily-form input,
  .daily-form select,
  .daily-form textarea {
    font-size: 1rem;
    padding: 0.7rem 0.75rem;
  }

  .daily-form .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .daily-form button,
  .daily-form .nav-button {
    width: 100%;
    justify-content: center;
  }

  .month-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .month-values {
    text-align: left;
  }

  .donut {
    width: 110px;
    height: 110px;
  }

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

  .body-3d-viewer {
    height: 300px;
  }

  .onboarding-panel .body-3d-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .onboarding-panel .body-3d-toolbar button {
    width: 100%;
    justify-content: center;
  }

  .onboarding-panel .body-map-regions {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    max-height: 260px;
  }

  .onboarding-panel .body-region {
    font-size: 0.78rem;
    padding: 0.5rem 0.55rem;
  }

  .onboarding-panel .body-3d-badge,
  .onboarding-panel .body-3d-status {
    font-size: 0.64rem;
  }

  .onboarding-panel .grid-form {
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .expense-group summary {
    grid-template-columns: 1fr auto 1.2rem;
    row-gap: 0.35rem;
  }

  .expense-group-count {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .therapist-group summary {
    grid-template-columns: 1fr auto 1.2rem;
    row-gap: 0.35rem;
  }

  .therapist-group-rate {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .onboarding-panel .body-3d-viewer {
    height: 240px;
  }

  .onboarding-panel .body-map-regions {
    max-height: 220px;
  }
}
  .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-card-header select {
    width: 100%;
  }
