/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --dark: #1a1a2e;
  --dark2: #16213e;
  --dark3: #0f3460;
  --accent: #e94560;
  --accent-hover: #c73350;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --green: #28a745;
  --blue: #007bff;
  --orange: #fd7e14;
  --sidebar-width: 240px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,.12);
  --transition: 0.2s ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* ─── App Layout ─────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.logo-brand { font-size: 16px; font-weight: 700; display: block; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,.5); display: block; }
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,.12); color: var(--white); }
.nav-item--accent { color: var(--accent); }
.nav-item--accent:hover, .nav-item--accent.active {
  background: var(--accent);
  color: var(--white);
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info { flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-email {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  color: rgba(255,255,255,.5);
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}
.logout-btn:hover { color: var(--accent); background: rgba(255,255,255,.08); }
.logout-btn svg { width: 18px; height: 18px; }

/* ─── Mobile Header ──────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--dark);
  color: var(--white);
  align-items: center;
  padding: 0 16px;
  z-index: 99;
  gap: 12px;
}
.hamburger {
  background: none; border: none; color: white;
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: white; border-radius: 2px;
}
.mobile-logo { flex: 1; font-weight: 700; font-size: 16px; }
.mobile-add-btn {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 300; color: white;
}

/* ─── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

/* ─── Flash Messages ─────────────────────────────────────────── */
.flash-messages { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  gap: 12px;
}
.flash--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash--error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash--warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.flash--info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.flash button { background: none; border: none; font-size: 18px; line-height: 1; opacity: .6; cursor: pointer; }

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left { display: flex; align-items: center; gap: 12px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--dark); }
.back-btn {
  width: 36px; height: 36px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }
.back-btn svg { width: 18px; height: 18px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.4;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-outline:hover { border-color: var(--gray-500); background: var(--gray-50); }
.btn-danger { background: #dc3545; color: white; border-color: #dc3545; }
.btn-danger:hover { background: #c82333; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}
.form-section:last-of-type { border-bottom: none; }
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-600);
  margin-bottom: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group--full { grid-column: 1 / -1; }
.form-label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-control {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,.12);
}
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}
.form-hint { font-size: 12px; color: var(--gray-500); }
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  cursor: pointer;
}
.form-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
}
.required { color: var(--accent); }

