/* Radzen Standard Theme Custom Styling */

/* Radzen CSS Variables Override */
:root {
    --rz-primary: #1976d2;
    --rz-primary-light: rgba(25, 118, 210, 0.16);
    --rz-primary-lighter: rgba(25, 118, 210, 0.08);
    --rz-primary-dark: #1565c0;
    --rz-primary-darker: #0d47a1;
    --rz-secondary: #00838f;
    --rz-secondary-light: rgba(0, 131, 143, 0.16);
    --rz-secondary-lighter: rgba(0, 131, 143, 0.08);
    --rz-secondary-dark: #006064;
    --rz-secondary-darker: #004d40;
}

body {
    background: var(--bg-main, #f5f7fa);
    color: var(--text-primary, #1a1a1a);
}

/* Card Styling */
.rz-card {
    box-shadow: var(--shadow-md, 0 2px 8px rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    border: 1px solid var(--surface-border, #dee2e6);
    background: var(--surface-card, #fff);
    transition: box-shadow 0.3s ease;
}

.rz-card:hover {
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.12));
}

/* Form Field Improvements */
.rz-formfield {
    margin-bottom: 0.75rem;
}

.rz-formfield label {
    font-weight: var(--font-medium, 500);
    font-size: var(--text-base);
    color: var(--text-secondary, #424242);
    margin-bottom: 0.25rem;
}

/* Consistent font sizing for all inputs - both themes */
.rz-formfield-text,
.rz-dropdown,
.rz-textbox,
.rz-numeric input,
.rz-chkbox-label,
input.rz-inputtext {
    font-size: var(--text-base) !important;
}

/* Labels - consistent styling for both themes */
label,
.rz-label,
.rz-formfield-label {
    font-size: var(--text-base) !important;
    font-weight: var(--font-medium) !important;
}

/* Checkbox and radio labels - consistent styling for both themes */
.rz-chkbox-label,
.rz-radiobutton-label {
    font-size: var(--text-base) !important;
    font-weight: var(--font-normal) !important;
    color: var(--text-primary) !important;
}

/* Dropdown & Autocomplete Styling */
.rz-dropdown,
.rz-autocomplete {
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.rz-dropdown:hover,
.rz-autocomplete:hover {
    border-color: #1976d2;
}

/* Primary Color Override */
.rz-primary,
.rz-button-primary,
.rz-state-primary {
    background-color: #1976d2 !important;
    border-color: #1976d2 !important;
}

.rz-button.rz-button-primary:hover:not(:disabled) {
    background-color: #1565c0 !important;
    border-color: #1565c0 !important;
}

/* Secondary Color Override */
.rz-secondary,
.rz-button-secondary,
.rz-button.rz-secondary.rz-shade-default,
.rz-state-secondary {
    background-color: #00838f !important;
    border-color: #00838f !important;
    color: #ffffff !important;
}

.rz-button.rz-button-secondary:hover:not(:disabled),
.rz-button.rz-secondary.rz-shade-default:hover:not(:disabled) {
    background-color: #006064 !important;
    border-color: #006064 !important;
}
.rz-dropdown:focus-within,
.rz-autocomplete:focus-within {
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Button Styling */
.rz-button {
    border-radius: 4px;
    font-weight: var(--font-medium, 500);
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.rz-button:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

.rz-button:active {
    transform: translateY(0);
}

/* Data Grid Styling */
.rz-compact-grid {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.rz-compact-grid .rz-datatable-header {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: var(--font-semibold, 600);
    font-size: var(--text-xs);
    color: #212529;
    border-bottom: 2px solid #dee2e6;
}

/* Light mode grid headers - explicit styling */
body:not([data-theme="dark"]) .rz-datatable-thead th,
body:not([data-theme="dark"]) .rz-datatable th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    border-color: #dee2e6;
    font-weight: var(--font-semibold, 600);
    font-size: var(--text-xs);
}

body:not([data-theme="dark"]) .rz-datatable-thead {
    background: #f8f9fa;
}

body:not([data-theme="dark"]) .rz-datatable td {
    color: #212529;
    border-color: #dee2e6;
}

.rz-compact-grid .rz-datatable-data tr:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s ease;
}

/* Selected row styling - more prominent in light mode */
/* Uses a darker blue (#bbdefb) similar to hover state for better visibility */
body:not([data-theme="dark"]) .rz-datatable-data tr.rz-state-highlight,
body:not([data-theme="dark"]) .rz-datatable-data tr.rz-state-selected {
    background-color: #54b0fc !important;
}

body:not([data-theme="dark"]) .rz-datatable-data tr.rz-state-highlight td,
body:not([data-theme="dark"]) .rz-datatable-data tr.rz-state-selected td {
    background-color: #54b0fc !important;
}

/* Compact grid inherits from above but can be more specific if needed */
.rz-compact-grid .rz-datatable-data tr.rz-state-highlight,
.rz-compact-grid .rz-datatable-data tr.rz-state-selected {
    background-color: #54b0fc !important;
}

.rz-compact-grid .rz-datatable-data tr.rz-state-highlight td,
.rz-compact-grid .rz-datatable-data tr.rz-state-selected td {
    background-color: #54b0fc !important;
}

/* Search grid selected row - higher contrast */
body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected,
body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected > td,
body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected .rz-cell-data {
    background-color: var(--rz-primary-dark, #1565c0) !important;
    color: #ffffff !important;
}

body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected a,
body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected .rz-link {
    color: #ffffff !important;
}

body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected a:hover,
body:not([data-theme="dark"]) .scms-multiselect-grid tr.scms-grid-row-selected .rz-link:hover {
    color: #e3f2fd !important;
}

body[data-theme="dark"] .scms-multiselect-grid tr.scms-grid-row-selected,
body[data-theme="dark"] .scms-multiselect-grid tr.scms-grid-row-selected > td,
body[data-theme="dark"] .scms-multiselect-grid tr.scms-grid-row-selected .rz-cell-data {
    background-color: rgba(84, 176, 252, 0.22) !important;
}

/* DatePicker/Calendar navigation buttons (light mode) */
body:not([data-theme="dark"]) .rz-datepicker-prev,
body:not([data-theme="dark"]) .rz-datepicker-next,
body:not([data-theme="dark"]) .rz-calendar-header button,
body:not([data-theme="dark"]) .rz-calendar-header .rz-button {
    background: var(--bg-main, #f5f7fa) !important;
    border: 1px solid var(--surface-border, #d9e1ee) !important;
    color: var(--text-primary, #0f172a) !important;
    border-radius: 6px !important;
}

body:not([data-theme="dark"]) .rz-datepicker-prev:hover,
body:not([data-theme="dark"]) .rz-datepicker-next:hover,
body:not([data-theme="dark"]) .rz-calendar-header button:hover,
body:not([data-theme="dark"]) .rz-calendar-header .rz-button:hover {
    background: rgba(15, 23, 42, 0.06) !important;
}

/* Seasons manager: read-only Season Name display */
.season-name-preview {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    border: 1px solid var(--surface-border, #d9e1ee);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-primary, #0f172a);
    font-size: 0.95rem;
}

body[data-theme="dark"] .season-name-preview {
    background: #1e2838;
    border-color: #374151;
    color: #f3f4f6;
}

.rz-datatable-scrollable-body {
    max-height: 600px;
}

/* Pager Styling */
.rz-paginator {
    background: #fafafa;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e0e0;
}

.rz-paginator .rz-paginator-pages button {
    margin: 0 2px;
    min-width: 36px;
    height: 36px;
    border-radius: 4px;
}

.rz-paginator .rz-paginator-pages button.rz-state-active {
    background: #1976d2;
    color: white;
    font-weight: 500;
}

/* Stack and Layout */
.rz-stack {
    gap: 1rem;
}

/* Loading Indicator */
.rz-datatable-loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
}

/* Checkbox Styling */
.rz-checkbox {
    transition: all 0.2s ease;
}

.rz-checkbox:hover {
    transform: scale(1.05);
}

/* Text Styling */
.rz-text-h5,
.rz-text-h6 {
    font-weight: var(--font-semibold, 600);
    color: var(--text-primary, #212529);
}

.rz-text-h5 {
    font-size: var(--text-xl);
}

.rz-text-h6 {
    font-size: var(--text-lg);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .rz-compact-grid {
        font-size: var(--text-base);
    }

    .rz-button {
        padding: 0.5rem 1rem;
        font-size: var(--text-base);
    }
}

/* Smooth Animations */
* {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Link Styling */
.rz-link {
    color: var(--rz-primary, #1976d2);
    text-decoration: none;
    font-weight: var(--font-medium, 500);
    font-size: var(--text-base);
    transition: color 0.2s ease;
}

.rz-link:hover {
    color: var(--rz-primary-dark, #1565c0);
    text-decoration: underline;
}

/* Card Title Styling */
.rz-card .rz-text-h5 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Grid Column Alignment */
.rz-datatable-data td {
    vertical-align: middle;
}

/* Icon Button Styling */
.rz-button-icon-only {
    padding: 0.5rem;
    min-width: 36px;
    height: 36px;
}

/* Notification Styling */
.rz-notification {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dialog Styling */
.rz-dialog {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.rz-dialog-title {
    font-weight: var(--font-semibold, 600);
    font-size: var(--text-2xl);
}

/* Keep background visible behind dialogs (no dim/blur mask) */
.rz-dialog-mask {
    background-color: transparent !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
}

/* ============================
   Dark Mode - Comprehensive Styling
   ============================ */

/* Base dark mode body */
body[data-theme="dark"],
body.dark-theme {
    color: var(--text-primary, #f3f4f6);
    background-color: var(--bg-main, #0f1419);
}

/* Card styling for dark mode */
body[data-theme="dark"] .rz-card,
body.dark-theme .rz-card {
    background: var(--surface-card, #1a1f2e) !important;
    border-color: var(--surface-border, #2d3548) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .rz-text-h5,
body[data-theme="dark"] .rz-text-h6,
body[data-theme="dark"] .rz-text {
    color: var(--text-primary, #f3f4f6) !important;
}

/* Form Field Labels */
body[data-theme="dark"] .rz-formfield label,
body[data-theme="dark"] .rz-formfield-text,
body[data-theme="dark"] .rz-label {
    color: var(--text-secondary, #9ca3af) !important;
    background: transparent !important;
}

body[data-theme="dark"] .rz-formfield.rz-state-focused label {
    color: #90caf9 !important;
}

body[data-theme="dark"] .rz-formfield-floating label,
body[data-theme="dark"] .rz-formfield-floating .rz-label-text {
    color: #9ca3af !important;
    font-weight: var(--font-medium, 500);
    font-size: var(--text-xs);
    background: var(--ce-bg-card, #1a1e27) !important;
    padding: 0 4px;
}

/* Input Controls - Dark backgrounds instead of white */
body[data-theme="dark"] .rz-dropdown,
body[data-theme="dark"] .rz-autocomplete,
body[data-theme="dark"] .rz-inputtext,
body[data-theme="dark"] .rz-textbox,
body[data-theme="dark"] .rz-multiselect,
body[data-theme="dark"] .rz-numeric,
body[data-theme="dark"] .rz-mask,
body[data-theme="dark"] .rz-datepicker,
body[data-theme="dark"] .rz-calendar,
body[data-theme="dark"] input.rz-inputtext,
body[data-theme="dark"] textarea.rz-textarea {
    background-color: #1e2838 !important;
    border: 1px solid #374151 !important;
    color: #f3f4f6 !important;
    box-shadow: none !important;
}

body[data-theme="dark"] .rz-dropdown:hover,
body[data-theme="dark"] .rz-inputtext:hover,
body[data-theme="dark"] .rz-numeric:hover {
    border-color: #4b5563 !important;
}

body[data-theme="dark"] .rz-dropdown:focus-within,
body[data-theme="dark"] .rz-autocomplete:focus-within,
body[data-theme="dark"] .rz-inputtext:focus-within,
body[data-theme="dark"] .rz-multiselect:focus-within,
body[data-theme="dark"] .rz-numeric:focus-within,
body[data-theme="dark"] .rz-mask:focus-within {
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.3) !important;
    border-color: #42a5f5 !important;
}

/* Nested inputs inside dropdowns/autocomplete */
body[data-theme="dark"] .rz-dropdown .rz-inputtext,
body[data-theme="dark"] .rz-autocomplete .rz-inputtext {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
}

/* Dropdown Panel (popup list) */
body[data-theme="dark"] .rz-dropdown-panel,
body[data-theme="dark"] .rz-popup {
    background-color: #1e2838 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="dark"] .rz-dropdown-items,
body[data-theme="dark"] .rz-listbox {
    background-color: #1e2838 !important;
}

body[data-theme="dark"] .rz-dropdown-item,
body[data-theme="dark"] .rz-listbox-item {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .rz-dropdown-item:hover,
body[data-theme="dark"] .rz-listbox-item:hover {
    background-color: #2d3a4d !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .rz-dropdown-item.rz-state-highlight,
body[data-theme="dark"] .rz-dropdown-item.rz-state-selected,
body[data-theme="dark"] .rz-listbox-item.rz-state-highlight {
    background-color: rgba(66, 165, 245, 0.25) !important;
    color: #90caf9 !important;
}

/* Placeholder text */
body[data-theme="dark"] .rz-dropdown .rz-placeholder,
body[data-theme="dark"] .rz-inputtext::placeholder,
body[data-theme="dark"] input::placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
}

body[data-theme="dark"] .rz-dropdown .rz-dropdown-label {
    color: #f3f4f6 !important;
}

/* Dropdown icons */
body[data-theme="dark"] .rz-dropdown-trigger-icon,
body[data-theme="dark"] .rz-dropdown-clear-icon,
body[data-theme="dark"] .rz-clear-icon {
    color: #9ca3af !important;
}

/* Data Grid */
body[data-theme="dark"] .rz-datatable,
body[data-theme="dark"] .rz-compact-grid {
    border-color: #374151 !important;
    background: #1a1f2e !important;
}

body[data-theme="dark"] .rz-datatable-header,
body[data-theme="dark"] .rz-datatable-thead,
body[data-theme="dark"] .rz-compact-grid .rz-datatable-header {
    background: #111827 !important;
    color: #f3f4f6 !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .rz-datatable th,
body[data-theme="dark"] .rz-datatable td {
    color: #ffffff !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .rz-datatable td a,
body[data-theme="dark"] .rz-datatable td .rz-link {
    color: #93c5fd !important;
}

body[data-theme="dark"] .rz-datatable td a:hover,
body[data-theme="dark"] .rz-datatable td .rz-link:hover {
    color: #bfdbfe !important;
}

body[data-theme="dark"] .rz-datatable-data,
body[data-theme="dark"] .rz-datatable tbody {
    background: #1a1f2e !important;
}

body[data-theme="dark"] .rz-datatable tr:nth-child(odd) td {
    background-color: rgba(30, 40, 56, 0.5) !important;
}

body[data-theme="dark"] .rz-datatable tr:nth-child(even) td {
    background-color: #1a1f2e !important;
}

body[data-theme="dark"] .rz-datatable tr:hover td {
    background-color: rgba(66, 165, 245, 0.15) !important;
}

body[data-theme="dark"] .rz-datatable tr.rz-state-highlight td,
body[data-theme="dark"] .rz-datatable tr.rz-state-selected td {
    background-color: rgba(66, 165, 245, 0.25) !important;
}

/* Paginator */
body[data-theme="dark"] .rz-paginator {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .rz-paginator-current {
    color: #9ca3af !important;
}

/* Buttons */
body[data-theme="dark"] .rz-button {
    box-shadow: none !important;
}

body[data-theme="dark"] .rz-button.rz-light,
body[data-theme="dark"] .rz-button.rz-button-light {
    background-color: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

body[data-theme="dark"] .rz-button.rz-light:hover,
body[data-theme="dark"] .rz-button.rz-button-light:hover {
    background-color: #4b5563 !important;
}

/* Tabs - comprehensive dark mode styling */
body[data-theme="dark"] .rz-tabs,
body[data-theme="dark"] .rz-tabview {
    background: transparent !important;
}

body[data-theme="dark"] .rz-tabview-nav,
body[data-theme="dark"] .rz-tabs-bar,
body[data-theme="dark"] .rz-tabview-nav-container {
    background: #111827 !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .rz-tabview-nav li,
body[data-theme="dark"] .rz-tabs-item {
    background: transparent !important;
}

body[data-theme="dark"] .rz-tabview-nav-link,
body[data-theme="dark"] .rz-tabs-item a {
    color: #9ca3af !important;
    background: transparent !important;
}

body[data-theme="dark"] .rz-tabview-nav-link:hover,
body[data-theme="dark"] .rz-tabs-item a:hover {
    color: #ffffff !important;
    background: rgba(66, 165, 245, 0.1) !important;
}

body[data-theme="dark"] .rz-tabview-nav-link.rz-state-active,
body[data-theme="dark"] .rz-tabs-item.rz-state-active a,
body[data-theme="dark"] .rz-tabview-selected {
    color: #42a5f5 !important;
    border-color: #42a5f5 !important;
    background: rgba(66, 165, 245, 0.15) !important;
}

body[data-theme="dark"] .rz-tabview-panels,
body[data-theme="dark"] .rz-tabs-content {
    background: transparent !important;
}

/* Grid Column Headers - brighter text for readability */
body[data-theme="dark"] .rz-datatable-thead th,
body[data-theme="dark"] .rz-grid-table thead th,
body[data-theme="dark"] .rz-datatable th.rz-sortable-column,
body[data-theme="dark"] .rz-datatable th {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #334155 !important;
    font-weight: var(--font-semibold, 600);
    font-size: var(--text-xs);
}

/* Ensure all nested elements in column headers inherit white text */
body[data-theme="dark"] .rz-datatable-thead th *,
body[data-theme="dark"] .rz-datatable th span,
body[data-theme="dark"] .rz-datatable th div,
body[data-theme="dark"] .rz-datatable th .rz-column-title,
body[data-theme="dark"] .rz-datatable th .rz-column-title-content,
body[data-theme="dark"] .rz-datatable th .rz-cell-data,
body[data-theme="dark"] .rz-sortable-column span,
body[data-theme="dark"] .rz-sortable-column .rz-column-title {
    color: #ffffff !important;
}

body[data-theme="dark"] .rz-datatable-thead,
body[data-theme="dark"] .rz-grid-table thead {
    background: #1e293b !important;
}

body[data-theme="dark"] .rz-sortable-column:hover {
    background: #334155 !important;
}

body[data-theme="dark"] .rz-sortable-column .rz-sortable-column-icon {
    color: #94a3b8 !important;
}

/* Grid cell text - ensure maximum readability */
body[data-theme="dark"] .rz-datatable td,
body[data-theme="dark"] .rz-datatable .rz-cell-data,
body[data-theme="dark"] .rz-grid-table td {
    color: #ffffff !important;
}

body[data-theme="dark"] .rz-datatable td *,
body[data-theme="dark"] .rz-grid-table td * {
    color: inherit;
}

/* Dialog */
body[data-theme="dark"] .rz-dialog {
    background: #1a1f2e !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .rz-dialog-titlebar {
    background: #111827 !important;
    color: #f3f4f6 !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .rz-dialog-content {
    background: #1a1f2e !important;
    color: #f3f4f6 !important;
}

/* Fieldset */
body[data-theme="dark"] .rz-fieldset,
body[data-theme="dark"] .rz-fieldset-legend {
    background: #1a1f2e !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

/* Checkbox & Radio */
body[data-theme="dark"] .rz-chkbox-label,
body[data-theme="dark"] .rz-radiobutton-label {
    color: #f3f4f6 !important;
}

/* Filter row inputs */
body[data-theme="dark"] .rz-cell-filter .rz-inputtext,
body[data-theme="dark"] .rz-cell-filter .rz-dropdown {
    background-color: #1e2838 !important;
}

/* Workspace panels dark mode */
body[data-theme="dark"] .contract-toolbar-card,
body[data-theme="dark"] .contract-body-card,
body[data-theme="dark"] .contract-panel {
    background: var(--surface-card, #1a1f2e) !important;
    border-color: var(--surface-border, #374151) !important;
}

body[data-theme="dark"] .checkbox-item {
    color: #9ca3af !important;
}

body[data-theme="dark"] .upload-trigger {
    background: #1e2838 !important;
    border-color: #374151 !important;
    color: #9ca3af !important;
}

/* Tooltip */
body[data-theme="dark"] .rz-tooltip {
    background: #374151 !important;
    color: #f3f4f6 !important;
}

/* Calendar/DatePicker popup - Comprehensive Dark Mode Styling */
body[data-theme="dark"] .rz-datepicker-popup,
body[data-theme="dark"] .rz-calendar-popup,
body[data-theme="dark"] .rz-datepicker-group,
body[data-theme="dark"] .rz-datepicker-calendar-container {
    background: #1e2838 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="dark"] .rz-calendar-header,
body[data-theme="dark"] .rz-datepicker-calendar {
    background: #1e2838 !important;
    color: #f3f4f6 !important;
}

/* Calendar navigation buttons */
body[data-theme="dark"] .rz-datepicker-prev,
body[data-theme="dark"] .rz-datepicker-next,
body[data-theme="dark"] .rz-datepicker-prev-icon,
body[data-theme="dark"] .rz-datepicker-next-icon,
body[data-theme="dark"] .rz-calendar-header button,
body[data-theme="dark"] .rz-calendar-header .rz-button {
    color: #9ca3af !important;
    background: transparent !important;
}

body[data-theme="dark"] .rz-datepicker-prev:hover,
body[data-theme="dark"] .rz-datepicker-next:hover,
body[data-theme="dark"] .rz-calendar-header button:hover {
    color: #f3f4f6 !important;
    background: #374151 !important;
}

/* Month/year title */
body[data-theme="dark"] .rz-datepicker-title,
body[data-theme="dark"] .rz-datepicker-month,
body[data-theme="dark"] .rz-datepicker-year,
body[data-theme="dark"] .rz-calendar-header .rz-link,
body[data-theme="dark"] .rz-calendar-header span {
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .rz-calendar-header .rz-link:hover {
    color: #42a5f5 !important;
}

/* Day names header row */
body[data-theme="dark"] .rz-datepicker-calendar thead th,
body[data-theme="dark"] .rz-calendar thead th,
body[data-theme="dark"] .rz-datepicker th {
    color: #9ca3af !important;
    background: #1e2838 !important;
}

/* Calendar table */
body[data-theme="dark"] .rz-calendar table,
body[data-theme="dark"] .rz-datepicker-calendar table {
    background: #1e2838 !important;
}

/* Day cells */
body[data-theme="dark"] .rz-calendar td,
body[data-theme="dark"] .rz-datepicker-calendar td {
    background: #1e2838 !important;
}

body[data-theme="dark"] .rz-calendar td span {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .rz-calendar td span:hover {
    background: #374151 !important;
}

/* Days outside current month */
body[data-theme="dark"] .rz-datepicker-other-month span,
body[data-theme="dark"] .rz-state-disabled span {
    color: #6b7280 !important;
}

/* Today indicator */
body[data-theme="dark"] .rz-datepicker-today span,
body[data-theme="dark"] .rz-state-today span {
    border-color: #42a5f5 !important;
    color: #42a5f5 !important;
}

/* Selected date */
body[data-theme="dark"] .rz-state-default.rz-state-active span,
body[data-theme="dark"] .rz-datepicker-calendar .rz-state-active span {
    background: #42a5f5 !important;
    color: #ffffff !important;
}

/* Time picker section */
body[data-theme="dark"] .rz-timepicker,
body[data-theme="dark"] .rz-datepicker-timeonly {
    background: #1e2838 !important;
    border-top: 1px solid #374151 !important;
}

body[data-theme="dark"] .rz-timepicker .rz-inputtext,
body[data-theme="dark"] .rz-datepicker-timeonly .rz-inputtext {
    background: #2d3a4d !important;
    color: #f3f4f6 !important;
    border-color: #374151 !important;
}

/* Footer buttons */
body[data-theme="dark"] .rz-datepicker-buttonbar {
    background: #1e2838 !important;
    border-top: 1px solid #374151 !important;
}

/* AI Chat Assistant Dark Mode */
body[data-theme="dark"] .html-display {
    background-color: #1a1f2e !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .input-container {
    background-color: #1a1f2e !important;
    border-color: #374151 !important;
}

body[data-theme="dark"] .user-message {
    background-color: #1e3a5f !important;
    color: #e5e7eb !important;
}

body[data-theme="dark"] .ai-message {
    background-color: #2d3748 !important;
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .system-message {
    background-color: #374151 !important;
    color: #9ca3af !important;
}

body[data-theme="dark"] .spinner-overlay {
    background-color: rgba(15, 20, 25, 0.85) !important;
}

body[data-theme="dark"] .timestamp {
    color: #6b7280 !important;
}

/* AI Chat Dialog */
body[data-theme="dark"] .rz-dialog .chat-container {
    background-color: #1a1f2e !important;
}

body[data-theme="dark"] .model-info {
    color: #9ca3af !important;
}

/* ============================================
   Walkthrough Highlight System
   ============================================ */

/* Pulsing highlight animation for walkthrough elements */
@keyframes walkthrough-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(66, 165, 245, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0);
    }
}

@keyframes walkthrough-glow {
    0%, 100% {
        border-color: rgba(66, 165, 245, 0.8);
    }
    50% {
        border-color: rgba(66, 165, 245, 1);
    }
}

.walkthrough-highlight {
    position: relative;
    z-index: 9999 !important;
    border-radius: 8px;
    border: 3px solid #42a5f5 !important;
    animation: walkthrough-pulse 2s ease-in-out infinite, walkthrough-glow 1.5s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* Ensure highlighted element is above the overlay */
.walkthrough-highlight * {
    position: relative;
    z-index: inherit;
}

/* Dark mode adjustments */
body[data-theme="dark"] .walkthrough-highlight {
    border-color: #64b5f6 !important;
}

@keyframes walkthrough-pulse-dark {
    0% {
        box-shadow: 0 0 0 0 rgba(100, 181, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(100, 181, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(100, 181, 246, 0);
    }
}

body[data-theme="dark"] .walkthrough-highlight {
    animation: walkthrough-pulse-dark 2s ease-in-out infinite, walkthrough-glow 1.5s ease-in-out infinite;
}

/* Walkthrough overlay styling */
.walkthrough-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
}

/* Walkthrough tooltip (for future enhancement) */
.walkthrough-tooltip {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 320px;
    z-index: 10000;
}

body[data-theme="dark"] .walkthrough-tooltip {
    background: #1e2838;
    color: #f3f4f6;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.walkthrough-tooltip-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #1976d2;
}

body[data-theme="dark"] .walkthrough-tooltip-title {
    color: #42a5f5;
}

.walkthrough-tooltip-content {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #424242;
}

body[data-theme="dark"] .walkthrough-tooltip-content {
    color: #9ca3af;
}

/* ============================================
   DB Maintenance Grid Styles
   ============================================ */

/* Container */
.db-mgr-container {
    height: 100%;
}

/* Toolbar card */
.db-mgr-toolbar {
    border-radius: 12px;
}

/* Grid card */
.db-mgr-grid-card {
    border-radius: 12px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Grid styling */
.db-mgr-grid {
    flex: 1;
    min-height: 300px;
}

/* Row hover effect */
.db-mgr-grid .rz-datatable-data tr:hover td {
    background-color: rgba(25, 118, 210, 0.08) !important;
    cursor: pointer;
}

/* Selected row styling */
.db-mgr-grid .rz-datatable-data tr.rz-state-highlight td,
.db-mgr-grid .rz-datatable-data tr.rz-state-selected td {
    background-color: rgba(25, 118, 210, 0.15) !important;
}

/* Checkbox column styling */
.db-mgr-grid .rz-datatable-data td:first-child,
.db-mgr-grid .rz-datatable-thead th:first-child {
    padding: 0.25rem 0.5rem;
}

/* Filter fields */
.db-mgr-filters {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface-border, #e3e8f0);
    margin-bottom: 0.75rem !important;
}

.db-mgr-filter-field {
    width: 180px;
    min-width: 140px;
}

.db-mgr-filter-field-sm {
    width: 120px;
    min-width: 100px;
}

/* Dark mode hover/select */
body[data-theme="dark"] .db-mgr-grid .rz-datatable-data tr:hover td {
    background-color: rgba(66, 165, 245, 0.12) !important;
}

body[data-theme="dark"] .db-mgr-grid .rz-datatable-data tr.rz-state-highlight td,
body[data-theme="dark"] .db-mgr-grid .rz-datatable-data tr.rz-state-selected td {
    background-color: rgba(66, 165, 245, 0.22) !important;
}

body[data-theme="dark"] .db-mgr-filters {
    border-bottom-color: var(--surface-border, #374151);
}

/* ============================================
   DB Maintenance Responsive Styles
   ============================================ */

/* Tablet breakpoint (768px) */
@media (max-width: 992px) {
    .db-mgr-hide-tablet {
        display: none !important;
    }

    .db-mgr-toolbar .rz-stack {
        gap: 0.5rem !important;
    }

    .db-mgr-title-section .rz-text-h5 {
        font-size: 1.1rem;
    }

    .db-mgr-filter-field {
        width: 160px;
        min-width: 120px;
    }

    .db-mgr-filter-field-sm {
        width: 100px;
        min-width: 80px;
    }
}

/* Mobile breakpoint (576px) */
@media (max-width: 768px) {
    .db-mgr-hide-mobile {
        display: none !important;
    }

    .db-mgr-toolbar {
        padding: 0.75rem !important;
    }

    .db-mgr-title-section {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .db-mgr-title-section .rz-text-h5 {
        font-size: 1rem;
    }

    .db-mgr-title-section .rz-text-caption {
        font-size: 0.75rem;
    }

    .db-mgr-actions {
        width: 100%;
        justify-content: flex-start !important;
    }

    .db-mgr-btn {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .db-mgr-btn .rz-button-text {
        display: none;
    }

    .db-mgr-btn .rz-button-icon {
        margin: 0;
    }

    .db-mgr-filters {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .db-mgr-filter-field,
    .db-mgr-filter-field-sm {
        width: 100%;
        min-width: unset;
    }

    .db-mgr-grid-card {
        padding: 0.75rem !important;
    }

    .db-mgr-grid {
        min-height: 250px;
    }

    /* Compact grid on mobile */
    .db-mgr-grid .rz-datatable td,
    .db-mgr-grid .rz-datatable th {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Checkbox column narrower on mobile */
    .db-mgr-grid .rz-datatable-data td:first-child,
    .db-mgr-grid .rz-datatable-thead th:first-child {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        padding: 0.25rem !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .db-mgr-toolbar .rz-stack {
        flex-direction: column;
        align-items: stretch !important;
    }

    .db-mgr-actions {
        flex-wrap: wrap;
        gap: 0.35rem !important;
    }

    .db-mgr-btn {
        flex: 1;
        min-width: 60px;
        justify-content: center;
    }
}
