/* Issue #10617 v2 + #10663 OP.B — Right-drawer · 85vw IFS-style bulk N-row UX */

/* ── Body scroll-lock when panel is open (Issue #10663 §C.M17) ── */
body.cw-tp-open { overflow: hidden; }

/* ── Backdrop overlay · IFS-style rgba(0,0,0,.45) · §C.M18 ── */
.cw-tracking-panel__overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99998;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease-out;
    pointer-events: none;
}
.cw-tracking-panel__overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

/* ── Drawer · Issue #10665 — 90vw (no cap) · 100vh · z-index outranks Logistik theme ── */
.cw-tracking-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 90vw;
    min-width: 480px;
    height: 100vh;
    background: #fff;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .25);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.22, .9, .3, 1);
    z-index: 99999;
    display: grid;
    /* #10691 — 7 tracks matching the 7 DOM children (after #10667 added the filter-bar):
       header · toolbar · filter-bar · body(table·1fr) · progress · action-bar · diagnostic-footer.
       Prior 5-track version caused the 1fr stretch to land on the filter-bar row → huge
       empty gray band between toolbar and table when the table was short (e.g. 3 rows). */
    grid-template-rows: auto auto auto 1fr auto auto auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cw-tracking-panel[data-state="open"] { transform: translateX(0); }

