/* Design pack styles, adapted for the wired portal.
   Some classes belong to approved screens that are not wired yet (tracking,
   Ask Movvo, Stock Journey, the report charts). They stay with the design
   reference rather than being reimplemented. The portal's own additions start
   at the PORTAL SHELL section. */
/* Design system: tenant accent = Zeus Packaging brand green (client brand decision), unslop-ignore
     Type: IBM Plex Sans/Mono — chosen for enterprise data density + tabular numerals.
     Aesthetic reference: the delivery docket — rule lines, stamps, mono refs. */
:root {
  --pine: #1e1b4b; /* rail / deep tenant green */
  --pine-2: #2a2668;
  --green: #4f46e5; /* Movvo brand indigo (brand book v1.0), unslop-ignore */
  --green-soft: #edebfc;
  --success: #1f9254;
  --success-bg: #e7f6ec;
  --ink: #1b1930;
  --sub: #6b6890;
  --bg: #f4f3fa;
  --surface: #ffffff;
  --border: #e2e1ee;
  --border-strong: #bebcd4;
  --amber: #9a5b00;
  --amber-bg: #f8efdd;
  --red: #b3261e;
  --red-bg: #f9e7e5;
  --blue: #4f46e5;
  --blue-bg: #e6eef8;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}
.num,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============ RAIL ============ */
.rail {
  width: 232px;
  flex-shrink: 0;
  background: var(--pine);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.rail-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.tenant-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tmark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #fff;
  color: var(--pine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  font-family: var(--mono);
}
.tname {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1px;
}
.tsub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.powered {
  margin-top: 11px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
}
.powered b {
  color: #9994f0;
  font-weight: 600;
}
.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}
.nav-group-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: rgba(255, 255, 255, 0.42);
  padding: 14px 10px 5px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 1px;
  position: relative;
  font-weight: 500;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 #9994f0;
}
.nav-item .ic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.nav-item .ic svg {
  width: 15px;
  height: 15px;
}
.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 600;
  font-family: var(--mono);
}
.nav-badge.red {
  background: #c64b40;
}
.nav-badge.live {
  background: #37327a;
  color: #b7b3f5;
}
.nav-lock {
  margin-left: auto;
  font-size: 8.5px;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 3px;
  padding: 2px 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--mono);
}
.rail-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono);
  line-height: 1.6;
}

/* ============ MAIN / TOPBAR ============ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 54px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
}
.search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 8px 64px 8px 32px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg);
  font-size: 13px;
  color: var(--ink);
  font-family: var(--sans);
}
.search-input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  background: #fff;
}
.search-input::placeholder {
  color: var(--sub);
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--sub);
}
.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 5px;
  font-family: var(--mono);
  background: #fff;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.clock {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--sub);
}
.role-chip {
  font-size: 11px;
  color: var(--sub);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
  font-family: var(--mono);
}
.icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sub);
}
.icon-btn:hover {
  background: var(--bg);
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}
.dot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  border-radius: 8px;
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-weight: 700;
  font-family: var(--mono);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 60px;
}
.screen {
  display: none;
  max-width: 1460px;
}
.screen.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}
.page-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
}
.breadcrumb {
  font-size: 11.5px;
  color: var(--sub);
  margin-bottom: 8px;
  font-family: var(--mono);
}
.breadcrumb a {
  color: var(--green);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

.btn {
  border: none;
  border-radius: 5px;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: #4238d4;
}
.btn-secondary {
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-secondary:hover {
  background: var(--bg);
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============ KPI (docket counters) ============ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.kpi-tile {
  padding: 14px 16px;
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.kpi-tile:last-child {
  border-right: none;
}
.kpi-tile:hover {
  background: var(--bg);
}
.kpi-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--sub);
  font-weight: 600;
}
.kpi-value {
  font-size: 26px;
  font-weight: 600;
  margin-top: 6px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-value.green {
  color: var(--success);
}
.kpi-value.red {
  color: var(--red);
}
.kpi-value.amber {
  color: var(--amber);
}
.kpi-sub {
  font-size: 10.5px;
  color: var(--sub);
  margin-top: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 16px 18px;
}
.card-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink);
}

/* stamped status badges — docket aesthetic */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
  white-space: nowrap;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
}
.badge.success {
  background: var(--success-bg);
  color: var(--success);
  border-color: #bcdcc9;
}
.badge.warning {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: #e8d3ac;
}
.badge.error {
  background: var(--red-bg);
  color: var(--red);
  border-color: #ecc5c1;
}
.badge.info {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: #c2d4ec;
}
.badge.neutral {
  background: var(--bg);
  color: var(--sub);
  border-color: var(--border);
}

