:root {
  color-scheme: light;
  --bg: #f4f4f5;
  --bg-accent: #e4e4e7;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(63, 63, 70, 0.14);
  --text: #18181b;
  --muted: #52525b;
  --accent: #52525b;
  --accent-2: #71717a;
  --accent-soft: rgba(82, 82, 91, 0.12);
  --shadow: 0 18px 50px rgba(24, 24, 27, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(113, 113, 122, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(82, 82, 91, 0.10), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-accent));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  padding: 28px 16px;
  border-right: 1px solid var(--panel-border);
  background: rgba(24, 24, 27, 0.92);
  color: #f4f4f5;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-collapsed .shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
  width: 76px;
  min-width: 76px;
  padding-left: 14px;
  padding-right: 14px;
  overflow: hidden;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
  align-items: flex-start;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: flex-start;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  margin-left: 0;
  align-items: flex-start;
}

.brand-name {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
}

.brand-subtitle {
  font-size: 11px;
  color: rgba(247, 240, 231, 0.66);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-align: left;
}

.brand-datetime {
  margin-left: 0;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: #ef4444 !important;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: left;
  align-self: flex-start;
}

.sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  margin: 4px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #f4f4f5;
  cursor: pointer;
}

.sidebar-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
}

.sidebar-collapsed .sidebar-toggle svg {
  transform: scaleX(-1);
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label {
  display: none;
}

.sidebar-collapsed .brand-main {
  justify-content: flex-start;
  width: 100%;
}

.sidebar-collapsed .brand-copy {
  display: flex;
  align-items: flex-start;
}

.sidebar-collapsed .brand-subtitle {
  display: none;
}

.sidebar-collapsed .brand-name {
  font-size: 18px;
  line-height: 1;
  text-align: left;
}

.sidebar-collapsed .brand-datetime {
  display: none;
}

.sidebar-collapsed .sidebar-toggle {
  align-items: center;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
}

.sidebar-user {
  margin-top: auto;
  flex: 0 0 auto;
  padding-top: 14px;
  display: grid;
  gap: 7px;
  align-items: stretch;
  justify-items: stretch;
}

.sidebar-user-main {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent !important;
  background-color: transparent !important;
  color: #f4f4f5;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar-user-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sidebar-user-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sidebar-user-name-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: start;
  text-align: left;
}

.sidebar-user-name,
.sidebar-user-role,
.sidebar-user-dealer {
  overflow: hidden;
  color: #f4f4f5;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-logout {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 0;
  font-size: 12px;
  color: rgba(244, 244, 245, 0.75);
  font-weight: 500;
  text-align: left;
}

.sidebar-collapsed .sidebar-user {
  align-items: center;
  justify-items: center;
  padding-top: 8px;
}

.sidebar-collapsed .sidebar-user-main {
  flex-direction: column;
  gap: 6px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
}

.sidebar-collapsed .sidebar-user-main:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-collapsed .sidebar-user-name-wrap,
.sidebar-collapsed .sidebar-user-name,
.sidebar-collapsed .sidebar-user-role,
.sidebar-collapsed .sidebar-user-dealer,
.sidebar-collapsed .sidebar-user-logout {
  display: none;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  flex: 1 1 auto;
}

.nav {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: thin;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(244, 244, 245, 0.16);
  border-color: rgba(244, 244, 245, 0.18);
  transform: translateX(2px);
}

.nav-item.active {
  color: #ffffff;
  box-shadow: inset 3px 0 0 #ef4444;
}

.main {
  padding: 32px;
}

.topbar {
  margin-bottom: 0;
}

.topbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.topbar-user {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 2.6vw, 38px);
  letter-spacing: -0.025em;
}

