:root {
  --bg: #dce2de;
  --panel: #fff;
  --panel2: #d2dad5;
  --card: #fff;
  --border: #98a39c;
  --text: #142019;
  --muted: #4d5850;
  --accent: #015b27;
  --primary: #015b27;
  --q-primary: #015b27;
  --q-positive: #16834f;
  --q-negative: #c43d48;
  --q-warning: #b7791f;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
.loading {
  padding: 60px;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #eef1ef;
  color: #142019;
  padding: 24px 14px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 26px;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.brand small {
  font-size: 10px;
  display: block;
  letter-spacing: 1px;
  color: #4d5850;
  margin-top: 3px;
}
.brand-icon {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px;
  margin-bottom: 4px;
  cursor: pointer;
}
.nav-item:hover {
  background: #ffffff0d;
}
.nav-item.active {
  background: #015b27;
  color: white;
}
.sidebar-footer {
  margin-top: auto;
  padding: 20px 10px 0;
  font-size: 12px;
  color: #4d5850;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 76px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 12px;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
}
.topbar-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.page {
  padding: 30px 32px;
  max-width: 1700px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 25px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.6px;
  margin: 0;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 18px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.muted,
.text-muted {
  color: var(--muted);
}
.subtitle {
  color: var(--muted);
  margin-top: 7px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 20px;
}
.kpi-action {
  position: relative;
  width: 100%;
  min-width: 0;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 100ms ease;
}
.kpi-action .kpi-label {
  padding-right: 25px;
}
.kpi-arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel2);
  color: var(--q-primary);
  font-size: 16px;
}
.kpi-action:focus-visible {
  outline: 3px solid rgb(0 104 55 / 28%);
  outline-offset: 2px;
  border-color: var(--q-primary);
}
.kpi-action:active {
  transform: scale(0.98);
}
@media (hover: hover) {
  .kpi-action:hover {
    border-color: var(--q-primary);
    box-shadow: 0 5px 14px rgb(0 84 42 / 10%);
  }
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-value {
  font-size: 27px;
  font-weight: 650;
  margin: 12px 0 5px;
  letter-spacing: -0.7px;
}
.kpi-note {
  font-size: 11px;
  color: var(--muted);
}
.positive {
  color: #16834f;
}
.negative {
  color: #c43d48;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 22px;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.panel-head h2 {
  margin: 0;
}
.columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.period {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}
.period .q-field {
  width: 170px;
  min-width: 140px;
  flex: 0 1 170px;
}
.filter-toolbar {
  width: 100%;
}
.filter-toolbar-label {
  white-space: nowrap;
}
.filter-toolbar .expense-filter {
  width: 280px;
  max-width: 320px;
  min-width: 210px;
  flex: 0 1 280px;
}
.report-toolbar {
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.report-toolbar .q-field {
  width: auto;
  min-width: 105px;
  flex: 1 1 130px;
}
.report-toolbar .q-btn {
  flex: none;
  padding-inline: 8px;
}
.task-toolbar {
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.task-toolbar .q-field {
  margin-left: auto;
}
.q-table th {
  color: var(--muted);
  font-weight: 600;
  background: #d2dad5;
}
.q-table td {
  height: 53px;
}
.q-table__container {
  box-shadow: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.q-field--outlined .q-field__control:before {
  border-color: var(--border);
}
.q-btn {
  border-radius: 6px;
  text-transform: none;
  font-weight: 550;
}
.q-card {
  border-radius: 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.work-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  cursor: pointer;
}
.work-card:hover {
  border-color: #149653;
  box-shadow: 0 4px 14px #002f1408;
}
.work-card p {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}
.work-card h3 {
  line-height: 1.45;
}
.work-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.badge {
  display: inline-block;
  background: #dce2de;
  color: #015b27;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}
.badge.done,
.badge.approved {
  background: #e5f5ee;
  color: #16834f;
}
.badge.waiting,
.badge.moderation,
.badge.acceptance {
  background: #fff3da;
  color: #976720;
}
.badge.rejected {
  background: #fbecec;
  color: #a84343;
}
.badge.debt-state {
  margin-bottom: 0;
  white-space: nowrap;
}
.badge.paid {
  background: #e5f5ee;
  color: #16834f;
}
.badge.advance {
  background: #e5f1ed;
  color: #006837;
}
.badge.due {
  background: #e9efec;
  color: #52645c;
}
.badge.due_soon {
  background: #fff3da;
  color: #976720;
}
.badge.overdue {
  background: #fbecec;
  color: #b23a45;
}
.badge.long_overdue {
  background: #8f2632;
  color: #fff;
}
.debt-detail-dialog {
  width: min(1180px, 96vw);
  max-width: 1180px;
}
.debt-register .q-table tbody tr {
  cursor: default;
}
.debt-filters .q-field {
  width: 210px;
}
.debt-summary-panel .detail-facts {
  margin-bottom: 12px;
}
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .material-icons {
  font-size: 34px;
  color: #98a39c;
  display: block;
  margin-bottom: 10px;
}
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  min-width: 0;
  padding-bottom: 12px;
}
.kanban-column {
  min-width: 0;
  background: #d2dad5;
  border-radius: 8px;
  padding: 12px;
}
.kanban-column > h3 {
  font-size: 13px;
  margin: 4px 2px 15px;
}
.kanban-column .work-card {
  margin-bottom: 12px;
  padding: 15px;
}
.gantt-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.gantt-track {
  background: #dce2de;
  border-radius: 5px;
  height: 26px;
  overflow: hidden;
  position: relative;
}
.gantt-bar {
  position: absolute;
  height: 100%;
  background: #149653;
  border-radius: 5px;
  min-width: 5px;
}
.gantt-bar.done {
  background: #16834f;
}
.modal {
  width: 600px;
  max-width: 95vw;
}
.web-onboarding {
  width: min(820px, calc(100vw - 32px));
  max-width: 820px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  border-radius: 12px;
}
.web-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.web-onboarding-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel2);
}
.web-onboarding-option > .q-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #dce9e1;
  color: var(--q-primary);
  font-size: 25px;
}
.web-onboarding-option h3 {
  margin: 2px 0 8px;
}
.web-onboarding-option p {
  line-height: 1.55;
}
.web-onboarding-privacy {
  color: var(--muted);
  font-size: 13px;
}
.detail {
  width: 850px;
  max-width: 96vw;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.attachment-picker {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.attachment-picked {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.attachment-picked > span {
  display: grid;
  min-width: 0;
  flex: 1;
}

.attachment-picked b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-picked small {
  color: var(--muted);
}
.full {
  grid-column: 1/-1;
}
.detail-copy {
  white-space: pre-wrap;
  line-height: 1.7;
}
.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.fact {
  padding: 14px;
  background: #d2dad5;
  border-radius: 7px;
}
.fact small {
  display: block;
  color: var(--muted);
  margin-bottom: 7px;
}
.auth {
  max-width: 460px;
  margin: 8vh auto;
  padding: 0 18px;
}
.auth .brand {
  color: var(--text);
  padding: 0 0 25px;
}
.auth .brand small {
  color: var(--muted);
}
.auth .brand-icon {
  color: white;
}
.auth .panel {
  padding: 28px;
}
.auth .q-field {
  margin-bottom: 16px;
}
.note {
  border-left: 3px solid #149653;
  background: #eef1ef;
  padding: 14px 16px;
  color: #303a33;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
}
.notice {
  background: #fff4df;
  color: #886021;
  padding: 12px 18px;
  border-bottom: 1px solid #eed6aa;
  font-size: 12px;
}
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #c3cbc6;
}
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #149653;
  margin-top: 6px;
  flex: none;
}
.timeline-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.notification-item {
  width: 100%;
  align-items: flex-start;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.notification-item:hover,
.notification-item:focus-visible {
  background: #eef1ef;
  outline: 0;
}
.notification-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--q-primary);
}
.notification-copy {
  flex: 1;
  min-width: 0;
}
.notification-item.read .notification-copy {
  opacity: 0.68;
}
.notification-chevron {
  margin: 1px 0 0 auto;
  color: var(--q-primary);
  font-size: 20px;
}
.qr {
  background: white;
  padding: 12px;
  display: flex;
  justify-content: center;
}
.qr img {
  max-width: 100%;
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-nav {
  display: none;
}
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  padding: 12px 0;
}
.session-device {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.session-device > div {
  min-width: 0;
}
.session-device b,
.session-device small {
  display: block;
}
.session-device .badge {
  margin: 0 0 0 8px;
  padding: 3px 6px;
}
.session-device small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}
.invitation-manager {
  max-height: min(92vh, 820px);
  overflow-y: auto;
}
@media (max-width: 600px) {
  .session-device {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .session-device > .q-btn {
    grid-column: 2;
    justify-self: start;
  }
}
.q-dialog__inner--minimized {
  padding: 16px;
}
.q-dialog .q-card__section {
  padding: 22px;
}
.q-table__bottom {
  min-height: 44px;
}
.q-notification {
  max-width: 90vw;
}
.donut {
  height: 9px;
  background: #dce2de;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  margin: 14px 0;
}
.donut > span {
  background: #015b27;
}
.donut > span + span {
  background: #52c987;
}
.q-tab {
  text-transform: none;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}
.discussion-message-body {
  white-space: pre-wrap;
}
.q-dialog .discussion-message-list {
  max-height: 310px;
  overflow: auto;
}
.mobile-only {
  display: none;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .main {
    grid-column: 1;
  }
  .topbar {
    padding: 0 18px;
    height: 65px;
  }
  .page {
    padding: 22px 16px 94px;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi {
    padding: 15px;
  }
  .kpi-value {
    font-size: 23px;
  }
  .columns,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading .actions {
    justify-content: flex-end;
  }
  h1 {
    font-size: 23px;
  }
  .panel {
    padding: 17px;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    overflow-x: auto;
    background: white;
    border-top: 1px solid var(--border);
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
    z-index: 20;
  }
  .mobile-nav button {
    flex: 1;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 10px;
    padding: 6px;
  }
  .mobile-nav button.active {
    color: var(--accent);
  }
  .mobile-nav .material-icons {
    font-size: 22px;
  }
  .topbar .desktop-label {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: 1;
  }
  .gantt-row {
    grid-template-columns: 110px 1fr;
    font-size: 12px;
  }
  .detail-facts {
    gap: 10px;
  }
  .mobile-only {
    display: block;
  }
  .desktop-only {
    display: none;
  }
  .period .q-field {
    flex: 1;
    width: auto;
    min-width: 125px;
  }
  .period,
  .filter-toolbar,
  .task-toolbar {
    flex-wrap: wrap;
  }
  .filter-toolbar .expense-filter {
    max-width: none;
    min-width: 180px;
  }
  .report-toolbar .filter-toolbar-label {
    width: 100%;
  }
  .task-toolbar .q-field {
    margin-left: 0;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

.nav-item .material-icons {
  font-size: 20px;
}
.page-heading h1 {
  line-height: 1.3;
}
.page-heading .eyebrow {
  line-height: 1.5;
}

.sidebar {
  border-right: 1px solid var(--border);
}
.nav-item:hover {
  background: var(--panel2);
}
.nav-item.active:hover {
  background: var(--q-primary);
}
.kpi,
.panel,
.work-card {
  background: var(--card);
}
.brand-tint {
  background: var(--panel2);
}
.contribution-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.contribution-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex: 1 1 250px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.contribution-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contribution-title .q-btn {
  margin-left: auto;
}
.contribution-price {
  font-size: 22px;
  font-weight: 600;
}
.contribution-price small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.contribution-preview {
  padding: 16px;
  background: var(--panel2);
  border-radius: 8px;
  line-height: 1.6;
}
.contribution-preview p {
  margin: 6px 0 0;
}
.members-table .q-table__middle {
  overflow: visible;
}
.members-table .q-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.members-table .q-table th,
.members-table .q-table td {
  padding: 10px 6px;
  line-height: 1.3;
  vertical-align: middle;
}
.members-table .q-table th {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 11.5px;
  font-weight: 600;
}
.members-table .q-table td {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 12px;
}
.members-table td.member-col-money {
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
}
.members-table td.member-col-object {
  font-weight: 600;
  white-space: nowrap !important;
}
.members-table .member-col-actions {
  text-align: center;
}
.members-table .q-btn--dense {
  flex: 0 0 26px;
  width: 26px;
  min-width: 26px !important;
  height: 28px;
  min-height: 28px !important;
  padding: 0 !important;
}
.members-table .q-btn .q-icon {
  font-size: 20px;
}
.members-table th:last-child,
.members-table td:last-child {
  white-space: nowrap;
  padding-inline: 3px;
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
  border-left: 1px solid var(--border);
}
.member-action-menu {
  min-width: 230px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(22, 48, 32, 0.18);
}
.member-action-menu .q-item {
  min-height: 42px;
}
.member-action-menu .q-item__section--avatar {
  min-width: 36px;
  padding-right: 8px;
}

.tasks-table {
  max-width: 100%;
}
.tasks-table .q-table__middle {
  max-height: none;
  overflow: visible;
}
.tasks-table .q-table {
  table-layout: fixed;
  width: 100%;
}
.tasks-table .q-table th,
.tasks-table .q-table td {
  padding: 8px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  border-color: var(--border);
}
.tasks-table .q-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel2);
}
.tasks-table .q-table th:first-child,
.tasks-table .q-table td:first-child {
  position: sticky;
  left: 0;
  width: 24%;
  min-width: 0;
  white-space: normal;
  background: var(--card);
  z-index: 1;
}
.tasks-table .q-table th:first-child {
  background: var(--panel2);
  z-index: 4;
}
.tasks-table th:nth-child(2) {
  width: 13%;
}
.tasks-table th:nth-child(3),
.tasks-table th:nth-child(4) {
  width: 8%;
}
.tasks-table th:nth-child(5) {
  width: 16%;
}
.tasks-table th:nth-child(6),
.tasks-table th:nth-child(7),
.tasks-table th:nth-child(8) {
  width: 9%;
}
.tasks-table th:nth-child(9) {
  width: 36px;
}
.tasks-table th:nth-child(9),
.tasks-table td:nth-child(9) {
  padding-inline: 2px;
}
.tasks-table td:nth-child(9) .q-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
}
.tasks-table td:nth-child(9) .q-icon {
  font-size: 20px;
}
.tasks-table .badge {
  white-space: normal;
}
.tasks-screen .panel-head {
  flex-wrap: wrap;
}
.tasks-screen .kanban .work-meta {
  flex-wrap: wrap;
}
.tasks-screen .kanban .work-card {
  overflow-wrap: anywhere;
}
.native-mobile .kanban {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 700px) {
  .web-onboarding {
    width: calc(100vw - 20px);
  }
  .web-onboarding > .q-card__section {
    padding: 16px;
  }
  .web-onboarding h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
  }
  .web-onboarding-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .web-onboarding-option {
    min-height: 0;
    padding: 12px;
  }
  .web-onboarding-option p {
    margin: 6px 0;
    line-height: 1.4;
  }
  .web-onboarding-option .q-btn {
    width: 100%;
    margin-top: 8px;
  }
  .kanban {
    grid-template-columns: minmax(0, 1fr);
  }
}
.tasks-table .q-table tbody tr {
  cursor: pointer;
}
.tasks-table .q-table tbody tr:hover td {
  background: var(--panel2);
}
.task-table-title {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  line-height: 1.4;
  cursor: pointer;
}
.task-table-title:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 3px;
}

.mobile-task-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.mobile-task-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  min-width: 0;
}
.mobile-task-item .q-item {
  padding: 16px;
}
.mobile-task-item .q-item__section--main {
  min-width: 0;
}
.mobile-task-item .task-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.task-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.task-summary .badge {
  white-space: normal;
}
.mobile-task-body {
  padding: 0 16px 18px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.task-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.task-facts .full {
  grid-column: 1 / -1;
}
.task-facts dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.task-facts dd {
  margin: 0;
  font-weight: 500;
}
.mobile-task-body .doc-row {
  gap: 8px;
}
.mobile-task-body .doc-row > span {
  min-width: 0;
}
.mobile-task-body .doc-row .q-btn {
  flex-shrink: 0;
}
.task-comment p {
  white-space: pre-wrap;
  margin-top: 4px;
}
.task-name-done,
.task-completed .task-name {
  color: #7b8881;
}
.calendar-panel {
  min-width: 0;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}
.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.calendar-legend i {
  width: 16px;
  height: 8px;
  display: inline-block;
}
.plan-key {
  background: #dc7c32;
}
.progress-key {
  background: #149653;
}
.calendar-scroll {
  overflow: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scrollbar-color: #718d7e #e4eae6;
  max-height: 65vh;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.calendar-axis,
.calendar-lane {
  cursor: grab;
  user-select: none;
}
.calendar-scroll.is-dragging,
.calendar-scroll.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
}
.calendar-scroll::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}
.calendar-scroll::-webkit-scrollbar-track {
  background: #e4eae6;
}
.calendar-scroll::-webkit-scrollbar-thumb {
  background: #718d7e;
  border: 2px solid #e4eae6;
  border-radius: 8px;
}
.calendar-sheet {
  --label-width: 235px;
  width: calc(var(--label-width) + var(--timeline-width));
  min-width: 100%;
}
.calendar-header,
.calendar-sheet .calendar-row {
  display: grid;
  grid-template-columns: var(--label-width) minmax(var(--timeline-width), 1fr);
  gap: 0;
  padding: 0;
}
.calendar-header {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 100px;
  background: #edf0ee;
  border-bottom: 1px solid var(--border);
}
.calendar-label {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 12px;
  background: #f7f9f7;
  border-right: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.calendar-header .calendar-label {
  background: #edf0ee;
  align-items: flex-end;
  font-weight: 600;
}
.calendar-label .task-name {
  flex: 1;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}
.calendar-label .task-edit-icon {
  flex: 0 0 auto;
  margin-left: 4px;
}
.task-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.task-card-heading h3 {
  flex: 1;
}
.expense-filter {
  max-width: 320px;
}
.expense-group {
  margin-bottom: 24px;
  min-width: 0;
}
.expense-group-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0;
}
.expense-group-heading h2 {
  font-size: 17px;
  margin: 0;
}
.expense-card-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}
.expense-card-heading b {
  flex: 1 1 130px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.expense-card-heading strong {
  white-space: nowrap;
}
.expense-card .mobile-task-body {
  overflow-wrap: anywhere;
}
.expense-void .expense-card-heading {
  color: #78847f;
}
.badge.cancelled {
  color: #8a4545;
  background: #f2e5e5;
}
.task-lifecycle {
  margin: 16px 0;
}
.editor-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 0;
}
.editor-task-action-dialog p {
  overflow-wrap: anywhere;
}

