/* Dispatcher module visual language. Scoped under .app-dispatcher. Reuses the .fm-* card/chip/
   badge/table components already defined in floormanager.css (same --co-* tokens, same card grid
   the floor-manager delivery tab uses) so Dispatcher reads as part of the same app instead of a
   bolted-on skin - only the write-action affordances below (checkbox/driver-picker/action bar)
   are new. */

.app-dispatcher {
    background: var(--co-bg-grad);
    color: var(--co-text);
    min-height: 100vh;
    font-family: "Dubai", "Segoe UI Variable", "Segoe UI", Tahoma, Arial, sans-serif;
}

.app-dispatcher * { box-sizing: border-box; }

.dispatcher-action-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow-xs);
}

.dispatcher-selected-count { font-size: 13px; font-weight: 700; color: var(--co-text-muted); }
.dispatcher-selected-count strong { color: var(--co-primary-dark); font-size: 15px; }

.dispatcher-driver-picker { min-width: 220px; }

.dispatcher-action-message { font-size: 13px; font-weight: 700; color: var(--co-primary-dark); }

.dispatcher-action-bar {
    position: sticky;
    top: 0;
    z-index: 5;
}

.dispatcher-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dispatcher-search-input { flex: 1 1 320px; min-width: 220px; font-size: 15px; padding: 10px 14px; }
.dispatcher-search-count { font-size: 13px; font-weight: 700; color: var(--co-text-muted); }
.dispatcher-search-count strong { color: var(--co-primary-dark); }

.dispatcher-print-btn {
    margin-inline-start: auto;
    margin-inline-end: 8px;
    padding: 4px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--co-primary-dark);
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.dispatcher-print-btn:hover { background: var(--co-primary-bg, var(--co-surface)); box-shadow: 0 0 0 2px var(--co-primary); }

.dispatcher-select-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-inline-end: 4px;
}

.fm-delivery-card.dispatcher-selected {
    box-shadow: 0 0 0 2px var(--co-primary);
}

/* ---- per-driver statement (PDF / WhatsApp) ---- */
.dispatcher-report-modal { max-width: 860px; width: 96vw; max-height: 94vh; display: flex; flex-direction: column; }
.dispatcher-report-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dispatcher-wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.dispatcher-report-scroll { overflow: auto; border: 1px solid var(--co-border); border-radius: var(--co-radius); background: #fff; }

/* Fixed width so the PDF looks the same whether it is made from a phone or a PC. Light colours on purpose (printed). */
.driver-report-sheet { width: 780px; padding: 18px; background: #fff; color: #111; font-family: "Dubai", "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px; }
.drs-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 10px; }
.drs-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #111; }
.drs-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.drs-summary > div { border: 1px solid #ccc; border-radius: 8px; padding: 8px; text-align: center; }
.drs-summary span { display: block; font-size: 12px; color: #555; }
.drs-summary strong { font-size: 17px; }
.drs-summary .ok strong { color: #15803d; }
.drs-summary .bad strong { color: #b91c1c; }
.drs-table { width: 100%; border-collapse: collapse; }
.drs-table th, .drs-table td { border: 1px solid #bbb; padding: 5px 6px; text-align: right; vertical-align: top; }
.drs-table th { background: #eee; }
.drs-table tr.uncollected td { background: #fff1f1; }
.drs-table tfoot td { font-weight: 800; background: #eee; }
.drs-table .drs-addr { width: 110px; max-width: 110px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.drs-table td { overflow-wrap: anywhere; }
.drs-sub { color: #666; font-size: 11px; }
.drs-pay { margin-top: 10px; font-size: 13px; }
