* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a2744;
  --navy-light: #243360;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --sidebar-width: 210px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-width);
  background: #e8eef6;
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

#sidebar .logo {
  padding: 16px 16px 12px;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#sidebar .logo h1 { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
#sidebar .logo p { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.portal-logo-img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  padding: 8px 10px;
  box-shadow: 0 4px 14px rgba(15,23,42,.10);
}

body.public-lastmile-domain #sidebar .portal-logo-img {
  display: none;
}

body.public-lastmile-domain #sidebar .logo p {
  margin-top: 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
}

#sidebar nav { padding: 12px 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
#sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  border-left: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar nav a:hover { color: var(--navy); background: #eef2f7; }
#sidebar nav a.active { color: var(--navy); background: #eff6ff; border-left-color: #3b82f6; }
#sidebar nav a .icon { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }
#sidebar nav a span:not(.icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar nav .nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px 7px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  white-space: nowrap;
}
#sidebar nav .nav-group-label:hover { color: var(--navy); background: #eef2f7; }
#sidebar nav .nav-group-label.active { color: var(--navy); background: #eff6ff; border-left-color: #3b82f6; }
#sidebar nav .nav-group-label .icon {
  font-size: 18px;
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
}
#sidebar nav .nav-group-label .nav-group-chevron {
  margin-left: auto;
  font-size: 12px;
  opacity: .8;
  transition: transform .15s;
}
body:not(.ocean-nav-collapsed) #sidebar nav .nav-group-label .nav-group-chevron {
  transform: rotate(90deg);
}
body.ocean-nav-collapsed #sidebar nav a[data-page="oceanimport"],
body.ocean-nav-collapsed #sidebar nav a[data-page="oceanexport"] {
  display: none;
}
#sidebar nav a.nav-subitem {
  padding-left: 46px;
}
#sidebar nav a.nav-subitem .icon {
  width: 16px;
}

.dash-notes-warn-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
#shared-shipment-notes {
  flex: 0 0 480px;
}
.dashboard-shipment-notes {
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2563eb;
  background: #fff;
}
.dashboard-shipment-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  max-height: 400px;
  overflow: auto;
}
.dashboard-shipment-notes .sidebar-note-item {
  min-height: 84px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  color: var(--text);
  margin: 0;
  padding: 10px 12px;
}
.dashboard-shipment-notes .sidebar-note-item:hover {
  background: #eff6ff;
}
.dashboard-shipment-notes .sidebar-note-ref {
  color: #1e40af;
  font-size: 13px;
}
.dashboard-shipment-notes .sidebar-note-text {
  color: #1e293b;
  font-size: 13px;
  line-height: 1.35;
}
.dashboard-shipment-notes .sidebar-note-meta,
.dashboard-shipment-notes .sidebar-note-empty {
  color: #64748b;
  font-size: 12px;
}

.sidebar-notes {
  margin: 14px 12px 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(15,23,42,.36);
}
.sidebar-notes-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 800;
}
.sidebar-notes-title button {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.sidebar-notes-list {
  max-height: calc(100vh - 575px);
  min-height: 120px;
  overflow: auto;
}
.sidebar-note-item {
  width: 100%;
  display: block;
  border: 0;
  border-left: 3px solid rgba(249,115,22,.75);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  text-align: left;
  padding: 8px;
  margin-bottom: 7px;
  cursor: pointer;
}
.sidebar-note-item:hover {
  background: rgba(249,115,22,.20);
}
.sidebar-note-ref {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.sidebar-note-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
}
.sidebar-note-meta,
.sidebar-note-empty {
  margin-top: 5px;
  color: rgba(255,255,255,.52);
  font-size: 10px;
  line-height: 1.2;
}

.air-shipment-note-box {
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  margin: 10px 0 12px;
}
.air-shipment-note-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.air-shipment-note-head strong {
  color: var(--navy);
  font-size: 14px;
}
.air-shipment-note-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.air-shipment-note-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.air-shipment-note-compose textarea {
  min-height: 46px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
}
.air-shipment-note-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}
.air-shipment-note-item {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}
.air-import-notes-modal {
  max-height: 86vh;
  overflow: auto;
}
.air-shipment-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.air-shipment-note-remove {
  color: var(--danger);
  border-color: var(--danger);
}
.air-shipment-note-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}
.air-shipment-note-meta,
.air-shipment-note-empty {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

#sidebar .sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid #cbd5e1;
  font-size: 12px;
  color: #94a3b8;
}

/* ── MAIN ── */
body.lastmile-customer-only #sidebar {
  display: none;
}

body.lastmile-customer-only #main {
  margin-left: 0;
  width: 100%;
}

body.lastmile-customer-only #topbar {
  padding-left: 28px;
}

#main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
#topbar h2 { font-size: 18px; font-weight: 700; }
#topbar .topbar-right { display: flex; align-items: center; gap: 12px; }

#workspace-tabs {
  position: sticky;
  top: 57px;
  z-index: 45;
  min-height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 28px 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.workspace-tab {
  min-width: 126px;
  max-width: 220px;
  height: 34px;
  padding: 0 8px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  background: #eff6ff;
  color: #9a3412;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.03);
}
.workspace-tab:hover { background: #cbd5e1; }
.workspace-tab.active {
  background: var(--white);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 -2px 8px rgba(37,99,235,.12);
}
.workspace-tab .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-tab .tab-close {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  line-height: 16px;
  opacity: .65;
}
.workspace-tab .tab-close:hover { background: rgba(15,23,42,.10); opacity: 1; }
#refresh-btn {
  background: var(--accent); color: #fff; border: none; padding: 7px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
#refresh-btn:hover { background: var(--accent-hover); }
#logout-btn {
  background: var(--accent); color: #fff; border: none; padding: 7px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
#logout-btn:hover { background: var(--accent-hover); }
#export-btn {
  background: #16a34a; color: #fff; border: none; padding: 7px 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
#export-btn:hover { background: #15803d; }

#content { padding: 24px 28px; flex: 1; }

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; }

/* ── CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.stat-card .icon-box {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-card.orange .icon-box { background: #f8fafc; }
.stat-card.blue .icon-box { background: #f8fafc; }
.stat-card.green .icon-box { background: #f0fdf4; }
.stat-card.purple .icon-box { background: #f8fafc; }
.stat-card.red .icon-box { background: #fff1f2; }
.stat-card.red .info h3 { color: #dc2626; }
.stat-card[onclick] { transition: transform .12s, box-shadow .12s; }
.stat-card[onclick]:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.10); }
.stat-card[onclick]:active { transform: translateY(0); }
.stat-card .info h3 { font-size: 20px; font-weight: 700; }
.stat-card .info p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── SECTION ── */
.section {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.section-header h3 { font-size: 15px; font-weight: 700; }

/* Settings collapse behavior */
#page-settings .section-collapsible .section-header { cursor: pointer; user-select: none; }
#page-settings .section-collapsible .section-header h3::before {
  content: '▾';
  display: inline-block;
  width: 16px;
  color: var(--text-muted);
  transition: transform 0.15s;
  margin-right: 4px;
}
#page-settings .section-collapsible.section-collapsed .section-header h3::before { transform: rotate(-90deg); }
#page-settings .section-collapsible.section-collapsed .section-body { display: none; }
#page-settings .section-collapsible.section-collapsed .section-header { border-bottom: none; }

/* Invoice row hover highlight */
.air-invoice-table tbody tr { transition: background 0.1s; }
.air-invoice-table tbody tr:hover { background: rgba(15, 23, 42, 0.08); cursor: default; }

/* Quote line editors — let inputs shrink to fit grid columns */
.customer-quote-line .form-group,
.vendor-quote-line .form-group { min-width: 0; }
.customer-quote-line .form-group input,
.customer-quote-line .form-group select,
.vendor-quote-line .form-group input,
.vendor-quote-line .form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
}

.ae-filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: calc(100vw - var(--sidebar-width) - 220px);
  padding-bottom: 2px;
}
.ae-filter-row input,
.ae-filter-row select {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  height: 32px;
}
.ae-filter-row input { width: 120px; }
#ae-search { width: 190px; }
.ae-filter-row input[type="date"] { width: 120px; }
.ae-filter-row select { min-width: 100px; max-width: 155px; }
#ae-customer-filter { width: 155px; }
#ae-status-filter { width: 115px; }
#ae-from-filter { width: 88px; }
#ae-to-filter { width: 82px; }
#ae-airline-filter { min-width: 120px; max-width: 155px; }

/* Air Export readability polish: same layout, softer contrast */
#page-airexport .section {
  border-color: #cbd5e1;
  background: #ffffff;
}
#page-airexport .section-header {
  background: #f8fafc;
  border-bottom-color: #cbd5e1;
}
#page-airexport .section-header h3 {
  font-size: 18px;
  color: #172033;
}
#page-airexport .ae-filter-row input,
#page-airexport .ae-filter-row select {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #253044;
  font-size: 14px;
  font-weight: 600;
}
#page-airexport .ae-filter-row input::placeholder {
  color: #8a96a8;
}
#page-airexport .table-wrap {
  background: #ffffff;
}
#page-airexport thead th {
  background: #f4f7fb;
  color: #334155;
  border-bottom-color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}
