/* Neuronix dark mode for both OpenIM GUIs. Linked by gui-theme-proxy after theme.css and
   web.css/admin.css with media="all" (GUI_THEME_MODE=dark), "(prefers-color-scheme: dark)"
   (auto) or "not all" (light). Colours: the dark sections of neuronixtech.com.
   Like theme.css, these override antd's CSS-in-JS, so they need !important. */
:root {
  --ccs-d-bg: #050e16;        /* page */
  --ccs-d-surface: #0c1d2c;   /* panels, cards, tables, menus */
  --ccs-d-raised: #0e2234;    /* inputs, popups, received bubbles */
  --ccs-d-hover: #142c42;
  --ccs-d-border: #1a3a52;
  --ccs-d-text: #e2e8f0;
  --ccs-d-muted: #94a3b8;
  --ccs-primary-bg: rgba(0, 188, 170, 0.16);   /* selected rows/items on dark */
  --ccs-primary-ring: rgba(0, 188, 170, 0.3);
}
html { color-scheme: dark; }
html body, #root { background: var(--ccs-d-bg) !important; color: var(--ccs-d-text) !important; }
::placeholder { color: var(--ccs-d-muted) !important; opacity: 0.7; }

/* ---------- antd: surfaces ---------- */
.ant-layout, .ant-layout-content, .ant-pro-layout, .ant-pro-layout-container,
.ant-pro-layout-content, .ant-pro-page-container, .ant-pro-grid-content { background: var(--ccs-d-bg) !important; }
.ant-pro-layout-bg-list { display: none !important; }
.ant-card, .ant-pro-card, .ant-table, .ant-table-container, .ant-table-thead > tr > th,
.ant-table-tbody > tr > td, .ant-table-placeholder, .ant-table-cell-fix-left, .ant-table-cell-fix-right,
.ant-list, .ant-collapse, .ant-collapse-content, .ant-descriptions-view,
.ant-layout-header, .ant-pro-global-header, .ant-pro-layout-header, .ant-layout-sider, .ant-pro-sider,
.ant-menu, .ant-menu-sub, .ant-menu-inline, .ant-pro-query-filter, .ant-pro-table-list-toolbar,
.ant-pro-table-search, .ant-transfer-list, .ant-tree, .ant-calendar, .ant-upload-wrapper .ant-upload-drag {
  background: var(--ccs-d-surface) !important;
  border-color: var(--ccs-d-border) !important;
}
.ant-modal-content, .ant-modal-header, .ant-modal-footer, .ant-drawer-content, .ant-drawer-header,
.ant-popover-inner, .ant-popconfirm-inner, .ant-dropdown-menu, .ant-select-dropdown,
.ant-picker-dropdown .ant-picker-panel-container, .ant-picker-panel, .ant-message-notice-content,
.ant-notification-notice, .ant-cascader-menus, .ant-tooltip-inner, .ant-popover-arrow::before,
.ant-dropdown .ant-dropdown-menu, .ant-image-preview-operations, .ant-tour-inner {
  background: var(--ccs-d-raised) !important;
  color: var(--ccs-d-text) !important;
}
.ant-table-thead > tr > th { background: var(--ccs-d-raised) !important; }
.ant-table-tbody > tr.ant-table-row:hover > td, .ant-table-tbody > tr > td.ant-table-cell-row-hover,
.ant-menu-item:not(.ant-menu-item-selected):hover, .ant-menu-submenu-title:hover,
.ant-dropdown-menu-item:hover, .ant-select-item-option-active:not(.ant-select-item-option-disabled),
.ant-picker-cell:hover .ant-picker-cell-inner, .ant-list-item:hover { background: var(--ccs-d-hover) !important; }
.ant-table-thead > tr > th::before { background: var(--ccs-d-border) !important; }
.ant-divider, .ant-card-head, .ant-list-item, .ant-table-tbody > tr > td, .ant-table-thead > tr > th,
.ant-tabs-nav::before, .ant-modal-footer, .ant-drawer-header, .ant-collapse-item,
.ant-descriptions-bordered .ant-descriptions-item-label, .ant-descriptions-bordered .ant-descriptions-item-content,
.ant-descriptions-bordered .ant-descriptions-row, .ant-layout-sider, .ant-pro-sider, .ant-menu-inline,
.ant-pro-global-header, .ant-layout-header { border-color: var(--ccs-d-border) !important; }
.ant-descriptions-bordered .ant-descriptions-item-label { background: var(--ccs-d-raised) !important; }

