body {
  margin: 0;
}

:root {
  --theme-bg: #eef2f7;
  --theme-surface: #ffffff;
  --theme-line: #d6deea;
  --theme-ink: #1f2d45;
  --theme-muted: #5d6b83;
  --theme-header: #152337;
  --theme-header-2: #1a2c45;
  --theme-primary: #0c73c8;
  --theme-primary-2: #0959a7;
}

body {
  background: var(--theme-bg);
  color: var(--theme-ink);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 248px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 0.75rem;
  background: linear-gradient(180deg, #1f2b3e 0%, #1a2333 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  backdrop-filter: none;
}

.content-shell::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 24;
  background: linear-gradient(180deg, #111a28 0%, #172234 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-strip-actions {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 26;
  display: inline-flex;
  gap: 0.35rem;
}

.top-strip-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(237, 245, 255, 0.82);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.top-strip-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.top-strip-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.top-strip-icon-avatar {
  border-radius: 999px;
  overflow: hidden;
  padding: 0;
}

.top-strip-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
}

.header-brand h2,
.header-brand .eyebrow,
.header-link,
.header-user {
  color: rgba(238, 245, 255, 0.92);
}

.header-link:hover,
.header-link.active,
.header-user:hover,
.header-user.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.12);
}

.app-shell .main-content {
  background: var(--theme-bg);
  padding-top: 70px;
  padding-left: 276px;
}

.header-brand {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.header-brand h2 {
  font-size: 1rem;
}

.mobile-nav-toggle {
  display: none;
}

.header-nav {
  display: grid;
  gap: 0.35rem;
  align-items: stretch;
  min-height: 0;
  overflow: auto;
}

.header-nav-section {
  display: grid;
  gap: 0.32rem;
  margin-bottom: 0.35rem;
}

.header-nav-section-bottom {
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.header-nav-title {
  margin: 0.25rem 0 0.2rem;
  padding: 0 0.35rem;
  color: rgba(210, 224, 241, 0.62);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-link {
  width: 100%;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  color: rgba(229, 239, 252, 0.86);
  background: transparent;
  border: 1px solid transparent;
}

.header-link:hover,
.header-link.active {
  background: linear-gradient(180deg, #1777c8, #0f5da6);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
}

.header-link-inner {
  display: inline-grid;
  grid-template-columns: 16px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
}

.header-link-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}

.header-link-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.header-link-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #d83333;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.58rem 0.62rem;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 0.5rem;
  color: rgba(232, 241, 252, 0.95);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: rgba(235, 244, 255, 0.85);
}

.sidebar-user-avatar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sidebar-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-meta {
  display: grid;
  gap: 0.1rem;
}

.sidebar-user-card strong {
  font-size: 0.9rem;
}

.sidebar-user-card small {
  color: rgba(208, 220, 236, 0.74);
}

.header-actions {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.65rem;
  justify-content: flex-start;
}

.user-menu-trigger {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  justify-content: flex-start;
  padding: 0 0.6rem;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.user-menu-trigger .user-menu-avatar-img {
  width: 24px;
  height: 24px;
}

.user-menu-dropdown {
  right: auto;
  left: 0;
}

.sidebar-footer-mark {
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  justify-content: flex-start;
}

.sidebar-footer-mark img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  padding: 2px;
}

.loader-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.auth-card {
  width: min(480px, 92vw);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d8deea;
  border-radius: 16px;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.inline-actions {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.modal-card .inline-actions {
  justify-content: flex-end;
}

.action-icon-button {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.action-icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: #2f374b;
}

input,
select,
textarea {
  font: inherit;
  border: 1px solid #cfd7e6;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.patient-diagnosis-field {
  min-height: 192px;
}

.list-card {
  margin-bottom: 1rem;
  border: 1px solid var(--theme-line);
  border-radius: 14px;
  background: var(--theme-surface);
  box-shadow: 0 4px 16px rgba(14, 29, 48, 0.04);
}

.two-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.two-card-row .list-card {
  margin-bottom: 0;
}

.hero-card {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  margin-top: 0.55rem;
  background: #ffffff;
}

.table-top-controls {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-start;
}

.table-top-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
  border-bottom: 1px solid #e5ebf5;
  padding: 0.72rem;
  vertical-align: top;
}

.table-wrap thead th {
  background: #f6f9fd;
  color: #1e2f4d;
  font-weight: 700;
}

.table-pagination {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.table-pagination-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #4a5977;
  font-size: 0.92rem;
}

.table-pagination-meta label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.table-page-size {
  width: auto;
  min-width: 74px;
}

.table-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.pagination-button {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
}

.pagination-arrow {
  width: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-arrow svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  margin-top: 0.25rem;
  width: fit-content;
}

.checkbox-row input[type='checkbox'] {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.6rem 0.7rem;
  margin-top: 0.35rem;
  border: 1px solid #d8dfeb;
  border-radius: 10px;
  background: #f9fafc;
}

.checkbox-list .checkbox-row {
  margin-top: 0;
}

.assignment-therapist-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.assignment-therapist-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.6rem;
}

.assignment-therapist-remove {
  border: none;
  background: transparent;
  color: #b3261e;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.assignment-therapist-remove:hover {
  color: #7a1a15;
}

.inline-card {
  border: 1px solid #d8deea;
  border-radius: 12px;
  padding: 0.7rem;
  margin-bottom: 0.45rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.documents-board {
  padding: 0.95rem;
  border-radius: 16px;
}

.documents-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.documents-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 2rem;
  color: #223248;
}

.documents-title svg {
  width: 26px;
  height: 26px;
  fill: #1d6fb8;
}

.documents-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.documents-filter {
  display: block;
}

.documents-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #263a55;
}

.documents-filter-checkbox input {
  width: 18px;
  height: 18px;
}

.documents-filter select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid #d8e3ef;
  font-size: 1.02rem;
  color: #263a55;
  background: #ffffff;
}

