/* Theme-aware colors for components that were written with fixed dark colors.
   The light and "balanced" (soft) themes define --panel, --panel2, --line, --text, --muted and --accent;
   this file makes the Jira detail, result tables, parts, record cards and chat surfaces use them. Loaded last. */
:is(html[data-theme="light"], html[data-theme="soft"]) {
  --ok-bg: #d7f0e4; --ok-fg: #0b5538; --bad-bg: #fbe1e1; --bad-fg: #8f1818; --warn-bg: #fdf0cf; --warn-fg: #6e4f0a;
  --row-hover: color-mix(in srgb, var(--accent) 10%, var(--panel));
  --row-open: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

/* chat and shell surfaces (the light theme had these, the balanced one did not) */
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.composer, .system-message, .assistant-message, .login-card) { background: var(--panel); }
:is(html[data-theme="light"], html[data-theme="soft"]) .user-message { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
:is(html[data-theme="light"], html[data-theme="soft"]) .nav-item { color: var(--muted); }
:is(html[data-theme="light"], html[data-theme="soft"]) .nav-item:hover { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .nav-item.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.status-chip, .credit-chip) { background: var(--panel); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.user-button, .icon-button) { color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .org-select option { background: var(--panel); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .header-language select { background: var(--panel); color: var(--text); border-color: var(--line); }
:is(html[data-theme="light"], html[data-theme="soft"]) .message-body pre { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .message p, :is(html[data-theme="light"], html[data-theme="soft"]) .system-message { color: var(--muted); }
:is(html[data-theme="light"], html[data-theme="soft"]) .filter { background: var(--panel); color: var(--muted); }

/* Jira cases */
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-table th { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.jira-table th, .jira-table td) { border-bottom-color: var(--line); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel2) 55%, transparent); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-table tbody tr:hover { background: var(--row-hover); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-case-row.expanded { background: var(--row-open); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-detail-row > td { background: var(--panel2) !important; }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-detail-card { background: var(--panel); border-color: var(--line); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-detail-fields dt { color: var(--muted); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-detail pre { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.jira-column-filters input, .jira-bulk-panel textarea) { background: var(--panel); color: var(--text); border-color: var(--line); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-column-options { background: var(--panel); border-color: var(--line); box-shadow: 0 12px 28px #0002; }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-empty { border-color: var(--line); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-kpi { background: var(--panel2); border-color: var(--line); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-bar { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .jira-bar::before { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* result tables and export dialog */
:is(html[data-theme="light"], html[data-theme="soft"]) .search-result-table th { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-result-table .selection-cell { background: var(--panel2); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-data-row:hover { background: var(--row-hover); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-data-row.expanded { background: var(--row-open); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-data-row.selected { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }
:is(html[data-theme="light"], html[data-theme="soft"]) .expanded-result > td { background: var(--panel2); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-export-dialog { background: var(--panel); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-export-dialog select { background: var(--panel2); color: var(--text); }

/* parts */
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-table th { background: var(--panel2); color: var(--text); }
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-section { background: var(--panel); border-color: var(--line) !important; box-shadow: none; }
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-detail-card { background: var(--panel); border-color: var(--line); }
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-fields dt { color: var(--muted); }
:is(html[data-theme="light"], html[data-theme="soft"]) .price-chart-card svg { background: var(--panel2); }
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-badge { background: var(--ok-bg); color: var(--ok-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .parts-badge.warning { background: var(--warn-bg); color: var(--warn-fg); }

/* machine and license records */
:is(html[data-theme="light"], html[data-theme="soft"]) .record-badge.valid { background: var(--ok-bg); color: var(--ok-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) :is(.record-badge.expired, .record-badge.disabled) { background: var(--bad-bg); color: var(--bad-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .record-badge.expiring_soon { background: var(--warn-bg); color: var(--warn-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .update-entitlement.eligible { color: var(--ok-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .update-entitlement.outside_entitlement { color: var(--bad-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .update-entitlement.manual_confirmation_required { color: var(--warn-fg); }
:is(html[data-theme="light"], html[data-theme="soft"]) .search-correction { background: #fff7e0; border-color: #d9b25b; border-left-color: #c58f1b; color: #6b4b00; }
