:root {
  --ink: #0d1420;
  --ink-2: #121c2a;
  --ink-3: #192638;
  --panel: #f6f7f9;
  --panel-2: #ffffff;
  --line: #dfe4ea;
  --line-dark: rgba(255,255,255,.09);
  --text: #172032;
  --muted: #6f7b8c;
  --sidebar-text: #d8e1ec;
  --sidebar-muted: #718198;
  --amber: #f1a53a;
  --amber-2: #d8891c;
  --amber-soft: #fff2df;
  --blue: #2f72d6;
  --blue-soft: #eaf2ff;
  --teal: #218e82;
  --teal-soft: #e4f5f1;
  --red: #c94f56;
  --red-soft: #fdebed;
  --green: #4d8b55;
  --green-soft: #edf6ee;
  --sidebar-width: 248px;
  --sidebar-collapsed: 76px;
  --topbar-height: 62px;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #edf0f4; color: var(--text); }
body { min-width: 1120px; font-size: 13px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  transition: grid-template-columns .18s ease;
}

.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 4%, rgba(47,114,214,.14), transparent 26%),
    linear-gradient(180deg, #101a29 0%, #0c1420 100%);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(0,0,0,.22);
}

.sidebar-brand {
  height: 78px;
  padding: 0 16px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-dark);
}

