/* Global layout styles */
body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Контейнер для контенту */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Заголовок (header) */
header {
  height: 64px;
  display: flex;
  align-items: center;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-full-width {
  max-width: none !important;
  width: 100% !important;
  padding: 0 2rem !important;
}

.header-content-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.header-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: #111b3d;
  text-decoration: none;
  white-space: nowrap;
}
.brand span{
}

header .brand img {
  height: 36px;
}

.nav-link {
  color: #111b3d;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Auth and User Menu styles */
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logout-link {
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.logout-link:hover {
  text-decoration: underline;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid #e1e8f5;
  transition: transform 0.2s;
}

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

/* Основний контент */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  padding: 0;
}

.main-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* =========================
   SmartFreight Footer
   ========================= */

.main-footer {
  background: #111b3d;
  color: #ffffff;
  height: 200px;
  padding: 0;
  margin-top: 0; /* Убрал отступ сверху */
  overflow: hidden;
}

.main-footer .container {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 360px 1fr 300px;
  align-items: center;
  column-gap: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-logo {
  width: 62px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.footer-logo-text {
  color: #ffffff;
  margin-top: 10px;
  margin-left: 2.5px;
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.footer-description {
  width: 270px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.38;
  font-weight: 400;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  justify-self: center;
  gap: 14px;
  margin-top: 20px;
  margin-left: -300px;
}

.footer-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.footer-link::before {
  content: "•";
  margin-right: 12px;
  color: #ffffff;
}

.footer-link:hover {
  opacity: 0.75;
}

.footer-bottom {
  justify-self: end;
  align-self: center;
  text-align: right;
  margin-top: 64px;
}

.footer-bottom p {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 400;
  white-space: nowrap;
}

.footer-bottom a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* =========================
   SmartFreight UA Home Page
   ========================= */

.home-page {
  width: 100%;
  min-width: 0;
  background: #ffffff;
  color: #111b3d;
  overflow-x: hidden;
}

/* Hero */
.home-hero {
  position: relative;
  width: 100%;
  min-height: 500px;
  background: #ffffff;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
          radial-gradient(circle at 72% 10%, rgba(47, 91, 234, 0.17), transparent 25%),
          linear-gradient(180deg, #ffffff 0%, #ffffff 72%, rgba(245, 247, 252, 0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

.home-map-bg {
  position: absolute;
  left: 50%;
  top: 10px;
  z-index: 1;
  width: 800px;
  max-width: none;
  transform: translateX(-54%);
  opacity: 0.33;
  pointer-events: none;
}

.home-map-bg img {
  width: 100%;
  height: auto;
  display: block;
}

.home-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  min-height: 500px;
  margin: 0 auto;
  padding: 10px 24px 100px;
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(500px, 1fr);
  align-items: center;
  gap: 34px;
}

.home-hero-content {
  position: relative;
  z-index: 4;
  max-width: 560px;
  padding-top: 0;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(47, 91, 234, 0.1);
  color: #2f5bea;
  font-size: 12px;
  font-weight: 800;
}

.home-hero h1 {
  margin: 0 0 14px;
  color: #111b3d;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.home-hero h1 span {
  color: #2f5bea;
}

.home-hero-subtitle {
  max-width: 520px;
  margin: 0;
  color: #253254;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 16px 40px;
  max-width: 450px;
  margin-top: 32px;
}

.home-stat {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-areas:
    "icon value"
    "icon label";
  align-items: center;
  column-gap: 10px;
}

.home-stat-icon {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: #2f5bea;
  font-size: 20px;
}

.home-stat strong {
  grid-area: value;
  color: #111b3d;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
}

.home-stat small {
  grid-area: label;
  color: #111b3d;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

/* Hero visual */
.home-hero-visual {
  position: relative;
  z-index: 3;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.home-truck-img {
  width: 520px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-right: -10px;
  filter: drop-shadow(0 28px 48px rgba(47, 91, 234, 0.16));
}

.hero-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid #111b3d;
  border-radius: 8px;
  background: #ffffff;
  color: #111b3d;
  font-size: 12px;
  box-shadow: 0 8px 22px rgba(17, 27, 61, 0.12);
}

.hero-label-weight {
  top: 60px;
  right: 40px;
}

.hero-label-gps {
  top: 180px;
  left: 120px;
}

/* Search */
.home-search {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 10;
  width: min(960px, calc(100% - 48px));
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 34px 1fr 1fr 138px;
  align-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(47, 91, 234, 0.72);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(47, 91, 234, 0.2);
  overflow: hidden;
}

.home-search-field {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  border-right: 1px solid #e1e8f5;
}

.home-search-field input {
  width: 100%;
  height: 100%;
  padding: 0 42px 0 22px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111b3d;
  font-size: 14px;
  font-weight: 600;
}

.home-search-icon {
  position: absolute;
  right: 18px;
  color: #111b3d;
  font-size: 15px;
  opacity: 0.7;
}

.home-search-swap {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid #cfd8eb;
  border-radius: 999px;
  background: #ffffff;
  color: #2f5bea;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(17, 27, 61, 0.1);
  transition: transform 0.2s ease;
}

.home-search-btn {
  height: 46px;
  margin: 6px;
  border: 0;
  border-radius: 10px;
  background: #2f5bea;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Trending */
.home-section {
  padding: 60px 0 28px;
}

.home-section-head h2 {
  margin: 0 0 30px;
  color: #111b3d;
  font-size: 28px;
  font-weight: 900;
}

.home-trending-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

.home-cargo-card {
  padding: 24px 20px 18px;
  border: 1px solid #e1e8f5;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 27, 61, 0.12);
  transition: transform 0.2s ease;
}

/* Benefits */
.home-benefits {
  padding: 50px 0 70px;
}

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

/* Security Section */
.security-tabs {
  display: grid;
  gap: 22px;
  max-width: 430px;
}

.security-tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #ffffff;
  text-align: left;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.security-tab.is-active {
  background: #ffffff;
  color: #111b3d;
}

.security-tab-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.security-tab.is-active .security-tab-icon {
  filter: brightness(0) saturate(100%) invert(8%) sepia(21%) saturate(3685%) hue-rotate(204deg) brightness(94%) contrast(96%);
}

.security-panel {
  position: relative;
  min-height: 205px;
  padding: 34px 42px;
  border-radius: 16px;
  background: #ffffff;
  color: #111b3d;
  box-shadow: 0 22px 50px rgba(17, 27, 61, 0.2);
}

/* CTA */
.home-cta-section {
  padding: 70px 0 0; /* Убрал нижний отступ */
  margin-bottom: -1px; /* Прижал к футеру */
  background: #ffffff;
}

.home-subscribe-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: center;
  min-height: 48px;
  padding: 6px;
  border: 1px solid rgba(47, 91, 234, 0.6);
  border-radius: 12px;
  background: #ffffff;
}

.home-subscribe-row button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #2f5bea;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Tablet / Mobile */
@media (max-width: 1023px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-bottom: 120px;
  }
  .home-hero-visual {
    justify-content: center;
    min-height: 300px;
  }
  .home-truck-img {
    width: 440px;
    margin-right: 0;
  }
  .home-search {
    grid-template-columns: 1fr 34px 1fr;
  }
}

@media (max-width: 767px) {
  .home-search {
    grid-template-columns: 1fr;
  }
  .home-truck-img {
    width: 320px;
  }
}
/* =============================== */
/* Admin Layout                    */
/* =============================== */

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #f5f7fc;
  color: #111b3d;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #111b3d;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  box-sizing: border-box;
  z-index: 50;
}

.admin-sidebar-brand {
  padding: 4px 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 18px;
}

.admin-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.admin-brand-link img {
  width: 58px;
  height: auto;
  display: block;
}

.admin-sidebar-brand p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(2px);
}

.admin-nav-link.active {
  background: #2f5bea;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(47, 91, 234, 0.3);
}

.admin-nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex: 0 0 auto;
}

.admin-sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
}

.admin-mini-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.admin-mini-avatar,
.admin-topbar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #b8ecff;
  color: #111b3d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.admin-mini-user strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
}