/* ── Header ── */
.cw-tracking-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(180deg, #fff, #f8f9fa);
}
.cw-tracking-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    line-height: 1.35;
}
.cw-tracking-panel__title #cw-tp-container-no {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: #0d6efd;
    font-weight: 700;
}
.cw-tracking-panel__close {
    background: none; border: none;
    font-size: 26px; line-height: 1;
    cursor: pointer; color: #6c757d;
    padding: 0 8px;
}
.cw-tracking-panel__close:hover { color: #000; }

/* ── Body ── */
.cw-tracking-panel__body {
    flex: 1; overflow-y: auto;
    padding: 0;
    background: #fff;
}

/* ── DataTable v2 (admin-diagnostic-modal style) — #10722 font harmony ── */
.cw-tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.45;
    table-layout: auto;
}
.cw-tp-table thead th {
    position: sticky; top: 0;
    background: #495057; color: #fff;
    text-align: left;
    padding: 11px 12px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 2px solid #343a40;
    line-height: 1.3;
}
/* Issue #10695 §3 — clickable sort */
.cw-tp-table thead th[data-sort-state] { cursor: pointer; user-select: none; }
.cw-tp-table thead th[data-sort-state]:hover { background: #5a6168; }
.cw-tp-table thead th[data-sort-state="asc"],
.cw-tp-table thead th[data-sort-state="desc"] { background: #0d6efd; }
.cw-tp-sort-indicator {
    margin-left: 4px;
    opacity: .55;
    font-size: 11px;
    display: inline-block;
}
.cw-tp-table thead th[data-sort-state="asc"]  .cw-tp-sort-indicator,
.cw-tp-table thead th[data-sort-state="desc"] .cw-tp-sort-indicator { opacity: 1; }
.cw-tp-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.45;
}
.cw-tp-table tbody tr:nth-child(even) { background: #f8f9fa; }
.cw-tp-table tbody tr:hover { background: #e7f1ff; }

.cw-tp-table .cw-tp-cell--source {
    font-weight: 600;
    color: #495057;
}
.cw-tp-table .cw-tp-cell--source .cw-tp-source-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    background: #e9ecef;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 13px;
}
.cw-tp-table .cw-tp-cell--source[data-source="zo"]  .cw-tp-source-tag { background: #cff4fc; color: #055160; }
.cw-tp-table .cw-tp-cell--source[data-source="storage"] .cw-tp-source-tag { background: #d1e7dd; color: #0a3622; }

/* TTFB column */
.cw-tp-table .cw-tp-cell--ttfb {
    font-family: ui-monospace, Menlo, monospace;
    font-weight: 600;
    text-align: right;
}
.cw-tp-table .cw-tp-cell--ttfb[data-ms-bucket="fast"]   { color: #198754; }
.cw-tp-table .cw-tp-cell--ttfb[data-ms-bucket="medium"] { color: #fd7e14; }
.cw-tp-table .cw-tp-cell--ttfb[data-ms-bucket="slow"]   { color: #dc3545; }

/* HTTP status badge */
.cw-tp-table .cw-tp-cell--http .cw-tp-badge {
    display: inline-block; padding: 4px 11px;
    font-size: 12px; border-radius: 12px;
    font-weight: 600;
}
.cw-tp-table .cw-tp-cell--http .cw-tp-badge[data-http="200"] { background: #d1e7dd; color: #0a3622; }
.cw-tp-table .cw-tp-cell--http .cw-tp-badge[data-http="0"],
.cw-tp-table .cw-tp-cell--http .cw-tp-badge[data-http^="4"],
.cw-tp-table .cw-tp-cell--http .cw-tp-badge[data-http^="5"] { background: #f8d7da; color: #842029; }

/* Status column (loading/ok/error) */
.cw-tp-table .cw-tp-cell--status .cw-tp-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid #dee2e6;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: cw-tp-spin .8s linear infinite;
}
@keyframes cw-tp-spin { to { transform: rotate(360deg); } }
/* #10722 — IFS-style filled status pills (matches reference mockup) */
.cw-tp-table .cw-tp-cell--status[data-status]:not([data-status="loading"]) {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.cw-tp-table .cw-tp-cell--status[data-status="ok"] {
    color: #0a3622;
    background: #d1e7dd;
    border-radius: 10px;
    padding: 3px 10px;
    display: inline-block;
}
.cw-tp-table .cw-tp-cell--status[data-status="error"] {
    color: #842029;
    background: #f8d7da;
    border-radius: 10px;
    padding: 3px 10px;
    display: inline-block;
}
.cw-tp-table .cw-tp-cell--status[data-status="loading"]{ color: #6c757d; }

/* Failed row red tint */
.cw-tp-table tbody tr[data-row-status="error"] { background: #fff5f5; }
.cw-tp-table tbody tr[data-row-status="error"]:hover { background: #ffe5e5; }

/* Key-fields cell */
.cw-tp-table .cw-tp-cell--keyfields {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 13px;
    color: #495057;
}
.cw-tp-table .cw-tp-cell--keyfields .cw-tp-kf-row {
    display: block;
    line-height: 1.4;
}
.cw-tp-table .cw-tp-cell--keyfields strong { color: #212529; }

/* Raw-body collapsible */
.cw-tp-table .cw-tp-cell--raw details {
    cursor: pointer;
}
.cw-tp-table .cw-tp-cell--raw details summary {
    font-size: 12px; color: #0d6efd;
}
.cw-tp-table .cw-tp-cell--raw pre {
    margin: 6px 0 0;
    padding: 8px; background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Sticky toolbar above table · IFS-style · Issue #10663 §C.M19 ── */
.cw-tracking-panel__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    font-size: 13px;
    color: #495057;
    flex-wrap: wrap;
}
.cw-tp-toolbar__check {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    user-select: none;
}
.cw-tp-toolbar__check input[type="checkbox"] { margin: 0; }
.cw-tp-toolbar__btn {
    padding: 6px 14px;
    font-size: 13px;
    background: #fff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s ease;
}
.cw-tp-toolbar__btn:hover:not(:disabled) {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0a58ca;
}
.cw-tp-toolbar__btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.cw-tp-toolbar__sep {
    flex: 1;
}
.cw-tp-toolbar__search {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #ced4da; border-radius: 4px;
    padding: 0 8px;
    background: #fff;
    flex: 0 1 280px;
}
.cw-tp-toolbar__search-icon { color: #6c757d; font-size: 14px; }
.cw-tp-toolbar__search input {
    border: none; outline: none;
    padding: 6px 4px;
    font-size: 13px;
    width: 100%;
    background: transparent;
}
.cw-tp-toolbar__btn--export {
    background: #198754; color: #fff; border-color: #198754;
}
.cw-tp-toolbar__btn--export:hover:not(:disabled) {
    background: #146c43; border-color: #13653f; color: #fff;
}
/* Issue #10695 §2 — XLSX export button (blue Excel-ish) */
.cw-tp-toolbar__btn--export-xlsx {
    background: #0d6efd; color: #fff; border-color: #0d6efd;
}
.cw-tp-toolbar__btn--export-xlsx:hover:not(:disabled) {
    background: #0b5ed7; border-color: #0a58ca; color: #fff;
}

/* ── Issue #10667 §B — Filter toolbar (5 controls + reset + count) ── */
.cw-tp-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 22px;
    background: #fafbfc;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
    font-size: 13px;
}
.cw-tp-filter-bar__group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cw-tp-filter-bar__label {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    white-space: nowrap;
}
.cw-tp-filter-bar__select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background: #fff;
    color: #212529;
    min-width: 90px;
    height: 28px;
}
.cw-tp-filter-bar__select:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}
.cw-tp-filter-bar__reset {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 3px;
    color: #495057;
    cursor: pointer;
    height: 28px;
}
.cw-tp-filter-bar__reset:hover {
    background: #f1f3f5;
    border-color: #adb5bd;
}
.cw-tp-filter-bar__count {
    font-size: 13px;
    color: #6c757d;
    font-family: ui-monospace, Menlo, monospace;
    min-width: 110px;
    text-align: right;
}
.cw-tracking-panel__btn--primary:disabled {
    background: #adb5bd;
    border-color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── Live progress strip · §A.M8 ── */
.cw-tracking-panel__progress {
    display: flex; align-items: center;
    gap: 18px;
    padding: 10px 22px;
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    color: #495057;
    font-family: ui-monospace, Menlo, monospace;
    flex-wrap: wrap;
}
.cw-tp-progress__icon { font-size: 16px; }
.cw-tp-progress__text { color: #212529; }
.cw-tp-progress__sep { color: #adb5bd; }
.cw-tracking-panel__progress strong { color: #0d6efd; }

/* ── Sticky bottom action bar · §C.M20 ── */
.cw-tracking-panel__action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .04);
}
.cw-tracking-panel__btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #212529;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s ease;
    min-width: 160px;
}
.cw-tracking-panel__btn--primary {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
.cw-tracking-panel__btn--primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}
.cw-tracking-panel__btn--secondary {
    background: #fff;
    color: #495057;
    border-color: #ced4da;
}
.cw-tracking-panel__btn--secondary:hover {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0a58ca;
}

/* ── New bulk DataTable columns · Issue #10663 §A.M3 ── */
.cw-tp-col--select { width: 40px; text-align: center; }
.cw-tp-col--num    { width: 36px; color: #6c757d; }
.cw-tp-col--container { font-family: ui-monospace, Menlo, monospace; }
.cw-tp-col--ttfb { width: 72px; text-align: right; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.cw-tp-col--ttfb[data-ms-bucket="fast"]   { color: #198754; }
.cw-tp-col--ttfb[data-ms-bucket="medium"] { color: #fd7e14; }
.cw-tp-col--ttfb[data-ms-bucket="slow"]   { color: #dc3545; }
.cw-tp-col--status { width: 130px; }

/* ── Legacy v1 footer (kept hidden but not deleted in case kill-switch flips back) ── */
.cw-tracking-panel__footer {
    display: none !important;
}
.cw-tp-footer__metrics {
    display: flex; gap: 18px; flex-wrap: wrap;
    font-family: ui-monospace, Menlo, monospace;
}
.cw-tp-footer__metrics span strong {
    color: #212529;
    margin-left: 4px;
    font-weight: 700;
}
.cw-tp-footer__actions {
    display: flex; gap: 8px;
}
.cw-tp-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #212529;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s ease;
}
.cw-tp-btn:hover { background: #e7f1ff; border-color: #0d6efd; color: #0a58ca; }
.cw-tp-btn--primary {
    background: #0d6efd; color: #fff; border-color: #0d6efd;
}
.cw-tp-btn--primary:hover { background: #0b5ed7; border-color: #0a58ca; color: #fff; }
.cw-tp-btn--danger {
    background: #fff; color: #dc3545; border-color: #f5c2c7;
}
.cw-tp-btn--danger:hover { background: #f8d7da; color: #842029; border-color: #dc3545; }

/* ── Legacy v1 raw-KV layout (kept for fallback when v2_enabled = 0) ── */
.cw-tp-section { margin-bottom: 20px; padding: 0 22px; }
.cw-tp-section:first-child { padding-top: 16px; }
.cw-tp-section__title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; text-transform: uppercase;
    color: #444; margin: 0 0 8px;
    padding-bottom: 6px; border-bottom: 2px solid #eee;
}
.cw-tp-elapsed {
    margin-left: auto; font-size: 11px;
    color: #6c757d; font-weight: 400;
}
.cw-tp-section__content {
    background: #f8f9fa; border-radius: 6px; padding: 12px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px; white-space: pre-wrap; word-break: break-word;
}
.cw-tp-kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; }
.cw-tp-kv__key { color: #6c757d; font-weight: 500; }
.cw-tp-kv__val { color: #212529; }
.cw-tp-kv__val--null { color: #adb5bd; font-style: italic; }
.cw-tp-kv__val--bool-true { color: #28a745; font-weight: 600; }
.cw-tp-kv__val--bool-false { color: #dc3545; font-weight: 600; }
.cw-tp-kv__val pre {
    margin: 0; padding: 6px; background: #fff; border: 1px solid #dee2e6;
    border-radius: 3px; font-size: 13px; max-height: 200px; overflow: auto;
}

/* Top legacy badge (used by v1 sections) */
.cw-tp-badge {
    display: inline-block; padding: 3px 9px;
    font-size: 12px; border-radius: 10px;
    background: #e9ecef; color: #495057;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cw-tracking-panel { width: 100vw; min-width: 100vw; max-width: 100vw; }
    .cw-tp-footer__metrics { flex-direction: column; gap: 4px; }
}

/* ── Issue #10666 — restore native checkbox visibility inside the right-panel ──
 * Logistik parent theme globally hides input[type="checkbox"] via:
 *   visibility:hidden; opacity:0; width:0; height:0; display:none;
 * (see themes/logistik-child/style.css:2273-2298 — same root cause as #8160
 * which fixed Gravity Forms checkboxes the same way).
 *
 * Override scoped tightly to .cw-tracking-panel so we don't disturb any
 * Gravity Forms / WooCommerce checkbox the parent theme styles elsewhere.
 * Specificity (0,0,2,1) wins against the theme's (0,0,1,1) AND uses !important
 * to overpower the multi-property kill-switch.
 */
.cw-tracking-panel input[type="checkbox"] {
    visibility: visible !important;
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    position: relative !important;
    margin: 0 !important;
    accent-color: #0d6efd;  /* match panel primary action-bar blue */
    cursor: pointer;
}
.cw-tracking-panel .cw-tp-col--select {
    text-align: center;
    vertical-align: middle;
}
.cw-tracking-panel .cw-tp-toolbar__check {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Issue #10659 — 3-state row coloring (ok / no_data / error) ── */
.cw-tp-table tbody tr[data-row-status="no_data"] {
    background: #fff8e1;            /* amber tint */
    border-left: 3px solid #ffa726;
}
.cw-tp-table tbody tr[data-row-status="no_data"]:hover { background: #fff3c4; }
.cw-tp-table tbody tr[data-row-status="no_data"] .cw-tp-status-info {
    color: #e65100;
    font-weight: 500;
}
.cw-tp-table tbody tr[data-row-status="error"][data-http-bucket="5xx"] {
    background: #ffebee;            /* deeper red for upstream 5xx */
    border-left: 3px solid #d32f2f;
}
.cw-tp-table tbody tr[data-row-status="error"] .cw-tp-status-tx {
    display: block;
    color: #555;
    font-weight: 400;
    font-size: 12px;
    margin-top: 2px;
}

/* ── Issue #10665 — Table-wrapper for 42-col horizontal scroll ── */
.cw-tp-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 100%;
    width: 100%;
}
.cw-tp-table-wrapper .cw-tp-table {
    min-width: max-content;  /* allow horizontal scroll when 42 cols overflow 90vw */
}

/* ── Column-picker dropdown · Issue #10665 §B.M11 ── */
.cw-tp-col-picker {
    position: absolute;
    top: calc(100% + 4px);
    right: 16px;
    z-index: 100000;  /* above the panel itself */
    width: 360px;
    max-height: 70vh;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    display: flex;
    flex-direction: column;
}
.cw-tp-col-picker__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
}
.cw-tp-col-picker__actions { display: flex; gap: 6px; align-items: center; }
.cw-tp-col-picker__action {
    padding: 4px 10px; font-size: 12px;
    background: #fff; color: #495057; border: 1px solid #ced4da; border-radius: 3px;
    cursor: pointer;
}
.cw-tp-col-picker__action:hover { background: #e7f1ff; color: #0d6efd; }
.cw-tp-col-picker__close {
    background: none; border: none;
    font-size: 20px; line-height: 1;
    cursor: pointer; color: #6c757d;
    padding: 0 6px;
}
.cw-tp-col-picker__close:hover { color: #000; }
.cw-tp-col-picker__body {
    overflow-y: auto;
    padding: 8px 12px;
    flex: 1;
}
.cw-tp-col-picker__group { margin-bottom: 12px; }
.cw-tp-col-picker__group-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: .05em;
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 4px;
}
.cw-tp-col-picker__item {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 3px;
}
.cw-tp-col-picker__item:hover { background: #f8f9fa; }
.cw-tp-col-picker__item input[type="checkbox"]:disabled + * { color: #adb5bd; }

/* Make toolbar a positioning context for the absolute picker dropdown */
.cw-tracking-panel__toolbar { position: relative; }

/* #10863 — Bootstrap tooltips are appended to <body>, but the tracking panel sits at
   z-index 99999, so without this the tooltip paints BEHIND the panel and is invisible
   (the in/out-mode + Customs tooltips never showed). Raise tooltips above the panel.
   Safe globally: tooltips should always be the top-most layer. */
.tooltip { z-index: 100001 !important; }
.tooltip.show { opacity: 1 !important; }
/* readable multi-line/HTML tooltips for the rich panel tooltips */
/* #10863 — force dark bg + white text so the tooltip TITLE isn't black-on-black (theme
   left .tooltip-inner color unset → header div rendered black on the dark tooltip). */
.tooltip .tooltip-inner { max-width: 340px; text-align: left; background: #212529; color: #fff; }
.tooltip .tooltip-inner table { color: #fff; }

/* #10722 — per-column cell styling. Bumped 11→14 px (body) / 11→13 px (header)
   for legibility; padding 6→9 px ditto. Higher specificity than the bulk th/td
   rules above, so these are the EFFECTIVE sizes the user sees. */
.cw-tp-table td[data-col-key] {
    padding: 9px 10px;
    font-size: 14px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cw-tp-table th[data-col-key] {
    padding: 10px 10px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   #10702 §A.M4 + §B — Color-coded cells by data source / empty severity
   ============================================================================
   3-state visual system (per user request 2026-05-28):
     1. GREEN  — value from primary upstream (Zo or Sylvain — live terminal data)
     2. ORANGE — value from Navis DWH fallback (canonical real-time view)
               OR an "expected" empty (legitimately blank for this row state)
     3. RED    — "missing" empty (data SHOULD be there but no source has it)

   Reason tooltips stay attached via title=… on the "—" span. Hover shows the
   plain-English explanation; the colored dash gives an at-a-glance verdict.
*/
.cw-row-src--primary { color: #198754; }                     /* green · Zo/Sylvain   */
.cw-row-src--navis   { color: #fd7e14; font-style: italic; } /* orange · Navis DWH (no emoji prefix — admin debug only) */

.cw-row-empty--expected {
    color: #fd7e14;             /* orange — by-design empty */
    border-bottom: 1px dotted #fd7e14;
    cursor: help;
}
.cw-row-empty--missing {
    color: #dc3545;             /* red — unknown / system gap */
    border-bottom: 1px dotted #dc3545;
    cursor: help;
}
.cw-row-cell--reason { cursor: help; }
.cw-row-cell--reason:hover { filter: brightness(0.85); }

/* ── Issue #10699 — Booking mode (drawer opened by booking# instead of containers) ── */
#cw-tracking-panel[data-mode="booking"] .cw-tracking-panel__action-bar,
#cw-tracking-panel[data-mode="booking"] #cw-tp-filter-bar,
#cw-tracking-panel[data-mode="booking"] th.cw-tp-col--select,
#cw-tracking-panel[data-mode="booking"] td.cw-tp-col--select {
    display: none !important;
}
/* Issue #10708 follow-up — neutralize .cw-tp-drill-link in BULK mode so it inherits
   the cell text color instead of the theme's default red <a> styling. The drill
   affordance (blue + underline) only applies in booking mode below. */
#cw-tracking-panel .cw-tp-drill-link {
    color: inherit;
    text-decoration: none;
    cursor: default;
}
#cw-tracking-panel[data-mode="booking"] .cw-tp-drill-link {
    color: #0d6efd;
    cursor: pointer;
    text-decoration: underline;
}
#cw-tracking-panel[data-mode="booking"] .cw-tp-drill-link:hover {
    color: #0a58ca;
    background: #eef5ff;
}
