/* Added by Claude - dark theme for the Settings page (documentation/specs/settings-page/design.md, D5).
   AntDesign 2.0 nightly's own dark theme needs ant-design-blazor.dark.css, which this nightly does not ship,
   so this sheet overrides the generated light styles. Every rule is scoped to html[data-ir-theme="dark"]
   (set by Pages/_Layout.cshtml and wwwroot/js/claude-settings.js); light mode is untouched.
   AntDesign's generated selectors use :where(), so most rules here win without !important; !important is
   used only where AntDesign or page markup sets the colour inline or with a long selector. */

html[data-ir-theme="dark"] {
    color-scheme: dark;
    --ir-bg: #0f0f0f;
    --ir-surface: #1a1a1a;
    --ir-surface-2: #222222;
    --ir-surface-3: #2c2c2c;
    --ir-border: #353535;
    --ir-border-strong: #4a4a4a;
    --ir-text: rgba(255, 255, 255, 0.86);
    --ir-text-strong: rgba(255, 255, 255, 0.94);
    --ir-text-secondary: rgba(255, 255, 255, 0.6);
    --ir-text-disabled: rgba(255, 255, 255, 0.3);
    --ir-link: #69b1ff;
    --ir-hover: rgba(255, 255, 255, 0.06);
    --ir-selected: rgba(22, 119, 255, 0.22);
}

/* ---------- page, layout ---------- */

html[data-ir-theme="dark"] body,
html[data-ir-theme="dark"] .ant-layout {
    background: var(--ir-bg) !important;
    color: var(--ir-text);
}

html[data-ir-theme="dark"] .site-layout .site-layout-background,
html[data-ir-theme="dark"] .ant-layout-header,
html[data-ir-theme="dark"] .ant-layout-content {
    background: var(--ir-surface) !important;
    color: var(--ir-text);
}

html[data-ir-theme="dark"] .ant-layout-footer {
    background: var(--ir-bg) !important;
    color: var(--ir-text-secondary);
}

html[data-ir-theme="dark"] h1, html[data-ir-theme="dark"] h2, html[data-ir-theme="dark"] h3,
html[data-ir-theme="dark"] h4, html[data-ir-theme="dark"] h5, html[data-ir-theme="dark"] h6,
html[data-ir-theme="dark"] strong, html[data-ir-theme="dark"] b {
    color: var(--ir-text-strong);
}

html[data-ir-theme="dark"] a { color: var(--ir-link); }
html[data-ir-theme="dark"] hr { border-color: var(--ir-border); }
html[data-ir-theme="dark"] code, html[data-ir-theme="dark"] pre { background: var(--ir-surface-2); color: var(--ir-text); }

html[data-ir-theme="dark"] .loading-overlay {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text) !important;
}

/* ---------- tables ---------- */