/* Fit the task workspace instead of clipping or horizontally scrolling it. */
.calendar-fit .calendar-sheet {
  --label-width: clamp(130px, 22vw, 235px);
  width: 100%;
  min-width: 0;
}
.calendar-fit .calendar-header,
.calendar-fit .calendar-row {
  grid-template-columns: var(--label-width) minmax(0, 1fr);
}
.calendar-fit .calendar-scroll {
  max-height: none;
  overflow: visible;
}
.calendar-fit .calendar-axis,
.calendar-fit .calendar-lane,
.calendar-fit .calendar-label .task-name {
  min-width: 0;
}
.calendar-fit .calendar-axis,
.calendar-fit .calendar-lane {
  cursor: default;
}
.native-mobile {
  grid-template-columns: minmax(0, 1fr);
}
.native-mobile .sidebar {
  display: none;
}
.native-mobile .main {
  grid-column: 1;
}
.native-mobile .page {
  padding: 22px 16px 94px;
}
.native-mobile .topbar .desktop-label {
  display: none;
}
.native-mobile .mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  overflow-x: auto;
  background: white;
  border-top: 1px solid var(--border);
  padding: 6px 4px max(6px, env(safe-area-inset-bottom));
  z-index: 20;
}
.native-mobile .mobile-nav button {
  flex: 1;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  padding: 6px;
}
.native-mobile .mobile-nav button.active {
  color: var(--accent);
}
.native-mobile .mobile-nav .material-icons {
  font-size: 22px;
}