#page-airexport tbody td {
  border-bottom-color: #cbd5e1;
  color: #263244;
  font-size: 14px;
  line-height: 1.5;
}
#page-airexport tbody td strong {
  color: #172033;
  font-weight: 800;
}
#page-airexport .air-customer-col {
  max-width: 260px;
  min-width: 170px;
  white-space: nowrap;
}
#page-airexport .ae-customer-party-col {
  min-width: 230px;
  white-space: normal;
}
#page-airexport .air-customer-chip {
  --customer-hue: 210;
  --customer-sat: 72%;
  --customer-ink: 24%;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px 4px 10px;
  border: 1px solid hsl(var(--customer-hue), var(--customer-sat), 58%);
  border-left-width: 7px;
  border-radius: 5px;
  background: linear-gradient(90deg, hsl(var(--customer-hue), var(--customer-sat), 90%), hsl(var(--customer-hue), var(--customer-sat), 96%));
  color: hsl(var(--customer-hue), 66%, var(--customer-ink));
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport #ae-thead th {
  background: #f8fafc;
  border-bottom: 1px solid #dbe3ee;
  padding: 8px 12px;
}
#page-airexport .ae-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #526174;
  font-size: 12px;
  text-transform: uppercase;
}
#page-airexport .ae-card-head > span {
  font-weight: 900;
}
#page-airexport .ae-card-head div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
#page-airexport .ae-card-head button {
  border: 1px solid #d8e2ef;
  border-radius: 5px;
  background: #fff;
  color: #526174;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 7px;
}
#page-airexport .ae-card-row > td {
  padding: 0;
  border-bottom: 1px solid #dbe3ee;
}
#page-airexport .ae-card-row.expanded > td {
  border-top: 2px solid #1e3a5f;
  border-right: 2px solid #1e3a5f;
  border-left: 2px solid #1e3a5f;
}
#page-airexport .ae-shipment-card {
  display: grid;
  grid-template-columns: 96px minmax(150px, 1.05fr) minmax(140px, .95fr) minmax(112px, .75fr) minmax(250px, 1.55fr) minmax(300px, 1.6fr) minmax(108px, .8fr);
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 4px 12px;
  border-left: 4px solid #cbd5e1;
  background: #ffffff;
  color: #273548;
}
#page-airexport .ae-card-row:nth-child(4n+1) .ae-shipment-card {
  background: #f8fafc;
}
#page-airexport .ae-card-row:hover .ae-shipment-card,
#page-airexport .ae-card-row.expanded .ae-shipment-card {
  border-left-color: #0f3d73;
  background: linear-gradient(90deg, #eef6ff 0, #f8fafc 46%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(37,99,235,.08), inset 0 -1px 0 rgba(37,99,235,.06);
}
#page-airexport .ae-card-row.expanded .ae-shipment-card {
  border-color: #1f2937;
  border-left-color: #0f2f57;
  border-left-width: 8px;
  background: linear-gradient(90deg, #dbeafe 0, #f8fafc 50%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(15,47,87,.2), 0 12px 26px rgba(15,23,42,.24);
}
#page-airexport .ae-card-date {
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}
#page-airexport .ae-card-identity {
  display: grid;
  justify-items: start;
  gap: 1px;
  min-width: 0;
}
#page-airexport .ae-card-identity > strong {
  color: #0f1f35;
  font-size: 15px;
}
#page-airexport .ae-card-note {
  color: #64748b;
  font-size: 12px;
}
#page-airexport .ae-card-awb {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px 8px;
  min-width: 0;
}
#page-airexport .ae-card-awb span,
#page-airexport .ae-detail-line span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
#page-airexport .ae-card-awb strong {
  overflow: hidden;
  color: #273548;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport .ae-card-route {
  display: grid;
  grid-template-columns: auto 16px auto;
  align-items: center;
  gap: 4px;
  border-left: 3px solid #60a5fa;
  border-radius: 6px;
  background: #eff6ff;
  padding: 3px 8px;
}
#page-airexport .ae-card-route strong {
  color: #0f3b73;
  font-size: 14px;
}
#page-airexport .ae-card-route span {
  color: #94a3b8;
}
#page-airexport .ae-card-route small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #49627f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport .ae-card-parties {
  display: grid;
  gap: 1px;
  min-width: 0;
  border-left: 3px solid #60a5fa;
  border-radius: 6px;
  background: #eff6ff;
  padding: 3px 8px;
}
#page-airexport .ae-card-customer .air-customer-chip {
  min-height: 20px;
  padding-top: 1px;
  padding-bottom: 1px;
}
#page-airexport .ae-card-party-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.15;
}
#page-airexport .ae-card-party-line span {
  color: #64748b;
  font-weight: 900;
}
#page-airexport .ae-card-party-line strong {
  overflow: hidden;
  color: #1e293b;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport .ae-card-cargo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
#page-airexport .ae-card-metric {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 3px 6px;
  text-align: center;
}
#page-airexport .ae-card-metric:nth-child(2) {
  border-color: #cbd5e1;
  background: #f8fafc;
}
#page-airexport .ae-card-metric:nth-child(3) {
  border-color: #cbd5e1;
  background: #f8fafc;
}
#page-airexport .ae-card-metric strong {
  display: block;
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport .ae-card-metric span {
  display: block;
  margin-top: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}
#page-airexport .ae-card-metric:nth-child(2) span {
  color: #64748b;
}
#page-airexport .ae-card-metric:nth-child(3) span {
  color: #64748b;
}
#page-airexport .ae-card-status {
  display: grid;
  justify-items: end;
  gap: 2px;
}
#page-airexport .ae-card-profit {
  font-size: 13px;
  font-weight: 900;
}
#page-airexport .ae-card-profit.is-positive {
  color: var(--success);
}
#page-airexport .ae-card-profit.is-negative {
  color: var(--error);
}
#page-airexport .ae-card-approvals {
  white-space: nowrap;
}
#page-airexport .ae-party-stack {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
#page-airexport .ae-party-stack div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-airexport .ae-party-stack span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 16px;
  margin-right: 4px;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10px;
  font-weight: 900;
}
#page-airexport .ae-weight-stack {
  display: grid;
  gap: 2px;
  min-width: 96px;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
}
#page-airexport .ae-weight-stack div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
#page-airexport .ae-weight-stack span {
  min-width: 28px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}
#page-airexport .ae-weight-stack strong {
  color: #172033;
}
#page-airexport .ae-overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}
#page-airexport .ae-overview-grid .ae-info-wide {
  grid-column: span 3;
}
#page-airexport .ae-overview-grid .ae-info-wide p {
  white-space: pre-line;
  max-height: 4.5em;
  overflow: auto;
}
#page-airexport .ae-detail-summary {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}
#page-airexport .ae-detail-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  padding-right: 8px;
}
#page-airexport .ae-detail-toolbar .tabs {
  flex: 1 1 auto;
  min-width: 360px;
  border-bottom: 0;
  margin-bottom: 0;
}
#page-airexport .ae-detail-actions {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  padding: 5px 0 7px;
}
#page-airexport .ae-detail-actions .btn {
  height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}
#page-airexport .ae-detail-main {
  display: grid;
  grid-template-columns: minmax(390px, 1.35fr) minmax(240px, .85fr) minmax(230px, .8fr);
  gap: 10px;
}
#page-airexport .ae-detail-panel {
  border: 1px solid #b6c5d8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
#page-airexport .ae-detail-cargo-panel {
  border-color: #cbd5e1;
}
#page-airexport .ae-detail-main .ae-detail-panel:nth-child(2) {
  border-color: #bfdbfe;
}
#page-airexport .ae-detail-main .ae-detail-panel:nth-child(3) {
  border-color: #cbd5e1;
}
#page-airexport .ae-detail-panel h4 {
  margin: 0;
  border-bottom: 1px solid #e5eaf1;
  padding: 6px 10px;
  color: #273548;
  font-size: 15px;
}
#page-airexport .ae-detail-cargo-panel h4 {
  background: #f8fafc;
  border-bottom-color: #cbd5e1;
}
#page-airexport .ae-detail-main .ae-detail-panel:nth-child(2) h4 {
  background: #eff6ff;
  border-bottom-color: #bfdbfe;
}
#page-airexport .ae-detail-main .ae-detail-panel:nth-child(3) h4 {
  background: #f8fafc;
  border-bottom-color: #cbd5e1;
}
#page-airexport .ae-detail-cargo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
}
#page-airexport .ae-detail-cargo-metric {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 7px 5px;
  text-align: center;
}
#page-airexport .ae-detail-cargo-metric.ae-cargo-volume {
  border-color: #bfdbfe;
  background: #eff6ff;
}
#page-airexport .ae-detail-cargo-metric.ae-cargo-chargeable-weight {
  border-color: #cbd5e1;
  background: #f8fafc;
}
#page-airexport .ae-detail-cargo-metric.ae-cargo-pieces {
  border-color: #cbd5e1;
  background: #f8fafc;
}
#page-airexport .ae-detail-cargo-metric strong {
  display: block;
  color: #2b3442;
  font-size: 20px;
}
#page-airexport .ae-detail-cargo-metric span {
  color: #334155;
  font-size: 13px;
}
#page-airexport .ae-detail-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 10px;
}
#page-airexport .ae-detail-line strong {
  color: #273548;
  font-weight: 700;
}
#page-airexport .ae-detail-main .ae-detail-panel:not(.ae-detail-cargo-panel) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
#page-airexport .ae-detail-main .ae-detail-panel:not(.ae-detail-cargo-panel) h4 {
  grid-column: 1 / -1;
}
#page-airexport .ae-from-header {
  min-width: 92px;
  white-space: nowrap;
}
#page-airexport .ae-from-title {
  font-weight: 800;
  line-height: 1.1;
}
#page-airexport .ae-from-subtitle {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
#page-airexport tbody tr:hover {
  background: #f8fafc;
}
#page-airexport tbody tr.expanded {
  background: #eef5ff;
}
#page-airexport .badge {
  font-size: 12px;
  letter-spacing: 0;
}
#page-airexport .ae-shipment-type {
  display: inline-block;
  min-width: 86px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
