@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/webfonts/montserrat-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/webfonts/montserrat-medium.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/webfonts/montserrat-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/webfonts/montserrat-bold.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/webfonts/montserrat-regular-italic.woff2") format("woff2");
}

:root {
  --brand-navy: #1d3557;
  --brand-blue: #457b9d;
  --accent-red: #e63946;
  --ui-primary: #1a73e8;
  --ui-secondary: #4285f4;
  --ui-dark: #333333;
  --surface: #ffffff;
  --page: #f4f4f4;
  --line: #d9e1e8;
  --muted: #5d6670;
  --success: #28a745;
  --warning: #c27b13;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ui-dark);
  background: var(--page);
  font-size: 16px;
  line-height: 1.7;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 15px;
}

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 4px solid var(--brand-blue);
  padding: 18px 0 16px;
}

h1,
h2 {
  color: var(--brand-navy);
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

header p {
  margin: 4px 0 0;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(29, 53, 87, 0.08);
  padding: 18px;
}

button,
input {
  min-height: 40px;
  border: 1px solid #b9c7d4;
  border-radius: 5px;
  font: inherit;
}

button {
  padding: 0 16px;
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

button:hover {
  background: var(--ui-secondary);
  border-color: var(--ui-secondary);
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

input {
  width: min(420px, 100%);
  padding: 0 12px;
  background: #ffffff;
  color: var(--ui-dark);
}

input:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
  outline: none;
}

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

.summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  justify-content: flex-end;
}

#status {
  color: var(--brand-navy);
  font-weight: 700;
}

.error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--accent-red);
  font-size: 14px;
  font-weight: 600;
}

.empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric {
  min-height: 82px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-navy);
  font-size: 17px;
  line-height: 1.25;
}

.metric.ok {
  border-left-color: var(--success);
}

.metric.running {
  border-left-color: var(--ui-primary);
  background: #f4f9ff;
}

.metric.warn {
  border-left-color: var(--accent-red);
  background: #fff7f8;
}

.history,
.destinations {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 140px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.timeline-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
  height: 120px;
}

.timeline-bar span {
  display: block;
  width: 100%;
  min-height: 12px;
  border-radius: 4px 4px 2px 2px;
  background: var(--brand-blue);
}

.timeline-bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.destination {
  min-height: 98px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-blue);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.destination strong,
.destination span,
.destination small {
  display: block;
}

.destination strong {
  color: var(--brand-navy);
  font-size: 15px;
  line-height: 1.35;
}

.destination span {
  margin-top: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.destination small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.destination.active {
  border-top-color: var(--success);
}

.destination.planned {
  border-top-color: var(--warning);
}

.destination.required {
  border-top-color: var(--accent-red);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: white;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

td:nth-child(6) {
  white-space: pre-line;
}

th {
  color: var(--brand-navy);
  font-weight: 700;
}

.snapshot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.snapshot-badge.present {
  border-color: rgba(40, 167, 69, 0.4);
  background: rgba(40, 167, 69, 0.1);
  color: #1b6f31;
}

.snapshot-badge.missing {
  border-color: rgba(230, 57, 70, 0.4);
  background: rgba(230, 57, 70, 0.08);
  color: var(--accent-red);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

pre {
  max-height: 280px;
  overflow: auto;
  background: var(--brand-navy);
  color: #ffffff;
  border-radius: 8px;
  padding: 12px;
}

@media (max-width: 860px) {
  main {
    padding: 14px;
  }

  header,
  .toolbar,
  .history-header {
    align-items: stretch;
    flex-direction: column;
  }

  .summary {
    justify-content: flex-start;
  }

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

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

  .timeline {
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  }
}