.topbar h1.lead-selection-page-title {
  font-size: clamp(20px, 1.82vw, 27px);
  white-space: pre-wrap;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.content {
  display: grid;
  gap: 20px;
}

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

.panel-wide {
  width: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.action-link,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(82, 82, 91, 0.18);
  background: rgba(82, 82, 91, 0.10);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.action-link-inline {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
}

button.js-open-stage-log {
  height: 24px;
  min-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 24px;
}

.action-button {
  appearance: none;
}

.action-link:hover,
.action-button:hover {
  background: rgba(82, 82, 91, 0.16);
}

.action-link:disabled,
.action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.note {
  margin: 0 22px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(113, 113, 122, 0.08);
  color: var(--muted);
}

.stage-filter-row {
  padding: 0 22px 12px;
}

.stage-filter-field {
  margin: 0;
  max-width: 520px;
}

.stage-filter-field span {
  font-size: 14px;
  line-height: 1.2;
  font-family: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.stage-filter-field input {
  padding: 8px 12px;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.2;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.cars-table th,
.cars-table td {
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.22;
  font-family: Helvetica, Arial, sans-serif;
  vertical-align: middle;
}

.cars-table thead th {
  background: rgba(241, 241, 243, 0.98) !important;
  letter-spacing: 0;
  font-weight: 400;
  text-transform: none;
  box-shadow: inset 0 -1px 0 rgba(113, 113, 122, 0.04);
  white-space: nowrap;
}

.cars-table thead th *,
.cars-table thead .sku-sort-head {
  white-space: nowrap;
}

.cars-table td {
  white-space: nowrap;
}

.cars-table th:nth-child(2),
.cars-table td:nth-child(2) {
  width: 44px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.cars-table th:nth-child(9),
.cars-table td:nth-child(9),
.cars-table th:nth-child(10),
.cars-table td:nth-child(10),
.cars-table th:nth-child(13),
.cars-table td:nth-child(13) {
  text-align: right;
}

.favorite-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(113, 113, 122, 0.6);
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
  position: relative;
  top: -1px;
}

.favorite-toggle:hover {
  background: rgba(113, 113, 122, 0.08);
  transform: translateY(-1px);
}

.favorite-toggle.is-favorite {
  color: #ef4444;
}

.favorite-toggle__icon {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.favorite-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: rgba(113, 113, 122, 0.6);
  vertical-align: middle;
}

.favorite-sort-head {
  justify-content: center;
}

.cars-filters {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(160px, 200px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0;
}

.cars-filters-panel {
  margin-bottom: 1px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  padding: 0;
}

.cars-filter-field {
  margin: 0;
}

.cars-filter-field span {
  font-size: 14px;
  line-height: 1.2;
  font-family: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.cars-filter-field input {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 34px;
  font-family: inherit;
}

.cars-filter-field select {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 34px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.cars-filters .field input,
.cars-filters .field select {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 34px;
  border-radius: 12px;
}

.cars-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
  padding-bottom: 0;
}

.cars-filter-actions .action-button,
.cars-filter-actions .action-link {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
}

th, td {
  padding: 14px 22px;
  border-top: 1px solid rgba(54, 39, 22, 0.08);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: rgba(243, 244, 246, 0.98);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selected {
  background: rgba(113, 113, 122, 0.08);
}

.dictionary-row {
  cursor: pointer;
}

.dictionary-row:hover {
  background: rgba(113, 113, 122, 0.06);
}

.dictionaries-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1.5fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.dictionaries-layout .panel,
.dictionaries-layout .table-wrap {
  min-width: 0;
}

.dictionaries-layout table {
  table-layout: fixed;
}

.dictionaries-layout .table-wrap {
  overflow-x: hidden;
}

.dictionaries-layout td,
.dictionaries-layout th {
  overflow-wrap: anywhere;
}

.translations-panel {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  overflow: hidden;
}

.translations-panel .panel-head {
  padding: 0 0 14px;
  align-items: center;
  gap: 18px;
}

.translations-panel .table-wrap {
  margin: 0 -18px -16px;
}

.translations-head-actions {
  display: grid;
  grid-template-columns: 240px auto;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: end;
}

.translations-button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.translation-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.translation-search-field span {
  flex: 0 0 auto;
  color: #18181b;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.translation-search-field span::after {
  content: ":";
}

.translation-search-field input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(82, 82, 91, 0.14);
  background: #fff;
  color: #18181b;
  padding: 0 12px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 1px rgba(24, 24, 27, 0.02);
  box-sizing: border-box;
}

.translation-search-field input:focus {
  outline: none;
  border-color: rgba(82, 82, 91, 0.5);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.12);
}

.inline-translation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 0 0 14px;
}

.inline-translation-field {
  display: grid;
  gap: 7px;
  margin: 0;
}

.inline-translation-field span {
  color: #18181b;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.inline-translation-field input {
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(82, 82, 91, 0.14);
  background: #fff;
  color: #18181b;
  padding: 0 12px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 1px rgba(24, 24, 27, 0.02);
  box-sizing: border-box;
}

.inline-translation-field input:focus {
  outline: none;
  border-color: rgba(82, 82, 91, 0.5);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.12);
}

.inline-translation-add {
  min-width: 38px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
}

.translation-import-form {
  margin: 0;
}

.translations-table th,
.translations-table td {
  padding: 11px 13px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.22;
  vertical-align: middle;
  text-align: left;
}

.translations-table th {
  background: rgba(241, 241, 243, 0.98) !important;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: inset 0 -1px 0 rgba(113, 113, 122, 0.04);
}

.translations-table td {
  white-space: normal;
}

.translations-table th:nth-child(1),
.translations-table td:nth-child(1),
.translations-table th:nth-child(2),
.translations-table td:nth-child(2) {
  width: calc((100% - 72px) / 2);
  text-align: left;
}

.translations-table th:last-child,
.translations-table td:last-child {
  width: 72px;
  text-align: right;
}

.translation-text {
  display: inline-block;
  min-width: 0;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.translation-edit-input {
  display: none;
  width: 100%;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(82, 82, 91, 0.14);
  background: #fff;
  color: #18181b;
  padding: 0 12px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 1px rgba(24, 24, 27, 0.02);
  box-sizing: border-box;
}

.translation-row.editing .translation-text {
  display: none;
}

.translation-row.editing .translation-edit-input {
  display: block;
}

.translation-edit-input:focus {
  outline: none;
  border-color: rgba(82, 82, 91, 0.5);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.12);
}

.translation-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  vertical-align: middle;
}

.translation-actions form {
  margin: 0;
}

.translation-edit-actions {
  display: none;
}

.translation-row.editing .translation-view-actions {
  display: none;
}

.translation-row.editing .translation-edit-actions {
  display: inline-flex;
}

.translation-actions-cell {
  white-space: nowrap;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.icon-action:hover,
.translation-save-link:hover,
.translation-cancel-link:hover {
  color: var(--accent);
}

.translation-save-link,
.translation-cancel-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.table-link {
  color: var(--accent-2);
  font-weight: 700;
  cursor: pointer;
}

.detail-card {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.car-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 0 22px 22px;
  align-items: start;
}

.car-detail-main,
.car-detail-side {
  overflow: hidden;
}

.car-detail-main {
  display: flex;
  flex-direction: column;
}

.car-detail-side {
  display: flex;
  flex-direction: column;
}

.panel-head-compact {
  padding-bottom: 8px;
}

.panel-head-compact h3 {
  margin: 0;
  font-size: 15px;
}

.car-detail-summary {
  display: grid;
  gap: 12px;
  padding: 0 22px 22px;
}

.car-detail-summary-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(54, 39, 22, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.car-detail-summary-item span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.car-detail-summary-item strong {
  font-size: 15px;
  font-weight: 700;
}

.detail-stack {
  margin-top: 20px;
}

.detail-head {
  display: grid;
  gap: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form {
  display: grid;
  gap: 14px;
  padding: 0 22px 18px;
}

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

.field > span,
.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(63, 63, 70, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(82, 82, 91, 0.5);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.12);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.panel-subtitle {
  padding: 6px 22px 10px;
}

.detail-table {
  border-top: 1px solid rgba(63, 63, 70, 0.08);
}

.empty-card {
  margin: 16px 22px 22px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(113, 113, 122, 0.08);
  color: var(--muted);
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 0 22px 22px;
}

.readonly-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(54, 39, 22, 0.08);
}

.readonly-item.full {
  grid-column: 1 / -1;
}

.readonly-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.readonly-value {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.field-value-box {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(54, 39, 22, 0.12);
  background: rgba(255, 255, 255, 0.9);
  min-height: 42px;
}

.candidate-detail-list {
  padding: 0 16px 16px;
  display: grid;
  gap: 6px;
}

.car-detail-rows {
  padding-bottom: 0;
}

.candidate-detail-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.candidate-detail-label,
.candidate-detail-value {
  min-height: 28px;
  display: flex;
  align-items: center;
}

.candidate-detail-label {
  color: var(--muted);
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-start;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.15;
  width: var(--car-detail-label-width, max-content);
  min-width: var(--car-detail-label-width, max-content);
}

.candidate-detail-value {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  min-width: 0;
  font-size: 14px;
  line-height: 1.15;
}

.candidate-detail-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.car-detail-main {
  width: 100%;
  max-width: none;
  margin: 0;
}

.car-detail-side {
  width: 100%;
  max-width: none;
  margin: 0;
}

@media (max-width: 1200px) {
  .car-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .car-detail-main,
  .car-detail-side {
    width: 100%;
    max-width: 100%;
  }
}

.load-runs-panel {
  margin-top: 6px;
}

.panel-subpanel {
  padding-top: 0;
}

.filter-line {
  display: flex;
  flex-direction: row;
  gap: 0;
  justify-content: flex-end;
  justify-self: end;
}

.filter-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.filter-inline-label {
  margin-right: 6px;
}

.filter-formula {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(113, 113, 122, 0.08);
  border: 1px solid rgba(63, 63, 70, 0.08);
  font-family: var(--mono-font, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 13px;
}

.mode-item {
  min-height: 0;
  padding-block: 8px;
  justify-self: start;
  align-self: stretch;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 0;
  flex-wrap: nowrap;
  margin-left: 0;
}

.mode-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.panel-subtitle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

.radio-inline input {
  margin: 0;
  transform: translateY(-0.5px);
}

.years-list {
  display: grid;
  gap: 10px;
  padding: 0 22px 22px;
}

.year-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(54, 39, 22, 0.08);
}

.status-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.status-check input {
  margin: 0;
}

.table-action-button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(54, 39, 22, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.table-action-button-danger:hover {
  background: rgba(113, 113, 122, 0.12);
  color: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 24, 27, 0.56);
  backdrop-filter: blur(10px);
  z-index: 20000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(720px, 100%);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(63, 63, 70, 0.14);
  box-shadow: 0 30px 80px rgba(24, 24, 27, 0.26);
  overflow: hidden;
}

.modal-card-wide {
  width: min(860px, 100%);
}

.modal-card-json {
  width: min(1100px, calc(100vw - 48px));
  height: min(75vh, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  margin: 0;
}

.modal-body {
  padding: 0 22px 22px;
}

.modal-card-json .modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
}

.modal-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.json-pre {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(113, 113, 122, 0.08);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 22px 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 24px;
}

.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.detail-meta {
  color: var(--muted);
  font-size: 13px;
}

.detail-meta-inline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .car-detail-layout {
    grid-template-columns: 1fr;
  }
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px 22px;
}

.muted {
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  background: rgba(60, 60, 60, 0.06);
}

.stage-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(82, 82, 91, 0.22);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.88);
  animation: stage-spin 0.9s linear infinite;
}

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

.status.pending {
  background: rgba(113, 113, 122, 0.14);
  color: var(--accent-2);
}

.status.running,
.status.not_started {
  background: rgba(82, 82, 91, 0.14);
  color: var(--accent);
}

.status.done,
.status.completed,
.status.success {
  background: rgba(82, 82, 91, 0.14);
  color: #3f3f46;
}

.status.error,
.status.failed {
  background: rgba(82, 82, 91, 0.14);
  color: #52525b;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.table-wrap > table {
  width: max-content;
  min-width: 100%;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    width: 76px;
    min-width: 76px;
    padding-left: 14px;
    padding-right: 14px;
    overflow: hidden;
  }

  .brand-copy,
  .nav-label,
  .brand-subtitle,
  .sidebar-user-name,
  .sidebar-user-role,
  .sidebar-user-dealer,
  .sidebar-user-logout {
    display: none;
  }

  .brand-copy {
    display: flex;
  }

  .brand-name {
    font-size: 18px;
    line-height: 1;
  }

  .brand-datetime {
    display: none;
  }

  .sidebar-toggle {
    align-items: center;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .sidebar-user-main {
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }

  .sidebar-user {
    align-items: center;
    justify-items: center;
  }

  .sidebar-user-main {
    flex-direction: column;
    gap: 6px;
  }

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

  .topbar-row {
    align-items: flex-start;
  }

}

@media (max-width: 700px) {
  .shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    width: 64px;
    min-width: 64px;
    padding: 18px 10px;
  }

  .main {
    min-width: 0;
    padding: 12px;
  }

  .content {
    gap: 12px;
  }

  .topbar-row,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .header-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .topbar h1 {
    font-size: 26px;
    line-height: 1.02;
  }

  .panel {
    border-radius: 16px;
  }

  .panel-head {
    padding: 16px 16px 10px;
  }

  .panel-head,
  th,
  td,
  .note {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-card,
  .modal-card-wide,
  .modal-card-json {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .modal-card-json {
    height: min(82vh, calc(100vh - 24px));
  }

  .modal-head {
    padding: 16px 16px 10px;
  }

  .modal-body {
    padding: 0 16px 16px;
  }

  .json-pre {
    font-size: 12px;
  }

  .dictionaries-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .translations-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .translations-panel .panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .translations-head-actions,
  .inline-translation-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .translation-search-field,
  .translations-button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .translation-search-field {
    gap: 6px;
  }

  .translations-button-row .action-link,
  .translations-button-row button,
  .translation-import-form,
  .inline-translation-add {
    width: 100%;
  }

  .translations-panel .table-wrap {
    margin: 0 -14px -14px;
  }
}