.brand { min-width: 0; display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; background: linear-gradient(145deg, #ffbe5f, #e28b19); color: #172033;
  box-shadow: 0 7px 20px rgba(241,165,58,.24);
}
.brand-mark svg { width: 26px; height: 26px; stroke-width: 2; }
.brand-copy { min-width: 0; display: grid; }
.brand-copy strong { font-size: 18px; letter-spacing: .06em; }
.brand-copy small { margin-top: 2px; color: #8998aa; font-size: 10px; white-space: nowrap; }

.sidebar-toggle {
  width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(255,255,255,.035);
  color: #91a1b5; cursor: pointer;
}
.sidebar-toggle:hover { color: white; background: rgba(255,255,255,.08); }

.create-button {
  margin: 16px 16px 10px; height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 10px; background: linear-gradient(135deg, #f5b34e, #e69123);
  color: #172033; font-weight: 800; box-shadow: 0 9px 24px rgba(225,139,25,.2); cursor: pointer;
}
.create-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.create-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.35); }
.create-icon svg { width: 15px; height: 15px; stroke-width: 2.2; }

.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 12px 16px; }
.nav-section { margin-top: 14px; }
.nav-heading { padding: 0 10px 7px; color: var(--sidebar-muted); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.nav-item {
  width: 100%; min-height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 9px; background: transparent; color: #b8c4d3; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.nav-item > svg:first-child { flex: 0 0 auto; color: #77889d; }
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { background: linear-gradient(90deg, rgba(47,114,214,.24), rgba(47,114,214,.08)); color: white; box-shadow: inset 3px 0 0 #4b8df0; }
.nav-item.active > svg:first-child { color: #77a8f2; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-chevron { margin-left: auto; width: 13px; transition: transform .16s ease; }
.nav-group.open .nav-chevron { transform: rotate(90deg); }

.subnav { display: none; padding: 4px 0 4px 43px; }
.nav-group.open .subnav { display: block; }
.subnav-item {
  position: relative; display: block; padding: 8px 10px; border-radius: 7px;
  color: #8f9db0; text-decoration: none; white-space: nowrap; font-size: 12px;
}
.subnav-item::before { content: ""; position: absolute; left: -13px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #405168; transform: translateY(-50%); }
.subnav-item:hover { color: white; background: rgba(255,255,255,.04); }
.subnav-item.selected { color: #f4b14a; }
.subnav-item.selected::before { background: #f4b14a; box-shadow: 0 0 0 4px rgba(244,177,74,.12); }

.sidebar-profile { padding: 12px; border-top: 1px solid var(--line-dark); }
.profile-button {
  width: 100%; padding: 9px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.045); color: white; cursor: pointer;
}
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #29405e; color: #bdd3ee; font-size: 11px; font-weight: 800; }
.profile-copy { min-width: 0; display: grid; text-align: left; }
.profile-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.profile-copy small { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; color: #7f90a6; font-size: 9px; }
.profile-more { margin-left: auto; width: 16px; color: #708197; }

.sidebar-collapsed .sidebar-brand {
  padding: 6px 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .create-label,
.sidebar-collapsed .nav-heading,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-chevron,
.sidebar-collapsed .subnav,
.sidebar-collapsed .profile-copy,
.sidebar-collapsed .profile-more { display: none; }
.sidebar-collapsed .brand { justify-content: center; }
.sidebar-collapsed .sidebar-toggle {
  width: 26px;
  height: 24px;
  display: grid;
  color: #b9c6d6;
  background: rgba(255,255,255,.055);
}
.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar-collapsed .create-button { width: 44px; padding: 0; margin-left: auto; margin-right: auto; justify-content: center; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .profile-button { justify-content: center; padding: 7px; }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #edf0f4; }

.topbar {
  flex: 0 0 var(--topbar-height); padding: 0 26px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.92); border-bottom: 1px solid #dde2e8; backdrop-filter: blur(12px);
}
.global-search {
  width: min(600px, 55%); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px;
  border: 1px solid #d8dee6; border-radius: 10px; background: #f6f8fa; color: #8b96a5;
}
.global-search:focus-within { border-color: #8db3ed; box-shadow: 0 0 0 3px rgba(47,114,214,.09); background: white; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search input::placeholder { color: #98a3b1; }
.global-search kbd { border: 1px solid #dfe4ea; border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; background: white; color: #8b96a5; font-size: 9px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.date-control, .icon-button {
  height: 36px; border: 1px solid #dce2e8; border-radius: 9px; background: white; color: #677487; cursor: pointer;
}
.date-control { padding: 0 11px; display: flex; align-items: center; gap: 8px; }
.date-control:hover, .icon-button:hover { border-color: #c7d0da; color: var(--text); box-shadow: 0 3px 10px rgba(29,42,63,.06); }
.icon-button { width: 36px; display: grid; place-items: center; }
.badge-button { position: relative; }
.tiny-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border: 2px solid white; border-radius: 999px; background: var(--red); color: white; font-size: 8px; font-weight: 800; }

.page-scroll { min-height: 0; flex: 1; overflow: auto; padding: 27px 28px 32px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.page-header h1 { margin: 7px 0 7px; font-size: 28px; line-height: 1.1; letter-spacing: -.025em; }
.page-header p { margin: 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button, .compact-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; font-weight: 750; cursor: pointer;
}
.primary-button { min-height: 40px; padding: 0 15px; border: 1px solid #d4841d; background: linear-gradient(135deg, #f5b34e, #e79225); color: #182234; box-shadow: 0 8px 19px rgba(214,132,29,.18); }
.primary-button:hover { filter: brightness(1.035); transform: translateY(-1px); }
.secondary-button { min-height: 40px; padding: 0 15px; border: 1px solid #d9e0e7; background: white; color: #526075; }
.compact-button { min-height: 34px; padding: 0 11px; border: 1px solid #dae1e8; background: white; color: #607085; font-size: 11px; }
.compact-button:hover, .secondary-button:hover { border-color: #bdc8d3; color: var(--text); }

.metric-strip { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.metric-card {
  position: relative; min-height: 106px; padding: 17px 18px; overflow: hidden;
  border: 1px solid #dfe4ea; border-radius: 14px; background: rgba(255,255,255,.88); box-shadow: 0 7px 23px rgba(27,39,58,.045);
}
.metric-card::after { content: ""; position: absolute; width: 78px; height: 78px; right: -28px; top: -32px; border-radius: 50%; background: rgba(47,114,214,.055); }
.metric-label { display: flex; align-items: center; gap: 8px; color: #677487; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.metric-dot { width: 8px; height: 8px; border-radius: 50%; }
.metric-dot.open { background: var(--amber); box-shadow: 0 0 0 4px rgba(241,165,58,.13); }
.metric-dot.covered { background: var(--teal); box-shadow: 0 0 0 4px rgba(33,142,130,.12); }
.metric-dot.transit { background: var(--blue); box-shadow: 0 0 0 4px rgba(47,114,214,.12); }
.metric-dot.delayed { background: var(--red); box-shadow: 0 0 0 4px rgba(201,79,86,.11); }
.metric-card strong { display: block; margin-top: 10px; font-size: 26px; line-height: 1; }
.metric-card small { display: block; margin-top: 8px; color: #8b96a5; }
.attention-card { border-color: #efd8db; background: linear-gradient(145deg, #fff, #fff8f8); }

.board-card { margin-top: 16px; overflow: hidden; border: 1px solid #dce2e8; border-radius: 15px; background: white; box-shadow: 0 10px 30px rgba(24,36,53,.055); }
.board-header { min-height: 72px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e5e9ee; }
.board-header h2 { margin: 0 0 4px; font-size: 17px; }
.board-header p { margin: 0; color: #8994a2; font-size: 11px; }
.board-tools { display: flex; gap: 7px; }

.view-toolbar { min-height: 51px; padding: 8px 12px 0 17px; display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid #e5e9ee; background: #fafbfc; }
.views { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.view-tab { height: 42px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #7a8798; font-size: 11px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.view-tab:hover { color: #334054; }
.view-tab.active { border-bottom-color: var(--amber); color: #172033; }
.view-actions { padding-bottom: 7px; }
.density-button { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid #dce2e8; border-radius: 8px; background: white; color: #778496; cursor: pointer; }

.table-scroll { min-height: 350px; max-height: calc(100vh - 430px); overflow: auto; scrollbar-color: #bdc4cb #edf0f2; scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #edf0f2; }
.table-scroll::-webkit-scrollbar-thumb { background: #bbc3ca; border-radius: 8px; border: 2px solid #edf0f2; }

.shipments-table { width: 100%; min-width: 1160px; border-collapse: collapse; table-layout: fixed; }
.shipments-table thead { position: sticky; top: 0; z-index: 5; background: #f7f9fb; }
.shipments-table th, .shipments-table td { padding: 0 13px; border-bottom: 1px solid #e7ebef; text-align: left; vertical-align: middle; }
.shipments-table th { height: 39px; color: #7b8797; font-size: 9px; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.shipments-table td { height: 61px; color: #303b4c; font-size: 11px; }
.shipments-table tbody tr { transition: background .12s ease; }
.shipments-table tbody tr:hover { background: #f8fafc; }
.shipments-table tbody tr td:nth-child(2) { border-left: 3px solid transparent; }
.shipments-table tbody tr.status-open td:nth-child(2) { border-left-color: var(--amber); }
.shipments-table tbody tr.status-covered td:nth-child(2) { border-left-color: var(--teal); }
.shipments-table tbody tr.status-in-transit td:nth-child(2) { border-left-color: var(--blue); }
.shipments-table tbody tr.status-delivered td:nth-child(2) { border-left-color: var(--green); }
.shipments-table tbody tr.status-delayed td:nth-child(2) { border-left-color: var(--red); }

.checkbox-col { width: 43px; text-align: center !important; }
.actions-col { width: 45px; }
.shipments-table th:nth-child(2) { width: 205px; }
.shipments-table th:nth-child(3) { width: 100px; }
.shipments-table th:nth-child(4) { width: 250px; }
.shipments-table th:nth-child(5) { width: 225px; }
.shipments-table th:nth-child(6) { width: 105px; }
.shipments-table th:nth-child(7) { width: 190px; }
.shipments-table th:nth-child(8) { width: 155px; }
.shipments-table th:nth-child(9) { width: 115px; }
.shipments-table th:nth-child(10) { width: 95px; }

input[type="checkbox"] { appearance: none; width: 14px; height: 14px; border: 1px solid #b8c2cd; border-radius: 4px; background: white; cursor: pointer; }
input[type="checkbox"]:checked { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px white; }

.shipment-primary, .route-primary, .schedule-primary, .carrier-primary, .assignment-primary { color: #202b3d; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shipment-secondary, .route-secondary, .schedule-secondary, .carrier-secondary, .assignment-secondary { margin-top: 5px; color: #8994a2; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shipment-code { color: var(--blue); }
.route-primary { display: flex; align-items: center; gap: 7px; }
.route-arrow { color: #a3adba; }
.status-tag { min-width: 72px; height: 25px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 9px; font-weight: 800; }
.status-tag.open { background: var(--amber-soft); color: #a9610a; }
.status-tag.covered { background: var(--teal-soft); color: #176e65; }
.status-tag.in-transit { background: var(--blue-soft); color: #245da9; }
.status-tag.delivered { background: var(--green-soft); color: #427749; }
.status-tag.delayed { background: var(--red-soft); color: #a83e45; }
.money { color: #1f2a3b; font-weight: 800; }
.tracking-state { display: inline-flex; align-items: center; gap: 6px; color: #657286; }
.tracking-dot { width: 7px; height: 7px; border-radius: 50%; background: #b4bdc7; }
.tracking-state.active .tracking-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(47,114,214,.1); }
.tracking-state.complete .tracking-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(77,139,85,.1); }
.row-actions { width: 29px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: #8793a2; cursor: pointer; }
.row-actions:hover { background: #edf1f5; color: #2f3a4d; }

.table-footer { min-height: 54px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e4e8ed; color: #7e8998; font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 7px; }
.page-numbers { display: flex; gap: 3px; }
.page-number, .page-arrow { min-width: 29px; height: 29px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #718094; cursor: pointer; }
.page-number:hover, .page-arrow:hover { border-color: #dfe4ea; background: #f7f9fb; color: #263248; }
.page-number.active { border-color: #d7a35f; background: var(--amber-soft); color: #965a0d; font-weight: 800; }
.pagination select { height: 31px; padding: 0 25px 0 9px; border: 1px solid #dfe4ea; border-radius: 8px; background: white; color: #536176; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(7,13,22,.62); backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(760px,100%); border: 1px solid #dde3e9; border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(12,23,39,.28); }
.modal-header { padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #e4e8ed; }
.modal-header h2 { margin: 6px 0 0; font-size: 20px; }
#shipmentForm { padding: 21px 22px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 6px; color: #5d6a7c; font-size: 10px; font-weight: 750; }
.form-grid input, .form-grid select { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #d7dee6; border-radius: 9px; outline: 0; background: #fafbfc; color: #222d3e; }
.form-grid input:focus, .form-grid select:focus { border-color: #8fb1e5; box-shadow: 0 0 0 3px rgba(47,114,214,.09); background: white; }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 110; min-width: 240px; padding: 13px 15px; border: 1px solid #b9daca; border-radius: 10px; background: #f1fff7; color: #296242; box-shadow: 0 14px 36px rgba(18,38,28,.15); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-height: 760px) {
  .page-scroll { padding-top: 20px; }
  .metric-card { min-height: 88px; padding: 13px 16px; }
  .metric-card strong { font-size: 22px; }
  .table-scroll { max-height: calc(100vh - 383px); }
}


/* ---------- Multi-page workspace ---------- */
.app-page { display: none; }
.app-page.active { display: block; }
.empty-board { height: 150px !important; text-align: center !important; color: #82909e !important; }

.global-search input:disabled { cursor: not-allowed; color: #98a3b1; }

/* ---------- Create shipment page ---------- */
.create-page { padding-bottom: 44px; }
.create-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.create-page-header h1 { margin: 7px 0 7px; font-size: 28px; line-height: 1.1; letter-spacing: -.025em; }
.create-page-header p { margin: 0; color: var(--muted); font-size: 13px; }
.back-link {
  margin: 0 0 17px -4px;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #65758a;
  font-weight: 700;
  cursor: pointer;
}
.back-link:hover { background: #e4e9ef; color: #1f2b3c; }
.back-link svg { width: 15px; }

.create-header-actions { display: flex; align-items: center; gap: 9px; padding-top: 28px; }
.create-header-actions .primary-button,
.create-header-actions .secondary-button { min-height: 40px; }

.draft-state {
  margin-right: 5px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #8994a2;
  font-size: 10px;
  font-weight: 750;
}
.draft-state.unsaved { background: #fff3df; color: #9c651b; }
.draft-state.saved { background: #e8f5ee; color: #31724b; }

.draft-notice {
  margin-bottom: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid #cbdcf3;
  border-radius: 12px;
  background: #f2f7ff;
  color: #334e72;
}
.draft-notice[hidden] { display: none; }
.draft-notice div:first-child { display: grid; gap: 2px; }
.draft-notice strong { font-size: 12px; }
.draft-notice span { color: #6c7f99; font-size: 10px; }
.draft-notice-actions { display: flex; gap: 8px; }
.text-button { border: 0; background: transparent; color: #68788f; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: #24324a; }

.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 17px;
}
.form-workspace { min-width: 0; display: grid; gap: 14px; }

.form-section {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 15px;
  background: white;
  box-shadow: 0 7px 24px rgba(24,36,53,.04);
}
.section-header {
  min-height: 72px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid #e6eaee;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}
.section-number {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #edf3fc;
  color: #2f72d6;
  font-size: 10px;
  font-weight: 850;
}
.section-header h2 { margin: 0 0 4px; font-size: 15px; }
.section-header p { margin: 0; color: #8994a2; font-size: 10px; }
.section-body { padding: 18px; }

.field-grid { display: grid; gap: 13px; }
.field-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.location-grid { grid-template-columns: minmax(0, 1.7fr) 90px 120px; }
.appointment-grid { grid-template-columns: 1.2fr 1fr 1fr 1.2fr; }

.field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  color: #5f6d80;
  font-size: 10px;
  font-weight: 750;
}
.field > span em { color: #c94f56; font-style: normal; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d8dfe7;
  border-radius: 9px;
  outline: 0;
  background: #fbfcfd;
  color: #222d3e;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.field input,
.field select { height: 39px; padding: 0 11px; }
.field textarea { min-height: 76px; padding: 10px 11px; resize: vertical; line-height: 1.45; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #86ace4;
  background: white;
  box-shadow: 0 0 0 3px rgba(47,114,214,.085);
}
.field input:invalid:not(:placeholder-shown),
.field select:invalid:not(:focus) { border-color: #e4a2a6; }
.field small { color: #929daa; font-size: 9px; font-weight: 500; line-height: 1.35; }

/* Route builder */
.route-builder { display: grid; gap: 0; }
.stop-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); }
.stop-rail { position: relative; display: flex; justify-content: center; }
.stop-marker {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 850;
}
.pickup-stop .stop-marker { background: #fff0da; border: 1px solid #efb761; color: #9b610e; }
.delivery-stop .stop-marker { background: #e9f1ff; border: 1px solid #83abe6; color: #285da8; }
.stop-line {
  position: absolute;
  top: 28px;
  bottom: -12px;
  left: 50%;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #cad3dc 0 5px, transparent 5px 10px);
  transform: translateX(-50%);
}
.stop-content {
  margin-bottom: 18px;
  padding: 0 0 18px 4px;
  border-bottom: 1px dashed #dfe4e9;
}
.delivery-stop .stop-content { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.stop-header {
  min-height: 37px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.stop-type { color: #8895a4; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stop-header h3 { margin: 3px 0 0; font-size: 14px; }
.appointment-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6c7889;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.appointment-toggle input { margin: 0; }
.stop-content .field-grid { margin-top: 12px; }
.stop-content > .field { margin-top: 12px; }

.add-stop-button {
  margin: 17px 0 0 46px;
  min-height: 35px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed #b9c5d1;
  border-radius: 9px;
  background: #fafbfc;
  color: #5d6e82;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.add-stop-button:hover { border-color: #7e9fcf; background: #f3f7fd; color: #2c5f9f; }
.add-stop-button svg { width: 14px; }

/* Freight */
.dimension-group { margin-top: 17px; padding-top: 16px; border-top: 1px solid #e7eaee; }
.dimension-heading { margin-bottom: 10px; color: #354156; font-size: 10px; font-weight: 800; }
.dimension-inputs { display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr minmax(150px, .8fr); align-items: end; gap: 8px; }
.dimension-x { padding-bottom: 12px; color: #9aa4b0; text-align: center; }
.density-result {
  height: 55px;
  padding: 9px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #dce4ec;
  border-radius: 10px;
  background: #f5f8fc;
}
.density-result span { color: #7c8999; font-size: 9px; }
.density-result strong { color: #274b7c; font-size: 13px; }

.option-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.check-card {
  min-height: 65px;
  padding: 11px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #dfe4e9;
  border-radius: 10px;
  background: #fbfcfd;
  cursor: pointer;
}
.check-card:hover { border-color: #bfcbd7; background: white; }
.check-card input { margin-top: 2px; }
.check-card span { display: grid; gap: 3px; }
.check-card strong { font-size: 10px; }
.check-card small { color: #8d98a5; font-size: 8px; }

/* Pricing */
.pricing-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pricing-panel { padding: 14px; border: 1px solid #dde4eb; border-radius: 12px; }
.pricing-panel header { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.pricing-panel header span { color: #667487; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.pricing-panel header strong { font-size: 16px; }
.revenue-panel { background: linear-gradient(145deg, #fff, #f5f9ff); }
.cost-panel { background: linear-gradient(145deg, #fff, #fff9f0); }

.margin-banner {
  margin-top: 12px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #f4faf6;
}
.margin-banner > div { display: grid; gap: 5px; }
.margin-banner > div + div { padding-left: 16px; border-left: 1px solid #dce5df; }
.margin-banner span { color: #708078; font-size: 9px; font-weight: 750; }
.margin-banner strong { color: #336e48; font-size: 15px; }
.margin-banner.negative-margin { border-color: #efd0d2; background: #fff5f5; }
.margin-banner.negative-margin strong { color: #ac4046; }
.margin-banner.healthy-margin { border-color: #bcdcc7; background: #effaf3; }

.miles-field { margin-top: 14px; max-width: 420px; }

/* Footer and summary */
.create-form-footer {
  padding: 8px 2px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.create-form-footer > div { display: flex; gap: 8px; }

.summary-rail { min-width: 0; }
.sticky-summary { position: sticky; top: 0; }
.summary-card {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 15px;
  background: white;
  box-shadow: 0 9px 30px rgba(24,36,53,.055);
}
.summary-header {
  min-height: 78px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #e6eaee;
  background: linear-gradient(145deg, #fff, #f8fafc);
}
.summary-header h2 { margin: 5px 0 0; font-size: 15px; }
.preview-status {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #9a5f0d;
  font-size: 9px;
  font-weight: 850;
}
.preview-status.covered { background: var(--teal-soft); color: #176e65; }
.preview-status.draft { background: #eef1f5; color: #637083; }
.preview-status.on-hold { background: var(--red-soft); color: #a43e45; }

.completion-block { padding: 14px 16px; border-bottom: 1px solid #e7ebef; }
.completion-row { margin-bottom: 8px; display: flex; justify-content: space-between; color: #738093; font-size: 9px; font-weight: 750; }
.completion-row strong { color: #2f72d6; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e8edf2; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f72d6, #69a2f5); transition: width .2s ease; }

.summary-route { padding: 17px 16px; }
.summary-stop { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; }
.summary-marker { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 850; }
.summary-marker.pickup { background: #fff0da; color: #9b610e; }
.summary-marker.delivery { background: #e9f1ff; color: #285da8; }
.summary-stop div { min-width: 0; display: grid; gap: 3px; }
.summary-stop strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.summary-stop small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8c97a4; font-size: 8px; }
.summary-route-line { display: block; height: 19px; margin-left: 12px; border-left: 2px dotted #cdd5de; }

.summary-list { margin: 0; padding: 0 16px 14px; }
.summary-list div { padding: 8px 0; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #edf0f3; }
.summary-list dt { color: #8792a0; font-size: 9px; }
.summary-list dd { max-width: 175px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344054; font-size: 9px; font-weight: 750; text-align: right; }

.summary-financials { padding: 13px 16px; border-top: 1px solid #e5e9ed; background: #f8fafb; }
.summary-financials div { padding: 5px 0; display: flex; justify-content: space-between; color: #727f90; font-size: 9px; }
.summary-financials strong { color: #283448; font-size: 10px; }
.summary-financials .summary-profit { margin-top: 7px; padding-top: 10px; border-top: 1px solid #dfe5ea; color: #2f6f47; font-weight: 800; }
.summary-financials .summary-profit strong { color: #2f6f47; font-size: 14px; }

.summary-warning {
  margin: 13px;
  padding: 10px 11px;
  border: 1px solid #eed7b4;
  border-radius: 9px;
  background: #fff8eb;
  color: #93631e;
  font-size: 9px;
  line-height: 1.45;
}
.summary-warning.ready { border-color: #c5dfcd; background: #f0faf3; color: #34714b; }

@media (max-width: 1350px) {
  .create-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .field-grid.three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appointment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-height: 760px) {
  .create-page-header { margin-bottom: 14px; }
  .section-header { min-height: 63px; padding-top: 12px; padding-bottom: 12px; }
}

/* Additional workflow statuses */
.shipments-table tbody tr.status-draft td:nth-child(2) { border-left-color: #8b96a5; }
.shipments-table tbody tr.status-on-hold td:nth-child(2) { border-left-color: var(--red); }
.status-tag.draft { background: #eef1f5; color: #637083; }
.status-tag.on-hold { background: var(--red-soft); color: #a83e45; }


/* ---------- Shipment details page ---------- */
.details-page { padding-bottom: 44px; }

.details-page-header {
  margin-bottom: 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.details-title-block { min-width: 0; }
.details-id-line { margin-top: 7px; display: flex; align-items: center; gap: 11px; }
.details-id-line h1 { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -.025em; }
.details-title-block > p { margin: 7px 0 0; color: #667487; font-size: 13px; }

.details-header-actions { padding-top: 29px; display: flex; align-items: center; gap: 8px; }
.details-header-actions .secondary-button { min-height: 40px; }
.detail-more-button { width: 40px; height: 40px; position: relative; }

.action-menu-wrap { position: relative; }
.action-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  width: 175px;
  padding: 6px;
  border: 1px solid #dce2e8;
  border-radius: 10px;
  background: white;
  box-shadow: 0 14px 35px rgba(21,34,52,.16);
}
.action-menu[hidden] { display: none; }
.action-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4f5e72;
  text-align: left;
  cursor: pointer;
}
.action-menu button:hover { background: #f3f6f9; color: #1f2a3b; }
.action-menu .danger-action { color: #b3474e; }
.action-menu .danger-action:hover { background: #fff0f1; color: #9f353d; }

.details-status-tag {
  min-width: 78px;
  height: 27px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #9a5f0d;
  font-size: 9px;
  font-weight: 850;
}
.details-status-tag.draft { background: #eef1f5; color: #637083; }
.details-status-tag.covered { background: var(--teal-soft); color: #176e65; }
.details-status-tag.dispatched,
.details-status-tag.at-pickup,
.details-status-tag.in-transit,
.details-status-tag.at-delivery { background: var(--blue-soft); color: #245da9; }
.details-status-tag.delivered,
.details-status-tag.completed { background: var(--green-soft); color: #427749; }
.details-status-tag.on-hold,
.details-status-tag.delayed,
.details-status-tag.cancelled { background: var(--red-soft); color: #a83e45; }

.details-identity-strip {
  margin-bottom: 14px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr .65fr .8fr .8fr;
  gap: 0;
  border: 1px solid #dce2e8;
  border-radius: 13px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 7px 23px rgba(27,39,58,.035);
}
.identity-item { min-width: 0; padding: 0 15px; display: grid; gap: 5px; }
.identity-item:first-child { padding-left: 0; }
.identity-item + .identity-item { border-left: 1px solid #e2e7ec; }
.identity-item span { color: #8994a2; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.identity-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2a3547; font-size: 11px; }

.status-workflow-card {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 15px;
  background: white;
  box-shadow: 0 8px 25px rgba(24,36,53,.04);
}
.status-workflow-header {
  min-height: 74px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e5e9ed;
}
.status-workflow-header h2 { margin: 5px 0 3px; font-size: 15px; }
.status-workflow-header p { margin: 0; color: #8994a2; font-size: 9px; }
.exception-status-control { display: grid; gap: 5px; color: #6d798a; font-size: 9px; font-weight: 750; }
.exception-status-control select {
  width: 135px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  outline: 0;
  background: #fbfcfd;
  color: #3a4658;
}

.status-progress {
  padding: 19px 18px 18px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}
.status-progress .status-step { flex: 0 0 70px; }
.status-progress .status-connector { flex: 1 0 26px; min-width: 26px; }
.status-step {
  width: 70px;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #96a1ae;
  cursor: pointer;
}
.status-step > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 2px solid #d3dae2;
  border-radius: 50%;
  background: white;
  color: #8e99a7;
  font-size: 9px;
  font-weight: 850;
  transition: .15s ease;
}
.status-step strong { font-size: 8px; font-weight: 750; white-space: nowrap; }
.status-step:hover > span { border-color: #91b2e3; color: #2f72d6; }
.status-step.complete > span { border-color: #7eaae9; background: #eaf2ff; color: #2b65b7; }
.status-step.complete strong { color: #466b9d; }
.status-step.current > span { border-color: var(--amber-2); background: var(--amber); color: #172033; box-shadow: 0 0 0 5px rgba(241,165,58,.14); }
.status-step.current strong { color: #8e570e; font-weight: 850; }
.status-step.exception-current > span { border-color: #bd555c; background: var(--red); color: white; box-shadow: 0 0 0 5px rgba(201,79,86,.12); }
.status-connector { height: 2px; background: #dfe4e9; }
.status-connector.complete { background: #8db4eb; }

.details-workspace-card {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 15px;
  background: white;
  box-shadow: 0 10px 30px rgba(24,36,53,.05);
}
.details-tabs {
  min-height: 52px;
  padding: 0 13px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  overflow-x: auto;
  border-bottom: 1px solid #e4e8ed;
  background: #fafbfc;
}
.details-tab {
  min-width: 82px;
  padding: 0 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #7a8798;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.details-tab:hover { color: #344156; }
.details-tab.active { border-bottom-color: var(--amber); color: #1d293b; }

.details-tab-panel { display: none; padding: 17px; }
.details-tab-panel.active { display: block; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 15px; }
.overview-main-column,
.overview-side-column { min-width: 0; display: grid; align-content: start; gap: 14px; }

.detail-panel,
.standalone-panel {
  overflow: hidden;
  border: 1px solid #e0e5ea;
  border-radius: 13px;
  background: white;
}
.detail-panel-header,
.standalone-panel-header {
  min-height: 61px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8ebef;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}
.detail-panel-header h3,
.standalone-panel-header h3 { margin: 4px 0 0; font-size: 13px; }
.panel-kicker { color: #8793a2; font-size: 8px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.route-distance { padding: 6px 8px; border-radius: 7px; background: #eef4fd; color: #3d6fae; font-size: 8px; font-weight: 750; }

.detail-route-timeline { padding: 16px; }
.detail-route-stop { display: grid; grid-template-columns: 38px minmax(0, 1fr); }
.detail-route-rail { position: relative; display: flex; justify-content: center; }
.detail-route-marker {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 850;
}
.detail-route-marker.pickup { border: 1px solid #efb761; background: #fff0da; color: #9b610e; }
.detail-route-marker.delivery { border: 1px solid #83abe6; background: #e9f1ff; color: #285da8; }
.detail-route-line {
  position: absolute;
  top: 28px;
  bottom: -17px;
  left: 50%;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #cbd4dd 0 5px, transparent 5px 10px);
  transform: translateX(-50%);
}
.detail-route-content { padding: 0 0 20px 3px; }
.detail-route-stop:last-child .detail-route-content { padding-bottom: 0; }
.detail-route-stop-head { display: flex; justify-content: space-between; gap: 12px; }
.detail-route-stop-head > div > span { color: #8793a2; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.detail-route-stop-head h4 { margin: 4px 0 0; font-size: 13px; }
.appointment-badge { height: 23px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 7px; background: #f1f4f7; color: #738093; font-size: 8px; font-weight: 750; }

.detail-stop-grid {
  margin-top: 12px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #e5e9ed;
  border-radius: 10px;
  background: #fafbfc;
}
.detail-stop-grid div { min-width: 0; display: grid; gap: 4px; }
.detail-stop-grid span { color: #8995a3; font-size: 8px; font-weight: 750; }
.detail-stop-grid strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3c485a; font-size: 9px; }
.stop-instruction { margin-top: 9px; padding: 9px 10px; border-left: 3px solid #dbe2e9; background: #f8fafb; color: #748092; font-size: 9px; line-height: 1.45; }

.detail-definition-grid {
  margin: 0;
  padding: 14px 15px 9px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.detail-definition-grid div { min-width: 0; min-height: 54px; padding: 9px 11px; border-right: 1px solid #e8ecf0; border-bottom: 1px solid #e8ecf0; }
.detail-definition-grid div:nth-child(4n) { border-right: 0; }
.detail-definition-grid div:nth-last-child(-n+4) { border-bottom: 0; }
.detail-definition-grid dt { color: #8994a2; font-size: 8px; }
.detail-definition-grid dd { margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344054; font-size: 10px; font-weight: 750; }
.requirements-list { padding: 0 15px 15px; display: flex; flex-wrap: wrap; gap: 7px; }
.requirement-chip { padding: 6px 8px; border-radius: 7px; background: #f0f4f8; color: #607087; font-size: 8px; font-weight: 750; }
.requirement-chip.alert { background: #fff0f1; color: #a33f46; }
.requirement-chip.active { background: #e8f4ef; color: #317155; }

.compact-detail-panel .detail-panel-header { min-height: 58px; }
.side-definition-list { margin: 0; padding: 5px 14px 12px; }
.side-definition-list div { padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf0f3; }
.side-definition-list div:last-child { border-bottom: 0; }
.side-definition-list dt { color: #8793a2; font-size: 8px; }
.side-definition-list dd { max-width: 170px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344054; font-size: 9px; font-weight: 750; text-align: right; }

.financial-snapshot { margin: 0; padding: 5px 14px 12px; }
.financial-snapshot div { padding: 10px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #edf0f3; }
.financial-snapshot div:last-child { border-bottom: 0; }
.financial-snapshot dt { color: #8793a2; font-size: 8px; }
.financial-snapshot dd { margin: 0; color: #344054; font-size: 10px; font-weight: 800; }
.financial-snapshot .financial-profit-row { margin-top: 3px; padding: 12px 10px; border: 0; border-radius: 9px; background: #eff8f2; }
.financial-snapshot .financial-profit-row dt,
.financial-snapshot .financial-profit-row dd { color: #34724c; }
.financial-snapshot-panel.negative-profit .financial-profit-row { background: #fff0f1; }
.financial-snapshot-panel.negative-profit .financial-profit-row dt,
.financial-snapshot-panel.negative-profit .financial-profit-row dd { color: #a43d45; }

.mini-activity-list { padding: 5px 14px 12px; }
.mini-activity-item { position: relative; padding: 10px 0 10px 18px; border-bottom: 1px solid #edf0f3; }
.mini-activity-item:last-child { border-bottom: 0; }
.mini-activity-item::before { content: ""; position: absolute; left: 2px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: #8bb2e7; }
.mini-activity-item strong { display: block; color: #3b485a; font-size: 9px; }
.mini-activity-item span { display: block; margin-top: 4px; color: #8c97a4; font-size: 8px; }

/* Other detail tabs */
.standalone-panel { min-height: 250px; }
.standalone-panel-header { min-height: 65px; padding: 14px 16px; }
.stops-table-wrap { overflow-x: auto; }
.stops-detail-table { width: 100%; min-width: 830px; border-collapse: collapse; }
.stops-detail-table th,
.stops-detail-table td { padding: 0 14px; border-bottom: 1px solid #e8ecf0; text-align: left; }
.stops-detail-table th { height: 38px; background: #f8fafb; color: #7f8b9a; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.stops-detail-table td { height: 58px; color: #3c485a; font-size: 9px; }
.stop-number-badge { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: #eef3f9; color: #48698f; font-weight: 850; }
.stop-type-badge { padding: 5px 7px; border-radius: 6px; background: #fff0da; color: #97600f; font-size: 8px; font-weight: 800; }
.stop-type-badge.delivery { background: #eaf2ff; color: #2e62a8; }

.financial-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.margin-analysis-panel { grid-column: 1 / -1; }
.charge-list { padding: 8px 16px 16px; }
.charge-row { padding: 11px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0f3; color: #556277; font-size: 9px; }
.charge-row:last-child { border-bottom: 0; }
.charge-row strong { color: #2b3749; font-size: 10px; }
.charge-row.total { margin-top: 4px; padding: 13px 10px; border: 0; border-radius: 9px; background: #f5f8fb; font-weight: 800; }
.margin-analysis { padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.margin-analysis-card { padding: 14px; border: 1px solid #e0e6eb; border-radius: 11px; background: #fafbfc; }
.margin-analysis-card span { display: block; color: #8793a2; font-size: 8px; }
.margin-analysis-card strong { display: block; margin-top: 7px; color: #344054; font-size: 16px; }
.margin-analysis-card.profit { background: #f1f9f4; border-color: #cfe4d5; }
.margin-analysis-card.profit strong { color: #34724c; }

.carrier-detail-layout,
.tracking-detail-layout,
.notes-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.carrier-profile-grid { margin: 0; padding: 10px 16px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.carrier-profile-grid div { min-width: 0; padding: 12px 10px; border-right: 1px solid #e8ecf0; border-bottom: 1px solid #e8ecf0; }
.carrier-profile-grid div:nth-child(2n) { border-right: 0; }
.carrier-profile-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.carrier-profile-grid dt { color: #8994a2; font-size: 8px; }
.carrier-profile-grid dd { margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #344054; font-size: 10px; font-weight: 750; }

.documents-grid { padding: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.document-card { min-height: 118px; padding: 13px; display: flex; flex-direction: column; border: 1px solid #e0e5ea; border-radius: 11px; background: #fafbfc; }
.document-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #eaf2ff; color: #2f72d6; }
.document-card strong { margin-top: 11px; color: #384559; font-size: 10px; }
.document-card small { margin-top: 4px; color: #8a96a4; font-size: 8px; }
.document-card button { margin-top: auto; align-self: flex-start; padding: 0; border: 0; background: transparent; color: #2f72d6; font-size: 8px; font-weight: 750; cursor: pointer; }
.document-card.empty { border-style: dashed; align-items: center; justify-content: center; color: #94a0ad; text-align: center; }

.tracking-mode-badge { padding: 6px 8px; border-radius: 7px; background: #eaf2ff; color: #2e63aa; font-size: 8px; font-weight: 800; }
.tracking-events { padding: 13px 16px 17px; }
.tracking-event { position: relative; padding: 8px 0 14px 28px; }
.tracking-event::before { content: ""; position: absolute; left: 6px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: #a9b4c0; }
.tracking-event::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: -2px; width: 1px; background: #d8dfe6; }
.tracking-event:last-child::after { display: none; }
.tracking-event.active::before { background: #2f72d6; box-shadow: 0 0 0 4px rgba(47,114,214,.11); }
.tracking-event strong { display: block; color: #3a4658; font-size: 9px; }
.tracking-event span { display: block; margin-top: 4px; color: #8a96a4; font-size: 8px; }

.full-activity-list { padding: 10px 16px 17px; }
.full-activity-item { padding: 12px 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: start; gap: 11px; border-bottom: 1px solid #edf0f3; }
.full-activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #edf3fb; color: #4679b8; }
.full-activity-item strong { display: block; color: #384559; font-size: 9px; }
.full-activity-item p { margin: 4px 0 0; color: #7f8b9a; font-size: 8px; line-height: 1.45; }
.full-activity-item time { color: #98a2ae; font-size: 8px; white-space: nowrap; }

.details-notes-area { width: calc(100% - 32px); min-height: 190px; margin: 16px 16px 0; padding: 12px; border: 1px solid #dce2e8; border-radius: 10px; outline: 0; resize: vertical; background: #fafbfc; color: #344054; line-height: 1.5; }
.details-notes-area:focus { border-color: #86ace4; background: white; box-shadow: 0 0 0 3px rgba(47,114,214,.08); }
.notes-panel-footer { padding: 12px 16px 16px; display: flex; justify-content: flex-end; }

.shipment-row-clickable { cursor: pointer; }
.shipment-code-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.shipment-code-button:hover { text-decoration: underline; }

@media (max-width: 1370px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr) 275px; }
  .status-step { width: 62px; }
  .details-identity-strip { grid-template-columns: 1.35fr .9fr .6fr .75fr .75fr; }
  .detail-definition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-definition-grid div:nth-child(4n) { border-right: 1px solid #e8ecf0; }
  .detail-definition-grid div:nth-child(2n) { border-right: 0; }
  .detail-definition-grid div:nth-last-child(-n+4) { border-bottom: 1px solid #e8ecf0; }
  .detail-definition-grid div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-height: 760px) {
  .status-workflow-header { min-height: 66px; }
  .status-progress { padding-top: 15px; padding-bottom: 14px; }
  .details-tab-panel { padding: 14px; }
}


/* ---------- V6 edit mode and persistence ---------- */
button[hidden],
.draft-state[hidden] { display: none !important; }

.danger-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #b9444c;
  border-radius: 9px;
  background: linear-gradient(135deg, #d85c64, #bd424a);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 19px rgba(189,66,74,.16);
}
.danger-button:hover { filter: brightness(1.04); transform: translateY(-1px); }

.confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7,13,22,.62);
  backdrop-filter: blur(4px);
}
.confirmation-backdrop[hidden] { display: none; }

.confirmation-dialog {
  width: min(440px, 100%);
  padding: 25px;
  border: 1px solid #dde3e9;
  border-radius: 17px;
  background: white;
  box-shadow: 0 28px 80px rgba(12,23,39,.27);
  text-align: center;
}
.confirmation-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
}
.confirmation-icon.warning {
  background: #fff1df;
  color: #b36b15;
}
.confirmation-icon svg { width: 25px; height: 25px; }
.confirmation-dialog h2 { margin: 16px 0 8px; font-size: 18px; }
.confirmation-dialog p {
  margin: 0 auto;
  max-width: 350px;
  color: #748092;
  font-size: 11px;
  line-height: 1.55;
}
.confirmation-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 9px;
}

.create-page.editing-mode .section-number {
  background: #fff1df;
  color: #a96512;
}


/* ---------- V7 Spot Quotes ---------- */
.quote-board-header { align-items: flex-start; }
.quote-metric-strip .metric-card { min-height: 100px; }
.metric-dot.quote-draft { background: #8d98a5; box-shadow: 0 0 0 4px rgba(141,152,165,.12); }
.metric-dot.quote-sent { background: #4b83d7; box-shadow: 0 0 0 4px rgba(75,131,215,.12); }
.metric-dot.quote-accepted { background: #2f937d; box-shadow: 0 0 0 4px rgba(47,147,125,.12); }
.metric-dot.quote-converted { background: #8a65bd; box-shadow: 0 0 0 4px rgba(138,101,189,.12); }

.quote-table-scroll { max-height: calc(100vh - 430px); }
.quotes-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  table-layout: fixed;
}
.quotes-table thead { position: sticky; top: 0; z-index: 5; background: #f7f9fb; }
.quotes-table th,
.quotes-table td {
  padding: 0 13px;
  border-bottom: 1px solid #e7ebef;
  text-align: left;
  vertical-align: middle;
}
.quotes-table th {
  height: 39px;
  color: #7b8797;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.quotes-table td { height: 61px; color: #303b4c; font-size: 10px; }
.quotes-table tbody tr:hover { background: #f8fafc; }
.quotes-table th:nth-child(1) { width: 125px; }
.quotes-table th:nth-child(2) { width: 120px; }
.quotes-table th:nth-child(3) { width: 185px; }
.quotes-table th:nth-child(4) { width: 250px; }
.quotes-table th:nth-child(5) { width: 130px; }
.quotes-table th:nth-child(6) { width: 75px; }
.quotes-table th:nth-child(7),
.quotes-table th:nth-child(8) { width: 120px; }
.quotes-table th:nth-child(9) { width: 85px; }
.quotes-table th:nth-child(10) { width: 110px; }
.quotes-table th:nth-child(11) { width: 42px; }

.quote-row-clickable { cursor: pointer; }
.quote-id-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 850;
  cursor: pointer;
}
.quote-id-button:hover { text-decoration: underline; }
.quote-secondary { margin-top: 5px; color: #8994a2; font-size: 8px; }
.quote-lane-primary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.quote-margin-cell {
  min-width: 50px;
  padding: 5px 7px;
  display: inline-flex;
  justify-content: center;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 850;
}
.quote-margin-cell.healthy { background: #e8f5ee; color: #31724b; }
.quote-margin-cell.low { background: #fff1df; color: #9d6318; }
.quote-board-hint { color: #8b96a4; }

.quote-status-tag {
  min-width: 70px;
  min-height: 25px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eef1f5;
  color: #637083;
  font-size: 8px;
  font-weight: 850;
  text-align: center;
}
.quote-status-tag.ready-to-send { background: #fff1df; color: #9b610e; }
.quote-status-tag.sent { background: #eaf2ff; color: #2d63ad; }
.quote-status-tag.accepted { background: #e5f5ef; color: #28735f; }
.quote-status-tag.declined,
.quote-status-tag.expired { background: #fdebed; color: #a64047; }
.quote-status-tag.converted { background: #f0eafb; color: #6e4da0; }

/* Quote form */
.quote-form-page { padding-bottom: 44px; }
.quote-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 17px;
}
.quote-lane-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.quote-location-card {
  padding: 14px;
  border: 1px solid #dfe5ea;
  border-radius: 12px;
  background: #fbfcfd;
}
.quote-location-card.origin { box-shadow: inset 3px 0 0 var(--amber); }
.quote-location-card.destination { box-shadow: inset 3px 0 0 var(--blue); }
.quote-location-card header { margin-bottom: 12px; display: grid; gap: 3px; }
.quote-location-card header span { color: #8a96a4; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quote-location-card header strong { font-size: 12px; }
.quote-lane-arrow { display: grid; place-items: center; color: #9aa6b3; }
.quote-lane-arrow svg { width: 24px; }
.quote-miles-field { max-width: 330px; margin-top: 14px; }

.assumption-banner {
  margin-bottom: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  background: #f2f7ff;
  color: #4c6687;
  font-size: 9px;
}
.assumption-banner svg { flex: 0 0 auto; color: #3e76bd; }

.calculated-field {
  min-height: 66px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #d6e2ef;
  border-radius: 10px;
  background: #f5f9fd;
}
.calculated-field span { color: #738197; font-size: 9px; font-weight: 750; }
.calculated-field strong { color: #2d5f9c; font-size: 17px; }
.calculated-field small { color: #8c99a7; font-size: 8px; }

.quote-rate-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quote-rate-panel {
  padding: 14px;
  border: 1px solid #dfe5eb;
  border-radius: 12px;
}
.quote-rate-panel.sell-side { background: linear-gradient(145deg, #fff, #f4f9ff); }
.quote-rate-panel.buy-side { background: linear-gradient(145deg, #fff, #fff8ee); }
.quote-rate-panel > header {
  margin-bottom: 14px;
  padding-bottom: 11px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #e3e8ed;
}
.quote-rate-panel header span { color: #7e8a9a; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quote-rate-panel header h3 { margin: 3px 0 0; font-size: 13px; }
.quote-rate-panel header > strong { font-size: 18px; }
.calculated-input input { color: #5f6f84; background: #eef3f8; cursor: not-allowed; }

.quote-margin-dashboard {
  margin-top: 13px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d7e5dc;
  border-radius: 12px;
  background: #f4faf6;
}
.quote-margin-dashboard > div { display: grid; gap: 5px; }
.quote-margin-dashboard > div + div { padding-left: 15px; border-left: 1px solid #dce6df; }
.quote-margin-dashboard span { color: #728078; font-size: 8px; font-weight: 750; }
.quote-margin-dashboard strong { color: #34714b; font-size: 14px; }
.quote-margin-dashboard.negative-margin { border-color: #efd0d2; background: #fff5f5; }
.quote-margin-dashboard.negative-margin strong { color: #a83e45; }
.quote-margin-dashboard.healthy-margin { border-color: #bcdcc7; background: #effaf3; }

.quote-summary-lane {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #e7ebef;
}
.quote-summary-lane div { min-width: 0; display: grid; gap: 4px; }
.quote-summary-lane div:last-child { text-align: right; }
.quote-summary-lane span { color: #8a96a4; font-size: 8px; font-weight: 750; }
.quote-summary-lane strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.quote-summary-lane svg { color: #a0abb7; }

.quote-summary-financials { padding: 13px 16px; border-top: 1px solid #e5e9ed; background: #f8fafb; }
.quote-summary-financials div { padding: 5px 0; display: flex; justify-content: space-between; color: #727f90; font-size: 9px; }
.quote-summary-financials strong { color: #283448; font-size: 10px; }
.quote-summary-financials .quote-summary-profit {
  margin-top: 7px;
  padding-top: 10px;
  border-top: 1px solid #dfe5ea;
  color: #2f6f47;
  font-weight: 800;
}
.quote-summary-financials .quote-summary-profit strong { color: #2f6f47; font-size: 14px; }

/* Quote details */
.quote-detail-identity {
  margin-bottom: 14px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 1.35fr 1fr .65fr .8fr .85fr .9fr;
  border: 1px solid #dce2e8;
  border-radius: 13px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 7px 23px rgba(27,39,58,.035);
}
.quote-detail-identity div { min-width: 0; padding: 0 13px; display: grid; gap: 5px; }
.quote-detail-identity div:first-child { padding-left: 0; }
.quote-detail-identity div + div { border-left: 1px solid #e2e7ec; }
.quote-detail-identity span { color: #8994a2; font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.quote-detail-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2a3547; font-size: 10px; }

.quote-status-workflow {
  margin-bottom: 14px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #dce2e8;
  border-radius: 13px;
  background: white;
}
.quote-status-workflow h2 { margin: 4px 0 3px; font-size: 15px; }
.quote-status-workflow p { margin: 0; color: #8994a2; font-size: 9px; }
.quote-status-workflow select {
  width: 170px;
  height: 37px;
  padding: 0 10px;
  border: 1px solid #d8e0e7;
  border-radius: 9px;
  background: #fbfcfd;
  color: #39465a;
}

.quote-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 15px; }
.quote-detail-main,
.quote-detail-side { min-width: 0; display: grid; align-content: start; gap: 14px; }

.quote-detail-lane {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.quote-detail-location { display: flex; align-items: center; gap: 10px; }
.quote-detail-location:last-child { justify-content: flex-end; text-align: right; }
.quote-detail-location div { min-width: 0; display: grid; gap: 3px; }
.quote-detail-location div > span { color: #8994a2; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.quote-detail-location strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.quote-detail-location small { color: #8c97a4; font-size: 8px; }
.quote-detail-lane-line { display: flex; align-items: center; color: #9aa6b3; }
.quote-detail-lane-line span { flex: 1; height: 1px; background: #d4dbe3; }
.quote-detail-lane-line svg { width: 20px; }
.quote-freight-grid { padding-top: 0; }

.quote-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-breakdown-column { padding: 15px; }
.quote-breakdown-column + .quote-breakdown-column { border-left: 1px solid #e5e9ed; }
.quote-breakdown-column h4 { margin: 0 0 6px; color: #647286; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }

.quote-notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-notes-grid article { min-height: 120px; padding: 16px; }
.quote-notes-grid article + article { border-left: 1px solid #e5e9ed; }
.quote-notes-grid span { color: #7e8a9a; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.quote-notes-grid p { margin: 9px 0 0; color: #5e6b7d; font-size: 10px; line-height: 1.55; }

.quote-conversion-message {
  padding: 12px 13px;
  border: 1px solid #e7d5b6;
  border-radius: 10px;
  background: #fff8ea;
  color: #91611c;
  font-size: 9px;
  line-height: 1.45;
}
.quote-conversion-message.ready { border-color: #bcddc8; background: #eff9f3; color: #34714b; }
.quote-conversion-message.converted { border-color: #d5c6eb; background: #f6f1fd; color: #6d4c9c; }

#convertQuoteButton:disabled {
  border-color: #d5dbe1;
  background: #e9edf1;
  color: #8b96a4;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1370px) {
  .quote-form-layout,
  .quote-detail-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .quote-detail-identity { grid-template-columns: 1.2fr .9fr .55fr .7fr .75fr .8fr; }
}

@media (max-width: 1220px) {
  .quote-lane-grid { grid-template-columns: 1fr; }
  .quote-lane-arrow { transform: rotate(90deg); }
  .quote-rate-columns { grid-template-columns: 1fr; }
  .quote-margin-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .quote-margin-dashboard > div + div { padding-left: 0; border-left: 0; }
}


/* ==========================================================================
   V8 Core Functionality Batch
   ========================================================================== */

.bulk-toolbar {
  min-height: 48px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d8e4f1;
  background: #f1f6fd;
}
.bulk-toolbar[hidden] { display: none; }
.bulk-toolbar > div:first-child { display: flex; align-items: center; gap: 10px; }
.bulk-toolbar strong { color: #315f99; font-size: 10px; }
.bulk-actions { display: flex; align-items: center; gap: 7px; }
.bulk-actions select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #ccd8e6;
  border-radius: 8px;
  background: white;
  color: #536176;
  font-size: 10px;
}

.ui-backdrop {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(8,15,25,.35);
  backdrop-filter: blur(2px);
}
.ui-backdrop[hidden] { display: none; }

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  width: min(390px, 92vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #dce2e8;
  background: white;
  box-shadow: -20px 0 55px rgba(15,28,45,.18);
}
.side-drawer[hidden] { display: none; }
.drawer-header {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e4e9ee;
}
.drawer-header h2 { margin: 5px 0 0; font-size: 16px; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 17px; display: grid; align-content: start; gap: 13px; }
.drawer-section-title { margin-top: 4px; color: #657388; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.drawer-footer {
  padding: 13px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e4e9ee;
  background: #fafbfc;
}

.column-options { gap: 7px; }
.column-options label {
  min-height: 43px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e0e5ea;
  border-radius: 9px;
  background: #fbfcfd;
  color: #536176;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.topbar-popover {
  position: fixed;
  top: 55px;
  right: 128px;
  z-index: 130;
  width: 365px;
  padding: 14px;
  border: 1px solid #d9e0e7;
  border-radius: 12px;
  background: white;
  box-shadow: 0 17px 45px rgba(15,28,45,.18);
}
.topbar-popover[hidden] { display: none; }
.topbar-popover > header { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.topbar-popover > p { margin: 11px 0; color: #8490a0; font-size: 8px; line-height: 1.45; }
.topbar-popover > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.topbar-panel {
  position: fixed;
  top: 62px;
  right: 0;
  z-index: 125;
  width: min(390px, 92vw);
  height: calc(100vh - 62px);
  border-left: 1px solid #dce2e8;
  background: white;
  box-shadow: -18px 0 48px rgba(15,28,45,.15);
}
.topbar-panel[hidden] { display: none; }
.topbar-panel-body { height: calc(100% - 72px); overflow-y: auto; padding: 10px 15px 18px; }
.utility-item {
  position: relative;
  padding: 13px 4px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid #edf0f3;
}
.utility-item .avatar.small { width: 32px; height: 32px; }
.utility-item strong { color: #39465a; font-size: 10px; }
.utility-item p { margin: 4px 0; color: #7c8898; font-size: 9px; line-height: 1.45; }
.utility-item small { color: #a0a9b4; font-size: 8px; }
.utility-item button:not(.dismiss-notification) {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}
.notification-item { grid-template-columns: 11px minmax(0, 1fr) 20px; }
.notification-indicator { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--amber); }
.dismiss-notification { border: 0; background: transparent; color: #9aa4b0; cursor: pointer; }
.utility-empty { padding: 45px 20px; color: #8c97a4; text-align: center; font-size: 10px; }

.floating-action-menu {
  position: fixed;
  z-index: 150;
  width: 190px;
  padding: 6px;
  border: 1px solid #d9e0e7;
  border-radius: 10px;
  background: white;
  box-shadow: 0 14px 38px rgba(18,31,49,.2);
}
.floating-action-menu[hidden] { display: none; }
.floating-action-menu > button {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #526075;
  text-align: left;
  font-size: 9px;
  cursor: pointer;
}
.floating-action-menu > button:hover { background: #f2f5f8; color: #243146; }
.floating-action-menu .danger-action { color: #b3474e; }
.floating-action-menu button:disabled { color: #aeb6bf; cursor: not-allowed; }
.quote-row-menu label {
  margin: 5px 4px;
  padding: 8px;
  display: grid;
  gap: 5px;
  border-top: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
  color: #7d8998;
  font-size: 8px;
}
.quote-row-menu select { width: 100%; height: 31px; border: 1px solid #dbe2e8; border-radius: 7px; background: #fafbfc; font-size: 9px; }

.training-guidance-banner {
  margin-bottom: 14px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid #e7c98f;
  border-radius: 13px;
  background: linear-gradient(135deg, #fff9eb, #fffdf8);
}
.training-guidance-banner[hidden] { display: none; }
.training-guidance-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; background: #fff0cf; color: #a86a13;
}
.training-guidance-copy strong { display: block; margin-top: 4px; color: #624317; font-size: 11px; }
.training-guidance-copy p { margin: 4px 0 0; color: #896d45; font-size: 9px; line-height: 1.45; }
.training-guidance-actions { display: flex; gap: 7px; }
.training-mismatch-row { background: linear-gradient(90deg, rgba(255,243,218,.55), transparent 24%); }

.carrier-assignment-modal { width: min(760px, 100%); }
#carrierAssignmentForm,
#stopEditorForm { padding: 18px 20px 20px; }
.carrier-training-note {
  margin-bottom: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #d4e1f2;
  border-radius: 10px;
  background: #f3f7fd;
  color: #526d8d;
  font-size: 9px;
  line-height: 1.45;
}
.carrier-training-note svg { flex: 0 0 auto; color: #3f76b9; }
.replacement-reason-field { margin-top: 13px; }
.carrier-modal-footer { justify-content: space-between; }
.carrier-modal-footer > div { display: flex; gap: 8px; }
.danger-text-button {
  border: 0;
  background: transparent;
  color: #b0444b;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.intermediate-stop-list { margin: 16px 0 0 46px; display: grid; gap: 8px; }
.intermediate-stop-card {
  min-height: 66px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dde4eb;
  border-radius: 10px;
  background: #f9fbfd;
}
.intermediate-stop-number {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: #edf3fb; color: #3e6fae; font-size: 9px; font-weight: 850;
}
.intermediate-stop-card > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.intermediate-stop-card span:not(.intermediate-stop-number) { color: #8793a2; font-size: 8px; text-transform: uppercase; font-weight: 800; }
.intermediate-stop-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.intermediate-stop-card small { color: #8995a3; font-size: 8px; }
.intermediate-stop-actions { display: flex; gap: 4px; }
.intermediate-stop-actions button {
  min-height: 28px; padding: 0 7px; border: 1px solid #d9e1e8; border-radius: 7px;
  background: white; color: #647286; font-size: 8px; cursor: pointer;
}
.intermediate-stop-actions button:disabled { opacity: .35; cursor: not-allowed; }
.stop-editor-modal { width: min(760px, 100%); }

.document-card-actions { margin-top: auto; display: flex; gap: 10px; }
.document-card-actions button { margin-top: 0; }
.document-card-actions .danger-link { color: #b3474e; }
.uploaded-document-card { border-color: #cbddec; background: #f7fbff; }
.document-card.empty { cursor: pointer; }

.shipments-table.density-compact td { height: 46px; }
.shipments-table.density-compact .shipment-secondary,
.shipments-table.density-compact .route-secondary,
.shipments-table.density-compact .schedule-secondary,
.shipments-table.density-compact .carrier-secondary,
.shipments-table.density-compact .assignment-secondary { display: none; }
.shipments-table.density-standard td { height: 61px; }
.shipments-table.density-comfortable td { height: 76px; }
.shipments-table.density-comfortable .shipment-secondary,
.shipments-table.density-comfortable .route-secondary,
.shipments-table.density-comfortable .schedule-secondary,
.shipments-table.density-comfortable .carrier-secondary,
.shipments-table.density-comfortable .assignment-secondary { margin-top: 7px; }

.quote-expiring-row { background: linear-gradient(90deg, rgba(255,242,218,.65), transparent 23%); }
.quote-expiring-label { margin-top: 4px; color: #a16715; font-size: 7px; font-weight: 850; text-transform: uppercase; }

@media (max-width: 1280px) {
  .training-guidance-banner { grid-template-columns: 38px minmax(0, 1fr); }
  .training-guidance-actions { grid-column: 2; }
}


/* ==========================================================================
   V8.1 — All current tabs functional
   ========================================================================== */

.nav-item.module-active,
.subnav-item.module-active {
  background: linear-gradient(90deg, rgba(47,114,214,.22), rgba(47,114,214,.07));
  color: white;
}
.subnav-item.module-active { color: #f4b14a; }

.module-page { padding-bottom: 44px; }
.module-page-header { margin-bottom: 15px; }
.module-header-actions { display: flex; gap: 8px; }
.module-tabs {
  min-height: 46px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 1px solid #dce2e8;
}
.module-tabs[hidden] { display: none; }
.module-tab {
  height: 43px;
  padding: 0 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #738093;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.module-tab.active { border-bottom-color: var(--amber); color: #1e2a3c; }

.module-content { display: grid; gap: 14px; }
.module-grid { display: grid; gap: 14px; }
.module-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.module-card {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 14px;
  background: white;
  box-shadow: 0 7px 24px rgba(24,36,53,.04);
}
.module-card > header {
  min-height: 63px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e7ebef;
  background: linear-gradient(180deg,#fff,#fbfcfd);
}
.module-card > header h2 { margin: 4px 0 0; font-size: 14px; }

.module-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.module-metric-card {
  min-height: 105px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid #dfe4ea;
  border-radius: 13px;
  background: white;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.module-metric-card:hover { border-color: #bfcbd8; box-shadow: 0 8px 22px rgba(24,36,53,.06); transform: translateY(-1px); }
.module-metric-card.attention { background: #fff9ed; border-color: #ebd5ae; }
.module-metric-card span { color: #6f7b8d; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.module-metric-card strong { font-size: 25px; }
.module-metric-card small { color: #8c97a4; font-size: 8px; }

.module-list { padding: 5px 14px 13px; }
.module-list-row {
  width: 100%;
  min-height: 57px;
  padding: 9px 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.module-list-row:last-child { border-bottom: 0; }
.module-list-row:hover { background: #fafbfc; }
.module-list-row div { min-width: 0; display: grid; gap: 4px; }
.module-list-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.module-list-row small { color: #8994a2; font-size: 8px; }
.module-list-row > span:last-child { color: #6680a1; font-size: 8px; }

.module-record-grid { padding: 14px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.module-record-grid button {
  min-height: 82px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #e0e5ea;
  border-radius: 10px;
  background: #fafbfc;
  text-align: left;
  cursor: pointer;
}
.module-record-grid button:hover { border-color: #bfcbd8; background: white; }
.module-record-grid span { color: #8a96a4; font-size: 8px; text-transform: uppercase; }
.module-record-grid strong { color: #2c394c; font-size: 12px; }
.module-record-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7b8797; font-size: 8px; }

.module-toolbar {
  min-height: 55px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e6eaee;
  background: #fafbfc;
  color: #7c8898;
  font-size: 9px;
}
.module-search {
  width: min(480px,65%);
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e0e7;
  border-radius: 9px;
  background: white;
  color: #8390a0;
}
.module-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }

.module-table-wrap { overflow: auto; }
.module-table { width: 100%; min-width: 900px; border-collapse: collapse; }
.module-table th,
.module-table td { height: 51px; padding: 0 12px; border-bottom: 1px solid #e8ecf0; text-align: left; font-size: 9px; }
.module-table th { height: 37px; background: #f8fafb; color: #7f8b9a; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.module-table tbody tr:hover { background: #fafbfc; }
.inline-link-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 9px; font-weight: 800; cursor: pointer; }
.inline-link-button:hover { text-decoration: underline; }

.module-empty { padding: 25px 15px; color: #8d98a5; text-align: center; font-size: 9px; }
.module-empty.large { padding: 55px 20px; }
.module-info-list { padding: 9px 15px 15px; }
.module-info-list > div { padding: 11px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #edf0f3; }
.module-info-list > div:last-child { border-bottom: 0; }
.module-info-list strong { color: #384559; font-size: 9px; }
.module-info-list span { color: #7f8b9a; font-size: 9px; text-align: right; }

.import-drop-zone { min-height: 245px; padding: 30px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; }
.import-drop-zone > svg { width: 36px; height: 36px; color: #5584bd; }
.import-drop-zone strong { font-size: 13px; }
.import-drop-zone p { margin: 0; color: #8490a0; font-size: 9px; }
.file-button input { display: none; }
.import-preview-note { padding: 10px 14px; color: #8390a0; font-size: 8px; }

.directory-status {
  min-width: 68px;
  padding: 5px 7px;
  display: inline-flex;
  justify-content: center;
  border-radius: 7px;
  background: #eef1f5;
  color: #637083;
  font-size: 8px;
  font-weight: 800;
}
.directory-status.active { background: #e6f5ef; color: #28735e; }
.directory-status.watchlist,
.directory-status.pending-review,
.directory-status.prospect { background: #fff1df; color: #9b610e; }
.directory-status.blocked,
.directory-status.credit-hold,
.directory-status.inactive { background: #fdebed; color: #a64047; }
.directory-expired { color: #a64047; font-weight: 750; }
.directory-actions { display: flex; gap: 7px; }
.directory-actions button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 8px; font-weight: 750; cursor: pointer; }
.directory-actions .danger-link { color: #b3474e; }

.form-card .module-form-grid { padding: 16px; }
.module-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.training-setting-card { margin: 16px; padding: 14px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid #cfe1d6; border-radius: 11px; background: #f1faf4; }
.training-setting-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #dff1e5; color: #34714b; }
.training-setting-card strong { font-size: 10px; }
.training-setting-card p { margin: 4px 0 0; color: #688071; font-size: 8px; line-height: 1.45; }
.setting-locked { padding: 6px 8px; border-radius: 7px; background: white; color: #34714b; font-size: 8px; font-weight: 800; }

.profile-module-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 14px; }
.profile-preview-card { min-height: 300px; padding: 25px; display: grid; place-items: center; align-content: center; gap: 9px; text-align: center; }
.profile-preview-avatar { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 20px; background: #29405e; color: #d1e2f5; font-size: 20px; font-weight: 850; }
.profile-preview-card strong { font-size: 16px; }
.profile-preview-card small { color: #8390a0; }

.report-builder { padding: 16px; display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 20px; align-items: end; }
.report-summary-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.report-summary-cards div { padding: 12px; border: 1px solid #e0e5ea; border-radius: 9px; background: #fafbfc; }
.report-summary-cards span { display: block; color: #8692a1; font-size: 8px; }
.report-summary-cards strong { display: block; margin-top: 6px; font-size: 16px; }

.panel-header-actions { display: flex; align-items: center; gap: 7px; }
.tab-action-row { margin-bottom: 13px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #dce4eb; border-radius: 10px; background: #f8fafc; }
.tab-action-row > div { display: grid; gap: 4px; }
.tab-action-row strong { font-size: 9px; color: #59677b; }

.workflow-modal { width: min(620px,100%); }
.workflow-modal form,
.directory-editor-modal form { padding: 18px 20px 20px; }
.directory-editor-modal { width: min(760px,100%); }
#entityEditorFields { display: grid; gap: 13px; }

@media (max-width: 1300px) {
  .module-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .module-record-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .module-grid.two { grid-template-columns: 1fr; }
}


/* ---------- V9 authentication and server state ---------- */
.auth-gate { position:fixed; inset:0; z-index:500; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 15% 10%,rgba(47,114,214,.24),transparent 28%),linear-gradient(145deg,#09111d,#111d2d); }
.auth-gate[hidden] { display:none; }
.auth-card { width:min(420px,100%); padding:30px; border:1px solid rgba(255,255,255,.12); border-radius:20px; background:rgba(255,255,255,.97); box-shadow:0 35px 100px rgba(0,0,0,.35); }
.auth-back-link { width:max-content; display:inline-flex; align-items:center; gap:7px; margin-bottom:20px; color:#536176; font-size:11px; font-weight:800; text-decoration:none; }
.auth-back-link svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.auth-back-link:hover { color:#1f6fbe; }
.auth-back-link:focus-visible { outline:3px solid rgba(47,114,214,.22); outline-offset:5px; border-radius:6px; }
.auth-brand-mark { width:52px; height:52px; display:grid; place-items:center; margin-bottom:18px; border-radius:14px; background:linear-gradient(145deg,#ffbe5f,#e28b19); color:#172033; }
.auth-brand-mark svg { width:34px; height:34px; }
.auth-card h1 { margin:8px 0 7px; font-size:25px; }
.auth-card > p { margin:0 0 20px; color:#718094; }
.auth-card form { display:grid; gap:13px; }
.auth-submit { width:100%; margin-top:5px; }
.auth-error { padding:10px 11px; border:1px solid #efc7ca; border-radius:9px; background:#fff1f2; color:#a33e45; font-size:10px; }
.auth-demo-users { margin-top:18px; padding:12px; display:grid; gap:4px; border:1px solid #e1e6eb; border-radius:10px; background:#f7f9fb; color:#68768a; font-size:9px; }
.auth-demo-users strong { color:#39465a; margin-bottom:3px; }
.auth-card > small { display:block; margin-top:10px; color:#929dab; font-size:8px; }
.server-status-badge { min-height:28px; padding:0 9px; display:inline-flex; align-items:center; gap:6px; border:1px solid #dce2e8; border-radius:8px; background:white; color:#637084; font-size:8px; font-weight:800; }
.server-status-badge span { width:7px; height:7px; border-radius:50%; background:#aeb7c1; }
.server-status-badge.online span { background:#3d9a69; box-shadow:0 0 0 4px rgba(61,154,105,.10); }
.server-status-badge.offline span { background:#c94f56; }
.server-status-badge.syncing span { background:#f1a53a; animation:serverPulse 1s infinite; }
@keyframes serverPulse { 50% { opacity:.35; } }
body[data-user-role="READ_ONLY"] .primary-button:not(.auth-submit):disabled,
body[data-user-role="ACCOUNTING"] button:disabled,
body[data-user-role="SALES"] button:disabled { opacity:.48; cursor:not-allowed; transform:none; }


/* FT101 Calibri readability patch — based on the user's updated V9 project. */
html,
body,
button,
input,
select,
textarea,
option,
optgroup,
table {
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

textarea {
  font: inherit;
}


/* FT101 action confirmation guard */
.confirmation-icon.danger {
  background: #ffe8e9;
  color: #b63b45;
}
.confirmation-icon.info {
  background: #eaf4ff;
  color: #2f70b7;
}
.confirmation-dialog.confirmation-busy {
  pointer-events: none;
  opacity: .78;
}
.confirmation-actions button {
  min-width: 112px;
}
body.confirmation-open {
  overflow: hidden;
}
@media (max-width: 520px) {
  .confirmation-actions {
    flex-direction: column-reverse;
  }
  .confirmation-actions button {
    width: 100%;
  }
}

/* FT101 portal identity — TMS keeps a soft amber accent and slightly larger type. */
:root {
  --amber-soft-30: rgba(241,165,58,.30);
}
body { font-size: 14px; }
.workspace {
  background:
    radial-gradient(circle at 100% 0, rgba(241,165,58,.11), transparent 28rem),
    #edf0f4;
}
.auth-gate {
  background:
    radial-gradient(circle at 15% 10%, rgba(241,165,58,.24), transparent 28%),
    linear-gradient(145deg,#09111d,#111d2d);
}
.auth-back-link:hover { color: #b66d0e; }
.auth-back-link:focus-visible { outline-color: rgba(241,165,58,.30); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(241,165,58,.22), rgba(241,165,58,.07));
  box-shadow: inset 3px 0 0 var(--amber);
}
.nav-item.active > svg:first-child { color: #ffc66f; }
.global-search:focus-within {
  border-color: #e3aa58;
  box-shadow: 0 0 0 3px rgba(241,165,58,.13);
}
.eyebrow { color: #bf7318; font-size: 11px; }
.nav-heading { font-size: 10px; }
.nav-item { font-size: 13px; }
.subnav-item { font-size: 13px; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { font-size: 10px; }
.page-header p,
.create-page-header p,
.details-title-block > p { font-size: 14px; }
.compact-button { font-size: 12px; }
.metric-label { font-size: 12px; }
.board-header p,
.section-header p { font-size: 12px; }
.view-tab { font-size: 12px; }
.shipments-table td { font-size: 12.5px; }
.quotes-table td { font-size: 12px; }
.form-grid label { font-size: 11.5px; }
.form-control,
input,
select,
textarea { font-size: 13px; }
.table-footer { font-size: 11px; }
.auth-card h1 { font-size: 27px; }
.auth-card > p { font-size: 14px; }
.auth-back-link { font-size: 12px; }
.auth-error { font-size: 11px; }
.auth-demo-users { font-size: 10.5px; }
.auth-card > small { font-size: 9.5px; }
.server-status-badge { font-size: 9.5px; }

/* Workspace selector shortcut */
.workspace-switcher {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(199,125,4,.28);
  border-radius: 10px;
  color: #7a4f07;
  background: rgba(243,170,32,.18);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.workspace-switcher svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.workspace-switcher:hover {
  border-color: rgba(199,125,4,.5);
  background: rgba(243,170,32,.28);
  transform: translateY(-1px);
}
.workspace-switcher:focus-visible {
  outline: 3px solid rgba(243,170,32,.24);
  outline-offset: 2px;
}
@media (max-width: 920px) {
  .workspace-switcher { width: 38px; padding: 0; }
  .workspace-switcher span { display: none; }
}


/* FT101v2 unified platform branding */
.module-logo{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}.auth-brand-mark{overflow:hidden;padding:0}.brand-mark{overflow:hidden}.brand-mark .module-logo{width:34px;height:34px;border-radius:8px}.nav-section .nav-item[href^="/"]{text-decoration:none}

/* ---------- Phase 9: generated training documents ---------- */
.document-generator-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.document-generator-card {
  min-height: 154px;
  padding: 16px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffff, #f6f9fc);
}
.document-generator-card.generated { border-color: #b9d8c5; background: linear-gradient(145deg, #ffffff, #f2faf5); }
.document-generator-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 11px; background: #eaf2ff; color: #2f72d6;
}
.document-generator-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.document-generator-copy { min-width: 0; display: grid; align-content: start; gap: 5px; }
.document-generator-kicker { color: #7f8b99; font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.document-generator-copy strong { color: #2f3b4e; font-size: 13px; }
.document-generator-copy small { color: #748196; font-size: 8px; line-height: 1.45; }
.document-generator-copy em { margin-top: 3px; color: #9a6417; font-size: 7px; font-style: normal; font-weight: 850; letter-spacing: .04em; }
.document-generator-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.document-generator-actions button {
  min-height: 31px; padding: 0 11px; border: 1px solid #d5dee7; border-radius: 8px;
  background: white; color: #536176; font-size: 8px; font-weight: 800; cursor: pointer;
}
.document-generator-actions button.primary { border-color: #2f72d6; background: #2f72d6; color: white; }
.document-generator-actions button:disabled { opacity: .55; cursor: wait; }
.document-history-heading {
  grid-column: 1 / -1;
  display: flex; align-items: end; justify-content: space-between; gap: 12px;
  padding: 5px 2px 0;
}
.document-history-heading h4 { margin: 4px 0 0; color: #39465a; font-size: 11px; }
.document-history-heading small { color: #8490a0; font-size: 8px; }
.documents-grid-inner { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.training-document-chip {
  width: fit-content; margin-top: 7px; padding: 4px 7px; border-radius: 999px;
  background: #fff1d9; color: #966116; font-size: 7px; font-weight: 850; text-transform: uppercase;
}
@media (max-width: 980px) {
  .document-generator-grid, .documents-grid-inner { grid-template-columns: 1fr; }
}


/* FT101v2 1.4.0 — Broker TMS Internal Comms */
.tms-comms-panel { overflow: hidden; }
.tms-comms-panel .negotiation-summary { border-top: 1px solid #e3e8ee; }
.tms-comms-panel .negotiation-message-list { min-height: 360px; max-height: 52vh; }
.tms-comms-panel .negotiation-composer { grid-template-columns: minmax(0,1fr) auto; }
.tms-comms-panel .negotiation-composer .primary-button { align-self: end; min-height: 38px; }

/* FT101v2 1.4.1 shared Internal Comms file handoff */
.comms-file-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(170px,.45fr); gap:12px; }
.comms-attachment { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; padding:10px 12px; border:1px solid #d8e0e8; border-radius:8px; background:#f8fafc; color:inherit; text-decoration:none; }
.comms-attachment:hover { border-color:#9db2c5; background:#f1f5f9; }
.comms-attachment span { font-size:12px; color:#64748b; }
@media (max-width:720px){ .comms-file-row { grid-template-columns:1fr; } }