/* Installed Android and mobile PWA surfaces use the available height more
   efficiently while the ordinary browser layout keeps its own spacing. */
.native-mobile.installed-mobile .topbar {
  height: 56px;
  padding: 0 10px;
  gap: 6px;
}
.installed-mobile .topbar-identity {
  gap: 7px;
}
.installed-mobile .topbar-logo {
  width: 30px;
  height: 30px;
}
.native-mobile.installed-mobile .topbar-title {
  font-size: 15px;
  line-height: 1.15;
}
.native-mobile.installed-mobile .topbar-sub {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.15;
}
.installed-mobile .topbar-actions {
  gap: 0;
}
.installed-mobile .topbar-actions .q-btn,
.installed-mobile .topbar-profile {
  min-width: 42px;
  min-height: 42px;
}
.installed-mobile .page {
  padding: 12px 10px 76px;
}
.installed-mobile .page-heading {
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.installed-mobile .eyebrow {
  display: none;
}
.installed-mobile h1 {
  font-size: 22px;
  line-height: 1.2;
}
.installed-mobile h2 {
  margin-bottom: 10px;
  font-size: 17px;
}
.installed-mobile .subtitle {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
}
.installed-mobile .page-heading .q-btn {
  min-height: 40px;
  padding-inline: 10px;
  font-size: 12px;
}
.installed-mobile .kpis {
  gap: 7px;
  margin-bottom: 10px;
}
.installed-mobile .kpi {
  padding: 11px;
}
.installed-mobile .kpi-label {
  gap: 5px;
  font-size: 11px;
  line-height: 1.2;
}
.installed-mobile .kpi-value {
  margin: 7px 0 3px;
  font-size: 21px;
  line-height: 1.15;
}
.installed-mobile .kpi-note {
  font-size: 10px;
  line-height: 1.25;
}
.installed-mobile .kpi-arrow {
  top: 7px;
  right: 7px;
}
.installed-mobile .panel {
  padding: 12px;
  margin-bottom: 10px;
}
.installed-mobile .panel-head {
  gap: 8px;
  margin-bottom: 10px;
}
.installed-mobile .columns,
.installed-mobile .cards,
.installed-mobile .mobile-task-list {
  gap: 8px;
}
.installed-mobile .period,
.installed-mobile .filter-toolbar,
.installed-mobile .task-toolbar {
  gap: 7px;
  margin-bottom: 10px;
}
.installed-mobile .period .q-field,
.installed-mobile .filter-toolbar .q-field {
  min-width: 0;
}
.installed-mobile.finance-screen .filter-toolbar {
  display: flex;
  flex-wrap: wrap;
}
.installed-mobile.finance-screen .filter-toolbar > .q-field:nth-child(1),
.installed-mobile.finance-screen .filter-toolbar > .q-field:nth-child(2) {
  flex: 1 1 calc(50% - 4px);
  width: calc(50% - 4px);
  min-width: 145px;
}
.installed-mobile.finance-screen .filter-toolbar > .expense-filter {
  flex: 1 1 230px;
  width: auto;
  min-width: 210px;
}
.installed-mobile.finance-screen .filter-toolbar > .q-space {
  display: none;
}
.installed-mobile .note {
  padding: 10px 12px;
  margin-block: 8px;
  line-height: 1.35;
}
.installed-mobile .timeline-item {
  padding-block: 8px;
}
.installed-mobile .work-card {
  padding: 12px;
}
.installed-mobile .mobile-task-item .q-item {
  min-height: 48px;
  padding: 9px 10px;
}
.installed-mobile.tasks-screen .mobile-task-item .q-item__section--main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
}
.installed-mobile .mobile-task-item .task-name {
  font-size: 14px;
  line-height: 1.3;
}
.installed-mobile.tasks-screen .mobile-task-item .task-summary {
  grid-column: 2;
  grid-row: 1;
}
.installed-mobile.tasks-screen .mobile-task-item .q-linear-progress {
  grid-column: 1 / -1;
}
.installed-mobile.tasks-screen .mobile-task-item .badge {
  margin-bottom: 0;
  padding: 4px 7px;
}
.installed-mobile .task-summary {
  gap: 6px;
  margin: 6px 0;
}
.installed-mobile.tasks-screen .task-summary {
  margin: 0;
}
.installed-mobile.tasks-screen .task-toolbar .q-btn {
  min-height: 40px;
  padding-inline: 7px;
  font-size: 12px;
}
.installed-mobile.tasks-screen .task-toolbar .q-icon {
  font-size: 18px;
}
.installed-mobile.tasks-screen .task-toolbar .q-field {
  flex: 1 0 100%;
  width: 100%;
  max-width: none !important;
}
.installed-mobile .mobile-task-body {
  padding: 0 12px 12px;
}
.installed-mobile .task-facts {
  gap: 8px 10px;
  margin: 10px 0;
}
.installed-mobile .task-facts dt {
  margin-bottom: 2px;
  font-size: 11px;
}
.installed-mobile .expense-group {
  margin-bottom: 14px;
}
.installed-mobile .expense-group-heading {
  margin: 8px 0;
}
.installed-mobile .detail-facts {
  gap: 7px;
}
.installed-mobile .q-dialog .q-card__section {
  padding: 14px;
}
.installed-mobile .mobile-nav {
  padding: 2px 3px max(2px, env(safe-area-inset-bottom));
}
.installed-mobile .mobile-nav button {
  min-width: 58px;
  min-height: 50px;
  gap: 1px;
  padding: 3px 4px;
  font-size: 9px;
  line-height: 1.1;
}
.installed-mobile .mobile-nav .material-icons {
  font-size: 20px;
}
@media (orientation: landscape) and (max-height: 600px) {
  .native-mobile.tasks-screen .page {
    padding-top: 12px;
  }
  .native-mobile.tasks-screen .eyebrow,
  .native-mobile.tasks-screen .subtitle {
    display: none;
  }
  .native-mobile.tasks-screen .page-heading {
    margin-bottom: 12px;
  }
  .native-mobile.tasks-screen .panel {
    padding: 12px;
  }
  .native-mobile.tasks-screen .calendar-header {
    height: 74px;
  }
  .native-mobile.tasks-screen .calendar-tick span {
    font-size: 10px;
  }
  .native-mobile.tasks-screen .calendar-row,
  .native-mobile.tasks-screen .calendar-lane {
    min-height: 42px;
  }
  .native-mobile.tasks-screen .calendar-label {
    padding: 6px;
  }
}
.calendar-axis {
  position: relative;
  overflow: hidden;
}
.calendar-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--border);
}
.calendar-tick span {
  position: absolute;
  bottom: 8px;
  left: 7px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 11px;
}
.calendar-sheet .calendar-row {
  min-height: 58px;
  align-items: stretch;
  cursor: default;
}
.calendar-row:last-child {
  border-bottom: none;
}
.calendar-lane {
  position: relative;
  min-height: 58px;
  background: #fafbfa;
}
.calendar-row:nth-child(odd) .calendar-lane {
  background: #f1f4f2;
}
.calendar-gridline {
  position: absolute;
  inset-block: 0;
  border-left: 1px solid #dce2de;
  pointer-events: none;
}
.calendar-today {
  position: absolute;
  inset-block: 0;
  border-left: 1px dashed #548575;
  pointer-events: none;
}
.calendar-sheet .gantt-bar {
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  min-width: 0;
  background: #dc7c32;
  border-radius: 2px;
}
.calendar-bar-button {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}
.calendar-bar-button:focus-visible {
  outline: 2px solid #003e22;
  outline-offset: 2px;
}
.gantt-progress {
  position: absolute;
  inset: 0 auto 0 0;
  background: #149653;
}
.calendar-percent {
  position: relative;
  font-size: 11px;
  line-height: 24px;
  font-weight: 600;
  text-shadow: 0 1px 2px #254631;
}
.calendar-undated {
  display: block;
  padding: 18px 12px;
  color: #7b8881;
  font-size: 12px;
}
.calendar-hint {
  font-size: 12px;
  margin: 12px 0 0;
}
@media (max-width: 700px) {
  .calendar-sheet {
    --label-width: 145px;
  }
  .calendar-label {
    padding: 10px 8px;
  }
  .calendar-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
.gantt-row {
  cursor: pointer;
}
.gantt-track {
  height: 30px;
}
.gantt-bar {
  min-width: 0;
  left: 0;
  background: #149653;
}
.task-progress-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #102c1e;
  text-shadow: 0 0 3px #fff;
}
@media (max-width: 700px) {
  .task-progress-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .gantt-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

.expense-breakdown {
  margin: 18px 0;
  min-width: 0;
}
.expense-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #ccd6cf);
}
.expense-breakdown-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.expense-breakdown-row small {
  display: block;
  margin-top: 4px;
  color: #52645a;
}
.expense-breakdown-row > strong {
  white-space: nowrap;
  font-size: 14px;
}
.expense-breakdown-total {
  border-bottom: 0;
}
.expense-breakdown p {
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Keep the club identity and every header action in a single aligned row. */
.topbar-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.topbar-copy {
  min-width: 0;
}
.topbar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}
.topbar-logo {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
}
.topbar-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}
.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
}
.topbar .topbar-pay {
  order: -1;
  min-height: 36px;
  padding: 0 13px;
  margin-right: 4px;
}
.topbar .topbar-pay.q-btn--round {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}
.topbar .topbar-action {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0;
  color: var(--primary);
}
.topbar-action .q-icon {
  font-size: 22px;
}
.topbar .topbar-unread {
  top: 1px;
  right: 0;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  font-size: 9px;
  line-height: 15px;
  border-radius: 8px;
  justify-content: center;
}
.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 40px;
  height: 40px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  flex: none;
}
.topbar-profile:hover {
  background: #dce8df;
}
.topbar-profile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.native-mobile .topbar {
  height: 68px;
  padding: 0 14px;
  gap: 10px;
  align-items: center;
}
.native-mobile .topbar-title {
  font-size: 16px;
  font-weight: 600;
}
.native-mobile .topbar-sub {
  font-size: 11px;
  margin-top: 3px;
}
.native-mobile .topbar-profile {
  border-radius: 50%;
}
@media (max-width: 900px) {
  .topbar {
    height: 68px;
    padding: 0 14px;
    gap: 10px;
    align-items: center;
  }
  .topbar-title {
    font-size: 16px;
    font-weight: 600;
  }
  .topbar-sub {
    font-size: 11px;
    margin-top: 3px;
  }
  .topbar-profile {
    border-radius: 50%;
  }
}
@media (max-width: 360px) {
  .topbar,
  .native-mobile .topbar {
    padding-inline: 10px;
    gap: 6px;
  }
  .topbar-identity {
    gap: 7px;
  }
  .topbar-logo {
    width: 30px;
    height: 30px;
  }
  .topbar-actions {
    gap: 1px;
  }
}

