:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #17231f;
  background: #c9d4d0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  --sidebar: #20483e;
  --sidebar-hover: #345d52;
  --page: #f3f5f4;
  --white: #fff;
  --text: #17231f;
  --muted: #64716c;
  --line: #dce3e0;
  --green: #08683b;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 360px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #c9d4d0;
  font-size: 11px;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: flex;
  height: 100vh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: var(--page);
}

.sidebar {
  flex: 0 0 174px;
  padding: 15px 11px;
  color: #f7faf8;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin: 0 5px 9px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 13px;
  line-height: 14px;
}

.brand-copy small {
  color: #d1dfd9;
  font-size: 8px;
  line-height: 10px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 9px;
  border-radius: 7px;
  color: #e3ebe7;
  font-size: 10px;
  font-weight: 550;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-section {
  margin: 13px 9px 4px;
  color: #a4b9b1;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.nav-count {
  display: inline-flex;
  min-width: 16px;
  height: 13px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 7px;
  color: #372508;
  background: #f5a623;
  font-size: 8px;
  font-weight: 800;
}

.main-content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  background: var(--page);
}

.topbar {
  display: flex;
  height: 51px;
  min-height: 51px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.topbar h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 11px;
}

.global-search {
  width: 255px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid #e1e7e4;
  border-radius: 9px;
  outline: none;
  color: #53615b;
  background: #f4f6f5;
  font-size: 10px;
}

.global-search::placeholder {
  color: #65726d;
  opacity: 1;
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  color: #24483f;
  background: #e7efeb;
  font-size: 9px;
  font-weight: 750;
}

.dashboard-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.stats-grid {
  display: grid;
  flex: 0 0 75px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid #e1e7e4;
  border-radius: 11px;
  background: var(--white);
}

.stat-label {
  overflow: hidden;
  margin-bottom: 5px;
  color: #58655f;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card strong {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 20px;
  white-space: nowrap;
}

.stat-note {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 11px;
}

.stat-note.positive {
  color: #08733f;
}

.stat-note.warning {
  color: #9c5200;
}

.dashboard-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1.61fr) minmax(285px, 1fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e6e3;
  border-radius: 11px;
  background: var(--white);
}

.panel-heading {
  display: flex;
  height: 35px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-heading a {
  flex: 0 0 auto;
  color: #214b3f;
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
}

.panel-heading a span {
  margin-left: 2px;
}

.reservations-panel {
  display: flex;
  flex-direction: column;
}

.table-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.reservation-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  white-space: nowrap;
}

.reservation-table th,
.reservation-table td {
  height: 32px;
  padding: 0 7px;
  border-bottom: 1px solid #e1e7e4;
  text-align: left;
  vertical-align: middle;
}

