:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #111827;
  --muted: #6b7280;
  --soft: #d5dbe4;
  --line: #e6e9ef;
  --accent: #2563eb;
  --accent-2: #2563eb;
  --red: #d64545;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius: 6px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #1a1f27;
  --text: #f6f7f9;
  --muted: #9aa3af;
  --soft: #303743;
  --line: #242b38;
  --accent: #6d96ff;
  --accent-2: #6d96ff;
  --red: #ff6b6b;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "SF Pro Display", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.75fr);
  gap: 20px;
  align-items: center;
  padding: 28px 0;
}

.auth-visual,
.auth-panel,
.panel,
.table-wrap,
.client-card {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-visual {
  min-height: 560px;
  border-radius: var(--radius);
  padding: 42px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: auto 42px 42px auto;
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--text);
  letter-spacing: 0;
}

[data-theme="dark"] .brand-mark {
  color: #111318;
  background: #f6f7f9;
}

.brand-avatar {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--text);
  font-size: 0.9rem;
  font-weight: 850;
}

.brand-avatar.large {
  width: 86px;
  height: 86px;
  border-radius: 6px;
  font-size: 1.35rem;
}

[data-theme="dark"] .brand-avatar {
  color: #111827;
  background: #f6f7f9;
}

.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-visual h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.98;
}