.admin-mini-user span {
  display: block;
  max-width: 165px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-logout-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.12);
  color: #ffb4b4;
  text-decoration: none;
  font-size: 15px;
  font-weight: 900;
  transition: background 0.18s ease, color 0.18s ease;
}

.admin-logout-link:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ffffff;
}

.admin-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 74px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #dfe7f6;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  box-sizing: border-box;
}

.admin-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-topbar-title strong {
  color: #111b3d;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.admin-topbar-title span {
  color: #6b7a99;
  font-size: 13px;
  font-weight: 600;
}

.admin-topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-topbar-user strong {
  display: block;
  max-width: 230px;
  color: #111b3d;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-user span {
  display: block;
  color: #2f5bea;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
}

.admin-main {
  width: 100%;
  max-width: 1320px;
  padding: 34px 32px 60px;
  margin: 0 auto;
  box-sizing: border-box;
}

.admin-main.container {
  max-width: 1320px;
}

.admin-burger {
  width: 46px;
  height: 46px;
  border: 1px solid #dfe7f6;
  border-radius: 14px;
  background: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.admin-burger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #111b3d;
}

.admin-sidebar-overlay {
  display: none;
}

/* Подчищаем старые стили, если где-то остались */
.admin-layout a {
  text-decoration: none;
}

.admin-layout .main-footer {
  display: none;
}

/* Dashboard cards */
.admin-dashboard,
.admin-page {
  width: 100%;
}

.admin-dashboard h1,
.admin-page h1,
.admin-main h1 {
  margin: 0 0 14px;
  color: #111b3d;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
}

.admin-dashboard p,
.admin-page p {
  color: #6b7a99;
}

.admin-stats-grid,
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.admin-stat-card,
.admin-card,
.stat-card {
  min-height: 104px;
  background: #ffffff;
  border: 1px solid #dfe7f6;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(17, 27, 61, 0.08);
  padding: 20px;
  box-sizing: border-box;
}

.admin-stat-card strong,
.admin-card strong,
.stat-card strong,
.admin-stat-card .value,
.admin-card .value,
.stat-card .value {
  display: block;
  margin-bottom: 8px;
  color: #2f5bea;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.admin-stat-card span,
.admin-card span,
.stat-card span {
  color: #6b7a99;
  font-size: 14px;
  font-weight: 700;
}

/* Tablet */
@media (max-width: 1023px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 286px;
    max-width: calc(100vw - 42px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

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

  body.admin-sidebar-open .admin-sidebar-overlay {
    display: block;
  }

  .admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(17, 27, 61, 0.38);
  }

  .admin-burger {
    display: flex;
  }

  .admin-topbar {
    padding: 0 18px;
  }

  .admin-main {
    padding: 28px 18px 48px;
  }

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

/* Mobile */
@media (max-width: 767px) {
  .admin-topbar {
    min-height: 68px;
    gap: 12px;
  }

  .admin-topbar-title span {
    display: none;
  }

  .admin-topbar-user div:not(.admin-topbar-avatar) {
    display: none;
  }

  .admin-main {
    padding: 24px 14px 42px;
  }

  .admin-dashboard h1,
  .admin-page h1,
  .admin-main h1 {
    font-size: 28px;
  }

  .admin-stats-grid,
  .admin-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-stat-card,
  .admin-card,
  .stat-card {
    min-height: 92px;
    border-radius: 18px;
    padding: 18px;
  }
}