/* Поступления: кассовое рабочее место */
.receipts-tabs {
  margin: -8px 0 18px;
  border-bottom: 1px solid var(--border);
}
.receipt-workbench,
.receipt-journal {
  min-width: 0;
}
.receipt-main-fields,
.receipt-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.receipt-filters {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}
.receipt-lines-heading,
.batch-actions,
.report-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.receipt-lines-heading {
  justify-content: space-between;
  margin-top: 22px;
}
.receipt-lines-heading h3 {
  margin: 0;
}
.receipt-line {
  display: grid;
  grid-template-columns:
    minmax(220px, 2fr) minmax(150px, 1fr) minmax(140px, 1fr)
    36px;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.receipt-line-warning {
  grid-column: 1 / -1;
  margin-top: -4px;
  padding-left: 2px;
  color: #9a6515;
  font-size: 12px;
}
.receipt-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 18px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 2px solid var(--border);
}
.receipt-total strong {
  color: var(--q-primary);
  font-size: 26px;
}
.batch-paste {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
}
.batch-paste .q-expansion-item__content {
  padding: 0 16px 16px;
}
.batch-mode {
  margin: 8px 0 16px;
  border: 1px solid var(--q-primary);
  border-radius: 7px;
}
.batch-heading .batch-mode {
  margin: 0;
}
.batch-heading .actions {
  flex-wrap: nowrap;
}
.batch-actions {
  margin: 12px 0;
}
.batch-grid-head,
.batch-grid-row {
  display: grid;
  grid-template-columns:
    42px minmax(95px, 0.7fr) minmax(140px, 1fr) minmax(130px, 1fr)
    minmax(180px, 1.4fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
}
.batch-grid-head {
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
}
.batch-grid-row {
  border: 1px solid var(--border);
  border-top: 0;
}
.batch-grid-row:last-child {
  border-radius: 0 0 8px 8px;
}
.batch-debt-cell {
  min-width: 0;
}
.batch-debt-cell strong,
.batch-debt-cell small {
  display: block;
}
.batch-debt-cell small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.receipt-journal-total {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.contribution-action {
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.contribution-action:hover,
.contribution-action:focus-visible {
  border-color: var(--q-primary);
  box-shadow: 0 4px 14px rgba(18, 88, 50, 0.12);
  outline: 0;
  transform: translateY(-1px);
}
.contribution-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--q-primary);
  font-weight: 600;
}
.contribution-cta .material-icons {
  font-size: 18px;
}
.report-presets {
  margin-bottom: 12px;
}
.receipt-detail-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}
@media (max-width: 1100px) {
  .receipt-main-fields,
  .receipt-filters {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}
@media (max-width: 700px) {
  .receipts-tabs .q-tabs__content {
    justify-content: flex-start;
  }
  .receipts-tabs .q-tab {
    min-width: 132px;
  }
  .batch-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .batch-heading .actions {
    align-items: stretch;
    flex-direction: column;
  }
  .receipt-main-fields,
  .receipt-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .receipt-line {
    grid-template-columns: minmax(0, 1fr) 36px;
  }
  .receipt-line > .q-field {
    grid-column: 1 / -1;
  }
  .receipt-line > .q-btn {
    grid-column: 2;
    grid-row: 1;
  }
  .batch-grid-head {
    display: none;
  }
  .batch-grid {
    display: grid;
    gap: 10px;
  }
  .batch-grid-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
  }
  .batch-grid-row > .q-field,
  .batch-grid-row > .muted,
  .batch-grid-row > .batch-debt-cell {
    grid-column: 2;
  }
  .receipt-total {
    justify-content: space-between;
  }
}