/* ---------- antd: text ---------- */
h1, h2, h3, h4, h5, h6, .ant-typography, .ant-table, .ant-table-thead > tr > th, .ant-form-item-label > label,
.ant-modal-title, .ant-modal-close, .ant-drawer-title, .ant-drawer-close, .ant-card, .ant-card-head-title,
.ant-descriptions-item-label, .ant-descriptions-item-content, .ant-descriptions-title, .ant-menu, .ant-menu-item,
.ant-menu-submenu-title, .ant-menu-title-content, .ant-breadcrumb-link, .ant-breadcrumb-separator,
.ant-breadcrumb li:last-child, .ant-pro-page-container-title, .ant-page-header-heading-title,
.ant-pagination, .ant-pagination-item a, .ant-pagination-item-link, .ant-select-selection-item,
.ant-select-item, .ant-select-arrow, .ant-checkbox-wrapper, .ant-radio-wrapper, .ant-tabs, .ant-tabs-tab,
.ant-dropdown-menu-item, .ant-dropdown-menu-title-content, .ant-list-item, .ant-list-item-meta-title,
.ant-empty-description, .ant-result-title, .ant-statistic-content, .ant-pro-card-title, .ant-form-item,
.ant-picker-content th, .ant-picker-cell-in-view, .ant-picker-header, .ant-picker-header button,
.ant-pro-global-header-logo h1, .ant-pro-layout-logo h1, .ant-pro-table-list-toolbar-title,
.ant-message-notice-content, .ant-notification-notice-message, .ant-notification-notice-description,
.ant-popover-title, .ant-popover-inner-content, .ant-popconfirm-title, .ant-popconfirm-description,
.ant-transfer-list-header, .ant-collapse-header, .ant-tree-title, .ant-input-number-handler {
  color: var(--ccs-d-text) !important;
}
.ant-typography-secondary, .ant-breadcrumb, .ant-breadcrumb a, .ant-form-item-extra, .ant-list-item-meta-description,
.ant-statistic-title, .ant-result-subtitle, .ant-empty-description, .ant-picker-cell:not(.ant-picker-cell-in-view),
.ant-pagination-total-text, .ant-card-meta-description, .ant-select-selection-placeholder,
.ant-pro-global-header-header-actions-item, .ant-input-prefix, .ant-input-suffix, .ant-input-password-icon,
.ant-menu-item .anticon, .ant-menu-submenu-arrow, .ant-pro-base-menu-inline-item-icon { color: var(--ccs-d-muted) !important; }