.attn-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.attn-item:hover .attn-title {
  color: var(--green);
}
.attn-item:last-child {
  border-bottom: none;
}
.attn-title {
  font-size: 12.5px;
  font-weight: 600;
}
.attn-sub {
  font-size: 11px;
  color: var(--sub);
  margin-top: 2px;
  font-family: var(--mono);
}

/* ============ FILTERS ============ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 11.5px;
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  color: var(--sub);
  font-weight: 600;
  font-family: var(--mono);
}
.chip:hover {
  border-color: var(--green);
  color: var(--green);
}
.chip.active {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}
.filter-spacer {
  flex: 1;
}
.select-mini,
.input-mini {
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 12px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
}
.input-mini:focus,
.select-mini:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}

/* ============ TABLE (manifest style) ============ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
thead th {
  text-align: left;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--sub);
  padding: 9px 12px;
  background: #edecf6;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover {
  background: #f7f6fb;
}
td.ref {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
}
td.mono-cell {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--sub);
}

/* ============ ORDER DETAIL ============ */
.detail-header {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px 6px 0 0;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.dh-title {
  font-size: 17px;
  font-weight: 700;
}
.dh-sub {
  font-size: 11.5px;
  color: var(--sub);
  margin-top: 5px;
  font-family: var(--mono);
}
.dh-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tabstrip {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: none;
  padding: 0 12px;
  border-radius: 0 0 6px 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.tabpanel {
  display: none;
}
.tabpanel.active {
  display: block;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 28px;
}
.kv-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.kv-label {
  font-size: 9.5px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.kv-value {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
}
.kv-value.mono {
  font-size: 12.5px;
}

.timeline-h {
  display: flex;
  align-items: flex-start;
  margin: 12px 0 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.tl-step {
  flex: 1;
  min-width: 96px;
  text-align: center;
  position: relative;
}
.tl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--success);
  margin: 0 auto 8px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px var(--success);
  position: relative;
  z-index: 1;
}
.tl-dot.pending {
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--border-strong);
}
.tl-line {
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--success);
  z-index: 0;
}
.tl-line.pending {
  background: var(--border-strong);
}
.tl-step:first-child .tl-line {
  display: none;
}
.tl-label {
  font-size: 11px;
  font-weight: 700;
}
.tl-time {
  font-size: 10px;
  color: var(--sub);
  margin-top: 2px;
  font-family: var(--mono);
}

.exc-item {
  background: var(--amber-bg);
  border: 1px solid #e8d3ac;
  border-radius: 5px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.55;
}
.exc-item b {
  color: var(--amber);
}
.exc-item.crit {
  background: var(--red-bg);
  border-color: #ecc5c1;
}
.exc-item.crit b {
  color: var(--red);
}

.pod-view {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}
.pod-doc {
  background: #e7e6f1;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 430px;
}
.pod-doc-mock {
  width: 320px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(19, 23, 17, 0.18);
  border-radius: 2px;
  padding: 22px;
  font-size: 10px;
  color: #333;
  min-height: 440px;
  position: relative;
}
.pod-doc-mock .dl {
  height: 6px;
  background: #e9e9e4;
  border-radius: 1px;
  margin-bottom: 7px;
}
.pod-doc-mock .dl.short {
  width: 55%;
}
.pod-meta-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
}
.pod-meta-row span:first-child {
  color: var(--sub);
}
.pod-meta-row span:last-child {
  font-weight: 600;
  text-align: right;
}
.pod-meta-row:last-child {
  border-bottom: none;
}

.stock-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stock-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.stock-list li:last-child {
  border-bottom: none;
}
.stock-list .sku {
  color: var(--sub);
  font-size: 10.5px;
  font-family: var(--mono);
}
.stock-list .qty {
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}
.stock-list li.short {
  color: var(--red);
  font-weight: 600;
}
.stock-list li.short .sku {
  color: var(--red);
  opacity: 0.75;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.6;
}
.empty-state .es-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
}

.section-note {
  font-size: 11.5px;
  color: #31502f;
  background: var(--green-soft);
  border: 1px solid #bcdcc9;
  border-radius: 5px;
  padding: 11px 14px;
  margin-bottom: 16px;
  line-height: 1.55;
}
.section-note.amber {
  background: var(--amber-bg);
  border-color: #e8d3ac;
  color: #6b4a10;
}

/* ============ CHARTS ============ */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 11.5px;
}
.bar-label {
  width: 200px;
  flex-shrink: 0;
  color: var(--sub);
}
.bar-track {
  flex: 1;
  height: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--green);
}
.bar-fill.warn {
  background: var(--amber);
}
.bar-fill.alt {
  background: #8b88c2;
}
.bar-num {
  width: 52px;
  text-align: right;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ============ LIVE MAP ============ */
.live-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}
.map-card {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}
.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.map-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--success);
  font-weight: 600;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}
