/* ==========================================================================
   ГрузБиржа — дизайн-система
   Один файл: токены, база, компоненты, раскладки. Без внешних зависимостей.
   ========================================================================== */

/* --- Токены ------------------------------------------------------------- */
:root {
  /* бренд */
  --navy-950: #08192e;
  --navy-900: #0d2340;
  --navy-800: #123154;
  --navy-700: #1b3a6b;
  --navy-600: #24508f;
  --navy-500: #2f66b3;
  --navy-100: #dfe8f5;
  --navy-50: #eef3fa;

  --amber-600: #d98410;
  --amber-500: #f5a623;
  --amber-400: #ffbf4d;
  --amber-100: #fdf0d8;

  --green-600: #15803d;
  --green-500: #22a05a;
  --green-100: #e3f7ec;
  --red-600: #c0392b;
  --red-500: #e05244;
  --red-100: #fdeaea;
  --blue-100: #e8f0fe;
  --blue-600: #2563eb;

  /* нейтральные */
  --ink-900: #101828;
  --ink-700: #344054;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --ink-300: #d0d5dd;
  --ink-200: #e4e7ec;
  --ink-100: #f2f4f7;
  --ink-50: #f9fafb;
  --white: #ffffff;

  /* семантика */
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e9f2;
  --border-strong: #cfd8e6;
  --text: #101828;
  --text-muted: #667085;
  --text-soft: #98a2b3;
  --primary: var(--navy-700);
  --primary-hover: var(--navy-800);
  --accent: var(--amber-500);
  --accent-hover: var(--amber-600);
  --success: var(--green-600);
  --danger: var(--red-600);
  --warning: #b45309;
  --info: var(--blue-600);

  /* размеры */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --container: 1200px;
  --header-h: 72px;

  /* тени */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12), 0 4px 8px rgba(16, 24, 40, 0.04);
  --shadow-ring: 0 0 0 4px rgba(47, 102, 179, 0.16);

  /* шрифт */
  --font: "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;

  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Сброс -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--navy-600);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--navy-800);
}

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

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(28px, 3.4vw, 44px);
}

h2 {
  font-size: clamp(24px, 2.4vw, 32px);
}

h3 {
  font-size: clamp(18px, 1.6vw, 22px);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

:focus-visible {
  outline: 3px solid rgba(47, 102, 179, 0.45);
  outline-offset: 2px;
}

/* --- Утилиты ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 760px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wrap {
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

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

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

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

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

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

.text-soft {
  color: var(--text-soft);
}

.text-small {
  font-size: 13px;
}

.text-smaller {
  font-size: 12px;
}

.text-bold {
  font-weight: 600;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.nowrap {
  white-space: nowrap;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.py-4 { padding-top: 32px; padding-bottom: 32px; }
.py-6 { padding-top: 56px; padding-bottom: 56px; }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Индикатор загрузки ------------------------------------------------- */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

/* --- Шапка -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--navy-900);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex: none;
}

.brand:hover {
  color: var(--navy-900);
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  display: grid;
  place-items: center;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.brand__mark .icon {
  width: 22px;
  height: 22px;
}

.brand__accent {
  color: var(--amber-600);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.site-nav__link {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}

.site-nav__link:hover {
  background: var(--navy-50);
  color: var(--navy-800);
}

.site-nav__link.is-active {
  color: var(--navy-700);
  background: var(--navy-50);
  font-weight: 600;
}

.site-nav__mobile-actions {
  display: none;
}

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

.header-cta {
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .site-nav__link {
    font-size: 13.5px;
    padding: 8px;
  }
}

@media (max-width: 1240px) {
  .header-cta {
    display: none;
  }
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.header-user:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.header-user__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.header-user__name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-900);
}

.header-user__company {
  font-size: 12px;
  color: var(--text-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--navy-800);
}

/* --- Аватары ------------------------------------------------------------ */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex: none;
}

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

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 26px;
  border-radius: 22px;
}

.avatar-company {
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  color: var(--navy-700);
}

