:root {
  color-scheme: light dark;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  margin: 0;
  padding: 0;
  background: rgba(120, 120, 120, 0.05);
}

/* ---- App shell (V0.1) ---- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(120, 120, 120, 0.22);
}

@media (prefers-color-scheme: dark) {
  .topbar {
    background: rgba(20, 20, 20, 0.55);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(80, 120, 255, 0.75);
  border: 1px solid rgba(80, 120, 255, 0.9);
}

.brand-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  margin-top: 2px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  padding: 18px;
  flex: 1 1 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main {
  min-width: 0;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.h1 {
  margin: 0 0 10px 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.list {
  margin: 10px 0 0 18px;
  padding: 0;
}

.nav {
  border: 1px solid rgba(120, 120, 120, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px;
}

@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(20, 20, 20, 0.55);
  }
}

.nav-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 10px;
  cursor: pointer;
  background: transparent;
  color: inherit;
}

.nav-item:hover {
  background: rgba(120, 120, 120, 0.08);
}

.nav-item.is-active {
  background: rgba(80, 120, 255, 0.18);
  border-color: rgba(80, 120, 255, 0.35);
}

.nav-badge {
  font-size: 11px;
  opacity: 0.7;
  border: 1px solid rgba(120, 120, 120, 0.28);
  padding: 2px 6px;
  border-radius: 999px;
}

.nav-sep {
  height: 1px;
  background: rgba(120, 120, 120, 0.25);
  margin: 10px 2px;
}

.statuspill {
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(120, 120, 120, 0.28);
  background: rgba(120, 120, 120, 0.08);
  white-space: nowrap;
}

.statuspill-unknown {
  border-color: rgba(120, 120, 120, 0.28);
}

.statuspill-ok {
  border-color: rgba(70, 170, 120, 0.55);
  background: rgba(70, 170, 120, 0.14);
}

.statuspill-warn {
  border-color: rgba(220, 160, 60, 0.6);
  background: rgba(220, 160, 60, 0.14);
}

.statuspill-error {
  border-color: rgba(220, 80, 80, 0.65);
  background: rgba(220, 80, 80, 0.14);
}

.statuscard {
  border: 1px solid rgba(120, 120, 120, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
}

@media (prefers-color-scheme: dark) {
  .statuscard {
    background: rgba(20, 20, 20, 0.55);
  }
}

.statuscard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.statuscard-title {
  font-weight: 650;
  font-size: 13px;
}

.statuscard-summary {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.9;
}

.statuscard-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 10px;
  font-size: 12px;
  opacity: 0.9;
}

.statuscard-k {
  opacity: 0.75;
}

.statuscard-v {
  word-break: break-word;
}

.statuscard-error {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.85;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(220, 80, 80, 0.35);
  background: rgba(220, 80, 80, 0.08);
}

.statuscard-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(120, 120, 120, 0.25);
}

.statuscard-subtitle {
  font-weight: 650;
  font-size: 12px;
  opacity: 0.85;
}

.statuslist {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: 12px;
  opacity: 0.95;
}

.statuslist li {
  margin: 4px 0;
}

.muted {
  opacity: 0.8;
  font-size: 14px;
}

.small {
  font-size: 12px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---- Shared cards/panels (used by devtools too) ---- */

.card {
  border: 1px solid rgba(120, 120, 120, 0.35);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
  .card {
    background: rgba(20, 20, 20, 0.35);
  }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.row {
  margin: 12px 0;
}

.row-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.grow {
  flex: 1 1 auto;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.85;
}

.input,
.select,
.textarea,
.button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid rgba(120, 120, 120, 0.35);
  padding: 9px 10px;
}

.input,
.select,
.textarea {
  background: rgba(120, 120, 120, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.input-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

.button {
  cursor: pointer;
  background: rgba(80, 120, 255, 0.22);
  border-color: rgba(80, 120, 255, 0.55);
  white-space: nowrap;
}

.button-compact {
  padding: 6px 10px;
  font-size: 12px;
}

.button-secondary {
  background: rgba(120, 120, 120, 0.12);
  border-color: rgba(120, 120, 120, 0.35);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.divider {
  border: 0;
  height: 1px;
  background: rgba(120, 120, 120, 0.35);
  margin: 14px 0;
}

.pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(20, 20, 20, 0.06);
  border: 1px solid rgba(120, 120, 120, 0.25);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
  min-height: 44px;
}

.form {
  margin-top: 8px;
}

.callout {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.9;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(120, 120, 120, 0.25);
  background: rgba(120, 120, 120, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
}

.error-summary {
  font-weight: 600;
  margin-bottom: 6px;
}

.callout-error {
  border-color: rgba(220, 80, 80, 0.35);
  background: rgba(220, 80, 80, 0.08);
}

.callout-warn {
  border-color: rgba(220, 160, 60, 0.55);
  background: rgba(220, 160, 60, 0.12);
}

/* ---- Shipments list/detail (V0.1) ---- */

.shipments-toolbar {
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 10px;
}

.shipments-advanced {
  margin: 6px 0 12px 0;
}

.shipments-toolbar .search-field {
  min-width: 220px;
}

.shipments-split {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
}

.shipments-list {
  min-width: 0;
}

.shipments-detail {
  min-width: 0;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(120, 120, 120, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(120, 120, 120, 0.04);
}

.table th,
.table td {
  font-size: 12px;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(120, 120, 120, 0.18);
  vertical-align: top;
  text-align: left;
}

.table th {
  font-weight: 650;
  opacity: 0.9;
  background: rgba(120, 120, 120, 0.06);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-row {
  cursor: pointer;
}

.table-row:hover {
  background: rgba(120, 120, 120, 0.06);
}

.table-row.is-selected {
  background: rgba(80, 120, 255, 0.14);
  outline: 1px solid rgba(80, 120, 255, 0.35);
}

/* ---- Shipment tracking (V0.1) ---- */

.shipment-tracking {
  margin-top: 10px;
}

.kv-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  font-size: 12px;
  opacity: 0.95;
}

.kv-k {
  opacity: 0.75;
}

.kv-v {
  word-break: break-word;
}

.details {
  margin-top: 10px;
}

.details-summary {
  cursor: pointer;
  font-size: 12px;
  opacity: 0.85;
}

.details[open] .details-summary {
  margin-bottom: 8px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120, 120, 120, 0.28);
  background: rgba(120, 120, 120, 0.08);
  opacity: 0.9;
}

.tag-success {
  border-color: rgba(70, 170, 120, 0.55);
  background: rgba(70, 170, 120, 0.14);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }

  .shipments-split {
    grid-template-columns: 1fr;
  }
}