html[data-ir-theme="dark"] .ant-table,
html[data-ir-theme="dark"] .ant-table-wrapper .ant-table,
html[data-ir-theme="dark"] .ant-table-container,
html[data-ir-theme="dark"] .ant-table-title,
html[data-ir-theme="dark"] .ant-table-footer {
    background: var(--ir-surface) !important;
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-table-thead > tr > th,
html[data-ir-theme="dark"] .ant-table-thead > tr > td {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text-strong) !important;
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-table-tbody > tr > td,
html[data-ir-theme="dark"] .ant-table-cell {
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-table-tbody > tr > td {
    background: var(--ir-surface) !important;
    color: var(--ir-text);
}

html[data-ir-theme="dark"] .ant-table-tbody > tr:hover > td,
html[data-ir-theme="dark"] .ant-table-tbody > tr.ant-table-row:hover > td {
    background: var(--ir-surface-3) !important;
}

html[data-ir-theme="dark"] .ant-table-tbody > tr.ant-table-row-selected > td {
    background: var(--ir-selected) !important;
}

html[data-ir-theme="dark"] .ant-table-bordered .ant-table-container,
html[data-ir-theme="dark"] .ant-table.ant-table-bordered > .ant-table-container,
html[data-ir-theme="dark"] .ant-table.ant-table-bordered > .ant-table-title {
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-table-column-sorter,
html[data-ir-theme="dark"] .ant-table-filter-trigger {
    color: var(--ir-text-disabled) !important;
}

html[data-ir-theme="dark"] .ant-table-column-sorter-up.active,
html[data-ir-theme="dark"] .ant-table-column-sorter-down.active,
html[data-ir-theme="dark"] .ant-table-filter-trigger.active {
    color: #4096ff !important;
}

html[data-ir-theme="dark"] .ant-table-placeholder,
html[data-ir-theme="dark"] .ant-table-placeholder:hover > td {
    background: var(--ir-surface) !important;
}

html[data-ir-theme="dark"] .ant-table-filter-dropdown,
html[data-ir-theme="dark"] .ant-table-filter-dropdown-btns {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text);
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-table-expanded-row > td,
html[data-ir-theme="dark"] .ant-table-row-expand-icon {
    background: var(--ir-surface-2) !important;
    border-color: var(--ir-border-strong) !important;
    color: var(--ir-text);
}

/* ---------- cards, statistics, descriptions, lists ---------- */

html[data-ir-theme="dark"] .ant-card {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text);
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-card-head {
    color: var(--ir-text-strong) !important;
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-card-head-title,
html[data-ir-theme="dark"] .ant-statistic-title,
html[data-ir-theme="dark"] .ant-descriptions-item-label {
    color: var(--ir-text-secondary) !important;
}

html[data-ir-theme="dark"] .ant-statistic-content {
    color: var(--ir-text-strong);
}

html[data-ir-theme="dark"] .ant-descriptions-view,
html[data-ir-theme="dark"] .ant-descriptions-row > th,
html[data-ir-theme="dark"] .ant-descriptions-row > td {
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-descriptions-bordered .ant-descriptions-item-label {
    background: var(--ir-surface-3) !important;
}

html[data-ir-theme="dark"] .ant-descriptions-item-content,
html[data-ir-theme="dark"] .ant-descriptions-title,
html[data-ir-theme="dark"] .ant-list,
html[data-ir-theme="dark"] .ant-list-item,
html[data-ir-theme="dark"] .ant-typography,
html[data-ir-theme="dark"] .ant-result-title,
html[data-ir-theme="dark"] .ant-empty-description {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-result-subtitle,
html[data-ir-theme="dark"] .ant-list-item-meta-description {
    color: var(--ir-text-secondary) !important;
}

html[data-ir-theme="dark"] .ant-list-item { border-color: var(--ir-border) !important; }
html[data-ir-theme="dark"] .ant-divider { border-color: var(--ir-border) !important; color: var(--ir-text); }

/* ---------- alerts, tags, badges ---------- */

html[data-ir-theme="dark"] .ant-alert-info    { background: #111d2c !important; border-color: #15395b !important; }
html[data-ir-theme="dark"] .ant-alert-success { background: #162312 !important; border-color: #274916 !important; }
html[data-ir-theme="dark"] .ant-alert-warning { background: #2b2111 !important; border-color: #594214 !important; }
html[data-ir-theme="dark"] .ant-alert-error   { background: #2c1618 !important; border-color: #5b2526 !important; }

html[data-ir-theme="dark"] .ant-alert-message,
html[data-ir-theme="dark"] .ant-alert-description,
html[data-ir-theme="dark"] .ant-alert {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-tag:not([class*="ant-tag-"][class*="-inverse"]) {
    border-color: var(--ir-border-strong);
}

html[data-ir-theme="dark"] .ant-tag-default,
html[data-ir-theme="dark"] .ant-tag:not([class*="ant-tag-"]) {
    background: var(--ir-surface-3) !important;
    color: var(--ir-text) !important;
}

/* ---------- inputs, selects, pickers, buttons ---------- */

html[data-ir-theme="dark"] .ant-input,
html[data-ir-theme="dark"] .ant-input-affix-wrapper,
html[data-ir-theme="dark"] .ant-input-number,
html[data-ir-theme="dark"] .ant-input-number-input,
html[data-ir-theme="dark"] .ant-picker,
html[data-ir-theme="dark"] .ant-select-selector,
html[data-ir-theme="dark"] .ant-select:not(.ant-select-customize-input) .ant-select-selector,
html[data-ir-theme="dark"] .ant-input-group-addon,
html[data-ir-theme="dark"] textarea,
html[data-ir-theme="dark"] select,
html[data-ir-theme="dark"] input:not([type="checkbox"]):not([type="radio"]) {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text) !important;
    border-color: var(--ir-border-strong) !important;
}

html[data-ir-theme="dark"] .ant-input::placeholder,
html[data-ir-theme="dark"] .ant-select-selection-placeholder,
html[data-ir-theme="dark"] input::placeholder {
    color: var(--ir-text-disabled) !important;
}

html[data-ir-theme="dark"] .ant-select-arrow,
html[data-ir-theme="dark"] .ant-select-clear,
html[data-ir-theme="dark"] .ant-picker-suffix,
html[data-ir-theme="dark"] .ant-input-number-handler-wrap,
html[data-ir-theme="dark"] .ant-input-number-handler {
    color: var(--ir-text-secondary) !important;
    background: var(--ir-surface-2) !important;
    border-color: var(--ir-border-strong) !important;
}

html[data-ir-theme="dark"] .ant-select-selection-item {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-select-multiple .ant-select-selection-item {
    background: var(--ir-surface-3) !important;
    border-color: var(--ir-border-strong) !important;
}

html[data-ir-theme="dark"] .ant-btn-default,
html[data-ir-theme="dark"] .ant-btn:not(.ant-btn-primary):not(.ant-btn-link):not(.ant-btn-text):not(.ant-btn-dangerous) {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text) !important;
    border-color: var(--ir-border-strong) !important;
}

html[data-ir-theme="dark"] .ant-btn-dangerous:not(.ant-btn-primary) {
    background: transparent !important;
}

html[data-ir-theme="dark"] .ant-btn[disabled],
html[data-ir-theme="dark"] .ant-btn:disabled {
    background: var(--ir-surface-3) !important;
    color: var(--ir-text-disabled) !important;
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-checkbox-inner,
html[data-ir-theme="dark"] .ant-radio-inner {
    background: var(--ir-surface-2);
    border-color: var(--ir-border-strong);
}

html[data-ir-theme="dark"] .ant-checkbox-wrapper,
html[data-ir-theme="dark"] .ant-radio-wrapper,
html[data-ir-theme="dark"] .ant-form-item-label > label {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-switch:not(.ant-switch-checked) {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* ---------- popups: dropdowns, select lists, pickers, popovers, modals, tooltips ---------- */

html[data-ir-theme="dark"] .ant-dropdown-menu,
html[data-ir-theme="dark"] .ant-select-dropdown,
html[data-ir-theme="dark"] .ant-picker-dropdown .ant-picker-panel-container,
html[data-ir-theme="dark"] .ant-picker-panel,
html[data-ir-theme="dark"] .ant-popover-inner,
html[data-ir-theme="dark"] .ant-popover-arrow::before,
html[data-ir-theme="dark"] .ant-modal-content,
html[data-ir-theme="dark"] .ant-modal-header,
html[data-ir-theme="dark"] .ant-modal-footer,
html[data-ir-theme="dark"] .ant-drawer-content,
html[data-ir-theme="dark"] .ant-drawer-header {
    background: var(--ir-surface-2) !important;
    color: var(--ir-text) !important;
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-dropdown-menu-item,
html[data-ir-theme="dark"] .ant-select-item,
html[data-ir-theme="dark"] .ant-select-item-option-content,
html[data-ir-theme="dark"] .ant-picker-cell,
html[data-ir-theme="dark"] .ant-picker-header,
html[data-ir-theme="dark"] .ant-picker-header button,
html[data-ir-theme="dark"] .ant-picker-content th,
html[data-ir-theme="dark"] .ant-popover-title,
html[data-ir-theme="dark"] .ant-popover-message,
html[data-ir-theme="dark"] .ant-popconfirm-message-title,
html[data-ir-theme="dark"] .ant-modal-title,
html[data-ir-theme="dark"] .ant-modal-close,
html[data-ir-theme="dark"] .ant-drawer-title {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-dropdown-menu-item:hover,
html[data-ir-theme="dark"] .ant-select-item-option-active:not(.ant-select-item-option-disabled),
html[data-ir-theme="dark"] .ant-picker-cell:hover .ant-picker-cell-inner {
    background: var(--ir-surface-3) !important;
}

html[data-ir-theme="dark"] .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
    background: var(--ir-selected) !important;
}

html[data-ir-theme="dark"] .ant-picker-cell:not(.ant-picker-cell-in-view) {
    color: var(--ir-text-disabled) !important;
}

/* ---------- tabs, pagination, menu (light parts), breadcrumbs, collapse ---------- */

html[data-ir-theme="dark"] .ant-tabs,
html[data-ir-theme="dark"] .ant-tabs-tab {
    color: var(--ir-text-secondary);
}

html[data-ir-theme="dark"] .ant-tabs-tab-active .ant-tabs-tab-btn {
    color: #4096ff !important;
}

html[data-ir-theme="dark"] .ant-tabs-nav::before,
html[data-ir-theme="dark"] .ant-tabs-card .ant-tabs-tab {
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-tabs-card .ant-tabs-tab {
    background: var(--ir-surface-2) !important;
}

html[data-ir-theme="dark"] .ant-tabs-card .ant-tabs-tab-active {
    background: var(--ir-surface) !important;
}

html[data-ir-theme="dark"] .ant-pagination,
html[data-ir-theme="dark"] .ant-pagination-item a,
html[data-ir-theme="dark"] .ant-pagination-prev .ant-pagination-item-link,
html[data-ir-theme="dark"] .ant-pagination-next .ant-pagination-item-link,
html[data-ir-theme="dark"] .ant-pagination-jump-prev .ant-pagination-item-ellipsis,
html[data-ir-theme="dark"] .ant-pagination-jump-next .ant-pagination-item-ellipsis {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-pagination-item {
    background: transparent !important;
}

html[data-ir-theme="dark"] .ant-pagination-item-active {
    background: var(--ir-surface-2) !important;
    border-color: #1677ff !important;
}

html[data-ir-theme="dark"] .ant-pagination-item-active a {
    color: #4096ff !important;
}

html[data-ir-theme="dark"] .ant-pagination-disabled .ant-pagination-item-link {
    color: var(--ir-text-disabled) !important;
}

html[data-ir-theme="dark"] .ant-menu-light,
html[data-ir-theme="dark"] .ant-menu:not(.ant-menu-dark) {
    background: var(--ir-surface) !important;
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-breadcrumb,
html[data-ir-theme="dark"] .ant-breadcrumb a,
html[data-ir-theme="dark"] .ant-breadcrumb-separator {
    color: var(--ir-text-secondary) !important;
}

html[data-ir-theme="dark"] .ant-collapse,
html[data-ir-theme="dark"] .ant-collapse-content,
html[data-ir-theme="dark"] .ant-collapse > .ant-collapse-item {
    background: var(--ir-surface-2) !important;
    border-color: var(--ir-border) !important;
}

html[data-ir-theme="dark"] .ant-collapse-header,
html[data-ir-theme="dark"] .ant-collapse-content {
    color: var(--ir-text) !important;
}

html[data-ir-theme="dark"] .ant-progress-text { color: var(--ir-text) !important; }
html[data-ir-theme="dark"] .ant-progress-inner { background: var(--ir-surface-3) !important; }

/* ---------- inline colours set in page markup ---------- */

html[data-ir-theme="dark"] [style*="background-color: #FBFBFB"],
html[data-ir-theme="dark"] [style*="background-color:#FBFBFB"],
html[data-ir-theme="dark"] [style*="background: #ECECEC"],
html[data-ir-theme="dark"] [style*="background-color: #ececec"],
html[data-ir-theme="dark"] [style*="background: #fff"],
html[data-ir-theme="dark"] [style*="background: rgba(0,0,0,0.04)"] {
    background: var(--ir-surface-2) !important;
}

html[data-ir-theme="dark"] [style*="color: #52514e"],
html[data-ir-theme="dark"] [style*="color:#52514e"] {
    color: var(--ir-text-secondary) !important;
}