/* ─── Toggle Groups ──────────────────────────────────────────── */
.toggle-group {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.toggle-btn {
  padding: 7px 20px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.toggle-btn.active {
  background: var(--white);
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* ─── Dashboard Stats ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon--blue { background: #e3f2fd; color: #1565c0; }
.stat-icon--green { background: #e8f5e9; color: #2e7d32; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; color: var(--dark); }
.stat-label { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

/* ─── Quick Actions ──────────────────────────────────────────── */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.quick-action {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
  transition: all var(--transition);
}
.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}
.quick-action--primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fff 60%, #fef5f7);
}
.quick-action--primary:hover { background: var(--accent); color: white; }
.qa-icon {
  width: 40px; height: 40px;
  background: var(--gray-100);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qa-icon svg { width: 20px; height: 20px; }
.quick-action--primary .qa-icon { background: rgba(233,69,96,.1); color: var(--accent); }
.quick-action--primary:hover .qa-icon { background: rgba(255,255,255,.2); color: white; }
.qa-text strong { display: block; font-size: 14px; font-weight: 600; }
.qa-text span { font-size: 12px; color: var(--gray-500); }
.quick-action--primary:hover .qa-text span { color: rgba(255,255,255,.8); }

/* ─── Trial Badge ────────────────────────────────────────────── */
.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(233,69,96,.08);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(233,69,96,.2);
}
.trial-badge svg { width: 14px; height: 14px; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.route-cell { display: flex; align-items: center; gap: 6px; font-size: 13px; max-width: 220px; }
.route-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-cell { font-weight: 600; }
.order-number { color: var(--dark3); }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.small { font-size: 12px; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge--created { background: #e3f2fd; color: #1565c0; }
.badge--paid { background: #e8f5e9; color: #2e7d32; }
.badge--loaded { background: #fff3e0; color: #e65100; }
.badge--delivered { background: #f3e5f5; color: #6a1b9a; }

/* ─── Company Cards ──────────────────────────────────────────── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.company-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
  transition: all var(--transition);
}
.company-card--default { border-color: var(--accent); }
.company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.company-type-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--dark);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.company-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.company-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.company-short-name { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.company-details { display: flex; flex-direction: column; gap: 4px; }
.detail-row { display: flex; justify-content: space-between; font-size: 13px; }
.detail-row span { color: var(--gray-500); }
.default-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(233,69,96,.08);
  color: var(--accent);
  border: 1px solid rgba(233,69,96,.2);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* ─── Order Form ─────────────────────────────────────────────── */
.order-progress {
  margin-bottom: 24px;
}
.progress-bar-track {
  height: 4px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .4s ease;
  width: 0%;
}
.order-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--gray-200);
}
.order-section--docs { border-color: var(--accent); background: linear-gradient(135deg, #fff 70%, #fef5f7); }
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-number {
  width: 28px; height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-title { font-size: 16px; font-weight: 600; }

/* Client search */
.client-search-block { margin-bottom: 16px; }
.search-input-wrap { position: relative; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: none;
  max-height: 240px;
  overflow-y: auto;
}
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--gray-50); }
.search-item strong { font-size: 14px; }
.search-item span { font-size: 12px; color: var(--gray-500); }
.selected-client-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(233,69,96,.08);
  border: 1px solid rgba(233,69,96,.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 14px;
}
.clear-client-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  line-height: 1;
}
.divider-text {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin: 14px 0;
  position: relative;
}

/* Route */
.route-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.route-arrow { color: var(--gray-400); }
.route-arrow svg { width: 24px; height: 24px; }

/* Dimensions toggle */
.btn-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--gray-600);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--transition);
}
.btn-expand:hover { border-color: var(--accent); color: var(--accent); }

/* Payment options */
.payment-options { display: flex; gap: 10px; flex-wrap: wrap; }
.payment-option {
  flex: 1;
  min-width: 150px;
  cursor: pointer;
}
.payment-option input { display: none; }
.payment-option-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition);
}
.payment-option-content svg { width: 20px; height: 20px; }
.payment-option input:checked + .payment-option-content {
  border-color: var(--accent);
  background: rgba(233,69,96,.05);
  color: var(--accent);
}
.number-options { display: flex; gap: 8px; }
.number-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
}
.number-opt input { accent-color: var(--accent); }

/* Services checkboxes */
.services-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.service-checkbox { cursor: pointer; }
.service-checkbox input { display: none; }
.service-checkbox-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition);
}
.service-checkbox-content svg { width: 18px; height: 18px; }
.service-checkbox input:checked + .service-checkbox-content {
  border-color: var(--accent);
  background: rgba(233,69,96,.05);
  color: var(--accent);
}

/* Doc checkboxes */
.doc-checkboxes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-checkbox { cursor: pointer; }
.doc-checkbox input { display: none; }
.doc-checkbox-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.doc-checkbox-content > div:last-child {
  display: flex; flex-direction: column;
}
.doc-checkbox-content strong { font-size: 14px; display: block; }
.doc-checkbox-content span { font-size: 12px; color: var(--gray-500); }
.doc-checkbox input:checked + .doc-checkbox-content {
  border-color: var(--accent);
  background: rgba(233,69,96,.05);
}
.doc-checkboxes--sm .doc-checkbox-content {
  padding: 8px 12px;
  gap: 6px;
}
.doc-checkboxes--sm .doc-checkbox-content span { font-size: 13px; font-weight: 500; color: inherit; }

/* Doc icons */
.doc-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  color: white;
}
.doc-icon--contract { background: var(--dark3); }
.doc-icon--invoice { background: var(--green); }
.doc-icon--act { background: var(--orange); }
.doc-icon--waybill { background: #6f42c1; font-size: 9px; }

/* Format selector */
.format-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
}
.format-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.format-opt input { accent-color: var(--accent); }