/* --- Кнопки ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink-700);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--navy-700);
  color: var(--white);
  border-color: var(--navy-700);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--amber-500);
  color: #3a2600;
  border-color: var(--amber-500);
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  background: var(--amber-400);
  border-color: var(--amber-400);
  color: #3a2600;
}

.btn-secondary {
  background: var(--white);
  border-color: var(--border-strong);
  color: var(--ink-700);
}

.btn-secondary:hover {
  border-color: var(--navy-500);
  color: var(--navy-700);
  background: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-danger {
  background: var(--red-500);
  border-color: var(--red-500);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--red-600);
  border-color: var(--red-600);
  color: var(--white);
}

.btn-success {
  background: var(--green-600);
  border-color: var(--green-600);
  color: var(--white);
}

.btn-success:hover {
  background: var(--green-500);
  border-color: var(--green-500);
  color: var(--white);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn-icon {
  padding: 9px;
  gap: 0;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy-600);
  font-weight: 500;
  cursor: pointer;
  font-size: inherit;
}

.btn-link:hover {
  color: var(--navy-800);
  text-decoration: underline;
}

/* --- Карточки ----------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-pad {
  padding: 24px;
}

.card-pad-sm {
  padding: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
  font-size: 17px;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card-hover {
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* --- Бейджи и чипы ------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-muted { background: var(--ink-100); color: var(--ink-700); }
.badge-info { background: var(--blue-100); color: var(--blue-600); }
.badge-success { background: var(--green-100); color: var(--green-600); }
.badge-warning { background: var(--amber-100); color: var(--warning); }
.badge-danger { background: var(--red-100); color: var(--red-600); }
.badge-accent { background: var(--navy-50); color: var(--navy-700); }

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--navy-500);
  color: var(--navy-700);
}

.chip.is-active {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
}

/* --- Поля ввода --------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: 18px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field > .label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
}

.field__hint {
  font-size: 12.5px;
  color: var(--text-soft);
}

.field__error {
  font-size: 12.5px;
  color: var(--red-600);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--ink-900);
  font-size: 14.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-soft);
}

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

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: var(--shadow-ring);
}

.input.has-error,
.select.has-error {
  border-color: var(--red-500);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.input-code {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 14px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-700);
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--navy-700);
  flex: none;
}

.radio-group {
  display: grid;
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.radio-card:hover {
  border-color: var(--navy-500);
  background: var(--surface-2);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--navy-700);
}

.radio-card__title {
  font-weight: 600;
  font-size: 14px;
}

.radio-card__desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Карточка заявки ---------------------------------------------------- */
.order-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.order-card:hover {
  color: inherit;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.order-card__number {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.route {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.route__point {
  min-width: 0;
}

.route__city {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.25;
}

.route__meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.route__line {
  flex: 1;
  height: 2px;
  min-width: 40px;
  background: linear-gradient(90deg, var(--navy-100), var(--amber-500));
  position: relative;
  border-radius: 2px;
}

.route__line::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 7px solid var(--amber-500);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.order-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--ink-700);
}

.spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spec .icon {
  color: var(--text-soft);
  width: 16px;
  height: 16px;
}

.order-card__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy-900);
  white-space: nowrap;
}

.order-card__price small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}

/* --- Таблицы ------------------------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

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

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Рейтинг ------------------------------------------------------------ */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-700);
}

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--ink-300);
}

.stars .icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

.stars .is-on {
  color: var(--amber-500);
}

.rating__value {
  font-weight: 700;
  color: var(--ink-900);
}

.rating__count {
  color: var(--text-soft);
}

/* --- Статистика --------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat__label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.stat__sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.stat__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--navy-700);
  display: grid;
  place-items: center;
}

/* --- Сообщения ---------------------------------------------------------- */
.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}

.alert .icon {
  margin-top: 1px;
}

