/* =================================================
   Inqarvo – CSS Custom Properties (Theme Tokens)
   ================================================= */

:root,
[data-theme="light"] {
    --ic-bg:              #F8FAFC;
    --ic-surface:         #FFFFFF;
    --ic-appbar-bg:       #FFFFFF;
    --ic-appbar-border:   #E5E7EB;
    --ic-drawer-bg:       #FFFFFF;
    --ic-drawer-border:   #E5E7EB;
    --ic-text-primary:    #0F172A;
    --ic-text-secondary:  #64748B;
    --ic-text-muted:      #94A3B8;
    --ic-border:          #E5E7EB;
    --ic-primary:         #4F46E5;
    --ic-primary-hover:   rgba(79, 70, 229, 0.08);
    --ic-primary-active:  rgba(79, 70, 229, 0.12);
    --ic-primary-strong:  rgba(79, 70, 229, 0.22);
    --ic-avatar-bg:       rgba(79, 70, 229, 0.12);
    --ic-avatar-color:    #4F46E5;
    --ic-nav-text:        #374151;
    --ic-icon-secondary:  #64748B;
    --ic-hamburger:       #374151;
    --ic-logo-color:      #0F172A;
}

[data-theme="dark"] {
    --ic-bg:              #0F1117;
    --ic-surface:         #1E2130;
    --ic-appbar-bg:       #0F1117;
    --ic-appbar-border:   #2D3748;
    --ic-drawer-bg:       #161B27;
    --ic-drawer-border:   #2D3748;
    --ic-text-primary:    #F1F5F9;
    --ic-text-secondary:  #94A3B8;
    --ic-text-muted:      #64748B;
    --ic-border:          #2D3748;
    --ic-primary:         #6366F1;
    --ic-primary-hover:   rgba(99, 102, 241, 0.12);
    --ic-primary-active:  rgba(99, 102, 241, 0.18);
    --ic-primary-strong:  rgba(99, 102, 241, 0.28);
    --ic-avatar-bg:       rgba(99, 102, 241, 0.18);
    --ic-avatar-color:    #818CF8;
    --ic-nav-text:        #CBD5E1;
    --ic-icon-secondary:  #94A3B8;
    --ic-hamburger:       #CBD5E1;
    --ic-logo-color:      #F1F5F9;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =================================================
   Logo
   ================================================= */

.ic-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ic-logo-color);
    flex-shrink: 0;
    padding: 4px 0;
}

.ic-logo-link:hover {
    text-decoration: none;
    color: var(--ic-logo-color);
}

.ic-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ic-logo-color);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

/* Dashboard: Revenue Trend fills the left column height (paired with Top products + segments). */
.dashboard-revenue-trend-slot {
    flex: 1 1 auto;
    min-height: 360px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1280px) {
    .dashboard-revenue-trend-slot {
        min-height: 300px;
    }
}

/* =================================================
   Dashboard range selector
   ================================================= */

.dashboard-range-select .mud-input-root {
    font-size: 0.8125rem;
    padding-right: 30px !important;
    min-height: 40px !important;
    height: 40px !important;
}

.dashboard-range-select .mud-input-slot {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 24px !important;
    min-height: 40px !important;
    height: 40px !important;
}

.dashboard-range-select .mud-select-input {
    font-size: 0.8125rem;
}

.dashboard-range-select .mud-select-icon {
    right: 8px !important;
    display: inline-flex !important;
    align-items: center;
    color: var(--mud-palette-text-secondary) !important;
    opacity: 1 !important;
}

.dashboard-range-popover .mud-list-item {
    font-size: 0.75rem !important;
    min-height: 36px !important;
}

.dashboard-range-popover .mud-list-item-text {
    font-size: 0.75rem !important;
}

/* =================================================
   Account menu items
   ================================================= */

.ic-account-menu-item--header,
.ic-account-menu-item--subtle {
    opacity: 1 !important;
}

.ic-account-menu-item--header {
    font-weight: 600;
    color: var(--ic-text-primary) !important;
}

.ic-account-menu-item--subtle {
    color: var(--ic-text-secondary) !important;
    font-size: 0.8125rem;
}

