/* ============================================
   HALO Theme - E3 Company
   Modern, Compact, High-Density Design
   Bootstrap 5.3 + Syncfusion Compatible
   ============================================ */

/* ============================================
   CSS Custom Properties (Light Mode - Default)
   ============================================ */
:root {
    /* Primary Colors - Emerald Green */
    --halo-primary: #059669;
    --halo-primary-light: #10B981;
    --halo-primary-dark: #047857;
    --halo-primary-rgb: 5, 150, 105;

    /* Background & Surface */
    --halo-background: #F4F6F8;
    --halo-surface: #FFFFFF;
    --halo-surface-hover: #F9FAFB;

    /* Sidebar */
    --halo-sidebar-bg: #1A1F2E;
    --halo-sidebar-hover: #2A3142;
    --halo-sidebar-active: #059669;
    --halo-sidebar-border: #2A3142;

    /* Text Colors */
    --halo-text-primary: #1F2937;
    --halo-text-secondary: #6B7280;
    --halo-text-light: #E5E7EB;
    --halo-text-muted: #9CA3AF;

    /* Border & Shadow */
    --halo-border: #E5E7EB;
    --halo-border-light: #F3F4F6;
    --halo-shadow: rgba(0, 0, 0, 0.08);
    --halo-shadow-lg: rgba(0, 0, 0, 0.12);

    /* Semantic Colors (status, alerts, health) */
    --halo-success: #10B981;
    --halo-warning: #F59E0B;
    --halo-danger:  #EF4444;
    /* Danger text and its tint, darker than --halo-danger so a delete action's text reaches AA */
    --halo-danger-text: #B91C1C;
    --halo-danger-bg: #FEF2F2;

    /* Regional board: PM pill, device status, Leapfrog, transfer info lines */
    --halo-pm-overdue: #DC2626;
    --halo-pm-overdue-text: #B91C1C;
    --halo-pm-overdue-bg: #FEF2F2;
    --halo-pm-overdue-border: #F87171;
    --halo-pm-soon-bg: #FFFBEB;
    --halo-pm-soon-border: #FCD34D;
    --halo-pm-soon-text: #92400E;
    --halo-pm-today-bg: #FEF3C7;
    --halo-pm-today-border: #F59E0B;
    --halo-device-reporting: #059669;
    --halo-device-not-reporting: #EA580C;
    --halo-device-unavailable: #8A94A6;
    --halo-leapfrog: #2563EB;
    --halo-info: #1D4ED8;
    --halo-info-bg: #EFF6FF;
    --halo-info-border: #BFDBFE;
    --halo-board-lane: #E8EBF0;
    /* Small text set on a lane: 6.3:1 on --halo-board-lane and above 6:1 on every lane tint */
    --halo-board-lane-text-secondary: #4B5563;

    /* Spacing */
    --halo-spacing-xs: 4px;
    --halo-spacing-sm: 8px;
    --halo-spacing-md: 12px;
    --halo-spacing-lg: 16px;
    --halo-spacing-xl: 24px;
    --halo-spacing-2xl: 32px;

    /* Border Radius */
    --halo-radius-sm: 4px;
    --halo-radius-md: 6px;
    --halo-radius-lg: 8px;
    --halo-radius-xl: 12px;
    --halo-radius-xxl: 16px;
    --halo-radius-pill: 9999px;

    /* Layout Dimensions */
    --halo-appbar-height: 56px;
    --halo-sidebar-width: 240px;
    --halo-sidebar-collapsed: 60px;

    /* Transitions */
    --halo-transition-fast: 150ms ease;
    --halo-transition-normal: 200ms ease;
    --halo-transition-slow: 300ms ease;

    /* Typography */
    --halo-font-family: 'Inter', 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --halo-font-size-xs: 11px;
    --halo-font-size-sm: 12px;
    --halo-font-size-base: 14px;
    --halo-font-size-lg: 16px;
    --halo-font-size-xl: 18px;
    --halo-font-size-2xl: 20px;
    --halo-font-size-3xl: 24px;
}

/* ============================================
   Dark Mode Variables
   ============================================ */
[data-bs-theme="dark"] {
    /* Primary Colors - Lighter Emerald for contrast */
    --halo-primary: #10B981;
    --halo-primary-light: #34D399;
    --halo-primary-dark: #059669;
    --halo-primary-rgb: 16, 185, 129;

    /* Background & Surface */
    --halo-background: #0F172A;
    --halo-surface: #1E293B;
    --halo-surface-hover: #334155;

    /* Sidebar */
    --halo-sidebar-bg: #0F172A;
    --halo-sidebar-hover: #334155;
    --halo-sidebar-active: #10B981;
    --halo-sidebar-border: #334155;

    /* Text Colors */
    --halo-text-primary: #F1F5F9;
    --halo-text-secondary: #94A3B8;
    --halo-text-light: #E2E8F0;
    --halo-text-muted: #64748B;

    /* Border & Shadow */
    --halo-border: #334155;
    --halo-border-light: #1E293B;
    --halo-shadow: rgba(0, 0, 0, 0.3);
    --halo-shadow-lg: rgba(0, 0, 0, 0.4);

    /* Semantic Colors (status, alerts, health) - lifted for dark-bg contrast */
    --halo-success: #34D399;
    --halo-warning: #FBBF24;
    --halo-danger:  #F87171;
}

/* ============================================
   Base Styles
   ============================================ */
html, body {
    font-family: var(--halo-font-family);
    font-size: var(--halo-font-size-base);
    background-color: var(--halo-background);
    color: var(--halo-text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--halo-text-primary);
    margin-bottom: var(--halo-spacing-sm);
    line-height: 1.3;
}

h1 { font-size: var(--halo-font-size-3xl); }
h2 { font-size: var(--halo-font-size-2xl); }
h3 { font-size: var(--halo-font-size-xl); }
h4 { font-size: var(--halo-font-size-lg); }
h5 { font-size: var(--halo-font-size-base); font-weight: 600; }
h6 { font-size: var(--halo-font-size-sm); font-weight: 600; }

a {
    color: var(--halo-primary);
    text-decoration: none;
    transition: color var(--halo-transition-fast);
}

a:hover {
    color: var(--halo-primary-dark);
}

/* ============================================
   App Layout Container
   ============================================ */
.halo-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--halo-background);
}

.halo-content-wrapper {
    display: flex;
    flex: 1;
    padding-top: var(--halo-appbar-height);
    min-height: calc(100vh - var(--halo-appbar-height));
    position: relative;
}


.halo-page-content {
    padding: var(--halo-spacing-lg);
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   AppBar / Header Styles
   ============================================ */
.halo-appbar {
    height: var(--halo-appbar-height);
    background: linear-gradient(135deg, #1A1F2E 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px var(--halo-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    padding: 0 var(--halo-spacing-md);
    display: flex;
    align-items: center;
}

.halo-appbar-spacer {
    flex: 1;
}

/* Menu Toggle Button */
.halo-menu-toggle {
    background: transparent;
    border: none;
    color: var(--halo-text-light);
    width: 40px;
    height: 40px;
    border-radius: var(--halo-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--halo-transition-fast);
    cursor: pointer;
    font-size: 20px;
}

.halo-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Centered Brand Container */
.halo-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--halo-spacing-sm);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.halo-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.halo-title {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 3px;
    font-family: var(--halo-font-family);
    text-transform: uppercase;
}

/* Header Actions (Theme toggle + User) */
.halo-header-actions {
    display: flex;
    align-items: center;
    gap: var(--halo-spacing-sm);
}

.halo-theme-toggle {
    background: transparent;
    border: none;
    color: var(--halo-text-light);
    width: 40px;
    height: 40px;
    border-radius: var(--halo-radius-md);
    transition: background-color var(--halo-transition-fast);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.halo-theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* User Dropdown */
.halo-user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.halo-user-btn {
    background: transparent;
    border: none;
    color: var(--halo-text-light);
    font-size: var(--halo-font-size-sm);
    padding: var(--halo-spacing-xs) var(--halo-spacing-sm);
    border-radius: var(--halo-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--halo-spacing-xs);
    transition: background-color var(--halo-transition-fast);
}

.halo-user-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.halo-user-btn i {
    font-size: 18px;
}

.halo-dropdown-arrow {
    font-size: 12px !important;
    margin-left: var(--halo-spacing-xs);
}

.halo-user-name {
    color: var(--halo-text-light);
    font-size: var(--halo-font-size-sm);
    font-weight: 500;
}

/* Dropdown Menu */
.halo-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--halo-spacing-xs);
    background-color: var(--halo-surface);
    border-radius: var(--halo-radius-md);
    box-shadow: 0 4px 16px var(--halo-shadow-lg);
    border: 1px solid var(--halo-border);
    min-width: 200px;
    z-index: 1200;
    display: none;
    overflow: hidden;
}

