/* Open Board presentation. Shared navigation, board sizing and table layout remain in their existing modules. */
#dispatch-levels { --primary: #1765cf; }
#dispatch-levels .dispatch-panel { border-radius: 10px; }
#dispatch-levels .panel-heading { padding: 12px 14px 8px; gap: 12px; }
#dispatch-levels .panel-heading h2 { font-size: 18px; letter-spacing: -.35px; }
#open-title + p { display: none; }
#dispatch-levels .table-count { border-radius: 12px; background: var(--blue-bg); color: var(--blue-text); padding: 3px 9px; }
#dispatch-levels button { border-radius: 6px; }
#dispatch-levels button:disabled { cursor: not-allowed; }
#dispatch-levels .panel-actions { flex-wrap: wrap; justify-content: flex-end; }
#dispatch-levels .panel-actions button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
#schedule-selected, #dispatch-levels .dispatch-outlined { border: 1px solid var(--primary); color: var(--blue); background: var(--panel); }
#dispatch-levels .table-filters { padding: 4px 12px 8px; gap: 8px 6px; align-items: flex-end; }
#dispatch-levels .filter-layout-tile { flex-shrink: 1; }
#dispatch-levels .filter-layout-tile > label { font-size: 11px; gap: 5px; }
#dispatch-levels .table-filters input, #dispatch-levels .table-filters select, #dispatch-levels .table-filters > button { height: 32px; font-size: 11px; }
#dispatch-levels .layout-drag-handle { opacity: .45; }
#dispatch-levels .filter-layout-tile:hover .layout-drag-handle, #dispatch-levels .layout-drag-handle:focus-visible { opacity: 1; }
#dispatch-levels .dispatch-view-options { margin-left: auto; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; padding: 8px; border-radius: 8px; background: var(--panel2); min-width: 0; }
.dispatch-view-options > div { display: flex; flex-wrap: wrap; gap: 6px; }
#dispatch-levels .dispatch-view-options button { min-height: 30px; height: auto; padding: 5px 8px; font-size: 11px; background: var(--panel); }
#dispatch-levels #board-grouping { max-width: 240px; }
.dispatch-group-label { display: block; font-size: 10px; line-height: 1.2; font-weight: 600; color: var(--muted); }
#dispatch-levels .dispatch-board-summary { display: flex; flex-wrap: wrap; align-items: center; padding: 5px 14px 9px; gap: 8px 14px; font-size: 11px; }
#dispatch-levels .dispatch-board-summary .load-totals { margin: 0 0 0 auto; padding: 0; color: var(--muted); }
#dispatch-levels .driver-panel .panel-heading > div:first-child { min-width: 0; }
#dispatch-levels #driver-groups { font-size: 11px; margin: 0; }
#dispatch-levels #driver-connection { font-size: 11px; margin: 2px 0 0; }
#dispatch-levels #driver-vehicle .board-vehicle-icon { width: 34px; height: 26px; }
#dispatch-levels .driver-header-actions .primary { min-height: 34px; }
#dispatch-levels .driver-board-filters { padding: 5px 14px 10px; flex-wrap: wrap; gap: 8px; align-items: center; }
#dispatch-levels .driver-board-filters button, #dispatch-levels .driver-board-filters select { min-height: 32px; font-size: 11px; padding: 6px 10px; }
#dispatch-levels .driver-board-filters [role=tab][aria-selected=true] { background: var(--primary); border-color: var(--primary); color: white; }
#dispatch-levels #driver-load-totals { margin-left: auto; padding-left: 14px; border-left: 1px solid var(--line); font-size: 11px; white-space: normal; }
#dispatch-levels .table-scroll { min-height: 80px; }
#dispatch-levels .dispatch-table th { background: var(--panel2); font-size: 11px; padding-block: 9px; }
#dispatch-levels .dispatch-table td { border-color: var(--line); padding-block: 7px; font-size: 12px; }
#dispatch-levels .dispatch-table .task-row:hover td { background: var(--panel2); }
#dispatch-levels .dispatch-table .task-row.selected td { background: var(--drop-bg); }
#dispatch-levels .dispatch-table .merchant-group td, #dispatch-levels .dispatch-table .board-group td { background: var(--panel2); }
#dispatch-levels .dispatch-table .golo-link { font-weight: 600; font-size: 12px; }