/* ===================================================
   SIDEBAR LAYOUT
   =================================================== */

:root {
    --ic-sidebar-width:           240px;
    --ic-sidebar-collapsed-width: 88px;
    --ic-sidebar-transition:      width 0.22s cubic-bezier(.4,0,.2,1);
    --ic-sidebar-bg:              #FFFFFF;
    --ic-sidebar-border:          #E5E7EB;
    --ic-mobile-topbar-height:    52px;
}

[data-theme="dark"] {
    --ic-sidebar-bg:     #161B27;
    --ic-sidebar-border: #2D3748;
}

/* Root layout — flex row */
.ic-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */
.ic-sidebar {
    width: var(--ic-sidebar-width);
    flex-shrink: 0;
    background: var(--ic-sidebar-bg);
    border-right: 1px solid var(--ic-sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    overflow: visible;
    transition: var(--ic-sidebar-transition);
}

.ic-sidebar--collapsed {
    width: var(--ic-sidebar-collapsed-width);
}

/* Header */
.ic-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    min-height: 56px;
    border-bottom: 1px solid var(--ic-sidebar-border);
    flex-shrink: 0;
    overflow: hidden;
}

.ic-sidebar--collapsed .ic-sidebar-header {
    justify-content: center;
    padding: 14px 12px;
    position: relative;
}

/* Collapse toggle / close button */
.ic-sidebar-toggle,
.ic-sidebar-close {
    width: 28px; height: 28px;
    border: none; background: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; color: var(--ic-text-secondary);
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.ic-sidebar-toggle:hover,
.ic-sidebar-close:hover {
    background: var(--ic-primary-hover);
    color: var(--ic-primary);
}

.ic-sidebar--collapsed .ic-sidebar-toggle {
    position: absolute;
    right: 0;
    margin: 0;
}

/* Demo banner */
.ic-demo-banner {
    margin: 8px;
    background: linear-gradient(135deg, #1E1B4B, #312E81);
    border-radius: 10px;
    padding: 10px 12px;
    flex-shrink: 0;
}
.ic-demo-banner-top {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
}
.ic-demo-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 4px; padding: 1px 7px;
    font-size: 10px; font-weight: 700;
    color: #A5B4FC; letter-spacing: .8px; text-transform: uppercase;
}
.ic-demo-hint {
    font-size: 11px; color: rgba(255,255,255,.6); font-weight: 300;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ic-demo-cta {
    display: block; text-align: center;
    font-size: 12px; font-weight: 600; color: #4F46E5;
    background: #fff; border-radius: 6px; padding: 5px;
    text-decoration: none; margin-bottom: 4px;
}
.ic-demo-back {
    display: block; text-align: center;
    font-size: 11px; color: rgba(255,255,255,.4);
    text-decoration: none; padding-top: 2px;
    transition: color .15s;
}
.ic-demo-back:hover { color: rgba(255,255,255,.7); }

/* Nav */
.ic-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px;
    transition: padding 0.22s cubic-bezier(.4,0,.2,1);
}

.ic-sidebar--collapsed .ic-sidebar-nav {
    padding-left: 0;
    padding-right: 0;
}

/* Block + full width in sidebar flex column (NavItem wrap + demo MudTooltip root) */
.ic-sidebar-nav .ic-nav-item-wrap,
.ic-sidebar-nav .mud-tooltip-root {
    display: block !important;
    width: 100%;
}

/* Prevent tooltip popup from stretching to full page width */
.mud-tooltip {
    width: max-content !important;
    max-width: 220px !important;
    white-space: normal;
}

/* Legacy label (keep for compatibility) */
.ic-nav-section-label {
    font-size: 10px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ic-text-secondary);
    padding: 8px 10px 4px;
    white-space: nowrap; overflow: hidden;
    max-height: 32px; opacity: 1;
    transition: opacity 0.15s, max-height 0.22s cubic-bezier(.4,0,.2,1),
                padding 0.22s cubic-bezier(.4,0,.2,1);
}
.ic-sidebar--collapsed .ic-nav-section-label {
    opacity: 0; max-height: 0;
    padding-top: 0; padding-bottom: 0;
}