.documents-year-block {
  margin-top: 0.7rem;
}

.documents-year-title {
  margin: 0 0 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  border-left: 6px solid #2b8ccc;
  background: #f5f8fc;
  color: #27384e;
  font-size: 2rem;
}

.documents-year-title svg {
  width: 22px;
  height: 22px;
  fill: #2b8ccc;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

@media (max-width: 1280px) {
  .documents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .documents-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.document-card {
  border: 1px solid #d8e2ee;
  border-left: 5px solid #2b8ccc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(20, 40, 65, 0.08);
  overflow: hidden;
  cursor: pointer;
}

.document-card:focus-visible {
  outline: 2px solid rgba(35, 111, 184, 0.45);
  outline-offset: 2px;
}

.session-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.session-history-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d8e2ee;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.session-history-card:hover {
  background: #f2f6fb;
}

.session-history-item-therapy {
  font-weight: 600;
  color: #1f2d45;
}

.session-history-item-date {
  color: #5c6b82;
  font-size: 0.9rem;
}

.document-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.8rem 0.95rem 0.35rem;
}

.document-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 0.82rem;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
}

.document-type-pill-evaluation {
  background: linear-gradient(180deg, #257ec0, #206fac);
}

.document-type-pill-followup {
  background: linear-gradient(180deg, #d19963, #bf8041);
}

.document-type-pill-progress {
  background: linear-gradient(180deg, #7f5ea9, #6c4c98);
}

.document-type-pill-neutral {
  background: linear-gradient(180deg, #5b7ea3, #4e6e90);
}

.document-type-pill-success {
  background: linear-gradient(180deg, #3fa15a, #2f8a49);
}

.document-type-pill-warning {
  background: linear-gradient(180deg, #c98a2f, #b3761f);
}

.document-type-pill-danger {
  background: linear-gradient(180deg, #d73333, #b92020);
}

.document-card h4 {
  margin: 0;
  padding: 0 0.95rem;
  color: #27374e;
  font-size: 1.9rem;
}

.document-card-patient {
  margin: 0.72rem 0 0;
  padding: 0.65rem 0.95rem 0;
  border-top: 1px solid #e5edf6;
  color: #495c74;
  font-size: 1rem;
}

.document-card-summary {
  margin: 0;
  padding: 0.35rem 0.95rem 0;
  color: #354a64;
  font-size: 0.97rem;
  line-height: 1.35;
}

.document-card-meta {
  margin-top: 0.68rem;
  padding: 0 0.95rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #4f627c;
  font-size: 0.93rem;
}

.document-visibility {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 700;
}

.document-visibility svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.document-visibility.is-visible {
  color: #2c8f5e;
}

.document-visibility.is-hidden {
  color: #7d8795;
}

.document-attachment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #4f627c;
}

.document-attachment-indicator svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.document-attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.document-attachment-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document-attachment-row .billing-attachment-button {
  flex: 1 1 auto;
}

.attachment-read-status {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.attachment-read-status.is-read {
  background: #e2f6ea;
  color: #197a3d;
}

.attachment-read-status.is-unread {
  background: #f4f0e2;
  color: #8a6d1f;
}

.attachment-viewer-modal {
  width: min(1400px, 96vw);
}

.attachment-viewer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88vh;
  max-height: 88vh;
  overflow: auto;
  padding: 0.5rem;
}

.attachment-viewer-body img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
}

.attachment-viewer-body iframe {
  width: 100%;
  height: 88vh;
  border: 0;
  border-radius: 8px;
}

.attachment-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  padding: 0.5rem;
  background: #f8fafc;
}

.attachment-card-body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
  text-align: left;
}

.attachment-card-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  fill: #3a6bd6;
}

.attachment-card-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-preview {
  flex-direction: column;
  align-items: stretch;
}

.attachment-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0 0.2rem;
}

.attachment-card-footer .attachment-read-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-permission {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--theme-line);
  background: #ffffff;
}

