/**
 * Preferred Presentation: Compact vs Comfortable
 * Body class is set from user preference (PREFERREDPRESENTATION) in page-template.jsp.
 * All overrides use !important so they win over base styles.
 */

/* --- Compact (default): tighter spacing --- */
body.spacing-compact input,
body.spacing-compact textarea,
body.spacing-compact select,
body.spacing-compact .hess-select {
    padding: 0.35rem 0.5rem !important;
}

body.spacing-compact .hess-content-container,
body.spacing-compact main {
    padding: 0.75rem 0.75rem !important;
}

body.spacing-compact .hess-grid-container table th,
body.spacing-compact .hess-grid-container table td,
body.spacing-compact .hess-grid-table th,
body.spacing-compact .hess-grid-table td {
    padding: 4px 6px !important;
}

body.spacing-compact .hess-grid-page-container {
    padding: 0.35rem !important;
}

body.spacing-compact .hess-detail-dashboard-grid {
    gap: 0.5rem !important;
}

body.spacing-compact .hess-card,
body.spacing-compact .hess-detail-card {
    padding: 0.5rem!important;
}

body.spacing-compact .hess-card td,
body.spacing-compact .hess-detail-card td {
    padding: 0.25rem!important;
}

body.spacing-compact h.ess-detail-card-header
{
    padding-bottom: 0.25rem!important;
    margin-bottom: 0.25rem!important;
}
body.spacing-compact button,
body.spacing-compact .hess-btn,
body.spacing-compact input[type="submit"],
body.spacing-compact input[type="button"] {
    padding: 0.35rem 0.65rem !important;
}

/* --- Comfortable: more generous spacing --- */
body.spacing-comfortable input,
body.spacing-comfortable textarea,
body.spacing-comfortable select,
body.spacing-comfortable .hess-select {
    padding: 0.5rem 0.5rem !important;
}

body.spacing-comfortable .hess-content-container,
body.spacing-comfortable main {
    padding: 1.25rem 1.5rem !important;
}

body.spacing-comfortable .hess-grid-container table th,
body.spacing-comfortable .hess-grid-container table td,
body.spacing-comfortable .hess-grid-table th,
body.spacing-comfortable .hess-grid-table td {
    padding: 12px 14px !important;
}

body.spacing-comfortable .hess-grid-page-container {
    padding: 0.75rem!important;
    min-height: calc(100vh - 115px)!important;
    height: calc(100vh - 115px)!important;
}

body.spacing-comfortable .hess-map-container {
    min-height: calc(100vh - 115px)!important;
}

body.spacing-comfortable .hess-detail-dashboard-grid {
    gap: 1.25rem !important;
}

body.spacing-comfortable .hess-card {
    padding: 1.25rem 1.5rem !important;
}

body.spacing-comfortable button,
body.spacing-comfortable .hess-btn,
body.spacing-comfortable input[type="submit"],
body.spacing-comfortable input[type="button"] {
    padding: 0.5rem 0.5rem !important;
}

/* ==========================================================================
   Dark theme (Preferred Presentation: Compact - Dark / Comfortable - Dark)
   Body class theme-dark is set from PREFERREDPRESENTATION in page-template.jsp.
   Minimal overrides so base hess.css stays the single source for structure.
   ========================================================================== */
body.theme-dark,
body.theme-dark.hess-body {
    background-color: #1e1e1e !important;
}

body.theme-dark .main-content {
    background-color: #1e1e1e !important;
}

body.theme-dark .hess-header {
    background-color: #2d2d2d !important;
    border-bottom-color: #404040 !important;
}