/* Collapsible / static section header */
.ic-nav-section-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 14px 10px 12px;
    margin-top: 2px;
    background: none; border: none; cursor: pointer;
    font-size: 11px; font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--ic-text-secondary);
    border-radius: 6px;
    transition: background 0.12s, color 0.12s,
                opacity 0.15s, max-height 0.22s cubic-bezier(.4,0,.2,1),
                padding 0.22s cubic-bezier(.4,0,.2,1);
    overflow: hidden; max-height: 60px; opacity: 1;
    white-space: nowrap;
}
.ic-nav-section-header:hover {
    background: var(--ic-primary-hover);
    color: var(--ic-primary);
}
/* Static (non-clickable) variant — no hover effect */
.ic-nav-section-header--static {
    cursor: default;
}
.ic-nav-section-header--static:hover {
    background: none;
    color: var(--ic-text-secondary);
}
.ic-nav-section-header-label {
    flex: 1; text-align: left;
}

.ic-nav-section-chevron {
    flex-shrink: 0; margin-left: 4px;
    color: var(--ic-text-secondary);
    transition: transform 0.2s cubic-bezier(.4,0,.2,1);
}
.ic-nav-section-chevron--closed {
    transform: rotate(-90deg);
}

/* Hide section header when sidebar is icon-only */
.ic-nav-section-header--hidden {
    opacity: 0; max-height: 0;
    padding-top: 0; padding-bottom: 0;
    pointer-events: none;
}

.ic-nav-divider {
    height: 1px;
    background: var(--ic-sidebar-border);
    margin: 8px 8px;
}

/* Analytics section header gets extra top space after the Main divider */
.ic-nav-section-header--analytics,
.ic-nav-section-header--reports {
    margin-top: 4px;
}

/* Integrations+Help group — always separated from Analytics */
.ic-nav-bottom-group {
    border-top: 1px solid var(--ic-sidebar-border);
    margin-top: 8px;
    padding-top: 6px;
}

