:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --ink: #071329;
  --text: #071329;
  --muted: #62708a;
  --line: #d9e2ee;
  --line-strong: #c8d5e3;
  --green: #00a879;
  --green-action: #0c8066;
  --green-soft: #dcfae8;
  --red: #ef2b2d;
  --red-soft: #fff0f0;
  --amber: #c26000;
  --amber-soft: #fff3d5;
  --blue: #1b62b9;
  --blue-soft: #edf5ff;
  --violet-soft: #f1e4ff;
  --sidebar: #0b1424;
  --sidebar-line: #1e2d45;
  --shadow: 0 14px 32px rgba(7, 19, 41, 0.08);
  --shadow-overlay: 0 18px 48px rgba(7, 19, 41, 0.18);
  --radius: 14px;
  --control-radius: 9px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.overlay-open,
body.mobile-menu-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(27, 98, 185, 0.18);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

strong {
  font-weight: 600;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 14px 10px 18px;
  overflow-y: auto;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 400;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--control-radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #9fb5d2;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.nav-item:hover,
.nav-item.active {
  border-color: #2c68c8;
  background: #122d58;
  color: #fff;
  font-weight: 600;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #fff;
}

.side-summary {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-line);
}

.side-label {
  color: #93a4bf;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.side-value {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.mini-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.side-summary .text-link {
  justify-content: flex-start;
  color: #a9c8f2;
}