body.theme-dark .hess-sidebar,
body.theme-dark .hess-sidebar-logo,
body.theme-dark .hess-sidebar-alert,
body.theme-dark .hess-sidebar-alert-summary,
body.theme-dark .hess-sidebar-history {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-sidebar-alert-header:hover,
body.theme-dark .hess-sidebar-history-header:hover,
body.theme-dark .hess-sidebar-logo:hover {
    background-color: #3d3d3d !important;
}

body.theme-dark .hess-sidebar-menu > li {
    border-bottom-color: #404040 !important;
}

body.theme-dark .hess-sidebar-menu > li.active > .hess-sidebar-parent-link {
    background-color: #1e3a5f !important;
    border-right-color: #3a89de !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-sidebar-parent-link:hover {
    background-color: #3d3d3d !important;
    color: #e5e5e5 !important;
}

/* Sidebar submenu: links and selected (active) child */
body.theme-dark .hess-sidebar-submenu {
    border-top-color: #404040 !important;
}

body.theme-dark .hess-sidebar-submenu li a {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-sidebar-submenu li a:hover {
    background-color: #3d3d3d !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-sidebar-submenu li a.active {
    background-color: #1e3a5f !important;
    color: #8fc5fa !important;
}

body.theme-dark .hess-sidebar-history-list li {
    border-top-color: #404040 !important;
}

body.theme-dark .hess-sidebar-history-list a:hover {
    background-color: #3d3d3d !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-sidebar-alert-text,
body.theme-dark .hess-sidebar-alert-content,
body.theme-dark .hess-sidebar-history-header .hess-sidebar-link-content,
body.theme-dark .hess-sidebar-parent-link,
body.theme-dark .hess-sidebar-history-list a {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-header-azure-badge,
body.theme-dark .hess-header-user-icon,
body.theme-dark .hess-header-user-dropdown-arrow,
body.theme-dark .hess-header-time,
body.theme-dark .hess-header-username {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-header-user-dropdown-toggle:hover {
    background-color: #3d3d3d !important;
}

body.theme-dark .hess-header-user-dropdown-menu {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-header-user-dropdown-item {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-header-user-dropdown-item:hover {
    background-color: #3d3d3d !important;
}

body.theme-dark .hess-header-search-input {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e5e5e5 !important;
}

body.theme-dark [id*="Dable_search"] {
    background-color: #252525 !important;
    border-color: #404040 !important;
    color: #e5e5e5 !important;
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3 {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-sidebar-separator {
    background-color: #404040 !important;
}

body.theme-dark .hess-header-user-dropdown-name {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-content-container,
body.theme-dark main {
    background-color: #1e1e1e !important;
}

body.theme-dark input[type="text"],
body.theme-dark input[type="number"],
body.theme-dark input[type="email"],
body.theme-dark input[type="tel"],
body.theme-dark input[type="password"],
body.theme-dark textarea,
body.theme-dark select,
body.theme-dark .hess-select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #9ca3af !important;
}

body.theme-dark select option {
    background-color: #252525 !important;
    color: #e5e5e5 !important;
}

/* Checkboxes and radios: dark background, light check */
body.theme-dark input[type="checkbox"],
body.theme-dark input[type="radio"] {
    background-color: #252525 !important;
    border: 1px solid #505050 !important;
    accent-color: #3a89de;
}

body.theme-dark .hess-detail-card {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-card th,
body.theme-dark .hess-detail-card td {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-card td:first-child,
body.theme-dark .hess-detail-card th:first-child {
    color: #a0a0a0 !important;
}

body.theme-dark .hess-detail-card label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-card-nested {
    background-color: #252525 !important;
}

body.theme-dark .hess-detail-card-nested > h2,
body.theme-dark .hess-detail-card-nested > h3,
body.theme-dark .hess-detail-card-nested > h4 {
    color: #e5e5e5 !important;
    border-bottom-color: #404040 !important;
}

body.theme-dark .critical-section {
    background-color: #2d2020 !important;
    border-color: #5c3a3a !important;
    border-left-color: #dc2626 !important;
}

body.theme-dark .critical-section h2,
body.theme-dark .critical-section h3,
body.theme-dark .critical-section .section-title {
    color: #fca5a5 !important;
}

body.theme-dark .critical-section input[type="text"],
body.theme-dark .critical-section input[type="number"] {
    background-color: #252525 !important;
    border-color: #5c3a3a !important;
    color: #e5e5e5 !important;
}

body.theme-dark .critical-section input:focus {
    border-color: #dc2626 !important;
}

body.theme-dark .critical-section button {
    background-color: #404040 !important;
    border-color: #dc2626 !important;
    color: #fca5a5 !important;
}

body.theme-dark .critical-section button:hover {
    background-color: #5c3a3a !important;
    border-color: #ef4444 !important;
    color: #fecaca !important;
}

body.theme-dark .critical-section td,
body.theme-dark .critical-section label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-card,
body.theme-dark .hess-detail-card {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

/* Remove background colors from detail card table rows (except alerts) */
body.theme-dark .hess-detail-card table thead th{
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-card td,
body.theme-dark .hess-detail-card td {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-filter {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-grid-filter-select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-grid-filter-label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-page-container {
    background-color: #1e1e1e !important;
}

body.theme-dark .hess-grid-container {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-grid-container table thead,
body.theme-dark .hess-grid-table thead {
    background-color: #353535 !important;
}

body.theme-dark .hess-grid-container table th,
body.theme-dark .hess-grid-container table td,
body.theme-dark .hess-grid-table th,
body.theme-dark .hess-grid-table td {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-container table thead th,
body.theme-dark .hess-grid-table thead th {
    background-color: #353535 !important;
    color: #e5e5e5 !important;
    border-bottom-color: #404040 !important;
}

/* Override Dable inline row backgrounds */
body.theme-dark .hess-grid-container table tbody tr,
body.theme-dark .hess-grid-table tbody tr,
body.theme-dark .hess-grid-dable-container table tbody tr,
body.theme-dark div[id$="Dable"] table tbody tr {
    background-color: #2d2d2d !important;
}

body.theme-dark .hess-grid-container table tbody tr:nth-child(even),
body.theme-dark .hess-grid-table tbody tr:nth-child(even),
body.theme-dark .hess-grid-dable-container table tbody tr:nth-child(even),
body.theme-dark div[id$="Dable"] table tbody tr:nth-child(even) {
    background-color: #282828 !important;
}

body.theme-dark .hess-grid-container table tbody td,
body.theme-dark .hess-grid-table tbody td,
body.theme-dark .hess-grid-dable-container table tbody td,
body.theme-dark div[id$="Dable"] table tbody td {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-dable-container {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

/* Dable header (Columns, filters above table) */
body.theme-dark .hess-dable-header,
body.theme-dark div[id$="Dable_header"] {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-dable-header input[type="text"],
body.theme-dark .hess-dable-header select,
body.theme-dark div[id$="Dable_header"] input[type="text"],
body.theme-dark div[id$="Dable_header"] select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

/* Dable footer (pager, Show X entries) */
body.theme-dark div[id$="Dable_footer"],
body.theme-dark .hess-dable-footer {
    background-color: #2d2d2d !important;
    border-top-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark div[id$="Dable_footer"] select,
body.theme-dark .hess-dable-footer select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-dable-pager-btn input[type="button"],
body.theme-dark div[id$="Dable_footer"] .hess-dable-pager-btn input[type="button"],
body.theme-dark .dable-reset-sort {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-dable-pager-btn input[type="button"]:hover:not(:disabled),
body.theme-dark .dable-reset-sort:hover {
    background-color: #505050 !important;
    border-color: #606060 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-dable-pager-btn[disabled] input[type="button"] {
    background-color: #353535 !important;
    border-color: #404040 !important;
    color: #808080 !important;
}

/* Column selector button (Columns) */
body.theme-dark .dable-column-selector-btn {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .dable-column-selector-btn:hover {
    background-color: #505050 !important;
    border-color: #606060 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .dable-column-selector-btn-disabled {
    background-color: #353535 !important;
    border-color: #404040 !important;
    color: #808080 !important;
}

/* Column selector popup (Show/Hide Columns) - overrides inline styles from JS */
body.theme-dark .dable-column-selector-popup {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .dable-column-selector-popup > div:first-child {
    color: #e5e5e5 !important;
    border-bottom-color: #404040 !important;
}

body.theme-dark .dable-column-selector-popup label {
    color: #d0d0d0 !important;
}

body.theme-dark .dable-column-selector-popup label:hover {
    background-color: #3d3d3d !important;
}

body.theme-dark .dable-column-selector-popup input[type="checkbox"] {
    background-color: #252525 !important;
    border-color: #505050 !important;
    accent-color: #3a89de;
}

body.theme-dark .hess-footer {
    border-top-color: #404040 !important;
    color: #a0a0a0 !important;
}

body.theme-dark .hess-footer-content,
body.theme-dark .hess-footer-links a {
    color: #a0a0a0 !important;
}

body.theme-dark .hess-footer-links a:hover {
    color: #3a89de !important;
}

body.theme-dark .hess-grid-page-title {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-grid-action-button,
body.theme-dark .hess-grid-filter-info-button {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-action-button:hover:not(.disabled),
body.theme-dark .hess-grid-filter-info-button:hover {
    background-color: #505050 !important;
    border-color: #606060 !important;
}

body.theme-dark .hess-alerts-map-button {
    background-color: #404040 !important;
    border-color: #505050 !important;
}

body.theme-dark .hess-alerts-map-button:hover {
    background-color: #505050 !important;
    border-color: #606060 !important;
}

body.theme-dark .hess-alerts-map-button:active {
    background-color: #353535 !important;
}

body.theme-dark .hess-alerts-map-button .hess-alerts-map-icon {
    filter: invert(1) brightness(0.9);
}

body.theme-dark .hess-detail-form-actions-sticky {
    background-color: #2d2d2d;
}

body.theme-dark .hess-detail-form-actions .hess-detail-form-button:not(.hess-detail-form-button-primary) {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-form-actions .hess-detail-form-button:not(.hess-detail-form-button-primary):hover {
    background-color: #505050 !important;
}

/* All secondary hess-detail-form-button (anywhere on page) */
body.theme-dark .hess-detail-form-button:not(.hess-detail-form-button-primary) {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-form-button:not(.hess-detail-form-button-primary):hover:not(:disabled) {
    background-color: #505050 !important;
    border-color: #606060 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-detail-form-button:not(.hess-detail-form-button-primary):disabled {
    background-color: #353535 !important;
    color: #808080 !important;
}

body.theme-dark .hess-detail-form-button-small:not(.hess-detail-form-button-primary) {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-form-button-small:not(.hess-detail-form-button-primary):hover:not(:disabled) {
    background-color: #505050 !important;
}

body.theme-dark .hess-detail-navigation input[type="button"],
body.theme-dark .hess-detail-navigation button {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-detail-navigation input[type="button"]:hover:not(:disabled),
body.theme-dark .hess-detail-navigation button:hover:not(:disabled) {
    background-color: #505050 !important;
    border-color: #606060 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-detail-navigation input[type="button"]:disabled,
body.theme-dark .hess-detail-navigation button:disabled {
    background-color: #353535 !important;
    color: #808080 !important;
}

body.theme-dark .hess-detail-navigation select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .alert-section {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .alert-section button {
    background-color: #404040 !important;
    border-color: #3a89de !important;
    color: #8fc5fa !important;
}

body.theme-dark .alert-section button:hover {
    background-color: #1e3a5f !important;
    border-color: #3a89de !important;
    color: #b3d4fc !important;
}

/* Links in content and tables */
body.theme-dark .hess-detail-card a,
body.theme-dark .hess-grid-container a,
body.theme-dark .hess-grid-table a,
body.theme-dark .hess-grid-dable-container a {
    color: #6eb3f7 !important;
}

body.theme-dark .hess-detail-card a:hover,
body.theme-dark .hess-grid-container a:hover,
body.theme-dark .hess-grid-table a:hover {
    color: #8fc5fa !important;
}

/* Filter checkbox group (e.g. Display Inactive) */
body.theme-dark .hess-grid-filter-checkbox {
    background-color: transparent !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-filter-checkbox label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-filter-info-content {
    color: #d0d0d0 !important;
}

/* Scrollbars in dark theme */
body.theme-dark ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body.theme-dark ::-webkit-scrollbar-track {
    background: #252525;
}

body.theme-dark ::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 6px;
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

body.theme-dark {
    scrollbar-color: #505050 #252525;
}

/* ==========================================================================
   Dark theme: Map page (dtmmap.jsp) - filter panel, controls, device summary, help modal
   ========================================================================== */
body.theme-dark .hess-map-container {
    background-color: #1e1e1e !important;
}

body.theme-dark .hess-sidebar-filters-absolute {
    background-color: #2d2d2d !important;
    border-right-color: #404040 !important;
}

body.theme-dark .hess-map-filter-section {
    background-color: #252525 !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-map-filter-section-content {
    background-color: transparent !important;
}

body.theme-dark .hess-map-filter-buttons {
    background-color: #2d2d2d !important;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.25) !important;
}

body.theme-dark .hess-map-filter-section h4,
body.theme-dark .hess-map-filter-section-toggle {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-map-filter-section-toggle:hover {
    background-color: #3d3d3d !important;
}

body.theme-dark .hess-map-filter-toggle-icon {
    color: #a0a0a0 !important;
}

body.theme-dark .hess-map-filter-checkbox-row label,
body.theme-dark .hess-map-filter-label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-map-filter-select {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-reset-filters-button {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-reset-filters-button:hover {
    background-color: #505050 !important;
}

body.theme-dark .hess-tree-search-wrapper {
    border-bottom-color: #404040 !important;
}

body.theme-dark .hess-tree-search-input {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-tree-search-clear {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-tree-search-clear:hover {
    background-color: #505050 !important;
}

body.theme-dark .hess-tree-panel {
    background-color: #2d2d2d !important;
}

body.theme-dark .hess-tree-container {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-tree-container a {
    color: #8fc5fa !important;
}

body.theme-dark .hess-tree-container a:hover {
    color: #b3d4fc !important;
}

body.theme-dark .hess-map-controls-overlay {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark #deviceCountDisplay {
    border-bottom-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .map-type-btn {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .map-type-btn:hover {
    background-color: #505050 !important;
}

body.theme-dark .hess-map-zoom-btn {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-map-zoom-btn:hover {
    background-color: #505050 !important;
}

body.theme-dark .hess-map-help-btn {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-map-help-btn:hover {
    background-color: #505050 !important;
}

body.theme-dark .hess-device-summary-sidebar {
    background-color: rgba(45, 45, 45, 0.98) !important;
    border-top-color: #3a89de !important;
}

body.theme-dark .hess-device-summary-content {
    background-color: #2d2d2d !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-device-summary-content table td {
    border-bottom-color: #404040 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .hess-device-summary-content table td:first-child {
    color: #a0a0a0 !important;
}

body.theme-dark .hess-device-summary-footer {
    background-color: #353535 !important;
    border-top-color: #404040 !important;
}

body.theme-dark .hess-map-filter-overlay {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

body.theme-dark .hess-map-help-modal {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
}

body.theme-dark .hess-map-help-modal-body {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-map-help-modal-body h3 {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-map-help-table td {
    color: #d0d0d0 !important;
    border-color: #404040 !important;
}

/* ==========================================================================
   Dark theme: Chart containers and graph pages (Highcharts/Chart.js wrappers)
   Chart internals (axes, grid, labels) need JS theming for full dark; these
   styles darken the containers and parameter panels.
   ========================================================================== */
body.theme-dark .hess-detail-graphs {
    background-color: transparent !important;
}

body.theme-dark .hess-detail-graph-item {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-chart-container {
    background-color: #252525 !important;
}

/* Highcharts places the chart in a div; darken the wrapper */
body.theme-dark .hess-chart-container .highcharts-container,
body.theme-dark .hess-detail-graph-item .highcharts-container {
    background-color: #252525 !important;
}

body.theme-dark .hess-graph-parameters {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .hess-graph-parameters-section-title,
body.theme-dark .hess-graph-parameters-group-title {
    color: #e5e5e5 !important;
}

body.theme-dark .hess-graph-parameters-group label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-graph-parameters-group select,
body.theme-dark .hess-graph-parameters input[type="text"],
body.theme-dark .hess-graph-parameters input[type="number"] {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .hess-graph-parameters-date-group label {
    color: #d0d0d0 !important;
}

body.theme-dark .hess-graph-parameters-submit,
body.theme-dark .hess-map-filter-buttons.hess-graph-parameters-submit {
    background-color: #2d2d2d !important;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.25) !important;
}

/* ==========================================================================
   Dark theme: Login page (cookie-driven when not logged in)
   ========================================================================== */
body.theme-dark .login-container,
body.theme-dark .login-main-content,
body.theme-dark .login-main {
    background-color: #1e1e1e !important;
}

body.theme-dark .login-left-panel {
    background-color: #2d2d2d !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

body.theme-dark .login-card {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

body.theme-dark .login-title {
    color: #e5e5e5 !important;
}

body.theme-dark .login-label {
    color: #d0d0d0 !important;
}

body.theme-dark .login-input {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .login-input::placeholder {
    color: #9ca3af !important;
}

body.theme-dark .login-button:hover:not(:disabled) {
    background-color: #1D4ED8 !important;
}

body.theme-dark .login-text,
body.theme-dark .login-note {
    color: #d0d0d0 !important;
}

body.theme-dark .login-footer {
    border-top-color: #404040 !important;
}

body.theme-dark .login-footer .hess-footer,
body.theme-dark .login-footer .hess-footer-content > div {
    color: #a0a0a0 !important;
}

body.theme-dark .login-footer .hess-footer-links a {
    color: #6eb3f7 !important;
}

body.theme-dark .login-footer .hess-footer-links a:hover {
    color: #8fc5fa !important;
}

body.theme-dark .login-link {
    color: #6eb3f7 !important;
}

body.theme-dark .error-box {
    background-color: #2d2020 !important;
    border-color: #5c3a3a !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

body.theme-dark .error-text {
    color: #fca5a5 !important;
}

body.theme-dark .error-button {
    background-color: #404040 !important;
    border-color: #505050 !important;
    color: #d0d0d0 !important;
}

body.theme-dark .error-button:hover {
    background-color: #505050 !important;
    border-color: #606060 !important;
    color: #e5e5e5 !important;
}

/* Page loading overlay (shown when navigating between pages) */
body.theme-dark .hess-page-loading-overlay {
    background-color: rgba(30, 30, 30, 0.95) !important;
}

body.theme-dark .hess-page-loading-spinner {
    border-color: #404040 !important;
    border-top-color: #6eb3f7 !important;
}

body.theme-dark .hess-page-loading-text {
    color: #d0d0d0 !important;
}

/* ==========================================================================
   Dark theme: Utility selection page (cookie-driven)
   ========================================================================== */
body.theme-dark .utility-select-container {
    background-color: #1e1e1e !important;
}

body.theme-dark .utility-select-header {
    border-color: #404040 !important;
}

body.theme-dark .utility-select-title {
    color: #e5e5e5 !important;
}

body.theme-dark .utility-search-input {
    background-color: #252525 !important;
    border-color: #505050 !important;
    color: #e5e5e5 !important;
}

body.theme-dark .utility-search-input::placeholder {
    color: #9ca3af !important;
}

body.theme-dark .utility-radio-text {
    color: #d0d0d0 !important;
}

body.theme-dark .utility-radio-input:checked + .utility-radio-custom {
    border-color: #3a89de !important;
    background-color: #1e3a5f !important;
}

body.theme-dark .utility-radio-input:checked + .utility-radio-custom .utility-radio-text {
    color: #8fc5fa !important;
}

body.theme-dark .utility-radio-custom:hover {
    border-color: #606060 !important;
    background-color: #3d3d3d !important;
}

body.theme-dark .utility-selection-content table tr.initial,
body.theme-dark .utility-selection-content table tr.normal {
    background-color: #2d2d2d !important;
    color: #d0d0d0 !important;
}

body.theme-dark .utility-selection-content table tr.highlight {
    background-color: #1e3a5f !important;
    color: #e5e5e5 !important;
}

body.theme-dark .utility-selection-content table tr.inactive {
    background-color: #353535 !important;
    color: #a0a0a0 !important;
}

body.theme-dark .utility-selection-content table td,
body.theme-dark .utility-selection-content table th {
    color: #d0d0d0 !important;
    border-color: #404040 !important;
}


body.theme-dark .hess-detail-card table tbody td {
    border-bottom: 1px solid #404040 !important;
}

body.theme-dark #treePanel span{
    color: #d0d0d0 !important;
}

body.theme-dark .login-legacy-box {
    border-color: #404040 !important;
    background-color: #2d2d2d !important;
    color: #d0d0d0 !important;
}

body.theme-dark .login-legacy-box a {
    color: #6eb3f7 !important;
}

body.theme-dark .login-legacy-box a:hover {
    color: #8fc5fa !important;
}

body.theme-dark .hess-customer-support-info{
    color: #d0d0d0 !important;
}

body.theme-dark .hess-powered-by-image {
    background-color: #2D2D2D; /* Your desired dark background */
    display: inline-block;
    padding: 10px; /* Optional spacing */
  }

body.theme-dark .hess-powered-by-image-logo {
    /* 1. Invert colors: White bg -> Black, Black text -> White */
    filter: invert(1) hue-rotate(180deg);

    /* 2. Remove the black background (previously white) */
    mix-blend-mode: lighten;
}

body.theme-dark .hess-grid-container table tbody tr,
body.theme-dark .hess-grid-table tbody tr {
    border-bottom: 1px solid #404040 !important;
    transition: background-color 0.15s;
}


body.theme-dark .hess-grid-actions {
color: #d0d0d0 !important;
}

body.theme-dark .hess-grid-actions form {
    color: #d0d0d0 !important;
}

/* Transformer Groups grid: Transformer Members column (one link per transformer) */
.hess-xf-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.hess-xf-member-item {
    display: block;
}
.hess-xf-member-item a {
    color: var(--hess-link-color, #2563eb);
    text-decoration: none;
}
.hess-xf-member-item a:hover {
    text-decoration: underline;
}
.hess-xf-members-empty {
    color: var(--hess-muted-color, #6b7280);
}


body.theme-dark .secondary-button:hover {
    background-color: #404040;
    text-decoration: none !important;
}

body.theme-dark .secondary-button a:hover {
    text-decoration: none !important;
}

body.theme-dark .secondary-button:active {
    background-color: #404040!important;
}

body.theme-dark .device-summary-tab-btn:hover {
    background-color: #404040!important;
}

body.theme-dark #DTMDataDable tr:nth-child(even) td,
body.theme-dark #TransformerDataDable tr:nth-child(even) td,
body.theme-dark #GFSReadingsDable tr:nth-child(even) td {
    background-color: #2d2d2d !important;
}

body.theme-dark #DTMDataDable tr:nth-child(odd) td,
body.theme-dark #TransformerDataDable tr:nth-child(odd) td,
body.theme-dark #GFSReadingsDable tr:nth-child(odd) td {
    background-color: #2d2d2d !important;
}

body.theme-dark #DTMDataDable tr:hover td,
body.theme-dark #TransformerDataDable tr:hover td,
body.theme-dark #GFSReadingsDable tr:hover td {
    background-color: #2d2d2d !important;
}

/* ==========================================================================
   Dark theme: Mobile & tablet overrides (mobile.css uses light colors;
   spacing-modes loads after mobile so these overrides apply when theme-dark)
   ========================================================================== */

/* Tablet & mobile (max-width: 1024px): hamburger, sidebar, close button */
@media (max-width: 1024px) {
    body.theme-dark .hess-mobile-menu-toggle {
        background-color: #404040 !important;
        border-color: #505050 !important;
    }
    body.theme-dark .hess-mobile-menu-toggle:hover {
        background-color: #404040 !important;
    }
    body.theme-dark .hess-mobile-menu-toggle svg {
        color: #e5e5e5 !important;
    }
    body.theme-dark .hess-sidebar,
    body.theme-dark #sidebar.hess-sidebar,
    body.theme-dark nav#sidebar.hess-sidebar {
        background-color: #2d2d2d !important;
    }
    body.theme-dark .hess-sidebar-close-mobile {
        background-color: #404040 !important;
        border-color: #505050 !important;
    }
    body.theme-dark .hess-sidebar-close-mobile:hover {
        background-color: #404040 !important;
    }
    body.theme-dark .hess-sidebar-close-mobile svg {
        color: #e5e5e5 !important;
    }
}

/* Phone (max-width: 768px): Dable cards, detail cards, utility table headers */
@media (max-width: 768px) {
    body.theme-dark div[id$="Dable"] table tbody tr {
        background-color: #2d2d2d !important;
        border-bottom-color: #404040 !important;
    }
    body.theme-dark div[id$="Dable"] table tbody tr:nth-child(even),
    body.theme-dark div[id$="Dable"] table tbody tr:nth-child(odd) {
        background-color: #2d2d2d !important;
    }
    body.theme-dark div[id$="Dable"] table td {
        border-bottom-color: #404040 !important;
    }
    body.theme-dark div[id$="Dable"] table td::before {
        color: #a0a0a0 !important;
    }
    body.theme-dark .utility-selection-content table tr td:only-child,
    body.theme-dark .utility-selection-content table tr td[colspan="4"],
    body.theme-dark .utility-selection-content table tr td[colspan="5"] {
        background-color: #404040 !important;
        color: #e5e5e5 !important;
    }
    /* Detail card stacked rows (mobile card layout) */
    body.theme-dark .hess-detail-card table tr,
    body.theme-dark .hess-detail-card-nested table tr {
        background-color: #2d2d2d !important;
        border-color: #404040 !important;
    }
    body.theme-dark .hess-detail-card table tr td:first-child,
    body.theme-dark .hess-detail-card-nested table tr td:first-child {
        background-color: #404040 !important;
        color: #d0d0d0 !important;
        border-bottom-color: #505050 !important;
    }
    body.theme-dark .hess-detail-card table tr td:not(:first-child),
    body.theme-dark .hess-detail-card-nested table tr td:not(:first-child) {
        background-color: #2d2d2d !important;
        border-bottom-color: #404040 !important;
        color: #d0d0d0 !important;
    }
    body.theme-dark .hess-detail-card table tr td:not(:first-child)::before {
        color: #a0a0a0 !important;
    }
    body.theme-dark .hess-detail-card tbody tr:nth-child(even) {
        background-color: #2d2d2d !important;
    }
    body.theme-dark .hess-detail-card tbody tr:nth-child(even) td:first-child {
        background-color: #404040 !important;
    }
    body.theme-dark .hess-detail-card tbody tr:nth-child(even) td:not(:first-child) {
        background-color: #2d2d2d !important;
    }
    body.theme-dark div[id$="Dable_footer"] li.table-page input[type="button"]:hover:not(:disabled),
    body.theme-dark div[id$="Dable_footer"] li.hess-dable-pager-btn input[type="button"]:hover:not(:disabled) {
        background-color: #404040 !important;
        border-color: #606060 !important;
    }
    body.theme-dark #transformereditForm table input,
    body.theme-dark #transformereditForm table select,
    body.theme-dark #transformereditForm table textarea,
    body.theme-dark #dtmeditForm table input,
    body.theme-dark #dtmeditForm table select,
    body.theme-dark #dtmeditForm table textarea {
        background-color: #252525 !important;
        border-color: #505050 !important;
        color: #e5e5e5 !important;
    }
}


