@font-face {
  font-family: "Gilroy";
  src: local("Gilroy"), local("Gilroy-Regular");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-0: #ffffff;
  --bg-1: #f6f6f6;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --text-primary: #151313;
  --text-secondary: #707070;
  --text-tertiary: #b1b1b1;
  --border-soft: #e1e2e5;
  --border-strong: #c3c3c3;
  --accent: #151313;
  --accent-hover: #1f1c1c;
  --accent-tint: rgba(21, 19, 19, 0.08);
  --success: #1f9d55;
  --warning: #d97706;
  --error: #fe4431;
  --info: #3b82f6;
  --radius-s: 10px;
  --radius-m: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Gilroy", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-1);
  color: var(--text-primary);
}

.theme-dark {
  --bg-0: #060606;
  --bg-1: #151313;
  --surface-1: #1f1c1c;
  --surface-2: #2a2525;
  --text-primary: #ffffff;
  --text-secondary: #d4d4d4;
  --text-tertiary: #b1b1b1;
  --border-soft: #322d2d;
  --border-strong: #444444;
  --accent: #ffffff;
  --accent-hover: #d4d4d4;
  --accent-tint: rgba(255, 255, 255, 0.12);
}

.app {
  min-height: 100vh;
  display: flex;
  background: var(--bg-1);
}

.sidebar {
  width: 240px;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-0);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

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

.burger-btn,
.mobile-action-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.burger-btn {
  display: none;
  gap: 4px;
  flex-direction: column;
}

.burger-btn span {
  width: 16px;
  height: 1px;
  border-radius: 1px;
  background: currentColor;
  display: block;
}