.document-card-actions {
  border-top: 1px solid #e5edf6;
  padding: 0.68rem 0.95rem;
  justify-content: flex-start;
  gap: 0.45rem;
}

.session-card-actions {
  justify-content: space-between;
}

.session-status-actions,
.session-manage-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 980px) {
  .session-card-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
  }
}

.documents-empty {
  margin: 0.75rem 0 0;
  color: #4d5f78;
}

.billing-filters {
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: none;
}

.billing-filters .documents-filter {
  flex: 1 1 150px;
  min-width: 130px;
}

.billing-filters .documents-filter select {
  min-height: 40px;
  font-size: 0.9rem;
  padding: 0 0.6rem;
}

.sessions-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  grid-template-columns: none;
}

.sessions-filters .documents-filter {
  flex: 1 1 150px;
  min-width: 130px;
}

.sessions-filters .documents-filter select {
  min-height: 40px;
  font-size: 0.9rem;
  padding: 0 0.6rem;
}

.sessions-filters .documents-filter-checkbox {
  flex: 0 0 auto;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.billing-summary-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f3f7fb);
}

.billing-summary-card small {
  color: #5a6983;
  font-size: 0.88rem;
}

.billing-summary-card strong {
  color: #24364f;
  font-size: 1.5rem;
}

.billing-summary-card-alert {
  border-color: #f0c4c4;
  background: linear-gradient(180deg, #fff8f8, #fff0f0);
}

.billing-summary-card-income {
  background: linear-gradient(180deg, #f8fffb, #eef9f1);
}

.billing-summary-card-expense {
  background: linear-gradient(180deg, #fffaf7, #fff2ea);
}

.billing-tax-note {
  margin: 0.35rem 0 0;
  color: #5b6d85;
  max-width: 860px;
}

.billing-section-divider {
  height: 1px;
  background: #dbe3ef;
  margin: 0.35rem 0 0.15rem;
}

.billing-ledger-header {
  margin-top: 0.4rem;
}

.billing-inline-note {
  margin: 0.3rem 0 0;
  color: #5b6d85;
}

.billing-entry-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 0.72rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.billing-entry-type-income {
  background: #e9f8ef;
  color: #237b4f;
}

.billing-entry-type-expense {
  background: #fff0f0;
  color: #b13a3a;
}

.billing-attachment-button {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

.billing-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: #f8fbff;
}

.billing-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.billing-status-pending {
  background: #eef4ff;
  color: #275ea8;
}

.billing-status-paid {
  background: #e9f8ef;
  color: #237b4f;
}

.billing-status-overdue {
  background: #fff0f0;
  color: #b13a3a;
}

.billing-status-cancelled {
  background: #f2f4f7;
  color: #66758f;
}

.document-preview-modal {
  max-height: 84vh;
  overflow: auto;
}

.document-preview-meta-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e4ebf5;
  color: #38506e;
}

.document-preview-body {
  display: grid;
  gap: 0.7rem;
}

.document-preview-body section {
  border-bottom: 1px solid #e7edf6;
  padding-bottom: 0.65rem;
}

.document-preview-body section:last-child {
  border-bottom: 0;
}

.document-preview-body h4 {
  margin: 0 0 0.35rem;
  color: #243754;
}

.document-preview-body p {
  margin: 0;
  color: #3e5571;
  line-height: 1.45;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(14, 24, 46, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: min(760px, 96vw);
  border-radius: 14px;
  border: 1px solid var(--theme-line);
  background: #ffffff;
  box-shadow: 0 22px 40px rgba(12, 26, 43, 0.24);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.modal-card-wide {
  width: min(1020px, 96vw);
}

.form-hint {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fdf3e2;
  color: #8a5a12;
  font-size: 0.92rem;
}

.modal-scroll {
  max-height: 74vh;
  overflow: auto;
  padding-right: 0.35rem;
}

.dynamic-list-field {
  display: grid;
  gap: 0.5rem;
}

.dynamic-list-label {
  font-weight: 600;
  color: var(--theme-text-strong, #1f2937);
}

.dynamic-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
}

.dynamic-row input[type='text'],
.dynamic-row input:not([type]) {
  width: 100%;
}

.dynamic-row-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.audio-record-field {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--theme-line);
  border-radius: 10px;
}

.audio-record-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.recording-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #ffffff;
  margin-right: 0.4rem;
  animation: recording-pulse 1.1s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.audio-interim-transcript {
  margin: 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--theme-text-muted, #6b7280);
}

.audio-record-player {
  width: 100%;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.modal-head h3 {
  margin: 0;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid #d5dced;
  border-radius: 8px;
  background: #f4f7fc;
  font-weight: 700;
  color: #4a5977;
}

.modal-close:hover {
  background: #edf2fb;
}

.button {
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-primary-2));
  box-shadow: 0 8px 16px rgba(12, 115, 200, 0.28);
}

.button.button-danger {
  background: linear-gradient(180deg, #d73333, #b92020);
  box-shadow: 0 8px 16px rgba(183, 32, 32, 0.24);
}

.button.button-success {
  background: linear-gradient(180deg, #3fa15a, #2f8a49);
  box-shadow: 0 8px 16px rgba(47, 138, 73, 0.24);
}

.button.button-ghost {
  background: #f2f6fc;
  color: #224267;
  border: 1px solid #d6deea;
  box-shadow: none;
}

.button.button-ghost:hover {
  background: #eaf0f8;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #ccd5e5;
  background: linear-gradient(180deg, #ffffff, #eef2f8);
  display: grid;
  place-items: center;
  color: #253655;
}

.user-menu-trigger svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.user-menu-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu-trigger:hover {
  border-color: #b5c1d9;
  background: linear-gradient(180deg, #ffffff, #e7edf8);
}

.user-menu-trigger:focus-visible {
  outline: 2px solid rgba(33, 92, 221, 0.35);
  outline-offset: 2px;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: auto;
  right: 0;
  width: 220px;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid #d4dced;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(20, 33, 61, 0.14);
  z-index: 25;
  display: grid;
  gap: 0.35rem;
}

.user-menu-dropdown-top {
  top: calc(100% + 0.45rem);
  right: 0;
  left: auto;
}

.user-menu-meta {
  display: grid;
  gap: 0.05rem;
  padding: 0.4rem 0.5rem 0.55rem;
  border-bottom: 1px solid #e8edf7;
}

.user-menu-meta strong {
  font-size: 0.92rem;
  color: #1d2f54;
}

.user-menu-meta small {
  color: #596782;
}

.user-menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 0.52rem 0.58rem;
  color: #21345e;
  font-weight: 600;
}

.user-menu-item:hover {
  background: #eef3ff;
}

.user-menu-item-danger {
  color: #b11f2f;
}

.user-menu-item-danger:hover {
  background: #fdecee;
}

.user-menu-item-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.user-menu-item-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #2e4a86;
}

.user-menu-item-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.notifications-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  min-height: 60vh;
}

@media (max-width: 900px) {
  .notifications-page {
    grid-template-columns: 1fr;
  }
}

.notifications-list-panel {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  overflow: hidden;
  min-width: 0;
}

.notifications-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.notifications-list-head h2 {
  margin: 0;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 65vh;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
}

.notifications-empty {
  color: var(--theme-muted);
  padding: 0.5rem 0;
}

.notification-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: stretch;
  text-align: left;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  background: #f8fbff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.notification-item-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.notification-item-row .notification-item {
  flex: 1 1 auto;
  min-width: 0;
}

.notification-item-row .action-icon-button {
  flex: 0 0 auto;
  align-self: center;
}

.notification-item.is-active {
  border-color: var(--theme-primary);
  background: #eaf3fd;
}

.notification-item.is-unread strong {
  color: var(--theme-primary-2);
}

.notification-item-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.notification-item-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.notification-lock-icon {
  width: 14px;
  height: 14px;
  fill: #b11f2f;
}

.notification-item-role {
  font-size: 0.78rem;
  color: var(--theme-muted);
}

.notification-item-preview {
  font-size: 0.85rem;
  color: var(--theme-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--theme-muted);
}

.notification-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.72rem;
}

.notifications-thread-panel {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  min-height: 65vh;
  min-width: 0;
}

.notifications-thread-empty {
  color: var(--theme-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.notifications-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px solid var(--theme-line);
  padding-bottom: 0.6rem;
}

.notifications-thread-head small {
  display: block;
  color: var(--theme-muted);
}

.notifications-thread-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: 50vh;
  padding: 0.3rem 0.1rem;
}

.chat-bubble {
  max-width: 70%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: #eef2f7;
}

.chat-bubble p {
  margin: 0 0 0.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble small {
  color: var(--theme-muted);
  font-size: 0.72rem;
}

.chat-bubble-mine {
  align-self: flex-end;
  background: var(--theme-primary);
  color: #ffffff;
}

.chat-bubble-mine p {
  color: #ffffff;
}

.chat-bubble-mine small {
  color: #ffffff;
  opacity: 0.9;
}

.chat-bubble-theirs {
  align-self: flex-start;
}

.notifications-locked-banner {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: #fdecee;
  color: #b11f2f;
  font-size: 0.85rem;
}

.notifications-reply-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.notifications-reply-form textarea {
  flex: 1;
  resize: vertical;
}
}

.user-menu-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 0.38rem;
  background: #d3122a;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-photo-editor {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0.8rem 0 1rem;
}