.alert-success { background: var(--green-100); border-color: #bfe8cf; color: #11633a; }
.alert-info { background: var(--blue-100); border-color: #c9dbfa; color: #1d4ed8; }
.alert-warning { background: var(--amber-100); border-color: #f5dca8; color: #92400e; }
.alert-danger { background: var(--red-100); border-color: #f6c9c3; color: #991b1b; }

/* --- Пустые состояния --------------------------------------------------- */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--navy-50);
  color: var(--navy-600);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.empty__icon .icon {
  width: 30px;
  height: 30px;
}

.empty h3 {
  margin-bottom: 6px;
}

.empty p {
  font-size: 14px;
  max-width: 420px;
  margin: 0 auto;
}

/* --- Пагинация ---------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
}

.pagination .is-current {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
  font-weight: 700;
}

/* --- Таймлайн ----------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: 20px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -28px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink-300);
}

.timeline__item.is-done .timeline__dot {
  border-color: var(--green-500);
  background: var(--green-500);
}

.timeline__item.is-current .timeline__dot {
  border-color: var(--amber-500);
  background: var(--white);
}

.timeline__title {
  font-weight: 600;
  font-size: 14px;
}

.timeline__meta {
  font-size: 12.5px;
  color: var(--text-soft);
}

/* --- Чат ---------------------------------------------------------------- */
.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  min-height: 560px;
}

.chat-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-list__item {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}

.chat-list__item:hover,
.chat-list__item.is-active {
  background: var(--navy-50);
  color: inherit;
}

.chat-window {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-window__head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-window__body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fbfcfe, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
}

.chat-window__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.message {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  align-self: flex-start;
}

.message__meta {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 4px;
}

.message.is-own {
  align-self: flex-end;
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.is-own .message__meta {
  color: rgba(255, 255, 255, 0.65);
}

.message.is-system {
  align-self: center;
  background: var(--amber-100);
  border-color: #f2d9a6;
  color: #7a4a06;
  font-size: 13px;
  max-width: 92%;
}

/* --- Лендинг: герой ----------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(245, 166, 35, 0.18), transparent 60%),
    radial-gradient(900px 420px at 10% 0%, rgba(47, 102, 179, 0.2), transparent 55%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  color: var(--white);
  padding: 64px 0 72px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 500;
  color: #dbe7f7;
  margin-bottom: 18px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(34px, 4.4vw, 54px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber-400);
}

.hero__lead {
  margin-top: 18px;
  font-size: clamp(15px, 1.5vw, 18px);
  color: #c3d2e6;
  max-width: 540px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero__note {
  margin-top: 18px;
  font-size: 13px;
  color: #93a9c6;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hero__note span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --- Форма поиска ------------------------------------------------------- */
.search-panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 22px;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(3, 14, 30, 0.35);
}

.search-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-panel .form-grid {
  gap: 12px;
}

.search-panel .input,
.search-panel .select {
  background: var(--surface-2);
  border-color: var(--border);
}

.search-panel .input:focus,
.search-panel .select:focus {
  background: var(--white);
}

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

/* --- Секции лендинга ---------------------------------------------------- */
.section {
  padding: 72px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-head__eyebrow {
  color: var(--navy-600);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-head p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  height: 100%;
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--navy-50);
  color: var(--navy-700);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.feature-card__icon .icon {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.step-card {
  position: relative;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 100%;
}

.step-card__num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--navy-700);
  color: var(--white);
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  border-radius: var(--radius-xl);
  color: var(--white);
}

.stats-band__value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stats-band__label {
  font-size: 13px;
  color: #b6c8de;
}

.cta-band {
  background: linear-gradient(120deg, var(--navy-800), var(--navy-600));
  border-radius: var(--radius-xl);
  padding: 44px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.cta-band::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.18);
}

.cta-band h2 {
  color: var(--white);
}

.cta-band p {
  color: #c3d2e6;
  margin-top: 8px;
  max-width: 560px;
}

/* --- Авторизация -------------------------------------------------------- */
.auth-layout {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

.auth-aside {
  background:
    radial-gradient(700px 380px at 20% 10%, rgba(245, 166, 35, 0.2), transparent 60%),
    linear-gradient(160deg, var(--navy-950), var(--navy-700));
  color: var(--white);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-aside h2 {
  color: var(--white);
  font-size: clamp(26px, 2.6vw, 36px);
  max-width: 440px;
}

.auth-aside p {
  color: #b9cbe2;
  margin-top: 16px;
  max-width: 440px;
}

.auth-aside__list {
  margin-top: 32px;
  display: grid;
  gap: 14px;
}

.auth-aside__list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #dce8f7;
  font-size: 14px;
}

.auth-aside__list .icon {
  color: var(--amber-400);
  margin-top: 2px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-card__lead {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 26px;
}

.auth-card__foot {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-card__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 12.5px;
  margin: 20px 0;
}

.auth-card__divider::before,
.auth-card__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Рабочий кабинет ---------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 56px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.sidebar__section {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 700;
  padding: 14px 12px 6px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  font-weight: 500;
  font-size: 14px;
}

.sidebar__link:hover {
  background: var(--surface-2);
  color: var(--navy-800);
}

.sidebar__link.is-active {
  background: var(--navy-50);
  color: var(--navy-700);
  font-weight: 600;
}

.sidebar__link .icon {
  color: var(--text-soft);
}

.sidebar__link.is-active .icon {
  color: var(--navy-600);
}

.sidebar__badge {
  margin-left: auto;
  background: var(--amber-500);
  color: #3a2600;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: clamp(24px, 2.6vw, 32px);
}

.page-head__sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--navy-700);
}

/* --- Панель фильтров ---------------------------------------------------- */
.filters {
  display: grid;
  gap: 14px;
}

.filters__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* --- Детальная заявка --------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 16px;
}

