:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #1a2332;
  --muted: #8a94a6;
  --line: #e8ecf1;
  --blue: #1e4f8f;
  --blue-deep: #163f74;
  --blue-soft: #e8f1f9;
  --blue-badge: #5b8fc7;
  --step-inactive: #c5ced8;
  --shadow: 0 8px 28px rgba(22, 40, 70, 0.08);
  --radius: 18px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top, #f8fafc 0%, transparent 55%),
    linear-gradient(180deg, #eef2f6 0%, var(--bg) 40%, #e9eef4 100%);
}

body.landing-body {
  background: #0b2f66;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-top {
  background: #fff;
  border-bottom: 1px solid #e6e9ee;
}

.site-top-inner {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: inline-block;
  padding: 28px 0 18px;
  color: #003366;
  font-size: clamp(1.55rem, 3.4vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.breadcrumb {
  border-top: 1px solid #eceff3;
  padding: 12px 0 14px;
  font-size: 0.92rem;
  color: #8b93a0;
}

.breadcrumb a {
  color: #8b93a0;
}

.breadcrumb a:hover {
  color: #003366;
}

.breadcrumb-sep {
  margin: 0 8px;
  color: #b0b7c2;
}

.breadcrumb-current {
  color: #4a5568;
  font-weight: 600;
}

.page {
  width: min(480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1b2433;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
  background: #0b2f66;
}

.landing-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 28px 22px 24px;
}

.landing-card h1 {
  margin: 0 0 18px;
  text-align: center;
  color: #123a6d;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.landing-form {
  display: grid;
  gap: 14px;
}

.landing-form input {
  width: 100%;
  border: 1px solid #cfd6e0;
  border-radius: 6px;
  padding: 14px 12px;
  background: #f3f5f8;
  color: #1b2433;
  outline: none;
}

.landing-form input::placeholder {
  color: #9aa3b2;
}

.landing-form input:focus {
  border-color: #7aa4d4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 79, 143, 0.12);
}

.landing-form button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  background: #f27a1a;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.landing-form button:hover {
  background: #e36d10;
}

.landing-card .alert {
  margin-top: 14px;
}

.btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #255ea8 0%, var(--blue) 100%);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: linear-gradient(180deg, #2b68b8 0%, var(--blue-deep) 100%);
}

.status-card,
.info-card,
.map-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-card {
  margin-top: 18px;
}

.map-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 0;
  color: #5d6b7c;
  font-size: 0.82rem;
  font-weight: 600;
}

.track-map {
  height: 260px;
  margin: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #dbe4ef;
}

.map-pin-wrap,
.map-truck-wrap {
  background: transparent;
  border: 0;
}

.map-pin {
  background: #163f74;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.map-pin.end {
  background: #f27a1a;
}

.map-truck {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid #1e4f8f;
  box-shadow: 0 6px 16px rgba(22, 63, 116, 0.28);
  animation: pulse-truck 1.8s ease-in-out infinite;
}

.map-truck span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #1e4f8f;
  box-shadow: 5px 0 0 #f27a1a;
}

@keyframes pulse-truck {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.alert {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.alert-error {
  background: #fff1f1;
  color: #9b2c2c;
  border: 1px solid #f5c2c2;
}

.alert-success {
  background: #edf8f0;
  color: #1f6b3a;
  border: 1px solid #b9e0c4;
}

.status-card {
  margin-top: 22px;
}

.status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #1c4d8d 0%, #163f74 100%);
  color: #fff;
}

.status-head-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.status-head-track {
  margin: 6px 0 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #d7e7f8;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 46%;
  text-align: center;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 26px 10px 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 42px;
  height: 2px;
  background: #d7dee7;
  z-index: 0;
}

.timeline-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dfe5ec;
  color: #8b97a8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.step-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.timeline-step.is-active .step-icon,
.timeline-step.is-done .step-icon {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(30, 79, 143, 0.12);
}

.timeline-step.is-done:not(.is-active) .step-icon {
  box-shadow: none;
}

.timeline-step.is-failed .step-icon {
  background: #c0392b;
  color: #fff;
  box-shadow: 0 0 0 6px rgba(192, 57, 43, 0.16);
}

.timeline-step.is-failed .step-label {
  color: #c0392b;
  font-weight: 700;
}

.step-label {
  font-size: 0.68rem;
  line-height: 1.25;
  color: #9aa3b2;
  max-width: 72px;
  font-weight: 500;
}

.timeline-step.is-active:not(.is-failed) .step-label {
  color: var(--blue);
  font-weight: 700;
}

.info-card {
  margin-top: 18px;
}

.info-head {
  padding: 14px 18px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-list {
  margin: 0;
  padding: 4px 18px 10px;
  list-style: none;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-label {
  color: #8b95a6;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.info-value {
  margin: 0;
  text-align: right;
  font-weight: 700;
  color: #1b2433;
  font-size: 0.95rem;
  line-height: 1.35;
}

.highlight-card {
  margin-top: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid #e6b422;
  padding: 16px;
}

.highlight-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.highlight-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f7efc8;
  color: #c9a017;
}

.highlight-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.highlight-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1b2433;
}

.highlight-hint {
  margin: 6px 0 0;
  color: #8b95a6;
  font-size: 0.9rem;
}

.highlight-location {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef3f8;
  color: #4a5568;
  font-size: 0.9rem;
  font-weight: 500;
}

.pin-icon {
  display: inline-grid;
  place-items: center;
  color: #1e4f8f;
}

.pin-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.movement-card {
  margin-top: 18px;
  margin-bottom: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.movement-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.movement-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 4px;
}

.movement-item {
  background: #eef3f8;
  border-radius: 14px;
  padding: 14px 16px;
}

.movement-item time {
  display: block;
  color: #5d6b7c;
  font-size: 0.92rem;
  font-weight: 600;
}

.movement-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #163f74;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.movement-desc {
  margin: 10px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1b2433;
}

.movement-loc {
  margin: 6px 0 0;
  color: #8b95a6;
  font-size: 0.88rem;
}

.site-chrome-footer {
  margin-top: 28px;
  background: #0b2a55;
  color: #fff;
}

.footer-inner {
  width: min(480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 18px;
}

.footer-brand {
  margin: 0 0 26px;
  font-size: 1.15rem;
  font-weight: 700;
}

.footer-block {
  margin-bottom: 26px;
}

.footer-block h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-block li + li {
  margin-top: 8px;
}

.footer-block a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.footer-block a:hover {
  color: #fff;
}

.footer-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.site-footer {
  margin-top: 24px;
  text-align: center;
  color: #9aa3b2;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--blue);
  font-weight: 600;
}

/* Admin */
.admin-shell {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.admin-card h1,
.admin-card h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #5d6b7c;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafbfd;
}

.form-grid textarea {
  min-height: 84px;
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #6b7788;
  font-weight: 600;
  font-size: 0.82rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-secondary {
  background: #eef2f7;
  color: var(--blue-deep);
}

.btn-danger {
  background: #c0392b;
}

.login-wrap {
  width: min(420px, calc(100% - 28px));
  margin: 10vh auto 0;
}

@media (max-width: 420px) {
  .status-head {
    flex-direction: column;
  }

  .status-badge {
    max-width: 100%;
  }

  .step-label {
    font-size: 0.62rem;
    max-width: 58px;
  }

  .step-icon {
    width: 36px;
    height: 36px;
  }

  .timeline::before {
    top: 39px;
  }

  .search-form {
    flex-direction: column;
  }
}