/* ---------- antd: inputs and default buttons ---------- */
.ant-input, .ant-input-affix-wrapper, .ant-input-password, .ant-input-number, .ant-input-number-input,
.ant-input-group-addon, .ant-select:not(.ant-select-customize-input) .ant-select-selector, .ant-picker,
.ant-picker-input > input, .ant-input-search-button:not(.ant-btn-primary), textarea.ant-input,
.ant-mentions, .ant-input-number-handler-wrap, .ant-checkbox-inner, .ant-radio-inner, .ant-radio-button-wrapper,
.ant-segmented, .ant-input-affix-wrapper > input.ant-input,
.ant-pagination-options-quick-jumper input, .ant-pro-sider-collapsed-button,
.ant-float-btn-default, .ant-float-btn-default .ant-float-btn-body {
  background-color: var(--ccs-d-raised) !important;
  border-color: var(--ccs-d-border) !important;
  color: var(--ccs-d-text) !important;
}
.ant-input-affix-wrapper > input.ant-input { border: 0 !important; }
.ant-btn-default:not(.ant-btn-dangerous):not(:disabled), .ant-btn-dashed:not(:disabled),
.ant-pagination-item, .ant-pagination-prev .ant-pagination-item-link, .ant-pagination-next .ant-pagination-item-link {
  background: var(--ccs-d-raised) !important;
  border-color: var(--ccs-d-border) !important;
  color: var(--ccs-d-text) !important;
}
.ant-btn-text:not(:disabled):not(.ant-btn-dangerous), .ant-btn-icon-only:not(.ant-btn-primary) { color: var(--ccs-d-text) !important; }
.ant-btn-text:not(:disabled):hover { background: var(--ccs-d-hover) !important; }
.ant-btn:disabled, .ant-input-disabled, .ant-select-disabled .ant-select-selector {
  background: var(--ccs-d-surface) !important; border-color: var(--ccs-d-border) !important; color: var(--ccs-d-muted) !important;
}
.ant-tag:not([class*="ant-tag-"]) { background: var(--ccs-d-raised) !important; border-color: var(--ccs-d-border) !important; color: var(--ccs-d-text) !important; }
.ant-switch:not(.ant-switch-checked) { background: var(--ccs-d-border) !important; }
.ant-skeleton-content .ant-skeleton-title, .ant-skeleton-content .ant-skeleton-paragraph > li { background: var(--ccs-d-raised) !important; }
.ant-empty-img-default-ellipse, .ant-empty-img-simple-ellipse { fill: var(--ccs-d-raised) !important; }

/* ---------- web chat client (openim-web-front) ---------- */
html:root {
  --chat-bubble: var(--ccs-d-raised);       /* received messages */
  --chat-bubble-sender: #0b4d47;            /* own messages: deep teal */
  --base-black: var(--ccs-d-text);
  --sub-text: var(--ccs-d-muted);
  --gap-text: var(--ccs-d-border);
  --primary-active: var(--ccs-primary-bg);
  --top-search-bar: var(--ccs-d-surface);
}
/* Tailwind surfaces and text the client uses */
.bg-white, .bg-\[\#fff\], .bg-\[\#FFF\], .bg-\[\#ffffff\], .bg-\[\#FFFFFF\] { background-color: var(--ccs-d-surface) !important; }
.bg-gray-100, .bg-\[\#e9e9eb\], .bg-\[\#E9E9EB\], .bg-\[\#F4F5F7\], .bg-\[\#f4f5f7\], .bg-\[\#F2F8FF\], .bg-\[\#f2f8ff\],
.bg-\[\#E8EAEF\], .bg-\[\#e8eaef\], .bg-\[\#F8F9FA\] { background-color: var(--ccs-d-raised) !important; }
.text-\[\#0C1C33\], .text-\[\#0c1c33\], .text-black, .text-gray-900, .text-gray-800 { color: var(--ccs-d-text) !important; }

/* Admin dashboard: embedded frame (Grafana) keeps the browser's light default border. */
.ant-pro-layout iframe { border-color: var(--ccs-d-border) !important; border-style: solid !important; }

/* Every other light Tailwind surface in the two bundles (listed from their CSS). */
.bg-\[\#e3e3e3\], .bg-\[\#e6f3ff\], .bg-\[\#E8EAEFFF\], .bg-\[\#f0f2f5\], .bg-\[\#F0F8FF\],
.bg-\[\#f3f3f3\], .bg-\[\#f3f8fe\], .bg-\[\#f4f8fd\] { background-color: var(--ccs-d-raised) !important; }
.text-gray-400, .text-gray-500 { color: var(--ccs-d-muted) !important; }
