/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --navy:      #0d1f3c;
  --blue:      #1a4b8c;
  --blue-mid:  #2563b0;
  --blue-lt:   #dbeafe;
  --accent:    #e8a020;
  --accent-dk: #c48010;
  --green:     #1a7a3c;
  --green-lt:  #d1fae5;
  --red:       #c0392b;
  --light:     #f0f4fa;
  --border:    #ccd6e8;
  --border-dk: #9aafc8;
  --text:      #1a1a2e;
  --muted:     #6278a0;
  --white:     #ffffff;
  --shadow:    0 2px 8px rgba(13,31,60,.14);
  --radius:    6px;
  --radius-lg: 10px;
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #dde4f0;
  overflow: hidden;
}

/* ============================================================
   LAYOUT
============================================================ */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Header */
.app-header {
  background: var(--navy);
  color: var(--white);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  flex-shrink: 0;
  z-index: 200;
}
.header-brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 1.25rem; font-weight: 900; letter-spacing: -.3px; }
.brand-name em { color: var(--accent); font-style: normal; }
.brand-sub { font-size: .72rem; color: #8fa8cc; letter-spacing: .3px; }
.header-nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Section nav tabs */
.section-nav {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 0 16px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.snav-btn {
  background: none;
  border: none;
  color: #8fa8cc;
  padding: 8px 14px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  letter-spacing: .3px;
}
.snav-btn:hover  { color: var(--white); }
.snav-btn.active { color: var(--white); border-bottom-color: var(--accent); }

/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: 440px 1fr;
  flex: 1;
  overflow: hidden;
}

/* Form Panel */
.form-panel {
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding-bottom: 48px;
}
.form-panel::-webkit-scrollbar { width: 4px; }
.form-panel::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 10px; }

/* Preview Panel */
.preview-panel {
  background: #cdd6ea;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 40px;
}
.preview-panel::-webkit-scrollbar { width: 5px; }
.preview-panel::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 10px; }

.preview-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #6b7a9a;
  margin-bottom: 14px;
  align-self: flex-start;
}

/* ── ZOOM TOOLBAR ──────────────────────────────────────────── */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-bottom: 14px;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.zoom-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border-dk);
  border-radius: 5px;
  background: var(--white);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s, transform .08s;
  user-select: none;
}
.zoom-btn:hover  { background: var(--blue-lt); border-color: var(--blue-mid); }
.zoom-btn:active { transform: scale(.92); background: var(--blue); color: var(--white); }
.zoom-display {
  min-width: 44px;
  text-align: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--border-dk);
  border-radius: 5px;
  padding: 4px 6px;
  font-family: 'Segoe UI', monospace;
  letter-spacing: .5px;
}
.zoom-fit {
  padding: 4px 9px;
  border: 1.5px solid var(--border-dk);
  border-radius: 5px;
  background: var(--white);
  color: var(--navy);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.zoom-fit:hover { background: var(--blue-lt); border-color: var(--blue-mid); }
.zoom-hint {
  font-size: .65rem;
  color: #8898bb;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover  { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--accent);     color: var(--navy); }
.btn-secondary { background: var(--blue-mid);   color: var(--white); }
.btn-ghost     { background: rgba(255,255,255,.12); color: var(--white); border: 1px solid rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-danger    { background: var(--red);         color: var(--white); padding: 3px 9px; font-size: .75rem; border: none; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { opacity: .85; }
.btn-icon      { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px 6px; font-size: .85rem; }
.btn-icon:hover { color: var(--red); }

.btn-add {
  width: 100%;
  background: var(--light);
  color: var(--blue);
  border: 1.5px dashed var(--blue-mid);
  border-radius: var(--radius);
  padding: 9px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  margin-top: 6px;
}
.btn-add:hover { background: var(--blue-lt); }
.btn-add.delivery { color: var(--green); border-color: var(--green); }
.btn-add.delivery:hover { background: var(--green-lt); }

/* ============================================================
   FORM ELEMENTS
============================================================ */
.form-section { padding: 18px 20px 14px; }
.form-section.hidden { display: none; }

.section-heading {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--blue);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue-lt);
}
.subsection-heading {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 14px 0 8px;
}
.section-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-end;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fg-grow { flex: 1 1 0; }

label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  white-space: nowrap;
}
.req { color: var(--red); }

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: .82rem;
  color: var(--text);
  background: var(--white);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 2px rgba(37,99,176,.15);
}
textarea { resize: vertical; min-height: 58px; }
select { appearance: auto; }

