:root {
  --bg: #f7fbff;
  --surface: #ffffff;
  --surface-soft: #eef6fb;
  --ink: #141821;
  --muted: #6d7480;
  --line: #dbe6ef;
  --blue: #168aad;
  --blue-dark: #0b5f7a;
  --red: #e63946;
  --red-dark: #a91f2b;
  --success: #16784d;
  --warning: #9a6700;
  --danger: #b42318;
  --shadow: 0 12px 26px rgba(20, 24, 33, 0.07);
  --radius: 8px;
  --font: Manrope, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
}

button,
input,
textarea,
select,
table {
  font: inherit;
}

button {
  min-height: 44px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 14px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  background: rgba(247, 251, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-line,
.header-side,
.screen-title,
.profit-topbar,
.top-actions,
.form-actions,
.room-card-top,
.room-card-row,
.room-actions,
.carousel-controls,
.search-row {
  display: flex;
  gap: 10px;
}

.brand-line,
.header-side,
.screen-title,
.profit-topbar,
.room-card-top,
.room-card-row,
.search-row {
  align-items: center;
}

.brand-line {
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.app-header h1,
.screen-title h2,
.form-head h3,
.room-viewer-card h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.app-header h1 {
  overflow: hidden;
  font-size: 1.18rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meta-strip,
.mode-chip {
  display: none;
}

.main-content,
.view-panel,
.auth-panel,
.auth-form,
.compact-form,
.selector-card,
.slim-card {
  display: grid;
  gap: 12px;
}

.auth-panel {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.screen-title {
  justify-content: space-between;
  min-height: 48px;
}

.screen-title h2 {
  font-size: 1.55rem;
}

.compact-form,
.selector-card,
.slim-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-head {
  padding-bottom: 2px;
}

.form-head h3 {
  font-size: 1rem;
}

.compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(22, 138, 173, 0.16);
  border-color: var(--blue);
}

textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea:focus {
  outline: 3px solid rgba(22, 138, 173, 0.16);
  border-color: var(--blue);
}

.toggle-field {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toggle-field input {
  width: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--blue);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: var(--radius);
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--red);
  color: #fff;
}

.primary-button:hover {
  background: var(--red-dark);
}

.secondary-button {
  background: var(--blue);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: rgba(22, 138, 173, 0.45);
  color: var(--blue-dark);
}

.small-action {
  min-width: 92px;
}

.derived-strip,
.totals-inline,
.report-summary,
.period-settings-grid,
.control-summary,
.control-list,
.control-values {
  display: grid;
  gap: 8px;
}

.derived-strip {
  grid-template-columns: 1fr;
}

.derived-strip span,
.mini-total,
.report-chip,
.info-box,
.empty-state {
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.derived-strip span {
  padding: 9px 10px;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.form-actions,
.top-actions,
.carousel-controls {
  flex-wrap: wrap;
}

.compact-actions,
.top-actions {
  justify-content: flex-start;
}

.search-row {
  align-items: stretch;
}

.search-wrap {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.search-result-button {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-result-button:hover {
  background: var(--surface-soft);
}

.counter-chip,
.status-chip,
.room-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.counter-chip {
  flex: 0 0 auto;
  background: var(--ink);
  color: #fff;
}

.status-chip {
  background: rgba(22, 138, 173, 0.12);
  color: var(--blue-dark);
}

.status-chip.is-confirmed {
  background: rgba(22, 120, 77, 0.12);
  color: var(--success);
}

.status-chip.is-draft {
  background: rgba(154, 103, 0, 0.12);
  color: var(--warning);
}

.room-viewer-card {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.room-viewer-card h3 {
  font-size: 1.9rem;
}

.room-card-top,
.room-card-row {
  justify-content: space-between;
  align-items: flex-start;
}

.room-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.room-card-top .muted,
.room-card-row .muted {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.room-status {
  flex: 0 0 auto;
}

.room-status.is-active {
  background: rgba(22, 120, 77, 0.12);
  color: var(--success);
}

.room-status.is-paused {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.room-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.info-box {
  min-width: 0;
  padding: 10px;
}

.telegram-log-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.telegram-log-panel.is-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.telegram-log-head,
.telegram-log-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.telegram-log-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.telegram-log-list {
  display: grid;
  gap: 8px;
}

.telegram-log-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.telegram-log-item strong,
.telegram-log-item span,
.telegram-log-item p {
  overflow-wrap: anywhere;
}

.telegram-log-item strong,
.telegram-log-item span {
  font-size: 0.76rem;
}

.telegram-log-item span {
  color: var(--muted);
}

.telegram-log-item p {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.info-box strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 800;
}

.balance-box {
  grid-column: 1 / -1;
  border: 1px solid transparent;
}

.balance-box strong {
  font-size: 1.2rem;
}

.balance-box.is-positive {
  background: rgba(22, 138, 173, 0.12);
  border-color: rgba(22, 138, 173, 0.2);
  color: var(--blue-dark);
}

.balance-box.is-negative {
  background: rgba(230, 57, 70, 0.1);
  border-color: rgba(230, 57, 70, 0.22);
  color: var(--red-dark);
}

.muted {
  color: var(--muted);
}

.carousel-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nav-button {
  width: 100%;
}

.profit-topbar {
  align-items: stretch;
  flex-direction: column;
}

.inline-field span,
.mini-total span,
.report-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.totals-inline,
.report-summary {
  grid-template-columns: 1fr;
}

.mini-total,
.report-chip {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.report-chip.is-carry {
  border: 1px solid #b9d9ea;
  background: #eef6fb;
}

.report-chip.is-aggio {
  border: 1px solid #b8dfcf;
  background: #edf8f3;
}

.mini-total strong,
.report-chip strong {
  font-size: 1rem;
  font-weight: 800;
}

.report-chip em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.period-settings-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.period-settings-head,
.control-card-head,
.control-actions,
.report-month-nav {
  display: flex;
  gap: 10px;
}

.period-settings-head,
.control-card-head {
  align-items: center;
  justify-content: space-between;
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.period-settings-grid {
  grid-template-columns: 1fr;
}

.report-month-nav {
  width: 100%;
  align-items: end;
  flex-wrap: wrap;
}

.report-month-nav .inline-field {
  flex: 1 1 180px;
  min-width: 0;
}

.month-nav-button {
  flex: 1 1 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: rgba(22, 138, 173, 0.35);
  background: #eaf8fb;
  color: var(--blue-dark);
  box-shadow: inset 0 -2px 0 rgba(22, 138, 173, 0.14);
}

.month-nav-button:hover {
  border-color: rgba(22, 138, 173, 0.7);
  background: #dff4f8;
}

.month-nav-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.period-note-field {
  grid-column: 1 / -1;
}

.inline-info {
  padding: 10px 11px;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 0.86rem;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fbff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.compact-table input {
  min-width: 116px;
  margin: 0;
}

.profit-section-row td {
  padding: 12px 10px 8px;
  background: #f7fbff;
  color: var(--blue-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.is-inactive-profit {
  background: #fbfcfd;
}

.is-inactive-profit td:first-child {
  color: var(--muted);
}

.telegram-profit-status {
  display: inline-flex;
  max-width: 220px;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  white-space: normal;
}

.telegram-profit-status span {
  font-size: 0.76rem;
  font-weight: 900;
}

.telegram-profit-status small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.telegram-profit-status.is-ok {
  border-color: #b7e5cf;
  background: #ecf9f2;
  color: var(--success);
}

.telegram-profit-status.is-warn {
  border-color: #f4d595;
  background: #fff8e8;
  color: var(--warning);
}

.telegram-profit-status.is-error {
  border-color: #ffc9cf;
  background: #fff1f2;
  color: var(--danger);
}

.telegram-profit-status.is-muted {
  color: var(--muted);
}

.report-table {
  min-width: 930px;
  table-layout: fixed;
}

.amount-percent-cell {
  position: relative;
  min-width: 126px;
  padding-right: 44px !important;
  padding-bottom: 18px !important;
}

.amount-percent-value {
  display: block;
}

.amount-percent-label {
  position: absolute;
  right: 8px;
  bottom: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
}

.report-table th:first-child,
.report-table td:first-child {
  position: sticky;
  left: 0;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-table th:first-child {
  z-index: 4;
  background: #f7fbff;
}

.report-table td:first-child {
  z-index: 2;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2) {
  width: 88px;
}

.report-table th:nth-child(3),
.report-table td:nth-child(3),
.report-table th:nth-child(4),
.report-table td:nth-child(4),
.report-table th:nth-child(5),
.report-table td:nth-child(5),
.report-table th:nth-child(9),
.report-table td:nth-child(9) {
  width: 114px;
}

.report-table th:nth-child(6),
.report-table td:nth-child(6),
.report-table th:nth-child(7),
.report-table td:nth-child(7),
.report-table th:nth-child(8),
.report-table td:nth-child(8) {
  width: 132px;
}

.report-table .report-total-row td {
  background: #eaf8fb;
  color: var(--ink);
  font-weight: 900;
}

.report-table .report-total-row td:first-child {
  background: #dff4f8;
  color: var(--blue-dark);
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  font-weight: 700;
}

.control-list {
  gap: 10px;
}

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

.cash-toolbar {
  display: grid;
  gap: 8px;
}

.cash-month-nav {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
}

.cash-month-button {
  display: inline-grid;
  min-height: 46px;
  place-items: center;
  padding: 0;
  border-color: rgba(22, 138, 173, 0.35);
  background: #eaf8fb;
  color: var(--blue-dark);
}

.cash-month-field input {
  min-width: 0;
}

#cash-summary {
  grid-template-columns: 1fr;
  gap: 7px;
}

.cash-net-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cash-net-strip.is-debit {
  border-color: #b8dfcf;
  background: #edf8f3;
}

.cash-net-strip.is-credit {
  border-color: rgba(230, 57, 70, 0.22);
  background: rgba(230, 57, 70, 0.08);
}

.cash-net-strip span,
.cash-mini-totals span,
.cash-row-title span,
.cash-row-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.cash-net-strip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 1.08rem;
}

.cash-mini-totals {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cash-mini-totals span {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  white-space: nowrap;
}

.cash-party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cash-party-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cash-party-chip.is-settled {
  border-color: rgba(15, 118, 85, 0.35);
  background: rgba(15, 118, 85, 0.06);
}

.cash-party-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.cash-party-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 0.84rem;
}

.cash-party-chip button {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.73rem;
  line-height: 1;
}

.cash-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  background: #fff;
}

.cash-row.is-credit {
  border-left-color: var(--red);
}

.cash-row-main {
  display: grid;
  gap: 5px;
}

.cash-row-title,
.cash-row-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cash-row-title {
  min-width: 0;
}

.cash-row-title strong {
  flex: 0 0 auto;
  font-size: 0.98rem;
  font-weight: 900;
}

.cash-row-title span {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-row-amount strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 900;
}

.status-chip.is-open {
  background: rgba(154, 103, 0, 0.12);
  color: var(--warning);
}

.cash-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.cash-quick-actions button {
  min-height: 40px;
  padding: 8px 5px;
  font-size: 0.73rem;
  line-height: 1.05;
}

.cash-row-note {
  display: block;
}

.activity-log-block {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.activity-log-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.activity-log-head strong,
.activity-log-head span {
  display: block;
}

.activity-log-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.activity-log-list {
  display: grid;
  gap: 8px;
}

.activity-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.activity-log-item strong,
.activity-log-item span,
.activity-log-item time {
  overflow-wrap: anywhere;
}

.activity-log-item span,
.activity-log-item time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.control-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.control-card.is-rectified {
  background: #f8fffb;
}

.control-card-head > div strong,
.control-card-head > div span {
  display: block;
}

.control-card-head > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.control-values {
  grid-template-columns: 1fr;
}

.control-toggle {
  margin: 0;
}

.control-note {
  display: grid;
  gap: 6px;
}

.control-actions {
  align-items: center;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 40;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(247, 251, 255, 0.82);
  backdrop-filter: blur(8px);
}

.loading-panel {
  display: grid;
  width: min(320px, 100%);
  justify-items: center;
  gap: 12px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-panel strong {
  font-size: 1.05rem;
}

.loading-panel span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.loading-spinner {
  width: 78px;
  height: 78px;
  border: 7px solid #d7e7f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: loading-spin 0.85s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.tabbar {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: min(calc(100% - 24px), 560px);
  margin: 0 auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.tab-button {
  display: grid;
  min-width: 0;
  min-height: 56px;
  justify-items: center;
  gap: 3px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.tab-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.tab-button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 560px) {
  .profits-wrap {
    border: 0;
    background: transparent;
  }

  .compact-table,
  .compact-table tbody,
  .compact-table tr,
  .compact-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .compact-table thead {
    display: none;
  }

  .compact-table tr {
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
  }

  .compact-table td {
    display: grid;
    grid-template-columns: minmax(76px, 0.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .compact-table td:last-child {
    border-bottom: 0;
  }

  .compact-table td::before {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
  }

  .compact-table td:nth-child(1)::before {
    content: "Sala";
  }

  .compact-table td:nth-child(2)::before {
    content: "Ref";
  }

  .compact-table td:nth-child(3)::before {
    content: "Profit";
  }

  .compact-table td:nth-child(4)::before {
    content: "Telegram";
  }

  .compact-table input {
    min-width: 0;
  }

  .profit-section-row td {
    display: block;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .profit-section-row td::before {
    content: "";
    display: none;
  }
}

@media (max-width: 420px) {
  .room-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 680px) {
  .app-shell {
    padding-inline: 22px;
  }

  .app-header {
    margin-inline: -22px;
    padding-inline: 22px;
  }

  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .derived-strip,
  .totals-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .report-chip.is-carry {
    grid-column: span 3;
  }

  .report-chip.is-aggio {
    grid-column: span 4;
  }

  .control-summary,
  .control-values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .profit-topbar {
    align-items: end;
    flex-direction: row;
    justify-content: space-between;
  }

  .inline-field input {
    min-width: 190px;
  }

  .report-month-nav {
    width: auto;
  }

  .month-nav-button {
    flex: 0 0 112px;
  }
}