.halo-dropdown-menu.show {
    display: block;
}

.halo-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--halo-spacing-sm);
    padding: var(--halo-spacing-sm) var(--halo-spacing-md);
    color: var(--halo-text-primary);
    text-decoration: none;
    font-size: var(--halo-font-size-sm);
    transition: background-color var(--halo-transition-fast);
}

.halo-dropdown-item:hover {
    background-color: var(--halo-surface-hover);
    color: var(--halo-text-primary);
}

.halo-dropdown-item i {
    color: var(--halo-text-secondary);
    width: 18px;
    text-align: center;
}

.halo-dropdown-divider {
    height: 1px;
    background-color: var(--halo-border);
    margin: var(--halo-spacing-xs) 0;
}

/* Login Button */
.halo-login-btn {
    background: transparent;
    border: none;
    color: var(--halo-text-light);
    font-size: var(--halo-font-size-sm);
    padding: var(--halo-spacing-xs) var(--halo-spacing-sm);
    border-radius: var(--halo-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--halo-spacing-xs);
    text-decoration: none;
    transition: background-color var(--halo-transition-fast);
}

.halo-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--halo-text-light);
}

/* ============================================
   Sidebar Styles
   ============================================ */
.halo-sidebar {
    background-color: var(--halo-sidebar-bg);
    border-right: 1px solid var(--halo-sidebar-border);
    box-shadow: 2px 0 8px var(--halo-shadow);
    top: var(--halo-appbar-height);
    height: calc(100vh - var(--halo-appbar-height));
    z-index: 1000;
    position: fixed;
    left: 0;
    width: var(--halo-sidebar-width);
    transition: width var(--halo-transition-normal);
    overflow-x: hidden;
}

/* Collapsed sidebar */
.halo-sidebar.collapsed {
    width: var(--halo-sidebar-collapsed);
}

/* Main content adjustment for sidebar */
.halo-main-content {
    flex: 1;
    min-width: 0;
    background-color: var(--halo-background);
    transition: margin-left var(--halo-transition-normal);
    margin-left: var(--halo-sidebar-width);
}

.halo-main-content.sidebar-collapsed {
    margin-left: var(--halo-sidebar-collapsed);
}


/* Navigation Container */
.halo-nav {
    padding: var(--halo-spacing-sm) 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Navigation Items */
.halo-nav-item {
    display: flex;
    align-items: center;
    padding: var(--halo-spacing-sm) var(--halo-spacing-md);
    margin: var(--halo-spacing-xs) var(--halo-spacing-sm);
    color: var(--halo-text-light);
    text-decoration: none;
    border-radius: var(--halo-radius-md);
    transition: all var(--halo-transition-fast);
    font-size: var(--halo-font-size-sm);
    font-weight: 500;
    min-height: 40px;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    width: calc(100% - var(--halo-spacing-lg));
    text-align: left;
}

.halo-nav-item:hover {
    background-color: var(--halo-sidebar-hover);
    color: #FFFFFF;
}

.halo-nav-item.active {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--halo-primary-light);
}

.halo-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background-color: var(--halo-primary);
    border-radius: 0 2px 2px 0;
}

/* Nav Icon */
.halo-nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: var(--halo-spacing-md);
}

.halo-nav-icon .e-icons,
.halo-nav-icon .bi {
    font-size: 18px;
}

/* Nav Text */
.halo-nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--halo-transition-fast);
}

/* Collapsed State */
.halo-sidebar.collapsed .halo-nav-text,
.halo-nav-collapsed .halo-nav-text {
    opacity: 0;
    width: 0;
    margin-left: 0;
}

.halo-sidebar.collapsed .halo-nav-item,
.halo-nav-collapsed .halo-nav-item {
    justify-content: center;
    padding: var(--halo-spacing-sm);
}

.halo-sidebar.collapsed .halo-nav-icon,
.halo-nav-collapsed .halo-nav-icon {
    margin-right: 0;
}

.halo-sidebar.collapsed .halo-nav-section-title,
.halo-nav-collapsed .halo-nav-section-title {
    display: none;
}

/* Section Title */
.halo-nav-section-title {
    font-size: var(--halo-font-size-xs);
    font-weight: 600;
    color: var(--halo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--halo-spacing-lg) var(--halo-spacing-md) var(--halo-spacing-xs);
    margin-top: var(--halo-spacing-sm);
}

/* Nav Divider */
.halo-nav-divider {
    height: 1px;
    background-color: var(--halo-sidebar-border);
    margin: var(--halo-spacing-sm) var(--halo-spacing-md);
}

/* Sidebar pref toggle (always-expand) */
.halo-nav { display: flex; flex-direction: column; }
.halo-nav-spacer { flex: 1; }

.halo-sidebar-pref-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--halo-spacing-sm) var(--halo-spacing-md);
    border-top: 1px solid var(--halo-sidebar-border);
    color: var(--halo-text-light);
    font-size: var(--halo-font-size-sm);
}

/* Hide when sidebar is collapsed (60px rail) */
.halo-sidebar.collapsed .halo-sidebar-pref-toggle,
.halo-nav-collapsed .halo-sidebar-pref-toggle { display: none; }

/* ============================================
   SfCard Shell — shared chrome for any <div class="halo-sf-card">
   wrapping an <SfCard>. Used by all deployment detail cards. The
   wrapper carries the "halo-sf-card" class; the SfCard renders as
   .e-card inside, and these rules override its default look to
   match the Halo design tokens.
   ============================================ */
.halo-sf-card .e-card {
    background: var(--halo-surface);
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-xl);
    box-shadow: 0 1px 3px var(--halo-shadow);
    overflow: hidden;
}

.halo-sf-card .e-card-header {
    padding: var(--halo-spacing-md) var(--halo-spacing-lg);
    border-bottom: 1px solid var(--halo-border-light);
    background: var(--halo-surface);
}

.halo-sf-card .e-card-content {
    padding: var(--halo-spacing-lg);
}

/* Header layout inside the card: title on the left, action button(s)
   on the right. Cards put their <h2 class="card-shell-title"> + their
   <SfButton class="card-shell-edit-btn"> inside this. */
.card-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-spacing-md);
    width: 100%;
}

.card-shell-title {
    font-size: var(--halo-font-size-lg);
    font-weight: 600;
    color: var(--halo-text-primary);
    margin: 0;
}

/* Compact icon-only edit button — same look as the devices grid action
   column. Used by the sidebar cards (Fleet / Companies / Units). */
.card-shell-edit-btn {
    min-width: 28px !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: var(--halo-radius-md) !important;
    color: var(--halo-text-secondary) !important;
    flex-shrink: 0;
}

.card-shell-edit-btn:hover {
    background: var(--halo-surface-hover) !important;
    color: var(--halo-primary) !important;
}

.card-shell-edit-btn .e-btn-icon {
    margin: 0 !important;
    font-size: 14px;
}

/* ============================================
   Mobile Card List — shared shape for the max-width: 768px card layouts
   that stand in for the SfGrids (units, devices, alerts, the device
   histories, saved views, company regions, digi setup). Components carry
   these classes next to their own "X-card-*" hook classes, which stay in
   the markup as test/semantic hooks; a component's .razor.css then holds
   only its deliberate deviations from this shape.
   ============================================ */
.halo-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: var(--halo-spacing-md);
    width: 100%;
    text-align: left;
}

.halo-mobile-cards-empty {
    text-align: center;
    color: var(--halo-text-secondary);
    padding: var(--halo-spacing-lg);
}

.halo-mobile-card {
    background: var(--halo-surface);
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-xl);
    padding: var(--halo-spacing-lg);
}

.halo-mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--halo-spacing-sm);
    margin-bottom: var(--halo-spacing-md);
    padding-bottom: var(--halo-spacing-sm);
    border-bottom: 1px solid var(--halo-border);
}

.halo-mobile-card-title {
    display: flex;
    align-items: center;
    gap: var(--halo-spacing-sm);
    flex-wrap: wrap;
    min-width: 0;
}