.data-list {
  display: grid;
  gap: 0;
}

.data-list__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.data-list__label {
  color: var(--text-muted);
  flex: none;
}

.data-list__value {
  text-align: right;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --- Профиль компании --------------------------------------------------- */
.company-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.company-head__meta {
  flex: 1;
  min-width: 220px;
}

.company-head__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* --- Модальное окно ----------------------------------------------------- */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 25, 46, 0.55);
  backdrop-filter: blur(3px);
}

.modal__dialog {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

/* --- Подвал ------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--navy-950);
  color: #a9bcd4;
  padding: 56px 0 28px;
}

.site-footer a {
  color: #c6d5e7;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-brand .brand {
  color: var(--white);
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 13.5px;
  max-width: 320px;
  color: #93a9c4;
}

.footer-col h4 {
  color: var(--white);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 13.5px;
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #7f95b1;
}

/* --- Выпадающее меню ---------------------------------------------------- */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 80;
}

.dropdown-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.dropdown-menu__item:hover {
  background: var(--surface-2);
  color: var(--navy-800);
}

.dropdown-menu__item .icon {
  width: 17px;
  height: 17px;
  color: var(--text-soft);
}

.dropdown-menu__sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.dropdown-menu__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 700;
  padding: 8px 12px 4px;
}

.dropdown-menu form {
  display: block;
  margin: 0;
}

.dropdown-menu__item.is-current {
  background: var(--navy-50);
  color: var(--navy-700);
  font-weight: 600;
}

/* --- Выбор города ------------------------------------------------------- */
.city-picker {
  position: relative;
}

.city-picker__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.city-picker__input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.city-picker__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 70;
}

.city-picker__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-700);
  font-size: 14px;
  cursor: pointer;
}

.city-picker__item:hover,
.city-picker__item:focus {
  background: var(--navy-50);
  color: var(--navy-800);
  outline: none;
}

.city-picker__item.is-selected {
  background: var(--navy-50);
  font-weight: 600;
}

/* --- Полноценный чат ---------------------------------------------------- */
.chat-layout {
  grid-template-columns: 340px minmax(0, 1fr);
}

.chat-list {
  max-height: calc(100vh - 230px);
  overflow-y: auto;
}

.chat-list__name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list__preview {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar.is-unread {
  box-shadow: 0 0 0 2px var(--amber-500);
}

.chat-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.chat-online__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-300);
}

.chat-online.is-online .chat-online__dot {
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34, 160, 90, 0.16);
}