/* ─── Detail Layout ──────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.detail-card:last-child { margin-bottom: 0; }
.detail-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item--full { grid-column: 1/-1; }
.detail-label { font-size: 12px; color: var(--gray-500); }
.detail-value { font-size: 14px; font-weight: 500; }
.price-big {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}

/* Route display */
.route-display { margin-bottom: 16px; }
.route-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.route-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.route-dot--from { background: var(--accent); }
.route-dot--to { background: var(--dark3); }
.route-line {
  width: 2px;
  height: 24px;
  background: var(--gray-300);
  margin-left: 5px;
}
.route-label { font-size: 12px; color: var(--gray-500); }
.route-value { font-size: 14px; font-weight: 500; }

/* Services badges */
.services-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.service-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(233,69,96,.08);
  color: var(--accent);
  border: 1px solid rgba(233,69,96,.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Party info */
.party-info { display: flex; flex-direction: column; gap: 4px; }
.party-type {
  display: inline-block;
  padding: 2px 8px;
  background: var(--dark);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  width: fit-content;
}
.party-name { font-size: 15px; font-weight: 600; }
.party-detail { font-size: 13px; color: var(--gray-600); }

/* Documents list in order detail */
.docs-list { margin-bottom: 16px; }
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 8px;
}
.doc-item:last-child { border-bottom: none; }
.doc-item-info { display: flex; align-items: center; gap: 10px; }
.doc-item-name { font-size: 14px; font-weight: 500; }
.doc-item-format { font-size: 12px; color: var(--gray-500); }
.generate-block {
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
}
.generate-title { font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 10px; }

/* Status form */
.status-form .form-select { min-width: 140px; }

/* ─── Client Type Badge ───────────────────────────────────────── */
.client-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.client-type-badge--fiz { background: #e3f2fd; color: #1565c0; }
.client-type-badge--yur { background: #f3e5f5; color: #6a1b9a; }

/* Order link in client detail */
.order-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.order-link:hover { border-color: var(--accent); background: rgba(233,69,96,.02); }
.order-link-number { font-weight: 600; font-size: 14px; }
.order-link-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }

/* ─── Filter Bar ─────────────────────────────────────────────── */
.filter-bar { margin-bottom: 20px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-search { flex: 1; min-width: 200px; }
.filter-select { min-width: 160px; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty-icon {
  width: 72px; height: 72px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  color: var(--gray-400);
}
.empty-icon svg { width: 32px; height: 32px; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--gray-500); margin-bottom: 20px; }

/* ─── Alert ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #5d4037; }
.alert p { margin: 4px 0 0; font-size: 14px; }

/* ─── Subscription Info ──────────────────────────────────────── */
.subscription-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(233,69,96,.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(233,69,96,.15);
}
.subscription-info strong { font-size: 14px; display: block; }
.subscription-info div { font-size: 13px; color: var(--gray-600); }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Sidebar Overlay ────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ─── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 50%, var(--dark3) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 24px;
  color: white;
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--dark); }
.auth-logo p { font-size: 14px; color: var(--gray-500); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--gray-500);
}
.auth-link { color: var(--accent); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { color: var(--gray-400); }
.auth-footer { color: rgba(255,255,255,.4); font-size: 12px; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .mobile-header { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 76px 16px 20px;
  }
  .form-grid { grid-template-columns: 1fr; }
  .form-group--full { grid-column: 1; }
  .route-inputs { grid-template-columns: 1fr; }
  .route-arrow { display: none; }
  .quick-actions { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 10px; }
  .page-title { font-size: 18px; }
  .doc-checkboxes { flex-direction: column; }
  .payment-options { flex-direction: column; }
  .filter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px; }
  .stats-grid { grid-template-columns: 1fr; }
  .company-grid { grid-template-columns: 1fr; }
  .form-card { padding: 18px; }
  .order-section { padding: 16px; }
}