.halo-mobile-card-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--halo-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--halo-surface-hover);
    color: var(--halo-text-primary);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.halo-mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--halo-spacing-sm);
    margin-bottom: var(--halo-spacing-md);
}

.halo-mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--halo-spacing-sm);
}

.halo-mobile-card-label {
    font-size: 0.75rem;
    color: var(--halo-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    flex-shrink: 0;
}

.halo-mobile-card-value {
    font-size: 0.8125rem;
    color: var(--halo-text-primary);
    text-align: right;
    word-break: break-word;
}

.halo-mobile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--halo-spacing-md);
    flex-wrap: wrap;
    padding-top: var(--halo-spacing-sm);
    border-top: 1px solid var(--halo-border);
}

/* Status pill. The mobile cards and the desktop grid Status columns both
   carry it, so one state reads the same in either layout. A component with
   its own state vocabulary (e.g. the alert history's resolved/ack) keeps
   those modifiers in its scoped file. */
.halo-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--halo-radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.halo-status-pill.active {
    background-color: #d1fae5;
    color: #065f46;
}

.halo-status-pill.inactive {
    background-color: #f1f5f9;
    color: #64748b;
}

.halo-status-pill.connected {
    background-color: #dbeafe;
    color: #1e40af;
}

.halo-status-pill.preinstall {
    background-color: #fef3c7;
    color: #92400e;
}

.halo-status-pill.retired {
    background-color: #fee2e2;
    color: #991b1b;
}

.halo-status-pill.unassigned {
    background-color: #f1f5f9;
    color: #64748b;
}

/* The shared pager button, rendered by LoadMoreButton.razor at the foot of a card
   list. Global like the rest of the family so the halo- prefix keeps meaning
   "defined in the theme". */
.halo-load-more-btn {
    background: none;
    border: 1px dashed var(--halo-border);
    color: var(--halo-text-secondary);
    font-size: 0.8125rem;
    padding: 10px;
    border-radius: var(--halo-radius-md);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.halo-load-more-btn:hover {
    background-color: var(--halo-surface-hover);
    color: var(--halo-primary);
}

/* ============================================
   Syncfusion Grid Overrides (High Density + Modern Rounded)
   ============================================ */
.e-grid {
    font-size: var(--halo-font-size-base) !important;
    border-radius: var(--halo-radius-xl) !important;
    border: 1px solid var(--halo-border) !important;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--halo-shadow), 0 1px 2px var(--halo-shadow) !important;
}

.e-grid .e-gridheader {
    background-color: var(--halo-surface) !important;
    border-bottom: 2px solid var(--halo-border) !important;
    border-radius: var(--halo-radius-xl) var(--halo-radius-xl) 0 0 !important;
}

.e-grid .e-gridcontent {
    border-radius: 0 0 var(--halo-radius-xl) var(--halo-radius-xl) !important;
}

.e-grid .e-headercell {
    padding: var(--halo-spacing-sm) var(--halo-spacing-md) !important;
    font-weight: 600 !important;
    font-size: var(--halo-font-size-xs) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    color: var(--halo-text-secondary) !important;
    background-color: var(--halo-surface) !important;
}

.e-grid .e-rowcell {
    padding: var(--halo-spacing-xs) var(--halo-spacing-md) !important;
    font-size: var(--halo-font-size-base) !important;
    color: var(--halo-text-primary) !important;
    border-color: var(--halo-border-light) !important;
}

.e-grid .e-row:hover .e-rowcell {
    background-color: rgba(5, 150, 105, 0.04) !important;
}

.e-grid .e-altrow .e-rowcell {
    background-color: var(--halo-background) !important;
}

.e-grid .e-pager {
    padding: var(--halo-spacing-sm) !important;
    background-color: var(--halo-surface) !important;
    border-top: 1px solid var(--halo-border) !important;
    border-radius: 0 0 var(--halo-radius-xl) var(--halo-radius-xl) !important;
}

.e-grid .e-toolbar {
    padding: var(--halo-spacing-sm) !important;
    background-color: var(--halo-surface) !important;
    border-bottom: 1px solid var(--halo-border) !important;
}

/* Pill-shaped Search Bar - Default style for all search inputs */
/* Note: Syncfusion adds CssClass to the same element as .e-input-group, so we use .class.e-input-group (no space) */
.halo-search-input.e-input-group,
.devices-search-input.e-input-group {
    border-radius: var(--halo-radius-pill) !important;
    background-color: var(--halo-background) !important;
    border: 1px solid var(--halo-border) !important;
}