.main {
  min-width: 0;
  padding: 24px 26px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.top-actions,
.action-row,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions {
  justify-content: flex-end;
}

.primary-btn,
.secondary-btn,
.chip,
.text-link,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.primary-btn {
  border-color: var(--green-action);
  background: var(--green-action);
  color: #fff;
}

.primary-btn:hover {
  border-color: #096f59;
  background: #096f59;
}

.secondary-btn {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-btn:hover {
  border-color: #b9c9de;
  background: var(--surface-soft);
}

.secondary-btn.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.text-link {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.text-link.small {
  min-height: 24px;
  font-size: 12px;
}

.icon-btn {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 20px;
}

.full {
  width: 100%;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hotline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.hotline > div,
.metric-card,
.panel,
.tariff-card,
.public-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hotline > div {
  display: grid;
  align-content: start;
  min-height: 104px;
  padding: 14px;
}

.hotline > div:nth-child(1) {
  background: var(--blue-soft);
}

.hotline > div:nth-child(2) {
  background: var(--amber-soft);
}

.hotline > div:nth-child(3) {
  background: var(--red-soft);
}

.hotline-label {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.hotline strong {
  display: block;
  margin-top: 6px;
  color: var(--amber);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.hotline strong.red,
.red {
  color: var(--red);
}

.locked-risk {
  border-color: #cddbf0 !important;
  background: var(--blue-soft) !important;
}

.locked-risk strong {
  color: var(--blue);
}

.locked-risk .text-link {
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metrics-grid.small {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  min-height: 112px;
  padding: 14px;
}

.metric-card.danger {
  background: var(--red-soft);
}

.metric-card.warning {
  background: var(--amber-soft);
}

.metric-card.success {
  background: var(--green-soft);
}

.metric-title {
  min-height: 20px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.metric-value {
  margin: 8px 0 6px;
  color: var(--amber);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.metric-card.danger .metric-value {
  color: var(--red);
}

.metric-card.success .metric-value {
  color: #0b8a63;
}

.metric-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.content-grid,
.accountant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 0.76fr);
  gap: 14px;
  align-items: start;
}

.accountant-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header.row {
  align-items: center;
}

.panel-header p {
  margin-top: 5px;
}

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

.request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.request-item:hover {
  border-color: #b9c9de;
  background: #fbfdff;
}

.request-main {
  min-width: 0;
}

.request-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.amount {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill.red {
  background: var(--red-soft);
  color: #b4232a;
}

.status-pill.yellow {
  background: var(--amber-soft);
  color: #9a4d00;
}

.status-pill.green {
  background: var(--green-soft);
  color: #087558;
}

.status-pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.message-list,
.status-timeline,
.setup-steps {
  display: grid;
  gap: 8px;
}

.message {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.message strong {
  color: var(--ink);
  font-size: 13px;
}

.message span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.filter-row {
  flex-wrap: nowrap;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.chip:hover {
  border-color: #9fb6d1;
  background: var(--surface-soft);
}

.chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  scrollbar-color: #aebdce #edf2f7;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eaf1f8;
  color: #29415d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #f9fbfe;
}

.data-table td > strong {
  font-weight: 600;
}

.supplier-card,
.public-card {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #274765;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9c9de;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

input::placeholder,
textarea::placeholder {
  color: #7d8aa0;
  opacity: 1;
}

.doc-bundle {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.bundle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.bundle-row:last-child {
  border-bottom: 0;
}

.bundle-row span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.bundle-row strong {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.timeline-item,
.setup-step {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.timeline-item.done,
.setup-step.done {
  border-color: #bfe8d0;
  background: var(--green-soft);
  color: #087558;
}

.timeline-item.current,
.setup-step.current {
  border-color: #c5d9f2;
  background: var(--blue-soft);
  color: var(--blue);
}

.setup-step {
  display: grid;
  gap: 4px;
}

.setup-step strong {
  color: inherit;
}

.setup-step span {
  color: var(--muted);
  font-weight: 400;
}

.public-wrap {
  display: grid;
  place-items: start center;
}

.public-card {
  width: min(760px, 100%);
  padding: 18px;
}

.public-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.public-head h2 {
  margin-top: 2px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed #9fb2c8;
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
}

.dropzone strong {
  color: var(--ink);
  font-size: 15px;
}

.dropzone span {
  max-width: 480px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}

.client-row strong {
  color: var(--amber);
}

.client-row.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #114d91;
}

.value-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.value-report > div {
  display: grid;
  align-content: start;
  min-height: 94px;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.value-report span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.value-report strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tariff-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
}

.tariff-card.recommended {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 168, 121, 0.11), var(--shadow);
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #087558;
  font-size: 11px;
  font-weight: 600;
}

.price {
  margin: 12px 0 8px;
  color: var(--amber);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.price span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.tariff-card ul {
  display: grid;
  gap: 7px;
  margin: 14px 0 18px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.tariff-card .full {
  margin-top: auto;
}

.drawer,
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer.open,
.modal.open {
  display: block;
}

.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 19, 41, 0.48);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 100%);
  overflow-y: auto;
  background: var(--bg);
  box-shadow: var(--shadow-overlay);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.drawer-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.drawer-body .panel {
  box-shadow: none;
}

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

.detail-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.detail-value {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(520px, calc(100vw - 28px));
  max-height: 88vh;
  margin: 6vh auto;
  overflow-y: auto;
  gap: 14px;
  padding: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-overlay);
}

.modal-panel .drawer-header {
  margin: 0 -16px;
}

.modal-panel .dropzone {
  min-height: 164px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
  line-height: 1.4;
}

.check-row input {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
}

.onboarding-panel,
.overview-panel {
  width: min(760px, calc(100vw - 28px));
}

.onboarding-intro {
  display: grid;
  gap: 12px;
}

.onboarding-intro > p {
  max-width: 620px;
}

.onboarding-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-points > div,
.onboarding-step,
.overview-list > div,
.overview-frame {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.onboarding-points > div {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 11px 12px;
}

.onboarding-points strong {
  color: var(--amber);
  font-size: 18px;
}

.onboarding-points span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.onboarding-steps {
  display: grid;
  gap: 8px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}

.onboarding-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.onboarding-step strong,
.overview-caption strong,
.overview-list strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.onboarding-step p,
.overview-caption p,
.overview-list p {
  margin-top: 3px;
}

.overview-frame {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.overview-screen {
  display: grid;
  gap: 8px;
}

.overview-card {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.overview-card span {
  color: var(--muted);
  font-size: 12px;
}

.overview-card strong {
  font-size: 20px;
  font-weight: 700;
}

.overview-card.danger {
  background: var(--red-soft);
}

.overview-card.danger strong {
  color: var(--red);
}

.overview-card.warning {
  background: var(--amber-soft);
}

.overview-card.warning strong {
  color: var(--amber);
}

.overview-card.success {
  background: var(--green-soft);
}

.overview-card.success strong {
  color: #0b8a63;
}

.overview-caption {
  align-self: center;
}

.overview-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-list > div {
  padding: 11px 12px;
}

.overview-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .hotline,
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.8fr);
  }

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

  .tariff-card.recommended {
    order: -1;
  }
}

@media (max-width: 960px) {
  .content-grid,
  .accountant-layout {
    grid-template-columns: 1fr;
  }

  .clients-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .clients-panel .panel-header {
    grid-column: 1 / -1;
  }

  .client-row {
    margin-bottom: 0;
  }

  .panel-header.row {
    align-items: flex-start;
  }

  .filter-row {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .chip {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  html {
    scrollbar-gutter: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(312px, calc(100vw - 54px));
    height: 100dvh;
    padding: 14px 10px 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

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

  .brand {
    padding: 0 12px 24px;
  }

  .side-summary {
    margin-top: 24px;
  }

  .mobile-menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 18;
    display: grid;
    place-items: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(7, 19, 41, 0.12);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    background: rgba(7, 19, 41, 0.46);
  }

  .mobile-menu-backdrop[hidden] {
    display: none;
  }

  .main {
    width: 100%;
    padding: 72px 12px 80px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 78px 78px minmax(108px, 1fr);
    flex: 1;
    max-width: 280px;
  }

  .top-actions .primary-btn,
  .top-actions .secondary-btn {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
    white-space: nowrap;
  }

  .top-actions #openFeedback {
    font-size: 0;
  }

  .top-actions #openFeedback::before {
    content: "Идея";
    font-size: 13px;
    font-weight: 600;
  }

  .top-actions #openOverview {
    font-size: 0;
  }

  .top-actions #openOverview::before {
    content: "Обзор";
    font-size: 13px;
    font-weight: 600;
  }

  .top-actions [data-action="openUpload"] {
    font-size: 0;
  }

  .top-actions [data-action="openUpload"]::before {
    content: "Загрузить";
    font-size: 13px;
    font-weight: 600;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 17px;
  }

  .hotline,
  .metrics-grid,
  .metrics-grid.small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hotline > div {
    min-height: 118px;
    padding: 12px;
  }

  .hotline-label {
    min-height: 38px;
    font-size: 12px;
  }

  .hotline strong {
    font-size: 18px;
  }

  .locked-risk .text-link {
    width: 100%;
    min-height: 28px;
    text-align: left;
  }

  .metric-card {
    min-height: 108px;
    padding: 12px;
  }

  .metric-title {
    min-height: 34px;
    font-size: 13px;
    line-height: 1.3;
  }

  .metric-value {
    margin-top: 4px;
    font-size: 22px;
  }

  .content-grid,
  .accountant-layout,
  .form-grid,
  .detail-grid,
  .value-report,
  .tariff-grid,
  .onboarding-points,
  .overview-frame,
  .overview-list {
    grid-template-columns: 1fr;
  }

  .onboarding-panel,
  .overview-panel {
    width: min(100vw - 20px, 760px);
  }

  .onboarding-step {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .panel,
  .public-card,
  .tariff-card {
    padding: 14px;
  }

  .panel-header,
  .panel-header.row,
  .public-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .panel-header .secondary-btn {
    width: 100%;
  }

  .request-item {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px 12px;
    padding: 11px 12px;
  }

  .request-main {
    grid-column: 1 / -1;
  }

  .request-title {
    white-space: normal;
  }

  .request-sub {
    overflow-wrap: anywhere;
  }

  .filter-row {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    flex-wrap: wrap;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 10px;
  }

  .data-table tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(7, 19, 41, 0.06);
  }

  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    border-bottom: 1px solid #e8eef5;
    background: #fff !important;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 108px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  .data-table td:first-child {
    display: block;
    padding-top: 12px;
    text-align: left;
  }

  .data-table td:first-child::before {
    display: block;
    margin-bottom: 5px;
  }

  .data-table td.table-action {
    display: block;
    padding: 10px;
    border-bottom: 0;
  }

  .data-table td.table-action::before {
    display: none;
  }

  .data-table td.table-action .secondary-btn {
    width: 100%;
  }

  .accountant-table td:first-child {
    overflow-wrap: anywhere;
  }

  .clients-panel {
    display: block;
  }

  .clients-panel .panel-header {
    display: flex;
  }

  .client-row {
    margin-bottom: 8px;
  }

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

  .bundle-row strong {
    color: var(--amber);
  }

  .action-row {
    align-items: stretch;
  }

  .action-row > .primary-btn,
  .action-row > .secondary-btn {
    flex: 1 1 145px;
  }

  .public-card {
    width: 100%;
  }

  .public-head .status-pill {
    align-self: flex-start;
  }

  .dropzone {
    min-height: 190px;
    padding: 20px 14px;
  }

  .dropzone .primary-btn {
    width: 100%;
    max-width: 300px;
  }

  .value-report > div {
    min-height: 82px;
  }

  .tariff-card.recommended {
    order: -1;
  }

  .badge {
    position: static;
    align-self: flex-start;
    margin-bottom: 10px;
  }

  .drawer-panel {
    width: 100%;
  }

  .drawer-header {
    min-height: 68px;
    padding: 12px 14px;
  }

  .drawer-body {
    padding: 12px;
  }

  .drawer-body .panel {
    padding: 14px;
  }

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

  .detail-item {
    padding: 10px;
  }

  .modal {
    overflow: hidden;
  }

  .modal-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 94dvh;
    margin: 0;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .modal-panel .drawer-header {
    margin: 0 -14px;
  }

  .modal-panel.onboarding-panel {
    top: max(8px, env(safe-area-inset-top));
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    max-height: none;
    align-content: start;
    overscroll-behavior: contain;
  }

  .onboarding-panel .drawer-header {
    flex: 0 0 auto;
    min-height: 64px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .onboarding-panel .onboarding-content {
    align-content: start;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 430px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .top-actions {
    grid-template-columns: 92px minmax(0, 1fr);
    width: 100%;
    max-width: none;
  }

  .onboarding-panel {
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .onboarding-panel .drawer-header {
    margin-right: -12px;
    margin-left: -12px;
  }

  .onboarding-panel .drawer-header h2 {
    max-width: calc(100% - 56px);
    font-size: 18px;
    line-height: 1.2;
  }

  .onboarding-panel .onboarding-content,
  .onboarding-panel .onboarding-steps {
    gap: 9px;
  }

  .onboarding-panel .onboarding-content > p {
    font-size: 13px;
    line-height: 1.4;
  }

  .onboarding-panel .onboarding-step {
    gap: 9px;
    padding: 9px 10px;
  }

  .onboarding-panel .onboarding-step p {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
  }

  .onboarding-panel .info-note {
    padding: 9px 10px;
    font-size: 12px;
  }

  .onboarding-panel .action-row {
    display: grid;
    gap: 8px;
  }

  .onboarding-panel .action-row > .primary-btn,
  .onboarding-panel .action-row > .secondary-btn {
    width: 100%;
    min-height: 44px;
  }

  .hotline > div {
    min-height: 120px;
  }

  .metric-card {
    min-height: 110px;
  }

  .metric-value {
    font-size: 21px;
  }

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