.input-addon {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-addon:focus-within {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 2px rgba(37,99,176,.15);
}
.input-addon input {
  border: none;
  border-radius: 0;
  flex: 1;
}
.input-addon input:focus { box-shadow: none; }
.addon-btn {
  background: var(--light);
  border: none;
  border-left: 1px solid var(--border);
  padding: 0 10px;
  cursor: pointer;
  color: var(--blue);
  font-size: .8rem;
  font-weight: 700;
  transition: background .15s;
}
.addon-btn:hover { background: var(--blue-lt); }
.addon-prefix {
  background: var(--light);
  border-right: 1px solid var(--border);
  padding: 0 9px;
  display: flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}

/* Toggle / Checkbox */
.toggle-row { margin-bottom: 10px; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}
.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  transition: all .15s;
}
.radio-item:has(input:checked) {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.radio-item input { display: none; }

/* ============================================================
   STOP CARDS
============================================================ */
.stop-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stop-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--navy);
  color: var(--white);
}
.stop-header.delivery-hdr { background: #0f4d2a; }
.stop-num {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .5px;
  background: var(--accent);
  color: var(--navy);
  padding: 2px 8px;
  border-radius: 20px;
}
.stop-num.delivery { background: #4ade80; color: #052e16; }
.stop-type-toggle {
  display: flex;
  gap: 4px;
}
.stop-type-btn {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  background: transparent;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  transition: all .15s;
}
.stop-type-btn.active     { background: var(--accent); color: var(--navy); border-color: var(--accent); }
.stop-type-btn.active.del { background: #4ade80; color: #052e16; border-color: #4ade80; }
.stop-remove { margin-left: auto; }
.stop-body { padding: 12px; background: #fbfcff; }

.stop-add-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.stop-add-btns .btn-add { margin-top: 0; }

/* ============================================================
   FREIGHT TABLE IN FORM
============================================================ */
.freight-row-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  padding: 10px;
  position: relative;
}
.freight-row-card .fr-remove {
  position: absolute;
  top: 8px;
  right: 8px;
}
.freight-row-num {
  font-size: .67rem;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.freight-totals {
  display: flex;
  gap: 20px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-top: 10px;
}
.total-item { font-size: .8rem; }
.total-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: #8fa8cc; margin-right: 4px; }

/* ============================================================
   HAZMAT
============================================================ */
.alert-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid #e8a020;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: .78rem;
  line-height: 1.5;
  color: #5a3e00;
  margin-bottom: 14px;
}

.hazmat-line-card {
  background: #fff5f5;
  border: 1px solid #f5c6c6;
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}
.hazmat-line-card .hz-remove {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* ============================================================
   ACCESSORIALS
============================================================ */
.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.acc-group-title {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--blue);
  margin-bottom: 7px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--blue-lt);
}
.acc-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  cursor: pointer;
  padding: 3px 0;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}
.acc-item input { width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }

/* ============================================================
   MODAL
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,31,60,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 360px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h3 { font-size: .95rem; font-weight: 800; margin-bottom: 16px; color: var(--navy); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.draft-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
}
.draft-item:hover { background: var(--light); }
.draft-name { font-weight: 700; font-size: .85rem; flex: 1; }
.draft-date { font-size: .72rem; color: var(--muted); }

/* ============================================================
   UTILITY
============================================================ */
.hidden { display: none !important; }

/* ============================================================
   BOL DOCUMENT (screen preview)
============================================================ */
.bol-doc {
  background: var(--white);
  width: 8.5in;
  min-height: 11in;
  box-shadow: 0 4px 28px rgba(0,0,0,.2);
  border-radius: 3px;
  padding: .45in .45in .4in;
  font-family: 'Arial', 'Helvetica Neue', sans-serif;
  font-size: 8pt;
  color: #0d0d1a;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* BOL: Top header */
.bol-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 7px;
  margin-bottom: 7px;
}
.bol-co-name {
  font-size: 18pt;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -.4px;
}
.bol-co-sub   { font-size: 7pt; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.bol-co-mc    { font-size: 6.5pt; color: var(--muted); margin-top: 1px; }
.bol-title-block { text-align: right; }
.bol-title    { font-size: 16pt; font-weight: 900; color: var(--navy); text-transform: uppercase; letter-spacing: .8px; line-height: 1; }
.bol-not-neg  { font-size: 6.5pt; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* BOL: Meta strip */
.bol-meta-strip {
  display: flex;
  gap: 0;
  margin-bottom: 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.bol-meta-cell {
  flex: 1;
  padding: 4px 8px;
  border-right: 1px solid var(--border);
}
.bol-meta-cell:last-child { border-right: none; }
.bol-meta-cell .lbl { font-size: 6pt; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.bol-meta-cell .val { font-size: 8.5pt; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* BOL: Carrier bar */
.bol-carrier-bar {
  background: var(--navy);
  color: var(--white);
  border-radius: 3px;
  padding: 5px 8px;
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 7px;
}
.bol-cb-cell .lbl { font-size: 5.5pt; color: #8fa8cc; text-transform: uppercase; letter-spacing: .4px; }
.bol-cb-cell .val { font-size: 8pt; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* BOL: References strip */
.bol-refs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  padding: 5px 8px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 7px;
}
.bol-ref-item { font-size: 7pt; }
.bol-ref-item .lbl { font-size: 6pt; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-right: 3px; }
.bol-ref-item .val { font-weight: 700; }

/* BOL: Stops section */
.bol-stops-section { margin-bottom: 7px; }
.bol-section-hdr {
  font-size: 6.5pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue);
  border-bottom: 1.5px solid var(--blue);
  padding-bottom: 2px;
  margin-bottom: 4px;
}
.bol-stop {
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 4px;
  overflow: hidden;
}
.bol-stop:last-child { margin-bottom: 0; }
.bol-stop-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px;
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bol-stop-hdr.pickup   { background: var(--navy);  color: var(--white); }
.bol-stop-hdr.delivery { background: #0f4d2a;      color: var(--white); }
.bol-stop-hdr.both     { background: #5b3a00;      color: var(--white); }
.bol-stop-badge {
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 6pt;
  font-weight: 800;
}
.bol-stop-hdr.pickup   .bol-stop-badge { background: var(--accent); color: var(--navy); }
.bol-stop-hdr.delivery .bol-stop-badge { background: #4ade80;       color: #052e16; }
.bol-stop-hdr.both     .bol-stop-badge { background: #fde68a;       color: #5b3a00; }
.bol-stop-meta { margin-left: auto; font-size: 6.5pt; font-weight: 400; opacity: .85; }

.bol-stop-body {
  display: grid;
  grid-template-columns: 1.8fr 1.8fr 1fr 1fr;
  gap: 5px;
  padding: 5px 7px;
  background: #fafbfd;
}
.bol-sf .lbl { font-size: 5.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.bol-sf .val { font-size: 7.5pt; font-weight: 600; margin-top: 1px; line-height: 1.35; min-height: 10px; }
.bol-sf-full { grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 3px; }

/* BOL: Per-stop signature row */
.bol-stop-sig {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  gap: 8px;
  padding: 5px 7px 6px;
  border-top: 1px dashed var(--border-dk);
  background: #f3f6fb;
}
.bol-ssi-notes { grid-column: 1 / -1; }  /* full-width notes line */
.bol-ssi-notes .ssi-line { margin-top: 10px; }
.ssi-lbl {
  font-size: 5.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--muted);
  margin-bottom: 1px;
}
.ssi-line {
  border-bottom: 1px solid #555;
  margin-top: 20px;
}

/* BOL: Carrier signature row (bottom, spans 2 cols) */
.bol-carrier-sig-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}

/* BOL: Single exceptions row spanning full width */
.bol-exceptions-row {
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: 2px;
  padding: 5px 8px 7px;
  margin-bottom: 7px;
  background: #fafbfd;
}
.bol-exceptions-row .ssi-lbl { color: var(--navy); font-size: 6pt; }
.bol-exceptions-row .ssi-line { border-bottom: 1px solid #666; margin-top: 16px; }

/* BOL: Freight table */
.bol-freight-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
  margin-bottom: 7px;
}
.bol-freight-tbl th {
  background: var(--light);
  color: var(--muted);
  font-size: 6pt;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 700;
  padding: 4px 5px;
  border: 1px solid var(--border);
  text-align: left;
}
.bol-freight-tbl td {
  padding: 4px 5px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.bol-freight-tbl tr:nth-child(even) td { background: #f8fafd; }
.bol-freight-tbl .total-row td { background: var(--light); font-weight: 700; border-top: 2px solid var(--border-dk); }
.haz-badge { background: var(--red); color: #fff; padding: 1px 5px; border-radius: 2px; font-size: 5.5pt; font-weight: 800; display: inline-block; }

/* BOL: Bottom section */
.bol-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 7px;
}
.bol-box {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 8px;
}
.bol-box-title {
  font-size: 6pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--blue);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--blue-lt);
}
.terms-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.chk-item { display: flex; align-items: center; gap: 5px; font-size: 8pt; font-weight: 600; }
.chk-box {
  width: 10px; height: 10px;
  border: 1.5px solid var(--navy);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chk-box.checked::after { content: '✓'; font-size: 7.5pt; color: var(--navy); line-height: 1; }

.acc-list { font-size: 7pt; line-height: 1.6; color: #333; }
.special-text { font-size: 7.5pt; margin-top: 4px; min-height: 20px; line-height: 1.4; color: var(--text); }

/* BOL: Hazmat statement */
.bol-hazmat-stmt {
  border: 1px solid #f5c6c6;
  border-left: 3px solid var(--red);
  border-radius: 2px;
  background: #fff8f8;
  padding: 4px 7px;
  font-size: 6.5pt;
  color: #5a0000;
  margin-bottom: 7px;
  line-height: 1.4;
}

/* BOL: Bill To box (when third party) */
.bol-billto {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 4px 7px;
  background: #fffbf0;
  border-left: 3px solid var(--accent);
  margin-bottom: 7px;
  font-size: 7.5pt;
}

/* BOL: Carrier acknowledgement block */
.bol-sig-block .lbl { font-size: 5.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.bol-sig-line { border-top: 1.5px solid var(--navy); margin-top: 26px; padding-top: 3px; }
.bol-sig-detail { font-size: 6pt; color: var(--muted); margin-top: 3px; border-top: 1px solid var(--border); padding-top: 2px; }

/* BOL: Footer */
.bol-footer {
  margin-top: auto;
  border-top: 1.5px solid var(--border);
  padding-top: 5px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.bol-legal {
  font-size: 5.5pt;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}
.bol-stamp { text-align: right; font-size: 6pt; color: var(--muted); white-space: nowrap; }

/* ============================================================
   DRAG-AND-DROP STOP REORDERING
============================================================ */
.drag-grip {
  color: rgba(255,255,255,.5);
  font-size: .9rem;
  letter-spacing: -3px;
  cursor: grab;
  padding: 0 6px 0 0;
  user-select: none;
  flex-shrink: 0;
}
.drag-grip:active { cursor: grabbing; }
.stop-card.drag-over {
  outline: 2.5px dashed var(--accent);
  outline-offset: 2px;
  background: rgba(232,160,32,.06);
}
.stop-card.dragging {
  opacity: .4;
  pointer-events: none;
}

/* ============================================================
   MOBILE TAB BAR (hidden on desktop)
============================================================ */
.mobile-tab-bar { display: none; }

/* ============================================================
   RESPONSIVE — TABLET & MOBILE  (≤ 900px)
============================================================ */
@media (max-width: 900px) {

  /* Show mobile tab bar */
  .mobile-tab-bar {
    display: flex;
    background: #0b1930;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
  }
  .mobile-tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: #8fa8cc;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
    letter-spacing: .3px;
  }
  .mobile-tab.active {
    color: var(--white);
    border-bottom-color: var(--accent);
  }

  /* Section nav: bigger tap targets */
  .snav-btn { padding: 10px 14px; font-size: .82rem; }

  /* Header: compact on mobile */
  .app-header { padding: 0 12px; height: 48px; }
  .brand-sub   { display: none; }
  .header-nav .btn-ghost { display: none; } /* hide secondary actions */
  .header-nav .btn-secondary { display: none; }
  /* Keep print button visible but compact */
  .header-nav .btn-secondary:last-child { display: flex; }

  /* Single-column workspace */
  .workspace {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  /* Form panel: full width, scrollable */
  .form-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: 100%;
  }

  /* Preview panel: hidden until tab switch */
  .preview-panel {
    display: none;
    width: 100%;
    height: 100%;
    padding: 16px 12px 32px;
    overflow: auto;
  }
  .preview-panel.mobile-active { display: flex; }

  /* Form hidden when preview tab active */
  .form-panel.mobile-hidden { display: none; }
  .section-nav.mobile-hidden { display: none; }

  /* Preview toolbar stacks on small screens */
  .preview-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .zoom-hint { display: none; }

  /* Larger touch targets for form inputs */
  input[type="text"],
  input[type="date"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    padding: 10px;
  }

  /* Accessorials: single column */
  .acc-grid { grid-template-columns: 1fr; }

  /* Field rows wrap on very small screens */
  .field-row { flex-wrap: wrap; }
  .field-group[style*="width"] { width: 100% !important; }
  .fg-grow { min-width: 120px; }

  /* Stop cards: full width */
  .stop-add-btns { flex-direction: column; }

  /* Freight row cards: stack fields */
  .freight-row-card .field-row { flex-wrap: wrap; }
}

/* ── Very small phones ────────────────────────────────────── */
@media (max-width: 480px) {
  .section-heading { font-size: .7rem; }
  .app-header { height: 44px; }
  .snav-btn { padding: 9px 10px; font-size: .76rem; }
}