.map-svg-wrap {
  background: #5ec5f5;
  position: relative;
}
.map-legend {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--sub);
  font-family: var(--mono);
  flex-wrap: wrap;
}
.lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lg i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.eta-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.eta-item:last-child {
  border-bottom: none;
}
.eta-item:hover .eta-cust {
  color: var(--green);
}
.eta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.eta-cust {
  font-size: 12.5px;
  font-weight: 600;
}
.eta-meta {
  font-size: 10.5px;
  color: var(--sub);
  font-family: var(--mono);
  margin-top: 3px;
}
.eta-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.eta-time.late {
  color: var(--amber);
}
.eta-time.verylate {
  color: var(--red);
}
.progress-track {
  height: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 7px;
}
.progress-fill {
  height: 100%;
  background: var(--green);
}

/* ============ ASK MOVVO ============ */
.ai-shell {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 18px;
}
.ai-query-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13px;
  font-family: var(--sans);
}
.ai-query-input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}
.ai-suggest {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ai-suggest span {
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 6px 11px;
  color: var(--sub);
  cursor: pointer;
  font-family: var(--mono);
}
.ai-suggest span:hover {
  border-color: var(--green);
  color: var(--green);
}
.ai-answer {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: none;
}
.ai-answer.show {
  display: block;
}
.ai-answer .aa-q {
  font-size: 11px;
  color: var(--sub);
  font-family: var(--mono);
  margin-bottom: 8px;
}
.ai-answer .aa-text {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.lock-pill {
  font-size: 9.5px;
  font-weight: 700;
  background: #fff;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 3px 8px;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child {
  border-bottom: none;
}
.user-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
}
.user-name {
  font-weight: 600;
  font-size: 13px;
}
.user-email {
  font-size: 11px;
  color: var(--sub);
  font-family: var(--mono);
}
.user-role {
  margin-left: auto;
}

.tenant-footer {
  margin-top: 32px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 11px;
  color: var(--sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  line-height: 1.55;
}
.tenant-footer b {
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: #c9c7dc;
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--pine);
  color: #fff;
  padding: 11px 16px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 70;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  font-family: var(--mono);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-tile:nth-child(3) {
    border-right: none;
  }
  .kpi-tile:nth-child(-n + 3) {
    border-bottom: 1px solid var(--border);
  }
  .grid-2,
  .live-grid,
  .pod-view {
    grid-template-columns: 1fr;
  }
}
/* v3 additions — live board, run grid, daily report, feed */
.feed-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  align-items: flex-start;
}
.feed-item:last-child {
  border-bottom: none;
}
.feed-time {
  font-family: var(--mono);
  color: var(--sub);
  font-size: 10.5px;
  width: 44px;
  flex-shrink: 0;
  padding-top: 2px;
}
.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.feed-dot.ok {
  background: var(--success);
}
.feed-dot.warn {
  background: var(--amber);
}
.feed-dot.err {
  background: var(--red);
}
.feed-body b {
  font-weight: 600;
}
.feed-sub {
  font-size: 10.5px;
  color: var(--sub);
  font-family: var(--mono);
  margin-top: 1px;
}
.feed-new {
  animation: feedIn 0.5s ease;
}
@keyframes feedIn {
  from {
    background: var(--green-soft);
  }
  to {
    background: transparent;
  }
}

.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.run-card {
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface);
}
.run-card:hover {
  border-color: var(--green);
}
.run-id {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  display: flex;
  justify-content: space-between;
}
.run-nums {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
}
.run-nums small {
  font-size: 10.5px;
  color: var(--sub);
  font-weight: 400;
}
.run-bar {
  height: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  overflow: hidden;
}
.run-bar i {
  height: 100%;
  display: block;
}
.run-bar .sg {
  background: var(--success);
}
.run-bar .us {
  background: var(--amber);
}

.report-controls {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.rc-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.rc-row:last-child {
  margin-bottom: 0;
}
.rc-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--sub);
  font-weight: 700;
  width: 100%;
}
.sig-split {
  display: flex;
  height: 26px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  margin: 10px 0 4px;
}
.sig-split i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  min-width: 34px;
}
.sig-split .sg {
  background: var(--success);
}
.sig-split .st {
  background: #166b41;
}
.sig-split .us {
  background: var(--amber);
}
.muted-row td {
  color: var(--sub);
}
.clickable {
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
}
.clickable:hover {
  text-decoration: underline;
}
td .short-flag {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}
.line-table td {
  font-size: 12px;
}
.result-note {
  font-size: 11px;
  color: var(--sub);
  font-family: var(--mono);
  margin: 8px 0 12px;
}

