/* JT Crop · Shipment Summary — read-only dashboard (English UI) */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e8ef;
  --line-soft: #eef2f7;
  --ink: #1c2536;
  --ink-2: #5a6a80;
  --ink-3: #8a99ad;
  --blue: #1f5aa8;
  --blue-soft: #eaf1fa;
  --green: #2f8f4e;
  --red: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.brand p { margin: 1px 0 0; font-size: 11.5px; color: var(--ink-3); letter-spacing: .4px; }

.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), #3f86d6);
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

nav.tabs { display: flex; gap: 4px; margin-left: 6px; }

.tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tab:hover { background: var(--line-soft); color: var(--ink); }
.tab.active { background: var(--blue); color: #fff; }

.ro-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #d3e2f5;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------- layout ---------------- */
main { padding: 18px 22px 40px; max-width: 1720px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(28, 37, 54, .04);
  padding: 16px 18px 14px;
  margin-bottom: 16px;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.board-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.board-head h2 .sub { font-weight: 500; color: var(--ink-3); font-size: 12px; margin-left: 6px; }

.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

input[type="text"], input[type="search"], select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
input[type="text"]:focus, input[type="search"]:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 90, 168, .12);
}

#q { width: 320px; max-width: 52vw; }

label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }

button.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
button.btn:hover { background: var(--line-soft); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #1a4d90; }

/* ---------------- table ---------------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 8px; }

table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1080px; }

thead th {
  position: sticky;
  top: 0;
  background: #f7f9fc;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 2;
}

tbody td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 12.8px;
  color: var(--ink);
}

tbody tr:nth-child(even) td { background: #fafbfd; }
tbody tr:hover td { background: var(--blue-soft); }
tbody tr:last-child td { border-bottom: 0; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--blue); }
.sort-ind { margin-left: 4px; color: var(--blue); font-weight: 700; }

td.danger, .danger { color: var(--red); font-weight: 700; }
td.c-narrow { white-space: nowrap; }
td.c-eta { color: var(--ink-2); }

/* shipper：长法定全称截断 2 行，完整值放 title */
.c-ship { max-width: 210px; }
.clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.c-prod { max-width: 230px; }
.c-prod .sub { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }

.empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

.hintline { margin: 10px 2px 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ---------------- access gate ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 28, 42, .55);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.gate.show { display: flex; }
.gate-card {
  background: #fff; border-radius: 12px; padding: 26px 28px;
  width: 340px; box-shadow: 0 18px 48px rgba(16, 24, 40, .28);
}
.gate-card h3 { margin: 0 0 4px; font-size: 16px; }
.gate-card p { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-3); }
.gate-card input { width: 100%; margin-bottom: 12px; }
.gate-msg { color: var(--red); font-size: 12.5px; min-height: 16px; margin: 8px 0 0; }
.gate-card button { width: 100%; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  main { padding: 12px 12px 30px; }
  #q { width: 100%; max-width: none; }
  .ro-badge { margin-left: 0; }
}