#page-airexport .ae-shipment-type-note {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
}
#page-airexport .ae-type-direct {
  background: #f0fdf4;
  color: #15803d;
}
#page-airexport .ae-type-mawb-consol {
  background: #eff6ff;
  color: #1d4ed8;
}
#page-airexport .ae-type-hawb-linked {
  background: #f8fafc;
  color: #6d28d9;
}
#page-airexport .ae-type-hawb-unlinked {
  background: #f8fafc;
  color: #1e40af;
}
#page-airexport .ae-type-shell {
  background: #f1f5f9;
  color: #475569;
}
#page-airexport .ae-mawb-allocation-row {
  background: #f8fafc;
  color: #64748b;
}
#page-airexport .ae-mawb-allocation-row td {
  border-color: #cbd5e1;
}
#page-airexport .ae-mawb-allocation-row strong {
  color: #475569;
}
#page-airexport .ae-mawb-allocation-note {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
#page-airexport .ae-mawb-lock,
#page-airexport .ae-mawb-allocation-action {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
#page-airexport #ae-pagination-info,
#page-airexport #ae-page-label {
  color: #475569;
  font-size: 14px;
}
#page-airexport .expand-panel {
  font-size: 15px;
  color: #263244;
}
#page-airexport .ae-expand-row > td {
  border-right: 3px solid #1f2937;
  border-bottom: 3px solid #1f2937;
  border-left: 3px solid #1f2937;
  box-shadow: 0 16px 34px rgba(15,23,42,.28);
}
#page-airexport .ae-expand-row .expand-panel {
  margin: 0;
  border-top: 2px solid #334155;
  background: linear-gradient(180deg, #f6f9ff 0, #f8fafc 100%);
  box-shadow: inset 8px 0 0 #0f2f57, inset 0 1px 0 rgba(255,255,255,.9);
}
#page-airexport .ae-detail-toolbar {
  border-bottom-color: #cbd5e1;
}
#page-airexport .info-item label {
  font-size: 12px;
  color: #64748b;
  letter-spacing: 0;
}
#page-airexport .info-item p {
  font-size: 15px;
  line-height: 1.45;
}
#page-airexport .tab-btn {
  font-size: 15px;
}
#page-airexport .air-accounting-title {
  font-size: 18px;
}
#page-airexport .air-accounting-title span {
  font-size: 14px !important;
}
#page-airexport .air-accounting-box table {
  font-size: 15px !important;
}
#page-airexport .air-accounting-box thead th {
  font-size: 14px;
}
#page-airexport .air-accounting-box tbody td {
  font-size: 15px;
  line-height: 1.45;
}
#page-airexport .air-charge-type-cell,
#page-airexport .air-charge-type-text {
  font-size: 14px;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

/* Keep each table's column labels visible while its rows scroll. Top-level page
   tables get their own viewport so horizontal scrolling and sticky headers work
   together consistently across Air, Ocean, Trucking, Storage, Accounting, etc. */
.page .section > .table-wrap {
  max-height: calc(100vh - 185px);
  overflow: auto;
  scrollbar-gutter: stable;
}
.table-wrap > table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 12;
  box-shadow: inset 0 -1px 0 var(--border);
}

#air-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
#air-load-more-btn { justify-self: center; }
#air-pagination .air-page-size-control { justify-self: end; }

/* Ocean desktop density: keep the complete shipment summary on one screen.
   Expanded AP/AR and notes remain full-width below the selected row. */