/* Nav items — no gap; label carries its own left margin */
.ic-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 14px;
    border-radius: 7px;
    color: var(--ic-nav-text, var(--ic-text-secondary));
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    /* only background/color + padding-left transition — no layout jump */
    transition: background .12s, color .12s,
                padding-left 0.22s cubic-bezier(.4,0,.2,1);
    margin-bottom: 2px;
    min-height: 36px;
}
.ic-nav-item:hover {
    background: var(--ic-primary-hover, rgba(79,70,229,.07));
    color: var(--ic-primary, #4F46E5);
    text-decoration: none;
}
.ic-nav-item--active,
.ic-nav-item.active {
    background: var(--ic-primary-active, rgba(79,70,229,.12));
    color: var(--ic-primary, #4F46E5);
    font-weight: 600;
}
.ic-nav-item--action {
    color: var(--ic-text-secondary);
}

/* Collapsed — center icon via padding-left; no justify-content flip */
/* sidebar=88px, icon=24px → (88-24)/2=32px */
.ic-sidebar--collapsed .ic-nav-item {
    padding-left: 32px;
    width: 100%;
}

.ic-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px; height: 24px;
    color: var(--ic-icon-secondary, var(--ic-text-secondary));
}
.ic-nav-item:hover .ic-nav-icon,
.ic-nav-item--active .ic-nav-icon,
.ic-nav-item.active .ic-nav-icon {
    color: var(--ic-primary, #4F46E5);
}

/* Label — always in DOM, hides via max-width+opacity */
.ic-nav-label {
    margin-left: 10px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    opacity: 1;
    transition: opacity 0.15s ease,
                max-width 0.22s cubic-bezier(.4,0,.2,1),
                margin-left 0.22s cubic-bezier(.4,0,.2,1);
}

.ic-sidebar--collapsed .ic-nav-label {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
}

.ic-nav-item--demo-mini {
    color: #818CF8;
    padding-left: 36px;
}

/* Footer */
.ic-sidebar-footer {
    padding: 6px;
    flex-shrink: 0;
    border-top: 1px solid var(--ic-sidebar-border);
}

/* User row — same no-jump approach as nav items */
/* sidebar=76px, footer-padding=6px, avatar=32px → (76-12-32)/2+6=22px */
.ic-user-row {
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    transition: background .12s, padding-left 0.22s cubic-bezier(.4,0,.2,1);
    min-height: 44px;
}
.ic-user-row:hover {
    background: var(--ic-primary-hover, rgba(79,70,229,.07));
}

/* Collapsed user row — center avatar: sidebar=88, footer-pad=6+6=12, row=76px, avatar=32 → (76-32)/2=22px */
.ic-sidebar--collapsed .ic-user-row {
    padding-left: 22px;
}

/* ── User footer dropdown ──────────────────────────────── */
.ic-user-footer-widget {
    position: relative;
}

/* Full-screen backdrop — click outside closes the menu */
.ic-user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 299;
}

.ic-user-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 210px;
    background: var(--ic-sidebar-bg);
    border: 1px solid var(--ic-sidebar-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
    z-index: 300;
    overflow: hidden;
    padding: 4px 0;
}

.ic-user-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 14px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--ic-text-primary, #0F172A);
    text-decoration: none;
    text-align: left;
    white-space: nowrap;
    transition: background .12s, color .12s;
    font-family: inherit;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

.ic-user-dropdown-item:hover {
    background: var(--ic-primary-hover, rgba(79,70,229,.07));
    color: var(--ic-primary, #4F46E5);
    text-decoration: none;
}

.ic-user-dropdown-item--danger {
    color: #EF4444;
}

.ic-user-dropdown-item--danger:hover {
    background: rgba(239,68,68,.08);
    color: #EF4444;
}

.ic-user-dropdown-divider {
    height: 1px;
    background: var(--ic-sidebar-border);
    margin: 4px 0;
}

.ic-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--ic-primary, #4F46E5);
    color: #fff;
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.3px;
    margin-right: 10px;
    transition: margin-right 0.22s cubic-bezier(.4,0,.2,1);
}

.ic-sidebar--collapsed .ic-user-avatar {
    margin-right: 0;
    flex-shrink: 0;
}

.ic-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    max-width: 140px;
    opacity: 1;
    transition: opacity 0.15s ease,
                max-width 0.22s cubic-bezier(.4,0,.2,1);
}

.ic-sidebar--collapsed .ic-user-info {
    max-width: 0;
    opacity: 0;
}

.ic-user-name {
    font-size: 13px; font-weight: 600;
    color: var(--ic-text-primary, #0F172A);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ic-user-email {
    font-size: 11px;
    color: var(--ic-text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* User chevron (up arrow) — hides in collapsed mode */
.ic-user-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ic-text-secondary);
    opacity: 1;
    max-width: 20px;
    overflow: hidden;
    transition: max-width 0.22s cubic-bezier(.4,0,.2,1), opacity 0.15s ease;
}
.ic-sidebar--collapsed .ic-user-chevron {
    max-width: 0;
    opacity: 0;
}

/* ── Main content ───────────────────────────────────── */
.ic-main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--ic-sidebar-width);
    transition: margin-left 0.22s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}

.ic-layout--collapsed .ic-main-content {
    margin-left: var(--ic-sidebar-collapsed-width);
}

.ic-page-body {
    padding: 16px;
    flex: 1;
}

@media (max-width: 600px) {
    .ic-page-body { padding: 10px 12px 20px; }
}

@media (min-width: 601px) {
    .ic-page-body { padding: 24px; }
}

/* Mobile topbar */
.ic-mobile-topbar {
    height: var(--ic-mobile-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--ic-sidebar-border);
    background: var(--ic-sidebar-bg);
    flex-shrink: 0;
    position: relative;
    z-index: 301;
}

.ic-mobile-topbar-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.ic-hamburger-btn {
    width: 36px; height: 36px;
    border: none; background: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; color: var(--ic-text-secondary);
    transition: background .15s;
}
.ic-hamburger-btn:hover { background: var(--ic-primary-hover); }

