/* ═══════════════════════════════════════════════════════
   PnL Assignment Report  (.pnlr- prefix)  FEAT-043
   ═══════════════════════════════════════════════════════ */

.pnlr-page   { min-height:100vh; padding-bottom:40px; }
.pnlr-header { display:flex; justify-content:space-between; align-items:center;
               padding:16px 24px 12px; border-bottom:1px solid #2d3548; background:#1e2537; }
.pnlr-title  { margin:0; font-size:1.05rem; font-weight:600; color:#e4e8f0; }
.pnlr-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pnlr-label    { font-size:0.8rem; color:#8a96b0; white-space:nowrap; }
.pnlr-date     { font-size:0.85rem; }

/* Filters */
.pnlr-filters  { display:flex; align-items:center; gap:10px; padding:12px 24px;
                 background:#161c2b; border-bottom:1px solid #2d3548; flex-wrap:wrap; }
.pnlr-dropdown { min-width:160px; font-size:0.85rem; }
.pnlr-search   { background:#1e2537 !important; border:1px solid rgba(255,255,255,0.15) !important;
                 color:#e4e8f0 !important; border-radius:6px; padding:5px 10px;
                 font-size:0.85rem; min-width:160px; }

/* KPI strip */
.pnlr-summary { display:flex; gap:12px; padding:14px 24px;
                background:#1a2030; border-bottom:1px solid #2d3548; flex-wrap:wrap; }
.pnlr-kpi     { background:#232d40; border-radius:8px; padding:10px 18px;
                text-align:center; min-width:110px; }
.pnlr-kpi-val { font-size:1.3rem; font-weight:700; color:#4a9eff; line-height:1.2; }
.pnlr-kpi-warn{ color:#f4a724 !important; }
.pnlr-kpi-lbl { font-size:0.7rem; color:#8a96b0; text-transform:uppercase; letter-spacing:0.05em; }

/* Content */
.pnlr-content     { padding:16px 24px; }
.pnlr-count       { font-size:0.82rem; color:#8a96b0; margin-bottom:10px; }
.pnlr-placeholder { color:#8a96b0; text-align:center; padding:60px; font-size:0.9rem; }
.pnlr-empty       { color:#8a96b0; text-align:center; padding:40px; }
.pnlr-error       { color:#e8734a; padding:16px; background:rgba(232,115,74,0.1);
                    border-radius:8px; font-size:0.85rem; }

/* Table */
.pnlr-table  { width:100%; border-collapse:collapse; font-size:0.82rem; }
.pnlr-th     { text-align:left; padding:8px 10px; font-weight:600; font-size:0.72rem;
               text-transform:uppercase; letter-spacing:0.05em; color:#8a96b0;
               border-bottom:2px solid rgba(255,255,255,0.1); white-space:nowrap; }
.pnlr-th-num { text-align:right; }
.pnlr-th-flag{ width:24px; }
.pnlr-td     { padding:7px 10px; border-bottom:1px solid rgba(255,255,255,0.04);
               color:#c8d0df; vertical-align:middle; }
.pnlr-td-plate { font-weight:600; color:#e4e8f0; }
.pnlr-td-num   { text-align:right; font-variant-numeric:tabular-nums; }
.pnlr-td-flag  { text-align:center; font-size:0.75rem; }
.pnlr-row-changed td { background:rgba(244,167,36,0.04); }
.pnlr-row:hover td   { background:rgba(255,255,255,0.03); }

/* Group headers */
.pnlr-group-row td { background:#1a2030 !important; }
.pnlr-group-header { font-weight:700; font-size:0.78rem; color:#4a9eff;
                     text-transform:uppercase; letter-spacing:0.06em;
                     padding:10px 10px 6px !important; }

/* PM badges */
.pnlr-pm         { display:inline-block; padding:2px 7px; border-radius:8px; font-size:0.72rem; font-weight:600; }
.pnlr-pm-overdue { background:rgba(232,115,74,0.2); color:#e8734a; }
.pnlr-pm-soon    { background:rgba(244,167,36,0.2); color:#f4a724; }
.pnlr-pm-ok      { background:rgba(77,212,143,0.2); color:#4dd48f; }
.pnlr-pm-dim     { background:rgba(138,150,176,0.15); color:#8a96b0; }

/* ── Dark theme dropdowns ──────────────────────────────────────────── */
/* dcc.Dropdown uses react-select v1 class names */
body:not([data-theme="light"]) .pnlr-filters .Select-control {
    background-color: #1e2537 !important;
    border-color: rgba(255,255,255,0.15) !important;
    color: #e8eaf0 !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-value-label,
body:not([data-theme="light"]) .pnlr-filters .Select-placeholder {
    color: #adb5bd !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-menu-outer {
    background-color: #1e2537 !important;
    border-color: rgba(255,255,255,0.15) !important;
    color: #e8eaf0 !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-option {
    background-color: #1e2537 !important;
    color: #e8eaf0 !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-option.is-focused {
    background-color: #2d3a52 !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-option.is-selected {
    background-color: #3a4a6b !important;
    color: #fff !important;
}
body:not([data-theme="light"]) .pnlr-filters .Select-arrow { border-top-color: #8a96b0 !important; }
body:not([data-theme="light"]) .pnlr-filters .Select-clear { color: #8a96b0 !important; }
/* Also handle newer dash Select (VirtualizedSelect) */
body:not([data-theme="light"]) .pnlr-filters .VirtualizedSelectFocusedOption { background:#2d3a52 !important; }
body:not([data-theme="light"]) .pnlr-filters .VirtualizedSelectSelectedOption { background:#3a4a6b !important; color:#fff !important; }

/* Light theme */
body[data-theme="light"] .pnlr-header  { background:#f8f9fa; border-bottom-color:#dde1eb; }
body[data-theme="light"] .pnlr-filters { background:#f0f2f5; border-bottom-color:#dde1eb; }
body[data-theme="light"] .pnlr-summary { background:#f8f9fa; border-bottom-color:#dde1eb; }
body[data-theme="light"] .pnlr-kpi     { background:#fff; border:1px solid #dde1eb; }
body[data-theme="light"] .pnlr-title, body[data-theme="light"] .pnlr-kpi-val { color:#1a1f2e; }
body[data-theme="light"] .pnlr-td      { color:#1a1f2e; border-bottom-color:#f0f2f5; }
body[data-theme="light"] .pnlr-td-plate { color:#1a1f2e; }
body[data-theme="light"] .pnlr-group-row td { background:#f0f2f5 !important; }

/* ── Dispatch detail drill-down (FEAT-045) ──────────────────────────────── */
.pnlr-num-btn {
    background: none; border: none; color: #4a9eff; cursor: pointer;
    font-size: inherit; font-family: inherit; padding: 0;
    text-decoration: underline; text-decoration-style: dotted;
}
.pnlr-num-btn:hover { color: #66b0ff; }
.pnlr-detail-summary { display: flex; gap: 24px; margin-bottom: 14px; font-size: 13px; color: #888; }
.pnlr-detail-summary strong { color: #ddd; }
.pnlr-detail-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.pnlr-detail-table th, .pnlr-detail-table td { padding: 6px 12px; text-align: left; border-bottom: 1px solid #333; font-size: 13px; }
.pnlr-detail-table thead th { background: #1a1a2e; color: #aaa; font-weight: 600; }
.pnlr-detail-routes { font-size: 13px; color: #aaa; }
.pnlr-detail-routes strong { color: #ddd; display: block; margin-bottom: 6px; }
.pnlr-detail-routes li { margin-bottom: 2px; }

body[data-theme="light"] .pnlr-detail-summary strong { color: #212529; }
body[data-theme="light"] .pnlr-detail-summary { color: #6c757d; }
body[data-theme="light"] .pnlr-detail-table th,
body[data-theme="light"] .pnlr-detail-table td { border-bottom-color: #dee2e6; }
body[data-theme="light"] .pnlr-detail-table thead th { background: #f8f9fa; color: #495057; }
body[data-theme="light"] .pnlr-detail-routes { color: #495057; }
body[data-theme="light"] .pnlr-detail-routes strong { color: #212529; }