#page-ocean > .section > .section-header {
  gap: 10px;
  padding: 12px 14px;
}
#page-ocean .ae-filter-row {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 2px;
  max-width: none;
  overflow: visible;
}
#page-ocean .ae-filter-row input,
#page-ocean .ae-filter-row select {
  min-width: 0;
  width: 88px;
  max-width: 112px;
  height: 30px;
  padding: 5px 4px;
  font-size: 12px;
}
#page-ocean #ocean-search { width: 145px; max-width: 145px; }
#page-ocean #ocean-customer-filter { width: 120px; max-width: 120px; }
#page-ocean .ae-filter-row label { white-space: nowrap; }
#page-ocean > .section > .table-wrap > table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
#page-ocean > .section > .table-wrap > table > thead > tr > th,
#page-ocean > .section > .table-wrap > table > tbody > tr > td {
  padding: 7px 1px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#page-ocean > .section > .table-wrap > table > thead > tr > th {
  font-size: 12px;
  letter-spacing: 0;
  white-space: normal;
}
#page-ocean > .section > .table-wrap > table > tbody > tr:not(.expand-row) > td {
  font-size: 13px;
  white-space: normal;
}
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(1) { width: 6%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(2) { width: 7%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(3),
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(4) { width: 8%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(5) { width: 8%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(6),
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(7) { width: 5%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(8) { width: 9%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(9) { width: 4%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(10) { width: 7%; }
#page-ocean > .section > .table-wrap > table > thead > tr > th:nth-child(n+11) { width: 4.7%; }

@media (max-width: 900px) {
  #page-ocean .ae-filter-row { justify-content: flex-start; overflow-x: auto; }
  #page-ocean > .section > .table-wrap > table { min-width: 1120px; }
}
#page-ocean .ocean-accounting-count {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(37, 99, 235, .10);
  font-size: 11px;
  font-weight: 700;
}
#page-ocean .ocean-accounting-totals {
  margin-left: auto;
  display: flex;
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
#page-ocean .ocean-selected-total {
  display: none;
  padding: 4px 0 2px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
#page-ocean .air-accounting-box .table-wrap {
  max-height: none;
}
table { width: 100%; border-collapse: collapse; }
.air-import-table {
  table-layout: fixed;
  min-width: 1460px;
}
.air-import-table th,
.air-import-table td {
  padding: 7px 6px;
  white-space: nowrap;
}
.air-import-table th { font-size: 14px; }
.air-import-table td {
  font-size: 15px;
  line-height: 1.3;
}
.air-import-table .air-date-col { width: 84px; }
.air-import-table .air-file-col { width: 100px; }
.air-import-table .air-awb-col { width: 110px; }
.air-import-table .air-customer-col {
  width: 175px;
  white-space: nowrap;
}
.air-import-table .air-weight-col { width: 84px; }
.air-import-table .air-count-col { width: 64px; text-align: center; }
.air-import-table .air-money-col { width: 88px; text-align: right; }
.air-import-table .air-tracking-col { width: 120px; }
.air-import-table .air-shipment-status-col {
  width: 108px;
  text-align: center;
}
.air-import-table .air-acct-col {
  width: 92px;
  text-align: right;
}
.air-import-table .air-main-value {
  font-weight: 800;
  color: var(--text);
}
.air-import-table .shipment-company-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.air-import-table .air-customer-chip {
  --customer-hue: 210;
  --customer-sat: 72%;
  --customer-ink: 24%;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 6px 3px 8px;
  border: 1px solid hsl(var(--customer-hue), var(--customer-sat), 58%);
  border-left-width: 6px;
  border-radius: 5px;
  background: linear-gradient(90deg, hsl(var(--customer-hue), var(--customer-sat), 90%), hsl(var(--customer-hue), var(--customer-sat), 96%));
  color: hsl(var(--customer-hue), 66%, var(--customer-ink));
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.air-customer-lookup {
  display: none;
  position: absolute;
  z-index: 999;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  top: 100%;
  left: 0;
}
.air-customer-lookup-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}
.air-customer-lookup-item:last-child { border-bottom: none; }
.air-customer-lookup-item:hover { background: #f0f9ff; }
.air-customer-lookup-item span {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 6px;
}
thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody tr.expandable { cursor: pointer; }
tbody tr.expanded { background: #eff6ff; }
tbody.air-focus-mode > tr.expandable:not(.expanded) {
  opacity: .38;
  filter: grayscale(.65);
}
tbody.air-focus-mode > tr.expandable:not(.expanded) > td {
  background: #f1f5f9 !important;
}
tbody.air-focus-mode > tr.expandable.expanded,
tbody.air-focus-mode > tr.expand-row {
  opacity: 1;
  filter: none;
}
tbody.air-focus-mode > tr.expandable:not(.expanded):hover {
  opacity: .62;
  filter: grayscale(.35);
}
tbody.air-focus-mode > tr.expandable:not(.expanded):hover > td {
  background: #cbd5e1 !important;
}

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-pending  { background: #f8fafc; color: #1e40af; }
.badge-progress { background: #f8fafc; color: #1e40af; }
.badge-cleared { background: #f0fdf4; color: #15803d; }
.badge-complete { background: #f0fdf4; color: #15803d; }
.badge-partial  { background: #fef3c7; color: #92400e; }
.badge-warning  { background: #f8fafc; color: #1e40af; }
.badge-blue     { background: #f8fafc; color: #1e40af; }
.badge-received { background: #dbeafe; color: #1d4ed8; }
.badge-prealert { background: #e2e8f0; color: #0f172a; }
.badge-voided { background: #fef2f2; color: #b91c1c; }
.badge-inventory { background: #f0fdf4; color: #15803d; }

/* ── EXPAND PANEL ── */
.expand-row td { padding: 0; }
.expand-panel {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.info-item label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.info-item p { font-size: 13px; margin-top: 2px; }
.air-import-summary-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 6px;
  margin-bottom: 10px;
}
.air-import-summary-grid .info-item { min-width: 0; }
.air-import-summary-grid .info-item label { font-size: 10px; margin-bottom: 1px; }
.air-import-summary-grid .info-item p {
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  margin-top: 1px;
}
.air-import-summary-grid .info-item-wide { grid-column: span 2; }
.air-accounting-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.air-accounting-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 14px 11px;
}
.air-accounting-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.air-accounting-panel { display: none; }
.air-accounting-panel.active { display: block; }
.air-accounting-single-page {
  display: grid;
  gap: 18px;
}
.air-accounting-section {
  min-width: 0;
}
.air-accounting-box {
  background: #fff;
  border: 2px solid #475569;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  overflow-x: auto;
  padding: 14px;
}
.air-accounting-box-receivable {
  border-left: 5px solid #16a34a;
}
.air-accounting-box-payable {
  border-left: 5px solid #dc2626;
}
.air-accounting-title {
  align-items: center;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  font-size: 16px;
  font-weight: 800;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 10px;
}
.air-accounting-title-receivable {
  color: #15803d;
}
.air-accounting-title-payable {
  color: #b91c1c;
}
.air-accounting-box table {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-collapse: separate;
  border-radius: 6px;
  border-spacing: 0;
  min-width: 1240px;
  overflow: hidden;
}
.air-accounting-box .air-invoice-table {
  table-layout: fixed;
}
.air-invoice-col-check { width: 28px; }
.air-invoice-col-party { width: 12%; }
.air-invoice-col-description { width: 18%; }
.air-invoice-col-note { width: 9%; }
.air-invoice-col-qty { width: 4%; }
.air-invoice-col-price { width: 5%; }
.air-invoice-col-sum { width: 5%; }
.air-invoice-col-invoice { width: 7%; }
.air-invoice-col-currency { width: 4%; }
.air-invoice-col-settlement { width: 7%; }
.air-invoice-col-status { width: 8%; }
.air-invoice-col-date { width: 7%; }
.air-invoice-col-action { width: 9%; }
.air-invoice-col-qbid { width: 5%; }
.air-accounting-box .air-invoice-table th:nth-child(1),
.air-accounting-box .air-invoice-table td:nth-child(1) { width: 28px; }
.air-accounting-box .air-invoice-table th:nth-child(2),
.air-accounting-box .air-invoice-table td:nth-child(2) { width: 12%; }
.air-accounting-box .air-invoice-table th:nth-child(3),
.air-accounting-box .air-invoice-table td:nth-child(3) { width: 18%; }
.air-accounting-box .air-invoice-table th:nth-child(4),
.air-accounting-box .air-invoice-table td:nth-child(4) { width: 9%; }
.air-accounting-box .air-invoice-table th:nth-child(5),
.air-accounting-box .air-invoice-table td:nth-child(5) { width: 4%; }
.air-accounting-box .air-invoice-table th:nth-child(6),
.air-accounting-box .air-invoice-table td:nth-child(6) { width: 5%; }
.air-accounting-box .air-invoice-table th:nth-child(7),
.air-accounting-box .air-invoice-table td:nth-child(7) { width: 5%; }
.air-accounting-box .air-invoice-table th:nth-child(8),
.air-accounting-box .air-invoice-table td:nth-child(8) { width: 7%; }
.air-accounting-box .air-invoice-table th:nth-child(9),
.air-accounting-box .air-invoice-table td:nth-child(9) { width: 4%; }
.air-accounting-box .air-invoice-table th:nth-child(10),
.air-accounting-box .air-invoice-table td:nth-child(10) { width: 7%; }
.air-accounting-box .air-invoice-table th:nth-child(11),
.air-accounting-box .air-invoice-table td:nth-child(11) { width: 8%; }
.air-accounting-box .air-invoice-table th:nth-child(12),
.air-accounting-box .air-invoice-table td:nth-child(12) { width: 7%; }
.air-accounting-box .air-invoice-table th:nth-child(13),
.air-accounting-box .air-invoice-table td:nth-child(13) { width: 9%; }
.air-accounting-box .air-invoice-table th:nth-child(14),
.air-accounting-box .air-invoice-table td:nth-child(14) { width: 5%; }
.air-accounting-box .air-invoice-table th,
.air-accounting-box .air-invoice-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.air-accounting-box .air-invoice-table th:nth-child(2),
.air-accounting-box .air-invoice-table td:nth-child(2),
.air-accounting-box .air-invoice-table .air-charge-type-cell {
  min-width: 0;
}
.air-accounting-box .air-invoice-table th:nth-child(2),
.air-accounting-box .air-invoice-table td:nth-child(2) {
  white-space: nowrap;
}
.air-accounting-box .air-invoice-table .air-charge-type-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.air-accounting-box .air-invoice-table .air-charge-type-text {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
  white-space: normal;
}
.air-accounting-box .air-invoice-table .air-charge-match-badge {
  vertical-align: middle;
}
.air-accounting-box .air-invoice-table .air-line-note-cell {
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.air-accounting-box .air-invoice-table .air-line-note-cell:hover {
  color: var(--primary);
  text-decoration: underline;
}
.air-accounting-box .air-invoice-table th:nth-child(11),
.air-accounting-box .air-invoice-table td:nth-child(11),
.air-accounting-box .air-invoice-table th:nth-child(13),
.air-accounting-box .air-invoice-table td:nth-child(13),
.air-accounting-box .air-invoice-table th:nth-child(14),
.air-accounting-box .air-invoice-table td:nth-child(14) {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.air-accounting-box .air-invoice-table td:nth-child(13) {
  align-items: center;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.air-accounting-box .air-invoice-table td:nth-child(11) .badge {
  white-space: nowrap;
}
.accounting-amount-draft {
  color: #111827;
  font-weight: 800;
}
.accounting-amount-issued {
  color: #dc2626;
  font-weight: 800;
}
.accounting-amount-paid {
  color: #15803d;
  font-weight: 800;
}
.statement-note-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  margin-left: 4px;
  min-width: 24px;
  padding: 0 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.statement-note-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.statement-note-btn.has-note {
  background: #f8fafc;
  border-color: #f59e0b;
  color: #b45309;
}
.statement-note-modal-overlay {
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.statement-note-modal-overlay.open {
  display: flex;
}
.statement-note-modal {
  max-width: 460px;
  width: min(460px, 96vw);
}
.statement-note-modal-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.statement-note-modal-head h3 {
  margin: 0;
}
.statement-note-modal-head p {
  color: var(--text-muted);
  font-size: 12px;
  margin: 3px 0 0;
}
.statement-note-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 0 2px;
}
.statement-note-modal textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  min-height: 94px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}
.statement-note-modal-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.statement-note-modal-count {
  color: var(--text-muted);
  flex: 1;
  font-size: 12px;
}
.qb-mini-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 4px;
  padding: 2px 5px;
  white-space: nowrap;
}
.qb-mini-ok {
  background: #dcfce7;
  color: #166534;
}
.qb-mini-missing {
  background: #fee2e2;
  color: #991b1b;
}
.qb-mini-error {
  background: #eff6ff;
  color: #9a3412;
}
.air-charge-delete-btn {
  margin-top: 0;
}
.air-accounting-box thead th {
  background: #eef2f7;
  color: #334155;
  border-bottom-color: #94a3b8;
}
.air-accounting-box tbody td {
  border-bottom-color: #dbe3ec;
}
.air-accounting-box tbody tr:last-child td {
  border-bottom: none;
}
.air-accounting-box .air-invoice-status-0 td {
  background: #fff;
}
.air-accounting-box .air-invoice-status-0 .badge-pending {
  background: #fff;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.air-accounting-box .air-invoice-status-5 td,
.air-accounting-box .air-invoice-status-50 td {
  background: #f0fdf4;
}
.air-accounting-box .air-invoice-status-10 td,
.air-accounting-box .air-invoice-status-40 td {
  background: #fffbeb;
}
.air-accounting-box .air-invoice-status-30 td {
  background: #eff6ff;
}
.air-accounting-box .air-invoice-status-31 td {
  background: #f0fdfa;
}
.air-accounting-box .air-invoice-status-45 td {
  background: #f8fafc;
}
.air-accounting-box tbody tr.air-invoice-status:hover td {
  box-shadow: inset 0 0 0 9999px rgba(15, 23, 42, 0.10);
  filter: brightness(.98);
}
.air-charge-type-cell {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 150px;
}
.air-charge-type-text {
  border-radius: 5px;
  display: inline-block;
  font-weight: 700;
  line-height: 1.2;
  padding: 3px 6px;
}
.air-charge-match-badge {
  border-radius: 999px;
  display: none;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
  padding: 2px 6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.air-charge-type-matched .air-charge-type-text {
  background: #dcfce7;
  box-shadow: inset 0 0 0 1px #16a34a;
  color: #166534;
}
.air-charge-type-matched .air-charge-match-badge {
  background: #16a34a;
  color: #fff;
  display: inline-block;
}
.air-charge-type-unbilled .air-charge-type-text {
  background: #fef3c7;
  box-shadow: inset 0 0 0 1px #f59e0b;
  color: #92400e;
}
.air-charge-type-unbilled .air-charge-match-badge {
  background: #f59e0b;
  color: #fff;
  display: inline-block;
}
.air-quick-add-btn {
  background: var(--primary);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: none;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.air-quick-add-btn:hover {
  opacity: 0.85;
}
.shipment-document-summary {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.shipment-document-list {
  display: grid;
  gap: 8px;
}
.shipment-document-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  min-height: 60px;
  padding: 8px 10px;
}
.shipment-document-thumb,
.shipment-document-icon {
  align-items: center;
  display: flex;
  flex: 0 0 52px;
  height: 52px;
  justify-content: center;
}
.shipment-document-thumb img {
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}
.shipment-document-unavailable {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  color: #64748b;
  font-size: 9px;
  line-height: 1.1;
  padding: 3px;
  text-align: center;
}
.shipment-document-icon { font-size: 28px; }
.shipment-document-body { min-width: 0; }
.shipment-document-name {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.shipment-document-name.muted { color: #64748b; }
.shipment-document-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 1500px) {
  .air-import-summary-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .air-import-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 9px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all .15s;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; border: none;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-sync { background: #7c3aed; color: #fff; }
.btn-sync:hover { background: #6d28d9; }
.btn-sync:disabled { background: #a78bfa; cursor: not-allowed; }

/* ── FORM ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border .15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.invoice-entry-wrap {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.invoice-entry-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.invoice-entry-line {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.5fr)
    minmax(170px, 1.35fr)
    minmax(125px, .9fr)
    minmax(76px, .55fr)
    minmax(82px, .6fr)
    minmax(88px, .65fr)
    78px 70px 88px
    minmax(120px, .9fr)
    auto;
  gap: 7px;
  align-items: end;
  min-width: 1250px;
  width: max-content;
}
.invoice-entry-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.invoice-entry-field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.invoice-entry-field input,
.invoice-entry-field select {
  width: 100%;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}
.invoice-entry-field input:focus,
.invoice-entry-field select:focus {
  outline: none;
  border-color: var(--accent);
}
.invoice-entry-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  height: 34px;
  white-space: nowrap;
}
.invoice-entry-help {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal .modal-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }

.ae-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 14px;
  background: rgba(15, 23, 42, .55);
}
.ae-create-dialog,
.ae-create-choice-dialog {
  width: min(1260px, 96vw);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d9e1e8;
  border-radius: 10px;
  background: #fff;
  color: #4b5563;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.ae-create-choice-dialog {
  width: min(900px, 96vw);
}
.ae-create-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid #e7edf3;
  background: #fff;
}
.ae-create-modal-head h3 {
  color: #2f8dcc !important;
  font-size: 24px;
  font-weight: 500 !important;
  line-height: 1.25;
}
.ae-create-title-note {
  display: inline-block;
  margin-left: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  vertical-align: baseline;
}
.ae-create-head-note {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}
.ae-create-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.ae-create-close:hover { background: #f1f5f9; }
.ae-create-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 4px;
  background: #f7f9fb;
}
.ae-create-section {
  margin: 0 0 12px;
  padding: 18px 24px 22px;
  border: 1px solid #dce3e9;
  border-radius: 9px;
  background: #fff;
}
.ae-create-section-details {
  display: block;
  padding-top: 0;
}
.ae-create-section legend {
  padding: 0 4px;
  background: #fff;
  color: #2f8dcc;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0;
}
.ae-create-section summary {
  margin: -18px -24px 16px;
  padding: 14px 24px;
  border-bottom: 1px solid #e7edf3;
  color: #2f8dcc;
  cursor: pointer;
  font-size: 19px;
  font-weight: 500;
  list-style-position: inside;
}
.ae-create-section:not([open]) summary {
  margin-bottom: 0;
  border-bottom: 0;
}
.ae-create-section-note {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}
.ae-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 70px;
  row-gap: 22px;
}
.ae-create-field {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  align-items: start;
  column-gap: 18px;
  row-gap: 6px;
  min-width: 0;
}
.ae-create-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  color: #4b5563;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
}
.ae-create-field-note {
  grid-column: 2;
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  margin-top: -2px;
}
.ae-create-input-action {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.ae-create-field > input,
.ae-create-field > select,
.ae-create-field > textarea,
.ae-create-field > .ae-create-input-action,
.ae-create-field > .ae-create-checkbox-line {
  grid-column: 2;
}
.ae-create-checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
}
.ae-create-checkbox-field .ae-create-label {
  min-height: 0;
}
.ae-create-checkbox-field input[type="checkbox"] {
  width: 17px;
  height: 17px;
  padding: 0;
  flex: 0 0 auto;
  accent-color: #2f8dcc;
}
.ae-goods-field {
  align-items: stretch;
}
.ae-goods-layout {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}
.ae-goods-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ae-goods-checks {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}
.ae-goods-checks .ae-create-checkbox-line {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  color: #374151;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}
.ae-goods-checks .ae-create-checkbox-line input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  justify-self: center;
  accent-color: #2f8dcc;
}
.ae-create-field input,
.ae-create-field select,
.ae-create-field textarea,
.ae-goods-main input,
.ae-goods-main textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 12px;
  background: #f8fafc;
  color: #1f2937;
  font-size: 15px;
  font-weight: 400;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ae-create-field select {
  color: #374151;
}
.ae-create-field input::placeholder,
.ae-create-field textarea::placeholder {
  color: #b6bdc4;
}
.ae-create-field input:focus,
.ae-create-field select:focus,
.ae-create-field textarea:focus,
.ae-goods-main input:focus,
.ae-goods-main textarea:focus {
  outline: none;
  border-color: #9fd0ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 141, 204, .12);
}
.ae-create-checkbox-field input[type="checkbox"] {
  width: 17px;
  min-width: 17px;
  height: 17px;
  padding: 0;
  box-shadow: none;
}
.ae-create-field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.35;
}
.ae-goods-main textarea {
  resize: vertical;
  min-height: 118px;
  line-height: 1.35;
}
.ae-create-field.ae-field-large textarea {
  min-height: 110px;
}
.ae-create-field.ae-agent-party-field textarea {
  min-height: 122px;
  font-size: 14px;
  line-height: 1.4;
}
.ae-create-field.ae-field-compact input {
  max-width: 100%;
}
.ae-create-section.ae-weight-section .ae-create-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  column-gap: 18px;
  row-gap: 18px;
}
.ae-create-section.ae-weight-section .ae-create-field {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 6px;
}
.ae-create-section.ae-weight-section .ae-create-label {
  min-height: 0;
  font-size: 14px;
  line-height: 1.22;
}
.ae-create-section.ae-weight-section .ae-create-field > input,
.ae-create-section.ae-weight-section .ae-create-field > select,
.ae-create-section.ae-weight-section .ae-create-field > textarea,
.ae-create-section.ae-weight-section .ae-create-field > .ae-create-input-action,
.ae-create-section.ae-weight-section .ae-create-field > .ae-create-checkbox-line,
.ae-create-section.ae-weight-section .ae-create-field-note,
.ae-create-section.ae-weight-section .ae-goods-layout {
  grid-column: 1;
}
.ae-create-section.ae-weight-section .ae-create-field input,
.ae-create-section.ae-weight-section .ae-create-field select {
  min-height: 42px;
}
.ae-create-field.ae-signature-field input,
.ae-awb-signature-input {
  font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive !important;
  font-size: 18px !important;
  line-height: 1.1;
}
.ae-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 20px;
  border-top: 1px solid #e7edf3;
  background: #fff;
}
.ae-create-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ae-create-type-btn {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.ae-create-type-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.ae-create-type-btn strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
}
.ae-create-type-btn span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.ae-create-type-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 18px !important;
  font-weight: 800;
}
.ae-create-type-copy {
  min-width: 0;
}
.ae-create-start {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr);
  gap: 14px;
  padding: 14px 16px 16px;
}
.ae-create-start-panel {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
  color: #334155;
  font-size: 12px;
}
.ae-create-start-panel strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 13px;
}
.ae-create-start-panel ol {
  margin: 0 0 10px 18px;
  padding: 0;
  line-height: 1.5;
}
.ae-create-guardrail {
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
  color: #475569;
  line-height: 1.45;
}
.ae-create-form-intro {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
}
.ae-create-form-intro strong {
  display: block;
  margin-bottom: 2px;
  color: #1e3a8a;
  font-size: 13px;
}
.ae-create-form-intro span {
  color: #334155;
}

.awb-pool-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 24px;
  background: rgba(15, 23, 42, .56);
}
.awb-pool-import-dialog {
  width: min(760px, 96vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px 24px 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .28);
}
.awb-pool-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #cbd5e1;
}
.awb-pool-import-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}
.awb-pool-import-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}
.awb-pool-import-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.awb-pool-import-close:hover { background: #f1f5f9; }
.awb-pool-import-grid,
.awb-pool-range-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.awb-pool-import-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.awb-pool-import-field span,
.awb-pool-range-title {
  color: #1e293b;
  font-size: 12px;
  font-weight: 800;
}
.awb-pool-import-field input,
.awb-pool-import-field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.awb-pool-import-field input {
  height: 36px;
  padding: 8px 10px;
}
.awb-pool-import-field textarea {
  min-height: 150px;
  padding: 10px 12px;
  resize: vertical;
}
.awb-pool-import-field input:focus,
.awb-pool-import-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .14);
}
.awb-pool-import-field input::placeholder,
.awb-pool-import-field textarea::placeholder {
  color: #94a3b8;
}
.awb-pool-range-box {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.awb-pool-range-title { margin-bottom: 10px; }
.awb-pool-range-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}
.awb-pool-generate-btn {
  height: 36px;
  white-space: nowrap;
}
.awb-pool-range-box p,
.awb-pool-number-field em {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}
.awb-pool-import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
}

/* ── TOAST ── */
#toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-pulse { animation: toastPulse .18s ease; }
@keyframes toastPulse { from { transform: scale(.98); } to { transform: scale(1); } }

/* ── LOADING ── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row td { text-align: center; padding: 32px; color: var(--text-muted); }

/* ── SUBTABS ── */
.subtabs { display: flex; gap: 8px; margin-bottom: 20px; }
.subtab-btn {
  padding: 8px 20px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: all .15s;
}
.subtab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── SEARCH ── */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 16px; align-items: center;
}
.search-bar input {
  flex: 1; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

/* ── SORT ── */
thead th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
thead th[data-sort]:hover { background: #eef2f7; }
thead th.sort-asc .sort-icon::after { content: ' ▲'; font-size:10px; }
thead th.sort-desc .sort-icon::after { content: ' ▼'; font-size:10px; }
thead th[data-sort] span { opacity: .4; font-size: 10px; }
thead th.sort-asc span, thead th.sort-desc span { opacity: 1; }
thead th.sort-asc span::before { content: '▲'; }
thead th.sort-desc span::before { content: '▼'; }

thead th[data-portal-auto-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th[data-portal-auto-sort]:hover { background: #eef2f7; }
thead th[data-portal-auto-sort] .portal-sort-indicator::after {
  content: '⇅';
  margin-left: 4px;
  color: #94a3b8;
  font-size: 10px;
}
thead th[data-portal-auto-sort].sort-asc .portal-sort-indicator::after {
  content: '▲';
  color: var(--primary);
}
thead th[data-portal-auto-sort].sort-desc .portal-sort-indicator::after {
  content: '▼';
  color: var(--primary);
}

.portal-select-combobox {
  position: relative;
  display: inline-block;
  width: auto;
  min-width: 72px;
  vertical-align: middle;
}
label > .portal-select-combobox,
.accounting-ar-filters .portal-select-combobox,
.accounting-history-filters .portal-select-combobox {
  width: 100%;
}
.portal-native-select {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.portal-select-search {
  width: 100%;
  min-height: inherit;
  padding: inherit;
  border: inherit;
  border-radius: inherit;
  background: inherit;
  color: inherit;
  font: inherit;
  font-size: inherit;
  outline: none;
}
.portal-select-search:focus {
  border-color: var(--primary, #2563eb) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}
.portal-select-list {
  display: none;
  position: absolute;
  z-index: 10050;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}
.portal-select-combobox.open .portal-select-list { display: block; }
.portal-select-option {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.portal-select-option:hover,
.portal-select-option:focus {
  background: #eff6ff;
  outline: none;
}
.portal-select-option.selected {
  background: #e0ecff;
  color: var(--primary);
  font-weight: 700;
}
.portal-select-option:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: .55;
}
.portal-select-empty {
  padding: 9px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.portal-mobile-picker {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.portal-mobile-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .44);
  opacity: 0;
  transition: opacity .18s ease;
}
.portal-mobile-picker-panel {
  position: relative;
  width: 100%;
  max-height: min(78%, 720px);
  display: flex;
  flex-direction: column;
  padding: 8px 14px max(16px, env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -18px 45px rgba(15, 23, 42, .24);
  transform: translateY(105%);
  transition: transform .2s ease;
  pointer-events: auto;
}
.portal-mobile-picker.open,
.portal-mobile-picker.open .portal-mobile-picker-backdrop {
  pointer-events: auto;
}
.portal-mobile-picker.open .portal-mobile-picker-backdrop {
  opacity: 1;
}
.portal-mobile-picker.open .portal-mobile-picker-panel {
  transform: translateY(0);
}
.portal-mobile-picker-handle {
  width: 46px;
  height: 5px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: #cbd5e1;
}
.portal-mobile-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}
.portal-mobile-picker-head strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}
.portal-mobile-picker-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.portal-mobile-picker-head button,
.portal-mobile-picker-use {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #1e40af;
  font-weight: 800;
  padding: 9px 12px;
}
.portal-mobile-picker-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
.portal-mobile-picker-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.14);
}
.portal-mobile-picker-use {
  margin-top: 8px;
  width: 100%;
  background: #fff;
}
.portal-mobile-picker-list {
  margin-top: 10px;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.portal-mobile-picker-option {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 10px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  text-align: left;
}
.portal-mobile-picker-option.selected {
  background: #f8fafc;
  color: #1e40af;
  font-weight: 800;
}
.portal-mobile-picker-option strong {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}
.portal-mobile-picker-empty {
  padding: 22px 10px;
  color: var(--text-muted);
  text-align: center;
}

/* ── EMPTY ── */
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }
.empty-state .icon { font-size: 36px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── CONFIRM ── */
.confirm-box { background: #fef9c3; border: 1px solid #fbbf24; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #air-pagination { grid-template-columns: minmax(0, 1fr) auto; }
  #air-load-more-btn {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .sp-hold-office-grid { grid-template-columns: 1fr !important; }
  .sp-hold-status-grid { grid-template-columns: 1fr !important; }
  #sidebar { width: 160px; }
  #sidebar .logo h1 { font-size: 13px; }
  #sidebar .logo p, #sidebar .sidebar-footer { display: none; }
  .portal-logo-img { max-width: 120px; padding: 6px 8px; }
  #sidebar nav { padding: 8px 0 14px; }
  #sidebar nav a .icon,
  #sidebar nav .nav-group-label .icon { font-size: 16px; width: 18px; flex-basis: 18px; }
  #sidebar nav a,
  #sidebar nav .nav-group-label { padding: 10px 9px; font-size: 13px; gap: 7px; }
  #sidebar nav a span:not(.icon),
  #sidebar nav .nav-group-label span:not(.icon):not(.nav-group-chevron) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #sidebar nav a.nav-subitem { padding-left: 34px; }
  #main { margin-left: 160px; }
  #page-airexport .section-header { align-items: stretch; flex-direction: column; gap: 10px; }
  #page-airexport .ae-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: none;
    overflow: visible;
    gap: 7px;
  }
  #page-airexport .ae-filter-row input,
  #page-airexport .ae-filter-row select,
  #page-airexport .ae-filter-row button,
  #page-airexport .ae-filter-row label {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  #page-airexport .ae-filter-row #ae-search,
  #page-airexport .ae-filter-row #ae-customer-filter,
  #page-airexport .ae-filter-row .ae-new-shipment-btn {
    grid-column: 1 / -1;
  }
  #page-airexport .ae-filter-row .ae-new-shipment-btn {
    order: -1;
    height: 38px;
    font-size: 14px;
    font-weight: 800;
  }
  #page-airexport .ae-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  #page-airexport .ae-card-head div {
    justify-content: flex-start;
  }
  #page-airexport .ae-shipment-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  #page-airexport .ae-card-awb,
  #page-airexport .ae-card-route,
  #page-airexport .ae-card-cargo {
    max-width: 100%;
  }
  #page-airexport .ae-card-status {
    justify-items: start;
  }
  #page-airexport .ae-detail-toolbar {
    display: grid;
    gap: 8px;
    padding-right: 0;
  }
  #page-airexport .ae-detail-toolbar .tabs {
    min-width: 0;
    overflow-x: auto;
  }
  #page-airexport .ae-detail-actions {
    justify-content: flex-start;
    padding-top: 0;
  }
  #page-airexport .ae-detail-main {
    grid-template-columns: 1fr;
  }
  #page-airexport .ae-detail-cargo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #page-airexport .ae-detail-main .ae-detail-panel:not(.ae-detail-cargo-panel) {
    display: block;
  }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid .stat-card:last-child { grid-column: 1 / -1; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  #page-airexport .ae-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-airexport .ae-overview-grid .ae-info-wide { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .awb-pool-import-overlay { padding: 12px; }
  .ae-create-overlay { padding: 8px; }
  .ae-create-dialog,
  .ae-create-choice-dialog {
    width: 100%;
    max-height: calc(100vh - 16px);
  }
  .ae-create-grid,
  .ae-create-type-grid {
    grid-template-columns: 1fr;
  }
  .ae-create-section {
    padding: 14px;
  }
  .ae-create-section summary {
    margin: -14px -14px 14px;
    padding: 12px 14px;
  }
  .ae-create-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .ae-create-label {
    min-height: 0;
    font-size: 14px;
  }
  .ae-create-field > input,
  .ae-create-field > select,
  .ae-create-field > textarea,
  .ae-create-field > .ae-create-input-action,
  .ae-create-field-note,
  .ae-goods-layout {
    grid-column: 1;
  }
  .ae-goods-layout {
    grid-template-columns: 1fr;
  }
  .ae-goods-checks {
    grid-template-columns: repeat(2, minmax(150px, max-content));
    justify-content: flex-start;
  }
  .ae-create-start {
    grid-template-columns: 1fr;
  }
  .ae-create-field[style*="span 2"],
  .ae-create-field[style*="span 3"],
  .ae-create-field[style*="span 4"] {
    grid-column: span 1 !important;
  }
  .awb-pool-import-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }
  .awb-pool-import-grid,
  .awb-pool-range-row {
    grid-template-columns: 1fr;
  }
  .awb-pool-generate-btn {
    width: 100%;
    justify-content: center;
  }
  #content { padding: 16px; }
}

/* ── LAST MILE ── */
.lastmile-card { overflow: hidden; }
.lastmile-form { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.lastmile-form h4 { margin-top: 4px; font-size: 13px; color: var(--navy); border-top: 1px solid var(--border); padding-top: 12px; }
.lastmile-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.lastmile-form input, .lastmile-form textarea, .lastmile-form select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); background: #fff;
}
.lastmile-form input:focus, .lastmile-form textarea:focus, .lastmile-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(249,115,22,.12); }
.lastmile-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.lastmile-two label { min-width: 0; }
.lastmile-three { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 10px; }
.lastmile-four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lastmile-package-main-row { display: grid; grid-template-columns: minmax(180px, 1fr); gap: 10px; align-items: end; }
.lastmile-package-summary { display:flex; align-items:center; gap:28px; min-height:42px; margin-top:2px; padding:9px 10px; border-top:1px solid var(--border); }
.lastmile-package-summary > div { display:flex; flex-direction:column; gap:2px; }
.lastmile-package-summary span { color:var(--text-muted); font-size:12px; font-weight:600; }
.lastmile-package-summary strong { color:var(--navy); font-size:17px; line-height:1.2; }
.lastmile-package-summary strong span { color:inherit; font-size:inherit; font-weight:inherit; }
.lastmile-dim-row { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; align-items: end; }
.lastmile-package-builder { container:package-builder / inline-size; border:1px solid var(--border); border-radius:10px; padding:12px; background:#f8fafc; }
.lastmile-package-builder-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; color:var(--navy); font-size:13px; }
.lastmile-package-entry { display:grid; grid-template-columns:34px 62px repeat(4,minmax(82px,1fr)) 34px; gap:6px; align-items:end; min-width:600px; padding:8px; margin-bottom:8px; background:#fff; border:1px solid var(--border); border-radius:8px; }
.lastmile-package-entry-index { align-self:center; font-weight:800; color:var(--navy); }
.lastmile-package-entry label { min-width:0; }
.lastmile-package-entry input { width:100%; min-width:0; padding:7px 6px; }
.lastmile-package-remove { width:34px; height:34px; padding:0 !important; color:var(--danger); align-items:center; justify-content:center; text-align:center; line-height:1; }
#lm-package-rows { overflow:visible; }
@container package-builder (max-width:700px) {
  .lastmile-package-entry {
    grid-template-columns:52px repeat(3,minmax(0,1fr));
    grid-template-areas:
      "number qty weight weight"
      "remove length width height";
    min-width:0;
  }
  .lastmile-package-entry-index { grid-area:number; align-self:end; justify-self:center; padding-bottom:9px; }
  .lm-package-qty-field { grid-area:qty; }
  .lm-package-weight-field { grid-area:weight; }
  .lm-package-length-field { grid-area:length; }
  .lm-package-width-field { grid-area:width; }
  .lm-package-height-field { grid-area:height; }
  .lastmile-package-remove { grid-area:remove; justify-self:center; }
}
.lastmile-international-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: #f8fafc; margin-top: 8px; }
.lastmile-international-box h4 { border-top: 0; padding-top: 0; margin: 0 0 10px; font-size: 13px; color: var(--navy); }
.lastmile-intl-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(110px, .62fr) minmax(0, 1.05fr); gap: 12px; align-items: end; margin-bottom: 10px; }
.lastmile-intl-grid-two { grid-template-columns: 1fr 1fr; }
.lastmile-intl-grid label { min-width: 0; }
.lastmile-intl-grid input, .lastmile-intl-grid select { min-height: 42px; }
.lastmile-package-row { display: grid; grid-template-columns: minmax(150px,1.2fr) minmax(86px,.65fr) minmax(130px,.95fr) repeat(3, minmax(86px,.62fr)); gap: 12px; align-items: end; }
.lastmile-package-row label { min-width: 0; }
.lastmile-package-row input, .lastmile-package-row select { padding: 7px 8px; min-width: 0; width: 100%; font-size: 13px; }
.lastmile-check { flex-direction: row !important; align-items: center; font-weight: 600 !important; }
.lastmile-check input { width: auto; }
.lastmile-status { min-height: 18px; font-size: 12px; color: var(--text-muted); }
.lastmile-status.error { color: var(--error); font-weight: 700; }
.lastmile-status.success { color: var(--success); font-weight: 700; }
.lm-batch-rate-select { min-width: 285px; max-width: 420px; width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px; }
.lm-batch-customer-select { width:110px; max-width:110px; height:28px; padding:2px 22px 2px 5px; border:1px solid var(--border); border-radius:5px; font-size:10px; }
.lm-batch-reference-cell { width:100px; min-width:100px; max-width:115px; }
.lm-batch-reference-line { white-space:nowrap; line-height:1.55; }
.lm-batch-control-row { grid-template-columns:minmax(260px,1.4fr) minmax(180px,.7fr) minmax(220px,1fr); }
.lastmile-json { margin:0; padding:16px; min-height:520px; max-height:720px; overflow:auto; background:#0f172a; color:#cbd5e1; font-size:12px; line-height:1.45; white-space:pre-wrap; border-radius:0 0 8px 8px; }
.lastmile-help { color: var(--text-muted); font-size: 12px; line-height: 1.45; background:#f8fafc; border:1px solid var(--border); border-radius:6px; padding:10px; }
.lastmile-rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.lastmile-rate-grid label { display: grid; grid-template-columns: 1fr 92px 92px; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; }
.lastmile-rate-grid span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 700; display:flex; flex-direction:column; gap:2px; }
.lastmile-dropbox { border:2px dashed var(--border); border-radius:10px; padding:16px; text-align:center; cursor:pointer; background:#f8fafc; color:var(--text-muted); transition:.15s; }
.lastmile-dropbox:hover, .lastmile-dropbox.drag { border-color:var(--accent); background:#f8fafc; color:var(--text); }
@media (max-width: 1100px) {
  #page-lastmile > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 820px) {
  .lastmile-package-row { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}
@media (max-width: 720px) {
  .lastmile-two, .lastmile-three, .lastmile-four, .lastmile-package-main-row, .lastmile-dim-row, .lastmile-intl-grid, .lastmile-intl-grid-two, .lastmile-package-row { grid-template-columns: 1fr; }
  .lastmile-rate-grid { grid-template-columns: 1fr; }
}

.lastmile-lookup-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  max-height: 260px;
  overflow: auto;
  margin-top: -8px;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.lastmile-lookup-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.lastmile-lookup-item:last-child { border-bottom: none; }
.lastmile-lookup-item:hover { background: var(--hover-bg, #f3f4f6); }
.lastmile-lookup-item strong { display:block; }
.lastmile-lookup-item span { color: var(--text-muted); font-size: 12px; }

.erp-customer-field { position: relative; }
.erp-customer-results {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  z-index: 1200;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
}
.erp-customer-result {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.erp-customer-result:last-child { border-bottom: 0; }
.erp-customer-result:hover { background: #eff6ff; }
.erp-customer-result strong { display: block; color: var(--text); }
.erp-customer-result span { color: var(--text-muted); font-size: 11px; }

.portal-action-status {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.portal-action-status-box {
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 420px;
  padding: 18px 22px;
  border-radius: 14px;
  background: var(--card-bg, #fff);
  box-shadow: 0 18px 55px rgba(15, 23, 42, .28);
  border: 1px solid var(--border);
}
.portal-action-status-box strong { display:block; font-size:15px; margin-bottom:4px; }
.portal-action-status-box p { margin:0; color:var(--text-muted); font-size:12px; }
.portal-action-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, .25);
  border-top-color: var(--primary, #2563eb);
  animation: spin .75s linear infinite;
  flex: 0 0 auto;
}
button.portal-action-busy {
  opacity: .68;
  cursor: wait !important;
}

.table-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.table-sort-btn:hover { color: var(--primary); text-decoration: underline; }

.shipment-company-name {
  display: -webkit-box;
  width: 100%;
  max-width: 220px;
  max-height: 2.7em;
  overflow: hidden;
  line-height: 1.35;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.subtab-btn .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}

.subtab-btn:not(.active) .tab-count {
  background: var(--bg-secondary);
  color: var(--text-muted);
}
.lm-shipment-expand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.lm-shipment-expand:hover strong { color: var(--primary); text-decoration: underline; }
.lm-shipment-expand-icon { width: 10px; color: var(--primary); font-size: 9px; }
.lm-shipment-detail-row > td { padding: 0 !important; background: #f8fafc; }
.lm-shipment-detail-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 2fr;
  gap: 18px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lm-shipment-address { line-height: 1.55; color: var(--text); }
.lm-shipment-address > span,
.lm-shipment-detail-grid span,
.lm-shipment-note > span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}
.lm-shipment-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 14px 18px; }
.lm-shipment-detail-grid strong { display: block; font-size: 13px; }
.lm-shipment-note { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 1000px) {
  .lm-shipment-detail-panel { grid-template-columns: 1fr 1fr; }
  .lm-shipment-detail-grid { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .lm-shipment-detail-panel { grid-template-columns: 1fr; }
  .lm-shipment-detail-grid { grid-column: auto; grid-template-columns: repeat(2, minmax(90px, 1fr)); }
}

.accounting-ar-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
}
.accounting-ar-views {
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: #fbfcfe;
}
.accounting-ar-views h3 { margin: 0 4px 20px; font-size: 17px; }
.accounting-ar-view-group + .accounting-ar-view-group { margin-top: 26px; }
.accounting-ar-view-label {
  margin: 0 8px 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.accounting-ar-view {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}
.accounting-ar-view:hover { background: #eef5ff; }
.accounting-ar-view.active { background: #e5f1ff; color: var(--primary); font-weight: 700; }
.accounting-ar-view strong { color: var(--primary); font-size: 12px; }
.accounting-ar-view-group p {
  margin: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.accounting-ar-main { min-width: 0; }
.accounting-ar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 14px;
}
.accounting-ar-header h3 { margin: 0; font-size: 18px; }
.accounting-ar-header p { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.accounting-upload-dropzone {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 280px;
  min-height: 96px;
  padding: 16px 18px;
  border: 2px dashed var(--primary);
  border-radius: 7px;
  background: #eff6ff;
  color: var(--primary);
  cursor: pointer;
  text-align: center;
}
.accounting-upload-dropzone:hover,
.accounting-upload-dropzone.dragging {
  border-color: var(--primary);
  background: #eff6ff;
}
.accounting-upload-dropzone span {
  color: var(--text-muted);
  font-size: 12px;
}
.accounting-upload-dropzone small {
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
}
.accounting-ap-review {
  margin: 0 22px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.accounting-ap-review.qb-bank-picker-review {
  overflow: visible;
}
.qb-bank-picker-row {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(360px, 560px) auto;
  gap: 12px;
  align-items: end;
}
.qb-bank-picker-label {
  position: relative;
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.qb-bank-picker-label label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.qb-bank-picker-input {
  width: 100%;
  margin-top: 4px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.qb-bank-picker-input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}
.qb-bank-picker-list {
  display: none;
  position: absolute;
  z-index: 20000;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
}
.qb-bank-picker-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.qb-bank-picker-option:last-child { border-bottom: 0; }
.qb-bank-picker-option:hover,
.qb-bank-picker-option:focus {
  background: #eff6ff;
  outline: none;
}
.qb-bank-picker-option.selected {
  background: #dbeafe;
  color: var(--primary, #2563eb);
}
.qb-bank-picker-option:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: .7;
}
.accounting-ap-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.accounting-ap-review-head h4 { margin: 0; font-size: 14px; }
.accounting-ap-review-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.accounting-ap-review table { width: 100%; font-size: 12px; }
.accounting-ap-review input,
.accounting-ap-review select {
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
}
.accounting-reconcile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(210px, auto);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.accounting-reconcile-total {
  display: grid;
  gap: 3px;
  min-height: 56px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background: #f8fafc;
}
.accounting-reconcile-total span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.accounting-reconcile-total strong {
  color: var(--text);
  font-size: 16px;
}
.accounting-reconcile-total-diff {
  border-color: var(--reconcile-diff-color);
  background: #fff;
}
.accounting-reconcile-total-diff strong { color: var(--reconcile-diff-color); }
.accounting-reconcile-counts {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
}
.accounting-reconcile-counts span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.accounting-ar-filters {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(220px, 1fr) repeat(3, minmax(130px, 170px)) auto;
  gap: 12px;
  align-items: end;
  padding: 0 22px 14px;
}
.accounting-ar-filters label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.accounting-ar-filters select,
.accounting-ar-filters input,
.accounting-ar-reference {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.accounting-ar-unpaid-total {
  min-width: 145px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.accounting-ar-actions {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 9px 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex-wrap: nowrap;
}
.accounting-ar-actions > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.accounting-ar-actions .btn,
.accounting-ar-actions label,
.accounting-ar-actions input,
.accounting-ar-actions .portal-select-combobox {
  flex: 0 0 auto;
}
.accounting-ar-email-box {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}
.accounting-ar-email-box .portal-select-combobox {
  width: 224px;
}
.accounting-ar-email-box .accounting-ar-action-select {
  border-color: #bfdbfe;
  border-radius: 6px 0 0 6px;
  min-width: 184px;
}
.accounting-ar-isc-option {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.accounting-ar-isc-option input {
  width: 15px;
  height: 15px;
}
.invoice-email-ai-pdf-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid #d97706;
  border-radius: 6px;
  background: #f8fafc;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.invoice-email-ai-pdf-option input {
  width: 15px;
  height: 15px;
}
.accounting-ar-email-box .btn {
  min-height: 34px;
  border-radius: 0 6px 6px 0;
  white-space: nowrap;
}
.accounting-ar-email-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 1px 0 rgba(15, 118, 110, .18);
}
.accounting-ar-email-primary:hover:not(:disabled) {
  background: #115e59;
  border-color: #115e59;
}
.accounting-ar-action-select {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.accounting-ar-select-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
#accounting-ar-selection,
#accounting-ap-selection,
#accounting-ap-payment-selection {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  flex: 0 0 auto;
}
.portal-select-all-header {
  width: 34px;
  min-width: 34px;
  text-align: center;
}
.portal-table-select-all-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}
.portal-table-select-all-label input {
  width: 18px;
  height: 18px;
}
table input[type="checkbox"],
.accounting-ar-select-all input[type="checkbox"],
.portal-table-select-all-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: #1a73e8;
  cursor: pointer;
}
.accounting-ar-status { min-height: 0; padding: 0 22px; color: var(--text-muted); font-size: 12px; }
.accounting-ar-status:not(:empty) { padding-top: 10px; padding-bottom: 10px; }
.accounting-ar-table-wrap {
  max-height: max(610px, calc(100vh - 285px));
  overflow: auto;
}
.accounting-ar-table-wrap table { min-width: 1080px; }
.accounting-ar-table-wrap td { vertical-align: middle; }
.accounting-ar-invoice-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
}
.accounting-ar-line-list { max-width: 250px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.accounting-ap-lines-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  max-width: 290px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}
.accounting-ap-lines-toggle span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.accounting-ap-lines-toggle strong { white-space: nowrap; color: var(--primary); }
.accounting-ap-lines-row > td { background: #f8fafc; padding: 10px 16px; }
.accounting-ap-line-detail { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.accounting-ap-line-detail table { min-width: 720px; }
.accounting-ap-line-detail th,
.accounting-ap-line-detail td { padding: 8px 10px; font-size: 12px; }
.accounting-ap-lines-loading {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}
.accounting-ar-email-ready { color: var(--success); font-size: 12px; font-weight: 700; }
.accounting-ar-email-missing { color: var(--danger); font-size: 12px; font-weight: 700; }
.accounting-ar-profit-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.accounting-ar-profit-ok { color: var(--text-muted); font-size: 12px; }
.accounting-profit-warning-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.accounting-history-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 135px 165px 150px 150px 170px 82px minmax(205px, auto);
  gap: 8px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.accounting-history-filters label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.accounting-history-filters input,
.accounting-history-filters select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.accounting-history-filters > .btn {
  min-height: 34px;
  white-space: nowrap;
}
.accounting-history-filters > span {
  align-self: center;
  white-space: nowrap;
}
.accounting-history-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 6px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
.accounting-history-table-wrap {
  max-height: max(610px, calc(100vh - 265px));
  overflow: auto;
}
.accounting-history-table-wrap table { min-width: 1120px; }
.accounting-history-linked-list {
  display: flex;
  max-width: 360px;
  flex-wrap: wrap;
  gap: 5px;
}
.accounting-history-linked {
  display: inline-flex;
  max-width: 170px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 950px) {
  .accounting-ar-shell { grid-template-columns: 1fr; }
  .accounting-ar-views {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .accounting-ar-views h3,
  .accounting-ar-view-label,
  .accounting-ar-view-group:nth-of-type(2) { display: none; }
  .accounting-ar-view-group { display: flex; margin: 0 !important; }
  .accounting-ar-view { width: auto; white-space: nowrap; }
  .accounting-ar-filters { grid-template-columns: 1fr 1fr; }
  .accounting-reconcile-summary { grid-template-columns: 1fr 1fr; }
  .accounting-history-filters { grid-template-columns: minmax(260px, 1fr) 135px 165px 150px 150px 170px 82px minmax(205px, auto); }
  .accounting-ar-unpaid-total { grid-column: 1 / -1; }
  .accounting-reconcile-counts { grid-column: 1 / -1; }
  .accounting-history-summary { grid-column: 1 / -1; }
  .accounting-ar-actions { align-items: center; flex-wrap: nowrap; }
  .accounting-ar-actions > div { flex-wrap: nowrap; }
}

/* ── Accounting Aging Charts ─────────────────────────────────────── */
.aging-chart-wrapper { padding: 12px 16px 0; }
.aging-chart { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
.aging-chart-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px; }
.aging-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.aging-bar-label { width: 80px; flex-shrink: 0; color: var(--text-muted); font-size: 11px; }
.aging-bar-track { flex: 1; background: var(--border); border-radius: 4px; height: 12px; overflow: hidden; }
.aging-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.aging-bar-amount { width: 160px; text-align: right; flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text); }

/* ── Dashboard Departures Widget ─────────────────────────────────── */
.departures-widget-wrap { padding: 0 0 4px; }
.departure-date-group { border-bottom: 1px solid var(--border); padding: 8px 16px; }
.departure-date-group:last-child { border-bottom: none; }
.departure-date-header { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.departure-today { background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.departure-soon { background: #f59e0b; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.departure-upcoming { background: var(--navy-light, #243360); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.departure-count { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.departure-rows { display: flex; flex-direction: column; gap: 3px; }
.departure-row { display: flex; gap: 12px; font-size: 12px; color: var(--text); padding: 2px 0; }
.departure-fileno { font-weight: 700; min-width: 90px; color: var(--navy, #1a2744); }
.departure-customer { flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.departure-route { min-width: 100px; font-weight: 600; color: var(--text); }

/* ── Air Import Linked HAWBs ─────────────────────────────────────── */
.linked-hawbs-section { margin: 8px 0; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px; padding: 8px 12px; }
.linked-hawbs-title { font-size: 11px; font-weight: 700; color: #0369a1; margin-bottom: 6px; }
.linked-hawbs-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.linked-hawbs-table th { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 3px 6px; border-bottom: 1px solid #bae6fd; text-align: left; }
.linked-hawbs-table td { padding: 4px 6px; border-bottom: 1px solid #e0f2fe; }
.linked-hawbs-table tr:last-child td { border-bottom: none; }
.linked-hawbs-table tr:hover { background: #e0f2fe; }

/* ── Aging chart inside sidebar ──────────────────────────────────── */
.accounting-ar-views .aging-chart-wrapper { padding: 0; }
.accounting-ar-views .aging-chart { padding: 10px 10px; }
.accounting-ar-views .aging-bar-row { gap: 5px; margin-bottom: 5px; }
.accounting-ar-views .aging-bar-label { width: 68px; font-size: 10px; }
.accounting-ar-views .aging-bar-amount { width: auto; min-width: 0; font-size: 10px; text-align: left; }