/* ── Mobile layout ──────────────────────────────────── */
@media (max-width: 959px) {
    .ic-layout {
        flex-direction: column;
    }
    .ic-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease, width 0s;
        width: var(--ic-sidebar-width) !important;
        box-shadow: none;
    }
    .ic-layout--overlay-open .ic-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.18);
    }
    .ic-main-content {
        margin-left: 0 !important;
    }
    .ic-overlay-backdrop {
        position: fixed; inset: 0; z-index: 199;
        background: rgba(0,0,0,.35);
    }
    .ic-sidebar--hidden {
        transform: translateX(-100%);
    }
}

/* ── Logo in collapsed mode ─────────────────────────── */
.ic-sidebar--collapsed .ic-logo-text {
    display: none;
}
.ic-sidebar--collapsed .ic-logo-link {
    justify-content: center;
}

/* Hide MudAppBar / reset MudMainContent */
.mud-appbar { display: none !important; }
.mud-main-content { margin-top: 0 !important; padding-top: 0 !important; }

/* =================================================
   Dark Mode — MudBlazor component overrides
   ================================================= */

[data-theme="dark"] .ic-sidebar {
    background: var(--ic-sidebar-bg);
    border-right-color: var(--ic-sidebar-border);
}

[data-theme="dark"] .ic-user-name {
    color: rgba(255,255,255,.9);
}

[data-theme="dark"] .ic-user-email {
    color: rgba(255,255,255,.45);
}

[data-theme="dark"] .ic-user-dropdown {
    background: #1E2130;
    border-color: #2D3748;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

[data-theme="dark"] .ic-user-dropdown-item {
    color: rgba(255,255,255,.85);
}

[data-theme="dark"] .ic-user-dropdown-item:hover {
    background: rgba(99,102,241,.12);
    color: #818CF8;
}

[data-theme="dark"] .mud-popover {
    background-color: #1E2130;
    border: 1px solid #2D3748;
}

[data-theme="dark"] .mud-list-item:hover {
    background-color: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] .mud-paper {
    background-color: var(--ic-surface);
}

[data-theme="dark"] .mud-table-head .mud-table-cell {
    background-color: #1a2035;
    color: var(--ic-text-secondary);
    border-bottom: 1px solid var(--ic-border);
}

[data-theme="dark"] .mud-table-body .mud-table-row:hover td {
    background-color: rgba(255,255,255,0.04) !important;
}

[data-theme="dark"] .mud-chip {
    border-color: var(--ic-border);
}

[data-theme="dark"] .mud-input-outlined .mud-input-outlined-border {
    border-color: #374151;
}

[data-theme="dark"] .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #6366F1;
}

[data-theme="dark"] .mud-alert {
    border: 1px solid var(--ic-border);
}

[data-theme="dark"] .dashboard-range-select .mud-input-root {
    color: var(--ic-text-primary);
}

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1E2130;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4B5563;
}

[data-theme="dark"] .empty-state-container {
    opacity: 0.5;
}

[data-theme="dark"] .text-secondary {
    color: var(--ic-text-secondary) !important;
}

[data-theme="dark"] #components-reconnect-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