.profile-photo-preview {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid #d1daeb;
  background: #eef2f9;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.profile-photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-placeholder {
  color: #61708d;
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-photo-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.profile-photo-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.profile-photo-upload input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.session-modal-actions {
  justify-content: flex-end;
}

.session-schedule-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.localized-date-field {
  position: relative;
}

.localized-date-field input[type='text'] {
  padding-right: 2.6rem;
  cursor: pointer;
}

.localized-date-trigger {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  color: #22345a;
  cursor: pointer;
}

.localized-date-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 960px) {
  .content-shell::before,
  .content-shell::after {
    display: none;

  .billing-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  }

  .top-strip-actions,
  .sidebar-footer-mark {
    display: none;
  }

  .billing-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    padding: 0.85rem 1rem;
    border-right: 0;
    background: linear-gradient(180deg, var(--theme-header), var(--theme-header-2));
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    margin: 0;
    padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--theme-header), var(--theme-header-2));
    box-shadow: 0 16px 28px rgba(10, 20, 40, 0.35);
    z-index: 20;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }

  .sidebar-user-card {
    display: none;
  }

  .header-link {
    width: 100%;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(237, 245, 255, 0.92);
    cursor: pointer;
  }

  .mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
  }

  .header-actions {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
    margin-left: auto;
  }

  .app-shell .main-content {
    padding-left: 1rem;
    padding-top: 1rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .session-schedule-row {
    grid-template-columns: 1fr;
  }
}