.message__author {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 3px;
}

.message__reply {
  border-left: 2px solid var(--amber-500);
  padding-left: 8px;
  margin-bottom: 6px;
  opacity: 0.92;
}

.message__reply-author {
  display: block;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--amber-600);
}

.message__reply-body {
  display: block;
  font-size: 12.5px;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}

.message.is-own .message__reply {
  border-left-color: rgba(255, 255, 255, 0.55);
}

.message.is-own .message__reply-author {
  color: #ffd47a;
}

.message__text_deleted {
  font-style: italic;
  opacity: 0.75;
}

.message__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.message__image img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.message__file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  text-decoration: underline;
}

.message__edited {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 6px;
}

.message__receipt {
  margin-left: 6px;
  color: var(--text-soft);
}

.message.is-own .message__receipt {
  color: rgba(255, 255, 255, 0.6);
}

.message__checks.is-read {
  color: var(--amber-500);
  font-weight: 700;
}

.message.is-own .message__checks.is-read {
  color: #ffd47a;
}

.message__actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}

.message:hover .message__actions,
.message:focus-within .message__actions {
  opacity: 1;
}

.message__action {
  background: none;
  border: 0;
  padding: 0;
  font-size: 11.5px;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: underline;
}

.message.is-own .message__action {
  color: rgba(255, 255, 255, 0.7);
}

.chat-day {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  align-self: stretch;
}

.chat-day span {
  font-size: 11.5px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 12.5px;
  color: var(--text-soft);
  border-top: 1px dashed var(--border);
  background: var(--surface);
}

.chat-typing[hidden] {
  display: none;
}

.chat-typing__dots {
  display: inline-flex;
  gap: 3px;
}

.chat-typing__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: typing-dot 1.2s infinite;
}

.chat-typing__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-dot {
  0%, 60%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.chat-reply {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-left: 3px solid var(--amber-500);
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.chat-reply[hidden] {
  display: none;
}

.chat-reply__author {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--amber-600);
}

.chat-reply__text {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}

.chat-window__body {
  max-height: 520px;
}

/* --- Юридическая проверка ---------------------------------------------- */
.legal-score {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-score__value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy-800);
}

.finding-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber-500);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}

.finding-card .badge {
  flex: none;
}

/* --- Заблокированные поля ---------------------------------------------- */
.input:disabled,
.select:disabled,
.textarea:disabled,
.input[readonly],
.select[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* --- Медиа -------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero {
    padding: 48px 0 56px;
  }

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

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

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

  .detail-aside {
    position: static;
  }

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

  .sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .sidebar__section {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 18px;
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .site-nav__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .header-user__meta {
    display: none;
  }

  .site-header__inner {
    gap: 12px;
  }

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

  .auth-aside {
    display: none;
  }

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

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

  .search-panel {
    min-width: 0;
  }

  .route {
    min-width: 0;
  }

  .order-card {
    min-width: 0;
  }

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

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

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

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
    overflow-x: hidden;
  }

  .container {
    padding: 0 16px;
  }

  .site-header__inner {
    gap: 8px;
    min-width: 0;
  }

  .brand {
    font-size: 17px;
    gap: 8px;
  }

  .brand__mark {
    width: 32px;
    height: 32px;
  }

  .nav-toggle {
    order: 2;
    margin-left: 0;
  }

  .header-login {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .hero h1 {
    font-size: clamp(27px, 8.2vw, 38px);
    overflow-wrap: anywhere;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .hero__lead {
    overflow-wrap: anywhere;
  }

  .order-card__top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .order-card__price {
    font-size: 18px;
  }

  .order-card__specs {
    gap: 6px 12px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 48px 0;
  }

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

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

  .route {
    flex-wrap: wrap;
    gap: 8px;
  }

  .route__line {
    min-width: 32px;
  }

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

  .card-pad,
  .card-body {
    padding: 18px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .auth-main {
    padding: 28px 16px;
  }
}

/* --- Мелкие анимации ---------------------------------------------------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-up 320ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