.brand {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.brand img {
  width: 156px;
  max-width: 156px;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

.brand-signature {
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.logo-dark { display: none; }
.theme-dark .logo-dark { display: block; }
.theme-dark .logo-light { display: none; }

.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-action-btn {
  display: none;
}

.theme-toggle-btn {
  display: inline-flex;
  width: 40px;
  min-width: 40px;
}

.theme-toggle-btn .icon-sun {
  display: none;
}

.theme-dark .theme-toggle-btn .icon-sun {
  display: block;
}

.theme-dark .theme-toggle-btn .icon-moon {
  display: none;
}

.mobile-action-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav a.active {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--accent-tint);
}

.drawer-backdrop {
  display: none;
}

.sidebar-meta {
  margin-top: auto;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
}

.main {
  flex: 1;
  padding: 24px 32px;
  max-width: calc(100vw - 240px);
}

.topbar {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.title-block h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

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

.search {
  border: 1px solid var(--border-soft);
  background: var(--surface-1);
  border-radius: 10px;
  color: var(--text-primary);
  height: 40px;
  min-width: 220px;
  padding: 0 12px;
}

.btn {
  height: 40px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-s);
  padding: 0 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}

.theme-dark .btn.primary {
  background: #ffffff;
  color: #151313;
  border-color: #ffffff;
}

.btn.editorial { border-radius: 0; }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  background: var(--surface-1);
  padding: var(--space-4);
}

.card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.kpi {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.kpi-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.chart-mock {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  height: 210px;
  position: relative;
  background: linear-gradient(180deg, var(--accent-tint), transparent 68%);
  overflow: hidden;
  padding: 16px 14px 12px;
}

.chart-bars {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 34px;
  top: 38px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  opacity: 0.45;
}

.chart-bars span {
  border-radius: 6px 6px 0 0;
  border: 1px solid var(--border-soft);
  border-bottom: none;
}

.chart-bars span:nth-child(1) { background: linear-gradient(180deg, rgba(44, 39, 39, 0.26), transparent); }
.chart-bars span:nth-child(2) { background: linear-gradient(180deg, rgba(58, 54, 54, 0.28), transparent); }
.chart-bars span:nth-child(3) { background: linear-gradient(180deg, rgba(72, 66, 66, 0.3), transparent); }
.chart-bars span:nth-child(4) { background: linear-gradient(180deg, rgba(103, 93, 140, 0.28), transparent); }
.chart-bars span:nth-child(5) { background: linear-gradient(180deg, rgba(118, 145, 163, 0.28), transparent); }
.chart-bars span:nth-child(6) { background: linear-gradient(180deg, rgba(102, 134, 118, 0.28), transparent); }
.chart-bars span:nth-child(7) { background: linear-gradient(180deg, rgba(54, 50, 50, 0.28), transparent); }

.theme-dark .chart-bars span:nth-child(1) { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent); }
.theme-dark .chart-bars span:nth-child(2) { background: linear-gradient(180deg, rgba(244, 244, 245, 0.24), transparent); }
.theme-dark .chart-bars span:nth-child(3) { background: linear-gradient(180deg, rgba(228, 228, 231, 0.25), transparent); }
.theme-dark .chart-bars span:nth-child(4) { background: linear-gradient(180deg, rgba(196, 181, 253, 0.3), transparent); }
.theme-dark .chart-bars span:nth-child(5) { background: linear-gradient(180deg, rgba(186, 230, 253, 0.3), transparent); }
.theme-dark .chart-bars span:nth-child(6) { background: linear-gradient(180deg, rgba(187, 247, 208, 0.26), transparent); }
.theme-dark .chart-bars span:nth-child(7) { background: linear-gradient(180deg, rgba(244, 244, 245, 0.2), transparent); }

.chart-line {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 26px;
  bottom: 34px;
  width: calc(100% - 28px);
  height: calc(100% - 60px);
  color: #6f6b91;
}

.theme-dark .chart-line {
  color: #b8b3d9;
}

.chart-line path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-labels {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.route-map {
  height: 210px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #eef4ff 0%, #e7f0fb 46%, #f6f9ff 100%);
}

.theme-dark .route-map {
  background: linear-gradient(180deg, #182234 0%, #141e2f 42%, #111a28 100%);
  border-color: rgba(157, 178, 212, 0.2);
}

.route-ocean {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 85% at 9% 92%, rgba(130, 168, 230, 0.2), transparent 58%),
    radial-gradient(120% 85% at 88% 8%, rgba(87, 133, 205, 0.18), transparent 55%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 68%);
}

.theme-dark .route-ocean {
  background:
    radial-gradient(120% 90% at 10% 88%, rgba(65, 102, 166, 0.28), transparent 58%),
    radial-gradient(120% 95% at 84% 12%, rgba(82, 129, 201, 0.24), transparent 54%),
    linear-gradient(140deg, rgba(157, 190, 234, 0.08) 0%, rgba(157, 190, 234, 0) 68%);
}

.route-contours,
.route-map .route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-contours path {
  fill: none;
  stroke: rgba(78, 116, 172, 0.24);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.theme-dark .route-contours path {
  stroke: rgba(156, 188, 236, 0.18);
}

.route-map .route-line {
  color: #2f5e97;
}

.theme-dark .route-map .route-line {
  color: #90b7e8;
}

.route-map .route-line path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-map .route-line .route-line-glow {
  stroke: color-mix(in srgb, currentColor 70%, white 30%);
  stroke-width: 7;
  opacity: 0.32;
  filter: blur(1.1px);
}

.route-map .route-line .route-line-main {
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-dasharray: 4 6;
  animation: route-dash-flow 7.5s linear infinite;
}

.route-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, currentColor 24%, white 76%);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 14px rgba(37, 66, 108, 0.22);
  display: grid;
  place-items: center;
}

.route-pin-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.route-pin.origin { left: 6.5%; top: 68%; color: #4f6d96; }
.route-pin.mid { left: 53%; top: 53%; color: #7399cc; }
.route-pin.dest { left: 92%; top: 24%; color: #27c06a; }

.route-ship {
  position: absolute;
  left: 53%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(65, 96, 142, 0.18);
  box-shadow: 0 10px 22px rgba(45, 74, 113, 0.25);
}

.route-ship svg {
  width: 15px;
  height: 15px;
  fill: #375f93;
}

.theme-dark .route-ship {
  background: rgba(29, 43, 67, 0.85);
  border-color: rgba(146, 179, 229, 0.24);
  box-shadow: 0 8px 20px rgba(7, 12, 22, 0.55);
}

.theme-dark .route-ship svg {
  fill: #a4c4ee;
}

.route-cities {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes route-dash-flow {
  to { stroke-dashoffset: -22; }
}

@media (prefers-reduced-motion: reduce) {
  .route-map .route-line .route-line-main {
    animation: none;
  }
}

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

.table th,
.table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 400;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--border-soft);
  font-size: 12px;
}

.badge.success { color: var(--success); border-color: rgba(31, 157, 85, 0.35); }
.badge.warn { color: var(--warning); border-color: rgba(217, 119, 6, 0.35); }
.badge.error { color: var(--error); border-color: rgba(254, 68, 49, 0.4); }
.badge.neutral { color: var(--text-secondary); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.chip {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.chip.active {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--accent-tint);
}

.breadcrumbs {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.timeline {
  border-left: 1px solid var(--border-soft);
  margin-left: 6px;
  padding-left: var(--space-4);
  display: grid;
  gap: var(--space-4);
}

.timeline-item h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
}

.timeline-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.progress-step {
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
}

.progress-step.done.success { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-step.done.info { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.progress-step.done.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.progress-step.pending { background: var(--border-soft); }

.footer-signature {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--text-tertiary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-signature span:last-child {
  text-transform: none;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.mobile-nav { display: none; }

@media (max-width: 900px) {
  html,
  body {
    font-size: 15px;
  }

  .app { display: block; }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 14px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 22;
  }

  .mobile-header { width: 100%; }

  .burger-btn { display: inline-flex; }

  .brand {
    flex: 0 1 150px;
    padding: 8px 8px 7px;
    gap: 3px;
  }

  .brand img {
    width: 126px;
    max-width: 126px;
  }

  .brand-signature {
    font-size: 8px;
    letter-spacing: 0.16em;
  }

  .header-controls {
    margin-left: auto;
    gap: 6px;
  }

  .mobile-action-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
  }

  .theme-toggle-btn {
    min-width: 36px;
    width: 36px;
    padding: 0;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 280px);
    padding: 78px 16px 20px;
    border-right: 1px solid var(--border-soft);
    background: var(--bg-0);
    display: grid;
    align-content: start;
    gap: 8px;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    z-index: 30;
  }

  body.nav-open .nav { transform: translateX(0); }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 6, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 25;
  }

  body.nav-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-meta { display: none; }

  .main {
    max-width: 100%;
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .title-block h1 { font-size: 22px; }
  .subtitle { font-size: 12px; }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .search {
    min-width: 100%;
    grid-column: 1 / -1;
    height: 38px;
  }

  .btn {
    height: 38px;
    font-size: 11px;
  }

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

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

  .kpi { font-size: 22px; }

  .table {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 12px 9px;
  }

  .chip,
  .badge {
    font-size: 11px;
  }

  .table-wrap { overflow-x: auto; }

  .footer-signature {
    justify-content: center;
    margin-top: 16px;
  }

  .mobile-nav { display: none !important; }
}