/* run detail — stop list + run map */
.stop-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: flex-start;
}
.stop-item:last-child {
  border-bottom: none;
}
.stop-item:hover .stop-cust {
  color: var(--green);
}
.stop-ic {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.stop-ic .done {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.stop-ic .pending {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-strong);
}
.stop-ic .next {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--blue);
  animation: pulse 1.6s infinite;
}
.stop-cust {
  font-size: 13px;
  font-weight: 600;
}
.stop-addr {
  font-size: 11px;
  color: var(--sub);
  margin-top: 2px;
  line-height: 1.45;
}
.stop-meta {
  font-size: 10.5px;
  color: var(--sub);
  font-family: var(--mono);
  margin-top: 3px;
}
.stop-right {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.stop-time {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}
.stop-time.next-t {
  color: var(--blue);
}
.next-panel {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: var(--surface);
  padding: 14px 16px;
  margin-top: 14px;
}
.next-eta {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1;
}
.next-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 8px;
}
.next-cust {
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 8px;
}
.next-addr {
  font-size: 11.5px;
  color: var(--sub);
  margin-top: 3px;
  line-height: 1.5;
}
.run-complete {
  border-left-color: var(--success);
}
.run-complete .next-eta {
  color: var(--success);
  font-size: 16px;
}

/* daily brief */
.brief-card {
  background: var(--pine);
  color: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.brief-label {
  font-size: 9.5px;
  letter-spacing: 1.1px;
  font-family: var(--mono);
  color: #9994f0;
  font-weight: 700;
}
.brief-stat {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}
.brief-stat small {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}
.brief-eur {
  color: #f2c063;
}
.brief-action {
  flex: 1;
  min-width: 260px;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  padding-left: 20px;
}
.brief-action .ba-t {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.45;
}
.brief-btn {
  background: #fff;
  color: var(--pine);
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
}
.brief-btn:hover {
  background: #e4f1e9;
}

/* tracking public preview */
.track-wrap {
  max-width: 560px;
  margin: 0 auto;
}
.track-card {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(19, 23, 17, 0.1);
}
.track-head {
  background: var(--pine);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.track-body {
  padding: 18px 20px;
}
.track-eta {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1;
}
.track-eta.done {
  color: var(--success);
  font-size: 22px;
}
.track-foot {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--sub);
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
}

/* ============ PORTAL SHELL ============ */
:root {
  --tenant-accent: #9994f0;
}
html,
body,
#app {
  height: 100%;
}
.powered b {
  color: var(--tenant-accent);
}
a {
  color: inherit;
}
a.nav-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
a.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--tenant-accent);
}
.tenant-box {
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
}
.tenant-logo {
  max-width: 100%;
  max-height: 52px;
  display: block;
}
.tenant-wordmark {
  color: var(--pine);
  font-weight: 700;
  font-size: 17px;
  font-family: var(--mono);
  letter-spacing: 0.4px;
  text-align: center;
}
.content > * {
  max-width: 1460px;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table-wrap table {
  min-width: 820px;
}
.line-table {
  min-width: 0;
}
.cell-sub {
  font-size: 10.5px;
  color: var(--sub);
  margin-top: 2px;
  font-family: var(--mono);
}
.short-line td {
  background: var(--red-bg);
  color: var(--red);
}
.short-line .mono-cell {
  color: var(--red);
}
.muted {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sub);
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
}
.check-chip input {
  accent-color: var(--green);
}
.pager {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-small {
  padding: 6px 10px;
  font-size: 11.5px;
}
a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
a.kpi-tile {
  color: inherit;
  text-decoration: none;
  display: block;
}
.kpi-tile .kpi-value {
  line-height: 1.1;
}
.brief-action .brief-btn {
  display: inline-block;
  margin-top: 9px;
  text-decoration: none;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.tab.active {
  border-bottom-color: var(--green);
}
.user-role {
  display: flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.alert {
  background: var(--red-bg);
  border: 1px solid #ecc5c1;
  color: var(--red);
  border-radius: 5px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 0;
}
.alert-ref {
  font-size: 10.5px;
  color: var(--sub);
  margin-top: 6px;
  font-family: var(--mono);
}
.filter-form {
  margin-bottom: 4px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 28px 16px;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 26px 28px;
  box-shadow: 0 10px 34px rgba(19, 23, 17, 0.08);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  background: var(--pine);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.login-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.login-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 3px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
}
.field input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}
.login-submit {
  width: 100%;
  margin-top: 8px;
  padding: 11px 15px;
}
.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 12px;
  font-size: 10.5px;
  color: var(--sub);
  font-family: var(--mono);
}
.login-foot b {
  color: var(--green);
}
.login-note {
  max-width: 430px;
  text-align: center;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.6;
  margin: 16px 0 0;
}
.login-retry {
  font-size: 11.5px;
  color: var(--amber);
  margin-top: 8px;
  font-family: var(--mono);
}

@media (max-width: 720px) {
  .kv-grid {
    grid-template-columns: 1fr;
  }
  .pod-view {
    grid-template-columns: 1fr;
  }
  .topbar .role-chip {
    display: none;
  }
  .login-card {
    padding: 22px 18px;
  }
}