.halo-search-input .e-input,
.devices-search-input .e-input {
    border-radius: var(--halo-radius-pill) !important;
    padding-left: 40px !important;
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.halo-search-input .e-input:focus,
.devices-search-input .e-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.halo-search-input.e-input-group.e-input-focus,
.devices-search-input.e-input-group.e-input-focus {
    border-color: var(--halo-primary) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
}

/* Map View Container - Generic styling for all maps */
.e-maps {
    border-radius: var(--halo-radius-xl) !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px var(--halo-shadow), 0 1px 2px var(--halo-shadow) !important;
}

/* Device Edit Dialog Action Buttons */
.e-dialog .btn {
    border-radius: var(--halo-radius-md) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

.e-dialog .btn i {
    font-size: 16px;
}

.e-dialog .btn-success {
    background-color: #10b981 !important;
    color: white !important;
}

.e-dialog .btn-success:hover {
    background-color: #059669 !important;
}

.e-dialog .btn-warning {
    background-color: #fb923c !important;
    color: white !important;
}

.e-dialog .btn-warning:hover {
    background-color: #f97316 !important;
}

.e-dialog .btn-info {
    background-color: #38bdf8 !important;
    color: white !important;
}

.e-dialog .btn-info:hover {
    background-color: #0ea5e9 !important;
}

/* ============================================
   Bootstrap Button Color Overrides
   ============================================ */
/* Primary Button */
.btn-primary {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

/* Success Button */
.btn-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

/* Warning Button */
.btn-warning {
    background-color: #fb923c !important;
    border-color: #fb923c !important;
    color: white !important;
}

.btn-warning:hover {
    background-color: #f97316 !important;
    border-color: #f97316 !important;
}

/* Info Button */
.btn-info {
    background-color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: white !important;
}

.btn-info:hover {
    background-color: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
}

/* Danger Button */
.btn-danger {
    background-color: #f87171 !important;
    border-color: #f87171 !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
}

/* Secondary Button */
.btn-secondary {
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #64748b !important;
    border-color: #64748b !important;
}

/* ============================================
   Syncfusion Button Overrides
   ============================================ */
.e-btn {
    border-radius: var(--halo-radius-md) !important;
    font-weight: 500 !important;
    font-size: var(--halo-font-size-sm) !important;
    padding: var(--halo-spacing-xs) var(--halo-spacing-md) !important;
    transition: all var(--halo-transition-fast) !important;
}

.e-btn.e-primary {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.e-btn.e-primary:hover:not(:disabled) {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.e-btn.e-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.e-btn.e-success:hover:not(:disabled) {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.e-btn.e-warning {
    background-color: #fb923c !important;
    border-color: #fb923c !important;
    color: white !important;
}

.e-btn.e-warning:hover:not(:disabled) {
    background-color: #f97316 !important;
    border-color: #f97316 !important;
}

.e-btn.e-info {
    background-color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: white !important;
}

.e-btn.e-info:hover:not(:disabled) {
    background-color: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
}

/* A disabled coloured button reads as off. The colours above are !important and outrank Syncfusion's own disabled
   colours, so the button fades here instead, and the hover rules above leave it alone. SfButton and the date range
   picker's Apply are disabled by the attribute alone. A flat one is drawn in the same solid colour, so it fades too. */
.e-btn.e-primary:disabled,
.e-btn.e-success:disabled,
.e-btn.e-warning:disabled,
.e-btn.e-info:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.e-btn.e-outline {
    border-color: var(--halo-border) !important;
    color: var(--halo-text-primary) !important;
}

.e-btn.e-outline:hover {
    background-color: var(--halo-surface-hover) !important;
}

/* ============================================
   Syncfusion Input Overrides
   ============================================ */
.e-input-group {
    margin-bottom: var(--halo-spacing-sm) !important;
}

.e-input-group .e-input,
.e-input-group.e-control-wrapper .e-input {
    font-size: var(--halo-font-size-sm) !important;
    padding: var(--halo-spacing-xs) var(--halo-spacing-sm) !important;
    border-radius: var(--halo-radius-md) !important;
}

.e-input-group:not(.e-disabled):not(.e-float-icon-left).e-input-focus {
    border-color: var(--halo-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--halo-primary-rgb), 0.2) !important;
}

.e-float-input.e-input-group .e-float-line::before,
.e-float-input.e-input-group .e-float-line::after {
    background: var(--halo-primary) !important;
}

/* A calendar day past its picker's Min or Max. The generated theme leaves it at 75% of the text colour, which reads
   as an ordinary day that ignores the click. */
.e-calendar .e-content td.e-disabled span.e-day,
.e-calendar .e-content td.e-disabled:hover span.e-day,
.e-calendar .e-content td.e-disabled:focus span.e-day {
    color: var(--halo-text-muted);
}

/* ============================================
   Syncfusion Chart Overrides
   ============================================ */
.e-chart {
    border-radius: var(--halo-radius-lg) !important;
    background-color: var(--halo-surface) !important;
    padding: var(--halo-spacing-md) !important;
}


/* ============================================
   Syncfusion Dialog Overrides
   ============================================ */
.e-dialog {
    border-radius: var(--halo-radius-xl) !important;
    box-shadow: 0 8px 32px var(--halo-shadow-lg) !important;
}

.e-dialog .e-dlg-header-content {
    padding: var(--halo-spacing-md) var(--halo-spacing-lg) !important;
    border-bottom: 1px solid var(--halo-border) !important;
}

.e-dialog .e-dlg-content {
    padding: var(--halo-spacing-lg) !important;
}

.e-dialog .e-footer-content {
    padding: var(--halo-spacing-md) var(--halo-spacing-lg) !important;
    border-top: 1px solid var(--halo-border) !important;
}

/* ============================================
   Syncfusion Spinner Overrides
   ============================================ */
.e-spinner-pane .e-spinner-inner .e-spin-material,
.e-spinner-pane .e-spinner-inner .e-spin-bootstrap5 {
    stroke: var(--halo-primary) !important;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--halo-background);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--halo-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--halo-text-muted);
}

/* ============================================
   Utility Classes
   ============================================ */
.halo-text-primary { color: var(--halo-text-primary) !important; }
.halo-text-secondary { color: var(--halo-text-secondary) !important; }
.halo-text-muted { color: var(--halo-text-muted) !important; }
.halo-bg-surface { background-color: var(--halo-surface) !important; }
.halo-bg-background { background-color: var(--halo-background) !important; }

/* ============================================
   Hover Tip - the short version of a control's details, shown while the control just before it is hovered or has
   keyboard focus. CSS only, so it needs no JS and renders the same in bUnit snapshots; touch screens get the
   control's own popover instead. It spans the nearest positioned ancestor, under it (or over it with .is-above).
   Shared by the board's device status icon and PM pill; global because scoped CSS cannot cross components.
   ============================================ */
.halo-hovertip {
    position: absolute;
    z-index: 3;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    padding: 6px 8px;
    border-radius: var(--halo-radius-md);
    background: var(--halo-text-primary);
    color: var(--halo-surface);
    font-size: var(--halo-font-size-sm);
    font-weight: 400;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    pointer-events: none;
}

.halo-hovertip.is-above {
    top: auto;
    bottom: calc(100% + 4px);
}

:hover + .halo-hovertip,
:focus-visible + .halo-hovertip {
    display: block;
}

@media (hover: none) {
    :hover + .halo-hovertip,
    :focus-visible + .halo-hovertip {
        display: none;
    }
}

/* ============================================
   Regional board - the pieces several board components render: a section's head and body, the kind tag, the count
   pill, the empty note, a Pending group, a status pill, a card's text line, the hint and the alert. Global because
   scoped CSS cannot cross components.
   ============================================ */
.board-section,
.board-section-body,
.board-group,
.board-group-cards {
    display: flex;
    flex-direction: column;
    gap: var(--halo-spacing-sm);
}

.board-section-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
}

.board-section-toggle {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 6px;
    min-width: 0;
    padding: 2px;
    border: 0;
    border-radius: var(--halo-radius-md);
    background: transparent;
    color: var(--halo-text-primary);
    text-align: left;
    cursor: pointer;
}

.board-section-toggle:hover {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.board-section-toggle:focus-visible {
    outline: 2px solid var(--halo-primary);
    outline-offset: 1px;
}

.board-chevron {
    flex: 0 0 auto;
    color: var(--halo-text-secondary);
    transition: transform var(--halo-transition-fast);
}

.board-chevron.is-closed {
    transform: rotate(-90deg);
}

.board-section-name {
    min-width: 0;
    overflow: hidden;
    font-size: var(--halo-font-size-base);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-kind,
.board-group-head {
    flex: 0 0 auto;
    color: var(--halo-text-secondary);
    font-size: var(--halo-font-size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.board-count {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: var(--halo-radius-pill);
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: var(--halo-text-primary);
    font-size: var(--halo-font-size-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

.board-empty {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: var(--halo-spacing-md);
    border: 1px dashed var(--halo-border);
    border-radius: var(--halo-radius-lg);
    color: var(--halo-board-lane-text-secondary);
    font-size: var(--halo-font-size-sm);
    text-align: center;
}

.board-empty strong {
    color: var(--halo-text-primary);
}

/* While a search runs every match (a card, or a section head or lane title found by its name) is outlined; the first
   one, which the board brought into view, also carries a halo. */
.is-search-match {
    outline: 2px solid var(--halo-info);
    outline-offset: 2px;
}

.is-search-first {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--halo-info) 25%, transparent);
}

.board-group-note,
.board-hint {
    margin: 0;
    color: var(--halo-text-secondary);
    font-size: var(--halo-font-size-sm);
}

/* Small text set on the lane itself rather than on a card (a section's kind tag, the group heads and notes) keeps its
   contrast on the gray lane and on every lane tint; the empty notes above take the same color. */
.board-section-head .board-kind,
.board-group-head,
.board-group-note {
    color: var(--halo-board-lane-text-secondary);
}

.board-pill {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 var(--halo-spacing-sm);
    border-radius: var(--halo-radius-pill);
    font-size: var(--halo-font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.board-pill.is-info {
    background: var(--halo-info-bg);
    color: var(--halo-info);
}

.board-pill.is-warn {
    background: var(--halo-pm-soon-bg);
    color: var(--halo-pm-soon-text);
}

.board-pill.is-danger {
    background: var(--halo-danger-bg);
    color: var(--halo-danger-text);
}

/* The quick-filter chips: one radio group of pill buttons, each with an optional dot and its count. */
.board-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.board-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-pill);
    background: var(--halo-surface);
    color: var(--halo-text-primary);
    font-size: var(--halo-font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.board-chip:hover {
    border-color: var(--halo-text-muted);
}

.board-chip:focus-visible {
    outline: 2px solid var(--halo-primary);
    outline-offset: 2px;
}

.board-chip[aria-checked="true"] {
    border-color: var(--halo-text-primary);
    background: var(--halo-text-primary);
    color: var(--halo-surface);
}

.board-chip-count {
    color: var(--halo-text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.board-chip[aria-checked="true"] .board-chip-count {
    color: var(--halo-border);
}

.board-chip-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.board-chip-dot.is-pm-overdue,
.board-chip-dot.is-no-device {
    background: var(--halo-pm-overdue);
}

.board-chip-dot.is-pm-due-soon {
    background: var(--halo-warning);
}

.board-chip-dot.is-not-reporting {
    background: var(--halo-device-not-reporting);
}

.board-chip-dot.is-leapfrog {
    background: var(--halo-surface);
    box-shadow: inset 0 0 0 2px var(--halo-leapfrog);
}

.board-chip-dot.is-transferring {
    background: var(--halo-info);
}

.board-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    color: var(--halo-text-secondary);
    font-size: var(--halo-font-size-sm);
    line-height: 1.35;
}

.board-line .bi {
    margin-top: 1px;
}

.board-line.is-info {
    color: var(--halo-info);
}

.board-line.is-warn {
    color: var(--halo-pm-soon-text);
}

.board-line.is-reason {
    color: var(--halo-text-primary);
    font-weight: 500;
}

/* Whose unit it is when it is not E3's: a filled pill, so it reads apart from the card's other lines. */
.board-line.is-owner {
    align-self: flex-start;
    padding: 2px var(--halo-spacing-sm);
    border-radius: var(--halo-radius-md);
    background: var(--halo-border);
    color: var(--halo-text-primary);
    font-weight: 600;
}

/* A unit type without a logo shows its name where the logo goes, and a customer's own unit shows its company there
   in the same look. Text on a white card: the type color darkened so the light hues (TOAD teal) stay readable. */
.board-unit-wordmark-text,
.board-unit-owner {
    color: color-mix(in srgb, var(--unit-type-color) 60%, #000000);
    font-size: var(--halo-font-size-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.board-alert {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--halo-spacing-sm) 10px;
    border-radius: var(--halo-radius-lg);
    font-size: var(--halo-font-size-sm);
    line-height: 1.4;
}

.board-alert.is-warn {
    border: 1px solid var(--halo-pm-soon-border);
    background: var(--halo-pm-soon-bg);
    color: var(--halo-pm-soon-text);
}

.board-alert.is-danger {
    border: 1px solid var(--halo-pm-overdue-border);
    background: var(--halo-pm-overdue-bg);
    color: var(--halo-pm-overdue-text);
}

/* Every board delete action reads as danger: the kit and component pages' Delete buttons and the card back's Discard
   (board-danger), and the asset menu's delete item. Global because Syncfusion renders a drop-down's popup at the page
   level and scoped CSS cannot cross components; the .e-btn.e-flat and .e-item qualifiers beat Syncfusion's own colors.
   Hovered, focused and pressed, they take the danger tint as well, since Syncfusion's flat-button fill and its popup's
   hover fill do not carry red text. */
.e-btn.e-flat.board-danger,
.e-btn.e-flat.board-danger:hover,
.e-btn.e-flat.board-danger:focus,
.e-dropdown-popup ul .e-item[id^="board-asset-delete-"],
.e-dropdown-popup ul .e-item[id^="board-asset-delete-"]:hover {
    color: var(--halo-danger-text);
}

.e-btn.e-flat.board-danger:hover,
.e-btn.e-flat.board-danger:focus,
.e-btn.e-flat.board-danger:active {
    border-color: transparent;
    background: var(--halo-danger-bg);
}

.e-dropdown-popup ul .e-item[id^="board-asset-delete-"]:hover,
.e-dropdown-popup ul .e-item[id^="board-asset-delete-"].e-focused,
.e-dropdown-popup ul .e-item[id^="board-asset-delete-"]:active {
    background: var(--halo-danger-bg);
}

/* The board's dialogs (the menu's lists, Share, the lane color): a title and a line under it, which may wrap. Global
   because several components host them. */
.board-list-dialog-title {
    display: block;
    font-size: var(--halo-font-size-xl);
    font-weight: 600;
}

.board-list-dialog-sub {
    display: block;
    margin-top: var(--halo-spacing-xs);
    color: var(--halo-text-secondary);
    font-size: var(--halo-font-size-sm);
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
}

/* The phone board's bottom sheets (a unit's actions, Jump to a lane). Global because both sheets share it and their
   items are Syncfusion buttons, which scoped CSS reaches only through ::deep. The theme ellipsizes the dialog header's
   own text on one line; a block title inside it wraps, so a long unit id shows in full. The theme's .e-btn sets its
   size and padding with !important, so the Syncfusion items counter it with a more specific selector to match the
   plain link items. */
.board-sheet-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: var(--halo-font-size-2xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
}

.board-sheet-sub {
    margin: 0 0 var(--halo-spacing-sm);
    color: var(--halo-text-secondary);
    font-size: var(--halo-font-size-base);
}

.board-sheet-items {
    display: flex;
    flex-direction: column;
}

.board-sheet-items .board-sheet-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 var(--halo-spacing-sm);
    border: 0;
    background: transparent;
    color: var(--halo-text-primary);
    font-size: var(--halo-font-size-lg);
    text-align: left;
    text-decoration: none;
}

.board-sheet-items .e-btn.board-sheet-item {
    padding: 0 var(--halo-spacing-sm) !important;
    font-size: var(--halo-font-size-lg) !important;
    font-weight: 400 !important;
}

.board-sheet-sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--halo-border);
}

.board-sheet-items .board-sheet-cancel {
    width: 100%;
    min-height: 44px;
    margin-top: var(--halo-spacing-sm);
}

/* A phone's asset menu rows are 44px touch targets; keyed on the item ids, which Syncfusion copies into its popup. */
@media (max-width: 768px) {
    .e-dropdown-popup ul .e-item[id^="board-asset-"]:not(.e-separator) {
        height: 44px;
        line-height: 44px;
    }
}

/* ============================================
   Responsive Breakpoints
   ============================================ */
@media (max-width: 768px) {
    .halo-brand .halo-title {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .halo-logo {
        height: 28px;
    }

    .halo-page-content {
        padding: var(--halo-spacing-md);
    }

    .halo-user-name {
        display: none;
    }

    .halo-header-actions .halo-user-menu .e-dropdown-btn .e-btn-content {
        display: none;
    }

    /* ---- Mobile sidebar drawer ----
       Order matters: this block lives AFTER the .halo-sidebar.collapsed and
       .halo-nav-collapsed rules above (lines ~493-514). Specificity ties on
       0,3,0 / 0,2,0 are resolved by source order, so don't move this earlier
       in the file or the desktop collapsed rules will win and the drawer will
       still hide labels and center items. */

    /* Force the closed and open mobile sidebar both to 240px so translateX(-100%)
       slides a full drawer off-screen, not just the 60px collapsed rail. */
    .halo-sidebar,
    .halo-sidebar.collapsed {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.25s ease-in-out, width var(--halo-transition-normal);
    }

    .halo-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Override the four collapsed-only nav rules so labels/icons/section titles
       render in their expanded form whenever the drawer is open, regardless of
       .collapsed or .halo-nav-collapsed still being present on inner elements. */
    .halo-sidebar.mobile-open .halo-nav-text {
        opacity: 1;
        width: auto;
        margin-left: var(--halo-spacing-sm);
    }

    .halo-sidebar.mobile-open .halo-nav-item {
        justify-content: flex-start;
    }

    .halo-sidebar.mobile-open .halo-nav-icon {
        margin-right: var(--halo-spacing-sm);
    }

    .halo-sidebar.mobile-open .halo-nav-section-title {
        display: block;
    }

    /* Sidebar always-expand pref is desktop-only; force it hidden on mobile. */
    .halo-sidebar-pref-toggle {
        display: none !important;
    }

    /* Drop the main-content gutter on mobile. Both selectors needed because
       <main> is born with .sidebar-collapsed and that compound rule (0,2,0)
       beats a plain .halo-main-content override (0,1,0). */
    .halo-main-content,
    .halo-main-content.sidebar-collapsed {
        margin-left: 0;
    }

    /* Prevent any rogue child element (a wide toolbar, an unscrolled grid, etc.)
       from giving the whole page a horizontal scrollbar on phones. */
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .halo-brand .halo-title {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .halo-logo {
        height: 24px;
    }
}

/* ============================================
   Error UI Styling
   ============================================ */
#blazor-error-ui {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--halo-radius-md);
    bottom: var(--halo-spacing-lg);
    left: var(--halo-spacing-lg);
    right: var(--halo-spacing-lg);
    padding: var(--halo-spacing-md);
    position: fixed;
    display: none;
    z-index: 1050;
    color: #92400E;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--halo-spacing-md);
    top: var(--halo-spacing-sm);
}

#blazor-error-ui .reload {
    color: var(--halo-primary);
    font-weight: 500;
}

[data-bs-theme="dark"] #blazor-error-ui {
    background: #422006;
    border-color: #92400E;
    color: #FCD34D;
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--halo-primary);
    outline-offset: 2px;
}

.e-btn:focus-visible,
.e-input:focus-visible {
    outline: 2px solid var(--halo-primary) !important;
    outline-offset: 2px !important;
}

/* ============================================
   Loading Overlay - Theme Aware
   ============================================ */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

[data-bs-theme="dark"] .loading-overlay {
    background-color: rgba(15, 23, 42, 0.8);
}

/* ============================================
   Dark Mode - Syncfusion Component Overrides
   ============================================ */

/* Grid - All Rows */
[data-bs-theme="dark"] .e-grid .e-rowcell {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-grid .e-altrow .e-rowcell {
    background-color: var(--halo-background) !important;
}

[data-bs-theme="dark"] .e-grid .e-row:hover .e-rowcell {
    background-color: var(--halo-surface-hover) !important;
}

/* Grid Header */
[data-bs-theme="dark"] .e-grid .e-headercell {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-secondary) !important;
    border-color: var(--halo-border) !important;
}

/* Sorted Column Header - ensure text remains visible in dark mode */
[data-bs-theme="dark"] .e-grid .e-headercell.e-ascending,
[data-bs-theme="dark"] .e-grid .e-headercell.e-descending,
[data-bs-theme="dark"] .e-grid .e-headercell.e-focus,
[data-bs-theme="dark"] .e-grid .e-headercell.e-sorted,
[data-bs-theme="dark"] .e-grid .e-headercell .e-sortfilterdiv,
[data-bs-theme="dark"] .e-grid .e-headercell .e-headercelldiv,
[data-bs-theme="dark"] .e-grid .e-headercell.e-ascending .e-headercelldiv,
[data-bs-theme="dark"] .e-grid .e-headercell.e-descending .e-headercelldiv,
[data-bs-theme="dark"] .e-grid .e-headercell .e-headertext,
[data-bs-theme="dark"] .e-grid .e-headercell.e-ascending .e-headertext,
[data-bs-theme="dark"] .e-grid .e-headercell.e-descending .e-headertext {
    color: var(--halo-text-secondary) !important;
}

/* Sort icons in dark mode */
[data-bs-theme="dark"] .e-grid .e-headercell .e-icons.e-icon-ascending,
[data-bs-theme="dark"] .e-grid .e-headercell .e-icons.e-icon-descending,
[data-bs-theme="dark"] .e-grid .e-headercell .e-sortfilterdiv .e-icons {
    color: var(--halo-primary) !important;
}

[data-bs-theme="dark"] .e-grid .e-gridheader {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

/* Grid Pager */
[data-bs-theme="dark"] .e-grid .e-pager {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-pager .e-numericitem,
[data-bs-theme="dark"] .e-pager .e-numericcontainer {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-pager .e-currentitem {
    background-color: var(--halo-primary) !important;
    color: white !important;
}

[data-bs-theme="dark"] .e-pager .e-icons {
    color: var(--halo-text-secondary) !important;
}

/* Pager Navigation Container (arrows) */
[data-bs-theme="dark"] .e-pager .e-pagercontainer,
[data-bs-theme="dark"] .e-pager .e-first,
[data-bs-theme="dark"] .e-pager .e-prev,
[data-bs-theme="dark"] .e-pager .e-next,
[data-bs-theme="dark"] .e-pager .e-last,
[data-bs-theme="dark"] .e-pager .e-pp,
[data-bs-theme="dark"] .e-pager .e-np,
[data-bs-theme="dark"] .e-pager .e-mfirst,
[data-bs-theme="dark"] .e-pager .e-mprev,
[data-bs-theme="dark"] .e-pager .e-mnext,
[data-bs-theme="dark"] .e-pager .e-mlast {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-pager .e-pagercontainer {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-pager .e-numericitem:hover,
[data-bs-theme="dark"] .e-pager .e-first:hover,
[data-bs-theme="dark"] .e-pager .e-prev:hover,
[data-bs-theme="dark"] .e-pager .e-next:hover,
[data-bs-theme="dark"] .e-pager .e-last:hover {
    background-color: var(--halo-surface-hover) !important;
}

/* Grid Empty Row - "No records to display" */
[data-bs-theme="dark"] .e-grid .e-emptyrow td,
[data-bs-theme="dark"] .e-grid .e-emptyrow,
[data-bs-theme="dark"] .e-grid .e-row:empty,
[data-bs-theme="dark"] .e-grid td.e-rowcell[colspan] {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-secondary) !important;
}

/* Input Groups / Search Bar */
[data-bs-theme="dark"] .e-input-group,
[data-bs-theme="dark"] .e-input-group.e-control-wrapper {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-input-group .e-input,
[data-bs-theme="dark"] .e-input-group.e-control-wrapper .e-input {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-input-group .e-input::placeholder {
    color: var(--halo-text-muted) !important;
}

/* DropDown / Select */
[data-bs-theme="dark"] .e-dropdownbase,
[data-bs-theme="dark"] .e-dropdown-popup,
[data-bs-theme="dark"] .e-ddl.e-popup,
[data-bs-theme="dark"] .e-popup.e-popup-open {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-dropdownbase .e-list-item,
[data-bs-theme="dark"] .e-ddl .e-list-item {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-dropdownbase .e-list-item:hover,
[data-bs-theme="dark"] .e-ddl .e-list-item:hover,
[data-bs-theme="dark"] .e-dropdownbase .e-list-item.e-hover {
    background-color: var(--halo-surface-hover) !important;
}

[data-bs-theme="dark"] .e-dropdownbase .e-list-item.e-active,
[data-bs-theme="dark"] .e-ddl .e-list-item.e-active {
    background-color: var(--halo-primary) !important;
    color: white !important;
}

/* MultiSelect */
[data-bs-theme="dark"] .e-multiselect.e-input-group,
[data-bs-theme="dark"] .e-multiselect-wrapper {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-multi-select-wrapper .e-chips {
    background-color: var(--halo-surface-hover) !important;
    color: var(--halo-text-primary) !important;
}

/* MultiSelect input text */
[data-bs-theme="dark"] .e-multiselect .e-multi-select-wrapper input,
[data-bs-theme="dark"] .e-multiselect .e-multi-select-wrapper input.e-dropdownbase,
[data-bs-theme="dark"] .e-multiselect input.e-input,
[data-bs-theme="dark"] .e-multi-select-wrapper input[type="text"],
[data-bs-theme="dark"] .e-multiselect.e-input-group input,
[data-bs-theme="dark"] .e-multiselect.e-input-group .e-input,
[data-bs-theme="dark"] .e-multiselect .e-searcher input,
[data-bs-theme="dark"] .e-multi-select-wrapper .e-searcher input,
[data-bs-theme="dark"] input.e-dropdownbase {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
    -webkit-text-fill-color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-multiselect .e-multi-select-wrapper input::placeholder,
[data-bs-theme="dark"] .e-multiselect input::placeholder,
[data-bs-theme="dark"] .e-multi-select-wrapper input::placeholder {
    color: var(--halo-text-muted) !important;
    -webkit-text-fill-color: var(--halo-text-muted) !important;
}

/* MultiSelect popup */
[data-bs-theme="dark"] .e-multiselect.e-popup,
[data-bs-theme="dark"] .e-multiselect .e-popup {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

/* DropDownList input */
[data-bs-theme="dark"] .e-ddl input.e-input,
[data-bs-theme="dark"] .e-dropdownlist input.e-input,
[data-bs-theme="dark"] .e-ddl.e-input-group input {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

/* Dialog */
[data-bs-theme="dark"] .e-dialog,
[data-bs-theme="dark"] .e-dialog .e-dlg-header-content,
[data-bs-theme="dark"] .e-dialog .e-dlg-content,
[data-bs-theme="dark"] .e-dialog .e-footer-content {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-dialog .e-dlg-header {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-dialog .e-dlg-header span,
[data-bs-theme="dark"] .e-dialog .e-dlg-header-content span {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-dialog .e-dlg-header-content,
[data-bs-theme="dark"] .e-dialog .e-footer-content {
    border-color: var(--halo-border) !important;
}

/* Dialog TextBox inputs */
[data-bs-theme="dark"] .e-dialog .e-textbox,
[data-bs-theme="dark"] .e-dialog .e-input,
[data-bs-theme="dark"] .e-dialog input.e-input,
[data-bs-theme="dark"] .e-dialog .e-float-input input,
[data-bs-theme="dark"] .e-dialog .e-float-input.e-control-wrapper input {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

/* SfTextBox component */
[data-bs-theme="dark"] .e-textbox,
[data-bs-theme="dark"] .e-float-input input,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper input,
[data-bs-theme="dark"] .e-float-input textarea,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper textarea {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

/* Float label text */
[data-bs-theme="dark"] .e-float-input label.e-float-text,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper label.e-float-text {
    color: var(--halo-text-secondary) !important;
}

/* Float input wrapper */
[data-bs-theme="dark"] .e-float-input,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper {
    background-color: var(--halo-surface) !important;
}

/* Input focus state label */
[data-bs-theme="dark"] .e-float-input.e-input-focus label.e-float-text,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper.e-input-focus label.e-float-text {
    color: var(--halo-primary) !important;
}

/* Switch Toggle */
[data-bs-theme="dark"] .e-switch-wrapper .e-switch-off {
    background-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-switch-wrapper .e-switch-handle {
    background-color: var(--halo-text-secondary) !important;
}

[data-bs-theme="dark"] .e-switch-wrapper.e-switch-active .e-switch-handle {
    background-color: white !important;
}

/* Chart */
[data-bs-theme="dark"] .e-chart {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-chart svg {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-chart .e-chart-svg-container {
    background-color: var(--halo-surface) !important;
}

/* Chart background rect (the actual white background in the SVG) */
[data-bs-theme="dark"] .e-chart rect[id*="ChartBorder"],
[data-bs-theme="dark"] .e-chart rect[id*="_ChartAreaBorder"],
[data-bs-theme="dark"] .e-chart rect[id*="_ChartBorder"],
[data-bs-theme="dark"] .e-chart rect:first-child {
    fill: var(--halo-surface) !important;
}

/* Chart area background */
[data-bs-theme="dark"] .e-chart .e-chart-area-border {
    fill: var(--halo-surface) !important;
}

/* Chart text colors for dark mode */
[data-bs-theme="dark"] .e-chart text {
    fill: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-chart .e-chart-title {
    fill: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-chart .e-axis-label {
    fill: var(--halo-text-secondary) !important;
}

[data-bs-theme="dark"] .e-chart .e-axis-title {
    fill: var(--halo-text-secondary) !important;
}

[data-bs-theme="dark"] .e-chart .e-chart-legend text {
    fill: var(--halo-text-primary) !important;
}

/* Chart grid lines */
[data-bs-theme="dark"] .e-chart .e-grid-lines line,
[data-bs-theme="dark"] .e-chart .e-minor-gridlines line {
    stroke: var(--halo-border) !important;
}

/* Chart axis lines */
[data-bs-theme="dark"] .e-chart .e-axis-line {
    stroke: var(--halo-border) !important;
}

/* Chart tooltip */
[data-bs-theme="dark"] .e-chart-tooltip,
[data-bs-theme="dark"] .e-chart .e-tooltip {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
    color: var(--halo-text-primary) !important;
}

/* Chart legend background */
[data-bs-theme="dark"] .e-chart .e-legend-header,
[data-bs-theme="dark"] .e-chart .e-legend {
    background-color: transparent !important;
}

/* Maps */
[data-bs-theme="dark"] .e-maps {
    border-color: var(--halo-border) !important;
}

/* DateTimePicker */
[data-bs-theme="dark"] .e-datetime-wrapper,
[data-bs-theme="dark"] .e-datetimepicker,
[data-bs-theme="dark"] .e-datepicker {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-calendar,
[data-bs-theme="dark"] .e-calendar .e-content {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-calendar .e-header {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

/* Calendar header title and navigation */
[data-bs-theme="dark"] .e-calendar .e-header .e-title,
[data-bs-theme="dark"] .e-calendar .e-header .e-day,
[data-bs-theme="dark"] .e-calendar .e-header span {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-calendar .e-header .e-icon-container .e-icons,
[data-bs-theme="dark"] .e-calendar .e-header .e-prev,
[data-bs-theme="dark"] .e-calendar .e-header .e-next {
    color: var(--halo-text-secondary) !important;
}

/* Calendar week header (Sun, Mon, Tue, etc.) */
[data-bs-theme="dark"] .e-calendar .e-content .e-week-header th,
[data-bs-theme="dark"] .e-calendar .e-week-header th {
    color: var(--halo-text-secondary) !important;
}

/* Calendar date cells */
[data-bs-theme="dark"] .e-calendar .e-content td,
[data-bs-theme="dark"] .e-calendar .e-content td span,
[data-bs-theme="dark"] .e-calendar .e-content td.e-cell span.e-day {
    color: var(--halo-text-primary) !important;
}

/* Calendar other month dates (faded) */
[data-bs-theme="dark"] .e-calendar .e-content td.e-other-month span,
[data-bs-theme="dark"] .e-calendar .e-content td.e-other-month span.e-day {
    color: var(--halo-text-muted) !important;
}

/* Calendar disabled dates */
[data-bs-theme="dark"] .e-calendar .e-content td.e-disabled span,
[data-bs-theme="dark"] .e-calendar .e-content td.e-disabled span.e-day {
    color: var(--halo-text-muted) !important;
    opacity: 0.5;
}

/* Calendar hover state */
[data-bs-theme="dark"] .e-calendar .e-content td:hover span.e-day,
[data-bs-theme="dark"] .e-calendar .e-content td.e-cell:hover span {
    background-color: var(--halo-surface-hover) !important;
    color: var(--halo-text-primary) !important;
}

/* Calendar selected date */
[data-bs-theme="dark"] .e-calendar .e-content td.e-selected span.e-day,
[data-bs-theme="dark"] .e-calendar .e-content td.e-selected span {
    background-color: var(--halo-primary) !important;
    color: white !important;
}

/* Calendar today's date */
[data-bs-theme="dark"] .e-calendar .e-content td.e-today span.e-day,
[data-bs-theme="dark"] .e-calendar .e-content td.e-today span {
    border-color: var(--halo-primary) !important;
    color: var(--halo-primary) !important;
}

/* Calendar focused date */
[data-bs-theme="dark"] .e-calendar .e-content td.e-focused-date span.e-day,
[data-bs-theme="dark"] .e-calendar .e-content td.e-focused-date span {
    background-color: var(--halo-surface-hover) !important;
    color: var(--halo-text-primary) !important;
}

/* Calendar popup container */
[data-bs-theme="dark"] .e-datepicker.e-popup,
[data-bs-theme="dark"] .e-datetimepicker.e-popup,
[data-bs-theme="dark"] .e-daterangepicker.e-popup {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

/* DateTimePicker time list */
[data-bs-theme="dark"] .e-datetimepicker .e-timepicker,
[data-bs-theme="dark"] .e-timepicker.e-popup {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-timepicker .e-list-item,
[data-bs-theme="dark"] .e-datetimepicker .e-list-item {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-timepicker .e-list-item:hover,
[data-bs-theme="dark"] .e-datetimepicker .e-list-item:hover {
    background-color: var(--halo-surface-hover) !important;
}

[data-bs-theme="dark"] .e-timepicker .e-list-item.e-active,
[data-bs-theme="dark"] .e-datetimepicker .e-list-item.e-active {
    background-color: var(--halo-primary) !important;
    color: white !important;
}

/* DateRangePicker specific */
[data-bs-theme="dark"] .e-daterangepicker .e-calendar,
[data-bs-theme="dark"] .e-daterangepicker .e-range-header {
    background-color: var(--halo-surface) !important;
}

[data-bs-theme="dark"] .e-daterangepicker .e-range-header .e-start-label,
[data-bs-theme="dark"] .e-daterangepicker .e-range-header .e-end-label,
[data-bs-theme="dark"] .e-daterangepicker .e-range-header .e-change-icon {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-daterangepicker .e-presets {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-daterangepicker .e-presets .e-list-item {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-daterangepicker .e-presets .e-list-item:hover {
    background-color: var(--halo-surface-hover) !important;
}

/* Year/Month/Decade views */
[data-bs-theme="dark"] .e-calendar .e-content.e-year td span,
[data-bs-theme="dark"] .e-calendar .e-content.e-decade td span,
[data-bs-theme="dark"] .e-calendar .e-content.e-month td span {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-calendar .e-content.e-year td:hover span,
[data-bs-theme="dark"] .e-calendar .e-content.e-decade td:hover span {
    background-color: var(--halo-surface-hover) !important;
}

/* NumericTextBox */
[data-bs-theme="dark"] .e-numerictextbox {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
}

/* Message */
[data-bs-theme="dark"] .e-message {
    border-radius: var(--halo-radius-md);
}

/* TextBox Float Label */
[data-bs-theme="dark"] .e-float-input label.e-float-text,
[data-bs-theme="dark"] .e-float-input.e-control-wrapper label.e-float-text {
    color: var(--halo-text-secondary) !important;
}

/* Grid Toolbar */
[data-bs-theme="dark"] .e-grid .e-toolbar {
    background-color: var(--halo-surface) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-grid .e-toolbar .e-toolbar-items {
    background-color: var(--halo-surface) !important;
}

/* Grid Toolbar Buttons (Edit, Delete, Add) */
[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn,
[data-bs-theme="dark"] .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn {
    background-color: var(--halo-surface) !important;
    color: var(--halo-text-primary) !important;
    border-color: var(--halo-border) !important;
}

[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn:hover,
[data-bs-theme="dark"] .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover {
    background-color: var(--halo-surface-hover) !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn .e-btn-icon,
[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn .e-tbar-btn-text,
[data-bs-theme="dark"] .e-grid .e-toolbar .e-icons {
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn:hover .e-btn-icon,
[data-bs-theme="dark"] .e-grid .e-toolbar .e-tbar-btn:hover .e-tbar-btn-text {
    color: var(--halo-text-primary) !important;
}

/* Grid Command Buttons (inline Edit/Delete buttons in rows) */
[data-bs-theme="dark"] .e-grid .e-rowcell .e-flat,
[data-bs-theme="dark"] .e-grid .e-rowcell .e-editbutton,
[data-bs-theme="dark"] .e-grid .e-rowcell .e-deletebutton,
[data-bs-theme="dark"] .e-grid .e-unboundcell .e-flat {
    background-color: transparent !important;
    color: var(--halo-text-primary) !important;
}

[data-bs-theme="dark"] .e-grid .e-rowcell .e-flat:hover,
[data-bs-theme="dark"] .e-grid .e-unboundcell .e-flat:hover {
    background-color: var(--halo-surface-hover) !important;
    color: var(--halo-primary) !important;
}

[data-bs-theme="dark"] .e-grid .e-rowcell .e-flat .e-icons,
[data-bs-theme="dark"] .e-grid .e-unboundcell .e-flat .e-icons {
    color: var(--halo-text-secondary) !important;
}

[data-bs-theme="dark"] .e-grid .e-rowcell .e-flat:hover .e-icons,
[data-bs-theme="dark"] .e-grid .e-unboundcell .e-flat:hover .e-icons {
    color: var(--halo-primary) !important;
}

/* ============================================
   Vector Ingestion View Styles
   ============================================ */
.vector-ingestion-container {
    padding: 20px;
}

.vector-ingestion-container .card {
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-lg);
    background-color: var(--halo-surface);
    box-shadow: 0 1px 3px var(--halo-shadow);
}

.vector-ingestion-container .card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: var(--halo-surface-hover);
    border-bottom: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-lg) var(--halo-radius-lg) 0 0;
}

.vector-ingestion-container .card-header h4 {
    margin: 0;
    color: var(--halo-text-primary);
}

.vector-ingestion-container .card-body {
    padding: 1.25rem;
}

.vector-ingestion-container .stats-section {
    margin-bottom: 20px;
}

.vector-ingestion-container .stats-section h5 {
    color: var(--halo-text-primary);
}

.vector-ingestion-container .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.vector-ingestion-container .stat-item {
    padding: 15px;
    background: var(--halo-surface-hover);
    border-radius: var(--halo-radius-md);
    border-left: 4px solid var(--halo-primary);
}

.vector-ingestion-container .stat-label {
    display: block;
    font-weight: bold;
    color: var(--halo-text-secondary);
    margin-bottom: 5px;
}

.vector-ingestion-container .stat-value {
    display: block;
    font-size: 1.5em;
    color: var(--halo-text-primary);
}

.vector-ingestion-container .control-panel {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.vector-ingestion-container .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vector-ingestion-container .form-group label {
    color: var(--halo-text-primary);
}

.vector-ingestion-container .button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.vector-ingestion-container .processing-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--halo-surface-hover);
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-md);
    margin: 15px 0;
}

.vector-ingestion-container .processing-indicator p {
    color: var(--halo-text-primary);
    margin: 0;
}

.vector-ingestion-container .ingestion-history {
    margin-top: 30px;
}

.vector-ingestion-container .ingestion-history h5 {
    color: var(--halo-text-primary);
}

.vector-ingestion-container .alert {
    padding: 12px;
    border-radius: var(--halo-radius-md);
    margin: 10px 0;
}

.vector-ingestion-container .alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-bs-theme="dark"] .vector-ingestion-container .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ============================================
   Footer Styles
   ============================================ */

.halo-footer {
    background-color: #E5E7EB;
    border-top: 1px solid var(--halo-border);
    margin-top: var(--halo-spacing-2xl);
    padding: 0;
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--halo-spacing-xl);
    padding: var(--halo-spacing-lg) var(--halo-spacing-2xl);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: var(--halo-spacing-sm);
}

.footer-branding {
    align-items: center;
    text-align: center;
}

.footer-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: var(--halo-spacing-xs);
}

.footer-tagline {
    color: var(--halo-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.footer-section h4 {
    color: var(--halo-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--halo-spacing-sm) 0;
    border-bottom: 2px solid var(--halo-primary);
    padding-bottom: var(--halo-spacing-xs);
}

.footer-locations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--halo-spacing-md);
}

.footer-location,
.footer-contact {
    margin-bottom: var(--halo-spacing-sm);
}

.footer-location p,
.footer-contact p {
    margin: 0;
    padding: 1px 0;
    color: var(--halo-text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.footer-location strong,
.footer-contact strong {
    color: var(--halo-text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--halo-spacing-sm);
}

.footer-links a,
.footer-contact a {
    color: var(--halo-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--halo-primary-dark);
    text-decoration: underline;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--halo-border);
    padding: var(--halo-spacing-md) var(--halo-spacing-2xl);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: var(--halo-text-secondary);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile footer layout:
         row 1: Branding (full-width header)
         row 2: Locations (full-width, with 2 internal columns of addresses)
         row 3: Contact | Products (50/50 side-by-side)                   */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--halo-spacing-md);
        padding: var(--halo-spacing-md);
    }

    /* Branding and the Locations section both span the full row.
       :has() targets the locations section without needing a markup change. */
    .footer-branding,
    .footer-section:has(.footer-locations-grid) {
        grid-column: 1 / -1;
    }

    /* Keep 2 columns inside the Locations section (overrides the desktop rule
       only insofar as the desktop default already happens to be 2 — explicit
       so the rule survives any future change to the desktop default). */
    .footer-locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tighten per-location margins so 2-column addresses don't pile up too tall. */
    .footer-location {
        margin-bottom: var(--halo-spacing-xs);
    }

    .footer-bottom {
        padding: var(--halo-spacing-sm) var(--halo-spacing-md);
    }

    .footer-section {
        text-align: center;
    }

    .footer-branding {
        padding-bottom: var(--halo-spacing-sm);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Half-size logo on mobile (height scales auto from max-width). */
    .footer-logo {
        max-width: 60px;
    }

    /* Tagline scaled down to match the smaller logo. */
    .footer-tagline {
        font-size: 0.7rem;
    }
}

.multiline-address-with-pin-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.multiline-address-with-pin-container-address-text {
    white-space: pre-line;
    line-height: 1;
}

.e-outline[disabled],
.sf-btn.e-outline[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: #f5f5f5 !important;
    color: #888 !important;
    border-color: #ddd !important;
    box-shadow: none !important;
}


/* Centered spinner box shown while a page resolves which URL owns its render (the unit-addressed gate and
   the three device-addressed routing probes). Global rather than component-scoped: four components in two
   projects show the same box, and scoped CSS does not cross component boundaries. */
.route-resolution-pending {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 240px;
}


/* Insert-image dialog of the notes rich text editor (SavedViewDetailView — the app's only SfRichTextEditor):
   drop the "web address" field and its heading, leaving the dialog upload-only. A note keeps an <img> only
   when its src is one the note-image endpoint minted, so a pasted external URL would insert a picture that
   silently disappears the moment the note is saved. Global rather than component-scoped because Syncfusion
   renders this dialog either inside the editor element or in a body-level .e-rte-elements host — see the
   paired .e-richtexteditor / .e-rte-elements selectors in syncfusion-halo.css — and ::deep cannot reach the
   second case. */
.e-rte-img-dialog .e-linkheader,
.e-rte-img-dialog .e-img-url {
    display: none;
}

/* Digi diagnostics popup: cap the content pane so a long answer scrolls inside the dialog instead of
   growing past the viewport. Syncfusion positions the dialog outside the component DOM scope, so the
   rule lives here rather than in the component stylesheet. */
.e-dialog.digi-diag-dialog {
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
}

.e-dialog.digi-diag-dialog .e-dlg-content {
    flex: 1 1 auto;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
}