.reservation-table th {
  height: 26px;
  color: #606c67;
  background: #fafbfa;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.reservation-table th:first-child,
.reservation-table td:first-child {
  padding-left: 7px;
}

.reservation-table td {
  color: #1b2722;
  font-size: 9px;
  font-weight: 500;
}

.reservation-table .reference {
  color: #68756f;
  font-size: 8px;
}

.reservation-detail-link {
  color: inherit;
  text-decoration: none;
}

.reservation-detail-link:hover {
  text-decoration: underline;
}

.reservation-table .client-name,
.reservation-table .amount {
  font-weight: 750;
}

.reservation-table .amount {
  text-align: right;
}

.status {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.status.confirmed {
  color: #08713d;
  background: #e4f3ea;
}

.status.pay {
  color: #1857ae;
  background: #e7efff;
}

.status.partner {
  color: #965000;
  background: #fff0dc;
}

.status.arrived {
  color: #12677a;
  background: #e1f1f5;
}

.status.expired {
  color: #626560;
  background: #efefed;
}

.status.finished {
  color: #4c5a54;
  background: #e9efec;
}

.status.refused,
.status.cancelled {
  color: #b3261e;
  background: #fce9e7;
}

.side-panels {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 13px;
}

.reservations-chart {
  flex: 0 0 152px;
}

.chart {
  display: flex;
  height: 115px;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 13px 10px;
}

.chart-column {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.chart-bar {
  width: 100%;
  height: var(--bar-height);
  min-height: 10px;
  border-radius: 5px 5px 0 0;
  background: #e7f0ec;
}

.chart-bar.today {
  background: #21483e;
}

.chart-column small {
  color: #46534d;
  font-size: 8px;
  line-height: 10px;
}

.alerts-panel {
  flex: 0 0 auto;
}

.alerts-panel .panel-heading strong {
  color: #21483e;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.alerts-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.alerts-list li {
  display: grid;
  min-height: 43px;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 9px 13px 7px;
  border-bottom: 1px solid var(--line);
}

.alerts-list li:last-child {
  border-bottom: 0;
}

.alert-dot {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
}

.alert-dot.red {
  background: #b42c25;
}

.alert-dot.orange {
  background: #f0a12a;
}

.alerts-list strong {
  display: block;
  overflow: hidden;
  color: #233029;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alerts-list p {
  overflow: hidden;
  margin: 2px 0 0;
  color: #64716b;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservations-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 16px 20px;
}

.reservation-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 6px;
  color: #26332d;
  background: #fff;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.filter-chip span {
  color: #69756f;
  font-weight: 600;
}

.filter-chip.selected {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.filter-chip.selected span {
  color: #d3e2dc;
}

.reservation-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.filter-control {
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 6px;
  color: #27342e;
  background: #fff;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.export-control {
  font-weight: 750;
}

.all-reservations-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.full-reservation-table {
  min-width: 820px;
}

.full-reservation-table th,
.full-reservation-table td {
  height: 32px;
  padding: 0 7px;
}

.full-reservation-table th {
  height: 25px;
  font-size: 8px;
}

.full-reservation-table td {
  font-size: 9px;
}

.full-reservation-table .amount {
  text-align: right;
}

.full-reservation-table .status {
  font-size: 8px;
}

.table-pagination {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  color: #58655f;
  font-size: 9px;
}

.table-pagination nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-pagination a {
  color: #48554f;
  text-decoration: none;
}

.table-pagination a[aria-current="page"] {
  color: var(--green);
  font-weight: 800;
}

.table-pagination a[aria-disabled="true"] {
  color: #a6b0ab;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.interaction-toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 18px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid #d5e0da;
  border-radius: 9px;
  color: #fff;
  background: #20483e;
  box-shadow: 0 8px 26px rgb(23 35 31 / 18%);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.interaction-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.interaction-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 60px rgb(23 35 31 / 22%);
  font-size: 11px;
}

.interaction-dialog::backdrop {
  background: rgb(20 31 27 / 45%);
}

.interaction-dialog h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.interaction-dialog-content {
  max-height: 55vh;
  overflow: auto;
}

.interaction-dialog-content label {
  display: grid;
  gap: 8px;
  font-weight: 650;
}

.interaction-dialog-content input {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.interaction-dialog-content dl {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) 1.2fr;
  gap: 9px 14px;
  margin: 0;
}

.interaction-dialog-content dt {
  color: var(--muted);
  font-weight: 700;
}

.interaction-dialog-content dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.interaction-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.interaction-dialog-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.interaction-dialog-actions button.primary {
  border-color: var(--sidebar);
  color: #fff;
  background: var(--sidebar);
}

.payments-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.payment-stats {
  display: grid;
  flex: 0 0 76px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.payment-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid #e1e7e4;
  border-radius: 11px;
  background: #fff;
}

.payment-stat > span {
  overflow: hidden;
  margin-bottom: 5px;
  color: #58655f;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-stat strong {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 20px;
  white-space: nowrap;
}

.payment-stat small {
  overflow: hidden;
  margin-top: 4px;
  color: #08733f;
  font-size: 8px;
  font-weight: 700;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-stat small.payment-warning {
  color: #995000;
}

.payment-toolbar {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payment-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-filter,
.payment-export {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #26332d;
  background: #fff;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.payment-filter.selected {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.payment-export {
  flex: 0 0 auto;
  font-weight: 750;
}

.payments-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.payment-table {
  min-width: 820px;
}

.payment-table th,
.payment-table td {
  height: 32px;
  padding: 0 7px;
}

.payment-table th {
  height: 25px;
  font-size: 8px;
}

.payment-table td {
  font-size: 9px;
}

.payment-table .amount {
  text-align: right;
}

.payment-table .status {
  font-size: 8px;
}

.transfers-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 17px 20px 16px;
}

.transfer-stats {
  display: grid;
  flex: 0 0 76px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.transfer-toolbar {
  display: flex;
  min-height: 27px;
  align-items: center;
}

.transfer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.transfers-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 2.12fr) minmax(230px, 0.88fr);
  gap: 13px;
}

.transfers-panel,
.partner-debts {
  min-height: 0;
}

.transfers-panel {
  display: flex;
  flex-direction: column;
}

.transfer-table {
  min-width: 650px;
}

.transfer-table th,
.transfer-table td {
  height: 35px;
  padding: 0 7px;
}

.transfer-table th {
  height: 26px;
  font-size: 8px;
}

.transfer-table td {
  font-size: 9px;
}

.transfer-table .amount {
  text-align: right;
}

.transfer-table .status {
  font-size: 8px;
}

.transfer-action {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e1e7e4;
  border-radius: 7px;
  color: #23332c;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.transfer-action.primary {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.partner-debts .panel-heading {
  height: 36px;
}

.partner-debts .panel-heading h3 {
  font-size: 11px;
}

.debt-table {
  width: 100%;
  border-collapse: collapse;
}

.debt-table th,
.debt-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e1e7e4;
  text-align: left;
  vertical-align: middle;
}

.debt-table th {
  color: #65716c;
  background: #fafbfa;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.debt-table td {
  color: #1b2722;
  font-size: 9px;
}

.debt-table td strong,
.debt-table td small {
  display: block;
}

.debt-table td strong {
  font-size: 9px;
  font-weight: 750;
}

.debt-table td small {
  margin-top: 3px;
  color: #64716b;
  font-size: 8px;
  line-height: 10px;
}

.debt-table .amount {
  text-align: right;
  font-weight: 750;
  white-space: nowrap;
}

.debt-note {
  margin: 10px 13px;
  color: #536059;
  font-size: 9px;
  line-height: 14px;
}

.clients-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.client-stats {
  display: grid;
  flex: 0 0 76px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.clients-toolbar {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.clients-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.client-table {
  min-width: 825px;
}

.client-table th,
.client-table td {
  height: 39px;
  padding: 0 7px;
}

.client-table th {
  height: 25px;
  font-size: 8px;
}

.client-table td {
  font-size: 9px;
}

.client-table .amount {
  text-align: right;
}

.client-table .status {
  font-size: 8px;
}

.client-action {
  min-width: 68px;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #26332d;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.referrals-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.referral-stats {
  display: grid;
  flex: 0 0 76px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.referrals-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.36fr);
  gap: 13px;
}

.referral-rules,
.top-referrers {
  min-height: 0;
}

.referral-rules .panel-heading,
.top-referrers .panel-heading {
  height: 36px;
}

.referral-rules {
  display: flex;
  flex-direction: column;
}

.referral-rules-form {
  padding: 12px 13px;
}

.referral-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.referral-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.referral-field label {
  color: #59665f;
  font-size: 8px;
  font-weight: 700;
}

.referral-field input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #202c26;
  background: #fff;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
}

.referral-save {
  min-height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid #20483e;
  border-radius: 7px;
  color: #fff;
  background: #20483e;
  font-size: 8px;
  font-weight: 750;
}

.referral-note {
  margin: 20px 0 0;
  color: #536059;
  font-size: 8px;
  line-height: 12px;
}

.top-referrers {
  display: flex;
  flex-direction: column;
}

.referrers-table {
  width: 100%;
  min-width: 460px;
}

.referrers-table th,
.referrers-table td {
  height: 27px;
  padding: 0 7px;
}

.referrers-table th {
  height: 24px;
  font-size: 7px;
}

.referrers-table td {
  font-size: 8px;
}

.referrers-table .amount {
  text-align: right;
}

.alerts-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.alert-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alerts-table-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.alert-table {
  min-width: 800px;
}

.alert-table th,
.alert-table td {
  height: 38px;
  padding: 0 7px;
}

.alert-table th {
  height: 25px;
  font-size: 8px;
}

.alert-table td {
  font-size: 9px;
}

.alert-table .alert-indicator-heading {
  width: 28px;
}

.alert-table .status {
  font-size: 8px;
}

.alert-severity {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.monthly-reports-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 17px 20px 16px;
}

.report-toolbar {
  display: flex;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-months {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.report-month {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #26332d;
  background: #fff;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.report-month.selected {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.report-stats {
  display: grid;
  flex: 0 0 76px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.monthly-reports-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.monthly-report-table {
  min-width: 790px;
}

.monthly-report-table th,
.monthly-report-table td {
  height: 32px;
  padding: 0 7px;
  font-size: 8px;
}

.monthly-report-table th {
  height: 27px;
}

.monthly-report-table td.amount {
  text-align: right;
}

.monthly-report-note {
  margin: 0;
  color: #536059;
  font-size: 8px;
  line-height: 12px;
}

@media (max-width: 760px) {
  .report-stats {
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.alert-severity.high {
  background: #b42c25;
}

.alert-severity.medium {
  background: #f0a12a;
}

.alert-action {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #20483e;
  border-radius: 7px;
  color: #fff;
  background: #20483e;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.alerts-notice {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #e0e6e3;
  border-radius: 10px;
  color: #536059;
  background: #fff;
  font-size: 9px;
  line-height: 12px;
}

.properties-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 17px 20px 16px;
}

.property-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.property-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e6e3;
  border-radius: 11px;
  background: #fff;
}

.property-image {
  height: 90px;
  background: linear-gradient(115deg, #a4c1b6 0%, #628c7e 100%);
}

.property-card-content {
  padding: 9px 10px 8px;
}

.property-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.property-title-row h3 {
  overflow: hidden;
  margin: 0;
  color: #1d2923;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-title-row .status {
  flex: 0 0 auto;
  font-size: 8px;
}

.property-card-content > p {
  overflow: hidden;
  margin: 0 0 3px;
  color: #4f5c55;
  font-size: 8px;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.property-action {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid #efb4ad;
  border-radius: 7px;
  color: #a7271e;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.property-action.primary {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.property-notice {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #e0e6e3;
  border-radius: 10px;
  color: #536059;
  background: #fff;
  font-size: 9px;
  line-height: 12px;
}

.property-exam-content {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.94fr);
  align-content: start;
  gap: 14px;
  padding: 16px 20px;
}

.property-exam-left,
.property-exam-right {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.property-gallery {
  display: grid;
  height: 171px;
  grid-template-columns: 1.8fr 0.9fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gallery-main,
.gallery-thumbnails > div {
  border-radius: 8px;
  background: linear-gradient(120deg, #a9c5bb 0%, #60897b 100%);
}

.gallery-main {
  grid-row: 1 / 3;
}

.gallery-thumbnails {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.room-panel {
  display: flex;
  flex-direction: column;
}

.room-panel .panel-heading {
  height: 35px;
}

.room-table {
  width: 100%;
}

.room-table th,
.room-table td {
  height: 25px;
  padding: 0 7px;
}

.room-table th {
  height: 24px;
  font-size: 7px;
}

.room-table td {
  font-size: 8px;
}

.room-table .amount {
  text-align: right;
}

.property-info-panel,
.decision-panel {
  flex: 0 0 auto;
}

.property-info-panel .panel-heading,
.decision-panel .panel-heading {
  height: 36px;
}

.property-info-content {
  padding: 11px 13px 10px;
}

.exam-details {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  row-gap: 4px;
  margin: 0;
  font-size: 9px;
  line-height: 12px;
}

.exam-details dt {
  color: #59665f;
}

.exam-details dd {
  overflow: hidden;
  margin: 0;
  color: #1d2923;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-info-content h4 {
  margin: 12px 0 7px;
  color: #5d6963;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.property-info-content > p {
  margin: 0;
  color: #26332d;
  font-size: 9px;
  line-height: 14px;
}

.decision-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 13px 10px;
}

.decision-content label {
  color: #58655f;
  font-size: 8px;
  font-weight: 700;
}

.decision-content textarea {
  min-height: 48px;
  resize: vertical;
  padding: 8px;
  border: 1px solid #e0e6e3;
  border-radius: 8px;
  color: #26332d;
  background: #fff;
  font: inherit;
  font-size: 9px;
}

.decision-content textarea::placeholder {
  color: #77827c;
  opacity: 1;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.decision-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #24312b;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.decision-button.approve {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.decision-button.refuse {
  border-color: #efb4ad;
  color: #a7271e;
}

.detail-app-shell {
  position: relative;
}

.detail-main {
  position: relative;
  overflow: hidden;
}

.detail-main > .topbar {
  position: relative;
  z-index: 0;
  width: 100%;
}

.detail-background {
  position: absolute;
  inset: 51px 0 0;
  overflow: hidden;
  padding: 16px 20px;
  background: var(--page);
}

.detail-background-filters {
  display: flex;
  width: max-content;
  gap: 6px;
  margin-bottom: 12px;
}

.background-chip {
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 6px;
  color: #53615b;
  background: #fff;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.background-chip.selected {
  color: #fff;
  background: #20483e;
}

.partner-list-background {
  padding-top: 16px;
}

.partner-filters {
  display: flex;
  width: max-content;
  gap: 6px;
  margin-bottom: 12px;
}

.partner-filters .background-chip.selected {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.partner-background-table {
  width: 100%;
  min-width: 500px;
  overflow: hidden;
  border: 1px solid #e0e6e3;
  border-radius: 10px;
  background: #fff;
}

.partner-table-head,
.partner-background-row {
  display: grid;
  height: 32px;
  grid-template-columns: 1.65fr 0.9fr 1fr 1.1fr 0.45fr;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  border-bottom: 1px solid #e1e7e4;
  white-space: nowrap;
}

.partner-table-head {
  height: 27px;
  color: #67736d;
  background: #fafbfa;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.partner-background-row {
  color: #56635d;
  font-size: 9px;
}

.partner-background-row strong {
  overflow: hidden;
  color: #26332d;
  font-weight: 700;
  text-overflow: ellipsis;
}

.partner-background-row.selected {
  background: #f1f4f2;
}

.partner-drawer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(389px, 48%);
  flex-direction: column;
  border-left: 1px solid #e0e6e3;
  background: #fff;
  box-shadow: -10px 0 25px rgba(32, 54, 45, 0.08);
}

.partner-drawer-header {
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.partner-drawer-header h2 {
  margin: 0 0 5px;
  color: #1c2923;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 17px;
}

.partner-drawer-header .status {
  font-size: 8px;
}

.partner-drawer-content {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 12px 16px 14px;
}

.partner-drawer-section {
  margin-bottom: 15px;
}

.partner-drawer-section h3 {
  margin: 0 0 9px;
  color: #5d6963;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.partner-details {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  row-gap: 5px;
  margin: 0;
  font-size: 9px;
  line-height: 12px;
}

.partner-details dt {
  color: #59665f;
}

.partner-details dd {
  overflow: hidden;
  margin: 0;
  color: #1d2923;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-section {
  margin-bottom: 12px;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.document-card {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px;
  border: 1px dashed #b9c9c1;
  border-radius: 9px;
  color: #46534d;
  background: #f7f9f8;
  font-size: 8px;
  line-height: 11px;
  text-align: center;
  text-decoration: none;
}

.document-card span,
.document-card small {
  display: block;
}

.document-card small {
  font-size: 8px;
}

.document-card.unavailable {
  cursor: default;
}

.trial-section {
  margin-bottom: 0;
}

.trial-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trial-controls select {
  min-width: 0;
  height: 30px;
  flex: 1;
  padding: 0 9px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #202c26;
  background: #fff;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
}

.partner-small-button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #24312b;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.trial-section > p {
  margin: 20px 0 0;
  color: #536059;
  font-size: 8px;
  line-height: 12px;
}

.partner-drawer-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.partner-action {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #24312b;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.partner-action.primary {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.partner-action.danger {
  margin-left: auto;
  border-color: #f2b6b0;
  color: #a7271e;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.detail-background-table {
  width: 100%;
  min-width: 500px;
  overflow: hidden;
  border: 1px solid #e0e6e3;
  border-radius: 10px;
  background: #fff;
}

.background-table-head,
.background-row {
  display: grid;
  height: 32px;
  grid-template-columns: 0.75fr 0.8fr 1.55fr 0.75fr;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border-bottom: 1px solid #e1e7e4;
  white-space: nowrap;
}

.background-table-head {
  height: 27px;
  color: #67736d;
  background: #fafbfa;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.background-row {
  color: #56635d;
  font-size: 9px;
}

.background-row strong {
  color: #34413b;
  font-weight: 700;
}

.background-row.selected {
  color: #44524b;
  background: #f1f4f2;
}

.detail-backdrop {
  position: absolute;
  z-index: 1;
  inset: 51px 0 0;
  background: rgba(224, 231, 227, 0.48);
  pointer-events: none;
}

.reservation-drawer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(389px, 48%);
  flex-direction: column;
  border-left: 1px solid #e0e6e3;
  background: #fff;
  box-shadow: -10px 0 25px rgba(32, 54, 45, 0.08);
}

.drawer-header {
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.drawer-reference {
  margin: 0 0 3px;
  color: #65726c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 0.015em;
}

.drawer-header h2 {
  margin: 0 0 5px;
  color: #1c2923;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 17px;
}

.drawer-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drawer-statuses .status {
  font-size: 8px;
}

.drawer-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #e1e7e4;
  border-radius: 7px;
  color: #17231f;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
}

.drawer-content {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 11px 16px 12px;
}

.drawer-section {
  margin-bottom: 15px;
}

.drawer-section h3 {
  margin: 0 0 9px;
  color: #5d6963;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.stay-details {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  row-gap: 5px;
  margin: 0;
  font-size: 9px;
  line-height: 12px;
}

.stay-details dt {
  color: #59665f;
}

.stay-details dd {
  overflow: hidden;
  margin: 0;
  color: #1d2923;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-section {
  margin-bottom: 17px;
}

.journey {
  position: relative;
  margin: 0;
  padding: 0 0 0 19px;
  list-style: none;
}

.journey::before {
  position: absolute;
  top: 5px;
  bottom: 9px;
  left: 4px;
  width: 1px;
  background: #d3dfd9;
  content: "";
}

.journey li {
  position: relative;
  min-height: 32px;
  padding: 0 0 5px;
}

.journey li::before {
  position: absolute;
  top: 1px;
  left: -19px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #20483e;
  box-shadow: 0 0 0 1px #d4dfda;
  content: "";
}

.journey li.journey-pending::before {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 1.5px #a9bbb2;
}

.journey strong,
.journey small {
  display: block;
}

.journey strong {
  color: #1f2b25;
  font-size: 9px;
  font-weight: 600;
  line-height: 12px;
}

.journey small {
  color: #67736d;
  font-size: 8px;
  line-height: 10px;
}

.money-section {
  margin-bottom: 18px;
}

.money-breakdown {
  padding: 7px 10px 6px;
  border: 1px solid #e0e6e3;
  border-radius: 9px;
}

.money-breakdown > div {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #202c26;
  font-size: 9px;
}

.money-breakdown strong {
  font-weight: 750;
  white-space: nowrap;
}

.money-breakdown .partner-share {
  min-height: 25px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 750;
}

.drawer-note {
  margin: 0;
  color: #4f5c55;
  font-size: 8px;
  line-height: 12px;
}

.drawer-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.drawer-button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #e0e6e3;
  border-radius: 7px;
  color: #24312b;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.drawer-button.primary {
  border-color: #20483e;
  color: #fff;
  background: #20483e;
}

.drawer-button.danger {
  border-color: #f2b6b0;
  color: #a7271e;
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .main-content {
    min-height: 100vh;
  }

  .dashboard-content {
    overflow: visible;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr);
  }

  .reservation-table {
    min-width: 540px;
  }

  .reservations-content {
    overflow: visible;
  }

  .all-reservations-panel {
    min-height: 420px;
  }

  .payments-content {
    overflow: visible;
  }

  .payments-panel {
    min-height: 420px;
  }

  .transfers-content {
    overflow: visible;
  }

  .transfers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .transfers-panel,
  .partner-debts {
    min-height: 300px;
  }

  .partner-debts {
    min-height: 220px;
  }

  .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-content {
    overflow: visible;
  }

  .referrals-content {
    overflow: visible;
  }

  .referrals-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .referral-rules,
  .top-referrers {
    min-height: 220px;
  }

  .alerts-content {
    overflow: visible;
  }

  .alerts-table-panel {
    min-height: 420px;
  }

  .clients-panel {
    min-height: 420px;
  }

  .property-exam-content {
    overflow: visible;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    flex-basis: auto;
    padding: 10px;
  }

  .brand {
    margin-bottom: 8px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav-link {
    min-height: 29px;
    padding: 0 8px;
  }

  .nav-section {
    display: none;
  }

  .topbar {
    height: auto;
    min-height: 51px;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .topbar h2 {
    font-size: 14px;
  }

  .global-search {
    width: min(255px, calc(100vw - 90px));
  }

  .dashboard-content {
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .reservations-content {
    padding: 12px;
  }

  .reservation-tools {
    justify-content: flex-start;
  }

  .all-reservations-panel {
    min-height: 500px;
  }

  .payments-content {
    padding: 12px;
  }

  .payment-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-export {
    align-self: flex-end;
  }

  .payments-panel {
    min-height: 500px;
  }

  .transfers-content {
    padding: 12px;
  }

  .transfer-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .transfers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .transfers-panel {
    min-height: 350px;
  }

  .properties-content {
    overflow: visible;
    padding: 12px;
  }

  .property-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .clients-content {
    padding: 12px;
  }

  .referrals-content {
    padding: 12px;
  }

  .referral-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .referrals-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .referral-rules,
  .top-referrers {
    min-height: 220px;
  }

  .alerts-content {
    padding: 12px;
  }

  .alerts-table-panel {
    min-height: 500px;
  }

  .client-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .clients-toolbar .payment-export {
    align-self: flex-end;
  }

  .clients-panel {
    min-height: 500px;
  }

  .property-exam-content {
    padding: 12px;
  }

  .property-gallery {
    height: 160px;
  }

  .room-panel .table-scroll {
    overflow-x: auto;
  }

  .room-table {
    min-width: 455px;
  }

  .reservation-drawer {
    position: fixed;
    top: 40px;
    right: 8px;
    bottom: 8px;
    width: min(389px, calc(100vw - 32px));
    border-radius: 10px;
  }

  .partner-drawer {
    position: fixed;
    top: 40px;
    right: 8px;
    bottom: 8px;
    width: min(389px, calc(100vw - 32px));
    border-radius: 10px;
  }

  .drawer-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .reservations-panel {
    min-height: 360px;
  }

  .side-panels {
    overflow: visible;
  }

  .reservations-chart {
    flex-basis: 152px;
  }

  .alerts-panel {
    min-height: 166px;
  }
}