/* =================================================
   Responsive — mobile fixes
   ================================================= */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 600px) {
    .mud-paper.pa-4 {
        padding: 12px !important;
    }

    .mud-paper.pa-8 {
        padding: 24px !important;
    }

    .mud-table-root {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Global overrides — Landing style ─────── */

/* MudPaper: убрать shadow, добавить border */
.mud-paper {
    box-shadow: none !important;
    border: 1px solid var(--ic-border) !important;
}
.mud-paper.mud-elevation-0 { border: none !important; }
.mud-paper.rounded-lg { border-radius: 12px !important; }

/* Кнопки: без uppercase */
.mud-button-root {
    text-transform: none !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}

/* MudChip: компактный */
.mud-chip {
    height: 22px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

/* MudTable: чистый стиль */
.mud-table thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    color: var(--ic-text-secondary) !important;
    border-bottom: 1px solid var(--ic-border) !important;
    background: transparent !important;
    padding: 10px 16px !important;
}
.mud-table tbody td {
    font-size: 13px !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid rgba(0,0,0,.05) !important;
    color: var(--ic-text-primary) !important;
}
.mud-table tbody tr:last-child td { border-bottom: none !important; }
.mud-table tbody tr:hover td { background: var(--ic-bg) !important; }

/* MudSimpleTable */
.mud-simple-table thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    color: var(--ic-text-secondary) !important;
    border-bottom: 1px solid var(--ic-border) !important;
    background: transparent !important;
    padding: 8px 12px !important;
}
.mud-simple-table tbody td {
    font-size: 13px !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid rgba(0,0,0,.04) !important;
}

/* MudAlert */
.mud-alert { border-radius: 10px !important; }

/* ── KPI card ──────────────────────────────── */
.ic-kpi-card {
    background: var(--ic-surface);
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    padding: 18px 20px;
    height: 100%;
}
.ic-kpi-label {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ic-text-secondary);
    margin-bottom: 8px;
    font-family: 'DM Sans', sans-serif;
}
.ic-kpi-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.8px;
    color: var(--ic-text-primary);
    line-height: 1;
    margin-bottom: 6px;
    font-family: 'DM Sans', sans-serif;
}
.ic-kpi-delta {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
}
.ic-kpi-delta--up   { color: #10B981; }
.ic-kpi-delta--down { color: #EF4444; }
.ic-kpi-delta-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--ic-text-secondary);
    margin-left: 3px;
}

/* ── Segment bars ──────────────────────────── */
.ic-seg-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}
.ic-seg-bar-row:last-child { margin-bottom: 0; }
.ic-seg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ic-seg-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--ic-text-primary);
    width: 80px;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}
.ic-seg-track {
    flex: 1;
    height: 5px;
    background: var(--ic-border);
    border-radius: 3px;
    overflow: hidden;
}
.ic-seg-fill {
    height: 100%;
    border-radius: 3px;
}
.ic-seg-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--ic-text-primary);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}
.ic-seg-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ic-border);
}
.ic-seg-top-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ic-text-secondary);
    margin-bottom: 3px;
    font-family: 'DM Sans', sans-serif;
}
.ic-seg-top-value {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ic-text-primary);
    font-family: 'DM Sans', sans-serif;
}

/* Dark mode */
[data-theme="dark"] .mud-paper {
    border-color: var(--ic-border) !important;
    background: var(--ic-surface) !important;
}
[data-theme="dark"] .mud-table thead th {
    color: var(--ic-text-secondary) !important;
    border-bottom-color: var(--ic-border) !important;
}
[data-theme="dark"] .mud-table tbody td {
    border-bottom-color: rgba(255,255,255,.04) !important;
    color: var(--ic-text-primary) !important;
}
[data-theme="dark"] .ic-kpi-card { background: var(--ic-surface); border-color: var(--ic-border); }
[data-theme="dark"] .ic-seg-track { background: var(--ic-border); }

/* ── PeriodToggle (shared 7d/30d/90d) ─────────────────────────────────────
   Matches the GrossMargin page's gm-range-tabs design. */
.ic-period-tabs {
    display: flex; align-items: center; gap: 2px;
    background: var(--ic-bg);
    border: 1px solid var(--ic-border);
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}
.ic-period-tab {
    font-size: 12px; font-weight: 600;
    font-family: 'DM Sans', system-ui, sans-serif;
    padding: 4px 12px;
    border-radius: 6px; border: none;
    background: transparent;
    color: var(--ic-text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.ic-period-tab:hover {
    background: var(--ic-surface);
    color: var(--ic-text-primary);
}
.ic-period-tab--active {
    background: var(--ic-surface);
    color: var(--ic-text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── MudSelect: fix double scrollbar ──────────────────────────────────────
   MudBlazor v9 sets overflow-y:auto on .mud-popover AND inherits it to
   .mud-popover .mud-list, producing two scrollbars. Mirror the same fix
   MudBlazor already applies for menu popovers (.mud-menu-list). */
.mud-popover:has(> .mud-list) { overflow: hidden !important; }