/* Tables keep both axes inside the table viewport. */
.page .q-table__middle,
.q-dialog .q-table__middle {
  max-width: 100%;
  max-height: clamp(300px, calc(100vh - 310px), 640px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.q-dialog .q-table__middle {
  max-height: min(36vh, 420px);
}
.page .q-table,
.q-dialog .q-table {
  min-width: 100%;
}
.page .q-table thead th,
.q-dialog .q-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--panel2);
  box-shadow: 0 1px 0 var(--border);
  height: 48px;
  padding-block: 6px;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.2;
  text-wrap: balance;
}
.page .q-table th:first-child,
.page .q-table td:first-child,
.q-dialog .q-table th:first-child,
.q-dialog .q-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--border);
}
.page .q-table thead th:first-child,
.q-dialog .q-table thead th:first-child {
  z-index: 6;
  background: var(--panel2);
}
.members-table .q-table {
  width: 100%;
  min-width: max(100%, var(--members-min-width, 1067px));
  table-layout: fixed;
}
.members-table .q-table th:last-child,
.members-table .q-table td:last-child {
  width: 52px !important;
  min-width: 52px;
  max-width: 52px;
  padding-inline: 4px;
  text-align: center;
}
.members-table .q-table .table-cell-value,
.members-table .q-table .table-full-value {
  max-width: 100%;
}
.members-table .q-table thead th:last-child {
  z-index: 6;
  background: var(--panel2);
}
.members-table .q-table tbody td:last-child {
  z-index: 3;
}
.debt-register .q-table th:first-child,
.debt-register .q-table td:first-child {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}
.debt-register .q-table th:nth-child(2),
.debt-register .q-table td:nth-child(2) {
  position: sticky;
  left: 48px;
  z-index: 2;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--border);
}
.debt-register .q-table thead th:nth-child(2) {
  z-index: 6;
  background: var(--panel2);
}
.batch-grid {
  max-width: 100%;
  max-height: clamp(280px, calc(100vh - 360px), 600px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.batch-grid-head,
.batch-grid-row {
  min-width: 780px;
}
.batch-grid-head {
  position: sticky;
  top: 0;
  z-index: 5;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 1px 0 var(--border);
}
.batch-grid-row {
  border: 0;
  border-bottom: 1px solid var(--border);
}
.batch-grid-row:last-child {
  border-radius: 0;
  border-bottom: 0;
}
.batch-grid-head > :first-child,
.batch-grid-row > :first-child {
  position: sticky;
  left: 10px;
  z-index: 2;
  background: var(--panel);
}
.batch-grid-head > :nth-child(2),
.batch-grid-row > :nth-child(2) {
  position: sticky;
  left: 62px;
  z-index: 2;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--border);
}
.batch-grid-head > :first-child,
.batch-grid-head > :nth-child(2) {
  z-index: 6;
  background: var(--panel2);
}

@media (max-width: 700px) {
  .batch-grid {
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    scrollbar-gutter: auto;
  }
  .batch-grid-head,
  .batch-grid-row {
    min-width: 0;
  }
  .batch-grid-row > :first-child,
  .batch-grid-row > :nth-child(2) {
    position: static;
    box-shadow: none;
  }
}