.auth-copy {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.auth-stats {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}

.auth-stats div {
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.auth-stats span,
.period-picker span,
.currency-picker span,
.field span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-stats strong {
  display: block;
  margin-top: 10px;
  font-size: 1.25rem;
}

.auth-panel {
  border-radius: var(--radius);
  padding: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.auth-tab,
.nav-item,
.mobile-nav-item {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.auth-tab {
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 800;
}

.auth-tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.auth-form {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

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

.field input,
.field select,
.field textarea,
.searchbox,
.period-picker,
.currency-picker {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 0 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  padding-top: 12px;
}

.field input:disabled {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.searchbox:focus-within,
.period-picker:focus-within,
.currency-picker:focus-within {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.tool-btn {
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 780;
  letter-spacing: 0;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.primary-btn {
  color: white;
  background: var(--accent);
  box-shadow: none;
  padding: 0 22px;
  white-space: nowrap;
}

[data-theme="dark"] .primary-btn {
  color: white;
}

.primary-btn:hover,
.ghost-btn:hover,
.tool-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn.compact,
.ghost-btn.compact {
  min-height: 40px;
  padding: 0 18px;
}

.ghost-btn,
.tool-btn {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  padding: 0 18px;
}

.ghost-btn.danger,
.tool-btn.danger {
  color: var(--red);
}

.icon-btn {
  width: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  font-size: 1.25rem;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(24px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}

.side-brand {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand span {
  max-width: 180px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav,
.side-footer {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 14px;
  text-align: left;
  font-weight: 760;
}

.nav-item.is-active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 78px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.topbar h2,
.panel h3 {
  margin: 0;
}

.topbar h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.period-picker {
  width: 128px;
  min-width: 128px;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  background: var(--surface-2);
}

.currency-picker {
  width: 90px;
  min-width: 90px;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  background: var(--surface-2);
}

.period-picker input,
.currency-picker select {
  border: 0;
  color: var(--text);
  background: transparent;
  outline: 0;
  padding: 0;
  font-weight: 800;
}

.period-picker input::-webkit-calendar-picker-indicator {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  opacity: 0.55;
}

.range-tabs {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 4px;
}

.range-tab {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  padding: 0 12px;
  font-weight: 760;
  white-space: nowrap;
}

.range-tab.is-active {
  color: #fff;
  background: var(--accent);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 116px;
  padding: 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  align-content: space-between;
}

.kpi-card:last-child {
  border-right: 0;
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.05;
}

.kpi-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 780;
}

.kpi-card .delta {
  color: var(--accent-2);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border-radius: var(--radius);
  padding: 18px;
}

.chart-panel {
  min-height: 0;
}

.chart-panel canvas {
  width: 100%;
  height: 180px;
  min-height: 0;
  display: block;
}

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

.panel-badge,
.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.searchbox {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.searchbox span {
  display: none;
}

.searchbox input {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: 0;
}

.toolbar select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  padding: 0 12px;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 920px;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 0;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table tbody tr {
  background: var(--surface);
}

.data-table tbody td {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-table tbody td:first-child {
  border-left: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
}

.data-table tbody td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.client-line {
  display: grid;
  gap: 3px;
}

.client-line strong,
.order-title {
  overflow-wrap: anywhere;
}

.client-line span,
.muted {
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-btn {
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  font-size: 0.86rem;
}

.status-paid {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.status-waiting,
.work-in_work {
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.status-cancelled {
  color: color-mix(in srgb, var(--red) 92%, var(--text));
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

.work-delivered {
  color: var(--text);
  background: var(--surface-2);
}

.rank-list,
.timeline-list,
.status-stack {
  display: grid;
  gap: 10px;
}

.rank-item,
.timeline-item,
.status-row {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  padding: 12px;
}

.rank-item,
.timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rank-index {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  font-weight: 900;
}

.rank-item strong,
.timeline-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.rank-money,
.timeline-money {
  font-weight: 900;
  white-space: nowrap;
}

.status-row {
  display: grid;
  gap: 8px;
}

.status-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 850;
}

.status-bar {
  height: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.status-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.client-card {
  min-height: 210px;
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.client-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.client-card h3 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.client-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.client-stats div,
.profile-list div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  padding: 10px;
}

.client-stats span,
.profile-list dt {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.client-stats strong,
.profile-list dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.split-layout,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.timeline-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.settings-grid {
  max-width: 980px;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.profile-editor {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-editor-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-editor-fields {
  display: grid;
  gap: 10px;
}

.avatar-upload {
  display: block;
  width: 86px;
  height: 86px;
  cursor: pointer;
  position: relative;
}

.avatar-upload input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-upload::after {
  content: "Фото";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--soft);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.modal {
  width: min(720px, calc(100% - 24px));
  max-width: calc(100vw - 16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0;
}

.modal::backdrop {
  background: rgba(6, 10, 18, 0.54);
  backdrop-filter: blur(6px);
}

.modal-body {
  width: 100%;
  padding: 18px;
  max-width: 100%;
  overflow-x: hidden;
}

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

.modal-head h3 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid > *,
.field input,
.field select,
.field textarea {
  min-width: 0;
}

.span-2 {
  grid-column: span 2;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.report-modal {
  width: min(760px, calc(100% - 24px));
}

.client-report {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
}

.report-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.client-report h2 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1;
}

.client-report p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.report-metrics div,
.client-report section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: 14px;
}

.report-metrics span,
.client-report section span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.report-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  min-height: 46px;
  display: none;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 800;
  z-index: 10;
}

.toast.is-visible {
  display: flex;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .kpi-grid,
  .clients-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card:nth-child(2n) {
    border-right: 0;
  }

  .kpi-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid,
  .split-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body {
    background: var(--bg);
  }

  .auth-screen {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 16px 0;
  }

  .auth-visual {
    min-height: 360px;
    padding: 26px;
    border-radius: var(--radius);
  }

  .auth-visual::after {
    width: 150px;
    height: 150px;
    right: 22px;
    bottom: 22px;
  }

  .auth-panel {
    border-radius: var(--radius);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 16px 14px 92px;
  }

  .topbar {
    min-height: auto;
    display: grid;
    gap: 14px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: stretch;
  }

  .period-picker,
  .currency-picker {
    min-width: 0;
  }

  .period-picker {
    width: auto;
    min-width: 0;
    grid-column: 1;
    grid-row: 2;
  }

  .currency-picker {
    width: auto;
    min-width: 0;
    grid-column: 2;
    grid-row: 2;
  }

  .range-tabs {
    grid-column: 1 / -1;
    grid-row: 1;
    overflow: hidden;
    justify-content: stretch;
  }

  .range-tab {
    flex: 1;
    min-width: 0;
    padding: 0 6px;
    font-size: 0.8rem;
  }

  #quickOrderBtn {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .kpi-grid,
  .clients-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .kpi-card:last-child {
    border-bottom: 0;
  }

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

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

  .data-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }

  .data-table td {
    min-height: 48px;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

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

  .row-actions {
    justify-content: stretch;
  }

  .data-table .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-card .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-actions .tool-btn {
    width: 100%;
    padding: 0 6px;
    font-size: 0.8rem;
  }

  .form-grid,
  .profile-list {
    grid-template-columns: 1fr;
  }

  .profile-editor-head {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 18px);
    overflow: auto;
    overflow-x: hidden;
    border-radius: var(--radius);
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

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

  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 62px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: center;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    z-index: 5;
  }

  .mobile-nav-item {
    min-width: 0;
    height: 48px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 850;
  }

  .mobile-nav-item.is-active {
    color: var(--text);
    background: var(--surface-2);
  }
}

@media (max-width: 520px) {
  .auth-screen {
    width: calc(100% - 20px);
  }

  .auth-stats {
    grid-template-columns: 1fr;
  }

  .auth-stats div {
    min-height: 72px;
  }

  .kpi-card {
    min-height: 112px;
  }

  .rank-item,
  .timeline-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .rank-money,
  .timeline-money {
    grid-column: 2;
  }
}