/* These flex footers occupy their own space outside each scrolling table. */
#dispatch-levels .dispatch-action-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; flex: 0 0 auto; position: sticky; bottom: 0; z-index: 5; background: var(--panel); border-top: 1px solid var(--line); padding: 9px 14px; margin: 0; }
.dispatch-action-toolbar .dispatch-action-group { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.dispatch-action-toolbar .dispatch-selection { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; border-right: 1px solid var(--line); padding-right: 14px; align-self: stretch; }
#dispatch-levels .dispatch-selection strong { color: var(--text); font-size: 11px; white-space: nowrap; margin: 0; }
.dispatch-button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#dispatch-levels .dispatch-action-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 9px; min-height: 33px; height: auto; font-size: 11px; line-height: 1.3; white-space: nowrap; background: var(--panel); border: 1px solid var(--line); color: var(--text); margin: 0; }
#dispatch-levels .dispatch-action-toolbar button.primary { background: var(--primary); border-color: var(--primary); color: white; }
#dispatch-levels .dispatch-action-toolbar button.dispatch-outlined { color: var(--blue); border-color: var(--primary); }
#dispatch-levels .dispatch-action-toolbar .cancel-order-action { color: var(--error); border-color: var(--error); background: var(--panel); }
#dispatch-levels .dispatch-action-toolbar button:hover:not(:disabled) { filter: brightness(.97); }
#dispatch-levels .dispatch-action-toolbar [id^=clear-] { font-size: 10px; background: var(--panel2); }
.dispatch-chevron { margin-left: 7px; font-size: 14px; line-height: 1; }
.dispatch-more-actions { margin-left: auto; }
.dispatch-action-menu { position: fixed; inset: auto; margin: 0; width: 220px; max-width: calc(100vw - 16px); padding: 5px; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 30px #0003; z-index: 1200; }
.dispatch-action-menu:not([hidden]), .dispatch-action-menu:popover-open { display: grid; gap: 2px; }
.dispatch-action-menu[hidden] { display: none !important; }
.dispatch-action-menu::backdrop { background: transparent; }
#dispatch-levels .dispatch-action-menu button, body > .dispatch-action-menu button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 34px; padding: 8px 10px; gap: 8px; text-align: left; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-family: inherit; font-size: 12px; line-height: 1.4; cursor: pointer; }
.dispatch-action-menu button:hover:not(:disabled), .dispatch-action-menu button:focus-visible { background: var(--panel2) !important; outline: 2px solid var(--primary); outline-offset: -2px; }
.dispatch-action-menu button:disabled { opacity: .45; cursor: not-allowed; }
.dispatch-action-menu button[hidden] { display: none !important; }
.dispatch-action-toolbar [hidden] { display: none !important; }

/* Monochrome action icons inherit the current theme and button state. */
[data-action-icon]::before { content: ''; display: inline-block; width: 14px; height: 14px; flex: 0 0 14px; vertical-align: -2px; margin-right: 4px; background: currentColor; -webkit-mask: var(--dispatch-icon) center / contain no-repeat; mask: var(--dispatch-icon) center / contain no-repeat; }
.dispatch-action-toolbar [data-action-icon]::before, .dispatch-action-menu [data-action-icon]::before { margin-right: 0; }
[data-action-icon=truck] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M2 5h12v13H2zM14 10h4l4 5v3h-8M4 18a2 2 0 104 0m8 0a2 2 0 104 0'/%3E%3C/svg%3E"); }
[data-action-icon=calendar] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M4 5h16v16H4zM4 10h16M8 2v6M16 2v6M8 14h3M8 17h6'/%3E%3C/svg%3E"); }
[data-action-icon=move], [data-action-icon=return] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 12h18M8 7l-5 5 5 5M16 7l5 5-5 5'/%3E%3C/svg%3E"); }
[data-action-icon=document], [data-action-icon=label] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h7'/%3E%3C/svg%3E"); }
[data-action-icon=group] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M4 5h2v2H4zM4 11h2v2H4zM4 17h2v2H4zM10 6h10M10 12h10M10 18h10'/%3E%3C/svg%3E"); }
[data-action-icon=columns] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Crect x='3' y='4' width='18' height='16' rx='1'/%3E%3Cpath d='M9 4v16M15 4v16'/%3E%3C/svg%3E"); }
[data-action-icon=clock] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
[data-action-icon=trash] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 6h18M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7M14 10v7'/%3E%3C/svg%3E"); }
[data-action-icon=check] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E"); }
[data-action-icon=pickup], [data-action-icon=export] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M12 16V3M7 8l5-5 5 5M4 14v7h16v-7'/%3E%3C/svg%3E"); }
[data-action-icon=expand] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M9 3H3v6M15 3h6v6M21 15v6h-6M3 15v6h6'/%3E%3C/svg%3E"); }
[data-action-icon=refresh] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M20 10a8 8 0 10-1 7M20 3v7h-7'/%3E%3C/svg%3E"); }
[data-action-icon=settings] { --dispatch-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M10 3h4l1 3 3 1 3 3v4l-3 1-1 3-3 3h-4l-1-3-3-1-3-3v-4l3-1 1-3z'/%3E%3C/svg%3E"); }
@media (max-width: 1250px) {
  #dispatch-levels .dispatch-action-toolbar { gap: 9px 12px; }
  .dispatch-more-actions { margin-left: 0; }
  #dispatch-levels .dispatch-view-options { margin-left: 0; }
}
@media (max-width: 800px) {
  #dispatch-levels .panel-heading { flex-wrap: wrap; padding: 10px; }
  #dispatch-levels .panel-actions { margin-left: auto; }
  #dispatch-levels .dispatch-action-toolbar { padding: 8px 10px; }
  .dispatch-action-toolbar .dispatch-selection { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 7px; }
  #dispatch-levels .driver-board-filters { padding-inline: 10px; }
  #dispatch-levels #driver-load-totals { margin-left: 0; }
  #dispatch-levels .dispatch-board-summary .load-totals { flex-basis: 100%; }
}

/* Compact board headers. Existing tables, sizing and action footers keep their own layout. */
#dispatch-levels .driver-panel { border-top-color: var(--green); }
#dispatch-levels .open-panel > .panel-heading { padding: 8px 14px 4px; min-height: 44px; gap: 8px; }
#dispatch-levels .open-panel > .panel-heading h2 { gap: 7px; line-height: 1.3; }
#dispatch-levels .table-count { padding: 2px 7px; font-size: 11px; line-height: 1.3; }
#dispatch-levels .panel-actions { display: flex; align-items: center; gap: 6px; }
#dispatch-levels .panel-actions button { height: 34px; min-height: 34px; padding: 5px 9px; white-space: nowrap; }
#dispatch-levels .open-panel > .table-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px; padding: 2px 14px 4px; }
#dispatch-levels .table-filters .filter-layout-tile { flex: 0 1 var(--filter-width); width: var(--filter-width); min-width: 100px; padding: 0 6px 0 0; gap: 2px; }
#dispatch-levels .table-filters .filter-layout-tile > label { gap: 2px; font-size: 10px; line-height: 1.2; }
#dispatch-levels .table-filters input, #dispatch-levels .table-filters select, #dispatch-levels .table-filters > button { height: 34px; min-height: 34px; font-size: 11px; }
#dispatch-levels .table-filters .layout-drag-handle { height: 34px; min-height: 34px; padding: 2px; width: 10px; flex: 0 0 10px; }
#dispatch-levels .table-filters > button { margin: 0; padding: 5px 8px; }
#dispatch-levels .compact-view-controls { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; margin-left: auto; min-width: 0; }
#dispatch-levels .compact-view-controls button { height: 34px; min-height: 34px; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
#dispatch-levels .dispatch-board-summary { padding: 2px 14px 5px; min-height: 21px; gap: 6px 12px; font-size: 11px; line-height: 1.25; }
#dispatch-levels .dispatch-board-summary strong { color: var(--blue); }
#dispatch-levels .driver-panel > .compact-driver-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 14px 4px; }
#dispatch-levels .driver-panel > .compact-driver-heading > .compact-driver-info { display: flex; flex: 1 1 450px; flex-wrap: wrap; align-items: center; gap: 3px 9px; min-width: 0; }
#dispatch-levels .compact-driver-info h2 { flex: 0 0 auto; gap: 7px; font-size: 18px; line-height: 1.3; }
#dispatch-levels #driver-vehicle { display: inline-flex; align-items: center; flex: 0 0 auto; }
#dispatch-levels #driver-groups, #dispatch-levels #driver-connection { margin: 0; font-size: 10px; line-height: 1.35; }
#dispatch-levels #driver-connection { overflow-wrap: anywhere; border-left: 1px solid var(--line); padding-left: 9px; }
#dispatch-levels .compact-driver-heading .driver-header-actions { display: flex; flex: 0 1 auto; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-left: auto; min-width: 0; }
#dispatch-levels .compact-driver-heading #driver-load-totals { padding: 0; margin: 0; border: 0; font-size: 11px; line-height: 1.35; }
#dispatch-levels .compact-driver-heading .primary { min-height: 34px; height: 34px; padding: 5px 10px; font-size: 11px; }
#dispatch-levels .driver-board-filters { padding: 4px 14px 6px; gap: 6px; min-height: 44px; }
#dispatch-levels .driver-board-filters [role=tablist] { display: flex; align-items: center; gap: 4px; }
#dispatch-levels .driver-board-filters button, #dispatch-levels .driver-board-filters select { min-height: 34px; height: 34px; padding: 5px 9px; font-size: 11px; }
#dispatch-levels .driver-board-filters label { margin: 0; }
@media (max-width: 1250px) {
 #dispatch-levels .compact-view-controls { margin-left: 0; flex-wrap: wrap; }
 #dispatch-levels .compact-driver-heading .driver-header-actions { margin-left: 0; }
}
@media (max-width: 800px) {
 #dispatch-levels .open-panel > .panel-heading, #dispatch-levels .driver-panel > .compact-driver-heading { padding-inline: 10px; }
 #dispatch-levels .open-panel > .table-filters, #dispatch-levels .dispatch-board-summary, #dispatch-levels .driver-board-filters { padding-inline: 10px; }
 #dispatch-levels .compact-view-controls { flex: 1 1 100%; }
 #dispatch-levels .compact-driver-heading .driver-header-actions { flex: 1 1 100%; }
 #dispatch-levels .compact-driver-info h2 { font-size: 16px; }
 #dispatch-levels .panel-actions { flex-wrap: wrap; }
}

/* One-line headers stay inside their original independently scrolling tables. */
#dispatch-levels .dispatch-table thead th {
 position: sticky !important; top: 0; z-index: 4; height: 40px;
 box-sizing: border-box; padding: 8px 8px 8px 23px; padding-right: 8px !important;
 vertical-align: middle; line-height: 20px; white-space: nowrap;
 overflow: hidden; text-overflow: ellipsis; background: var(--panel2);
 border-bottom: 1px solid var(--line); box-shadow: 0 2px 2px #0000000a;
}
#dispatch-levels .dispatch-table thead .select-cell,
#dispatch-levels .dispatch-table thead .actions-cell { padding: 8px 7px !important; }
#dispatch-levels .dispatch-table thead input[type=checkbox] { display: block; margin: 0 auto; }
#dispatch-levels .dispatch-table .layout-column-drag {
 position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
 display: inline-flex; align-items: center; justify-content: center;
 width: 14px; height: 20px; min-height: 20px; margin: 0;
}
#dispatch-levels .dispatch-table .column-heading-label {
 display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dispatch-levels #driver-table .driver-column-sort {
 display: flex; align-items: center; justify-content: space-between; gap: 2px;
 width: 100%; max-width: 100%; min-width: 0; min-height: 20px;
 height: 20px; margin: 0; padding: 0; line-height: 20px; white-space: nowrap;
}
#dispatch-levels #driver-table .driver-column-sort > span:first-child {
 display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dispatch-levels #driver-table .driver-sort-arrow { flex: 0 0 auto; line-height: 20px; }
