/**
 * DarajaERP v8.2 - Layout Styles
 * Header, Sidebar, and Navigation Enhancement
 * 
 * @author BlueBridge Group
 * @version 8.2.0
 */

/* ============================================
   HEADER STYLES
   ============================================ */

:root {
    --brand-ink: var(--d-brand-ink, #010100);
    --brand-navy: var(--d-brand-navy, #13203D);
    --brand-blue: var(--d-primary-500, #009CD5);
    --brand-blue-strong: var(--d-primary-600, #03A0D6);
    --brand-purple: var(--d-accent-500, #8A60C2);
    --brand-lilac: var(--d-accent-400, #B576B2);
    --brand-slate: var(--d-brand-slate, #524574);
}

html, body {
    height: 100%;
}

.d-ui-v2.d-page {
    overflow: hidden;
}

.thetop {
    min-height: 100vh;
    align-items: stretch;
    overflow: hidden;
}

.thetop main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#scrollable-container {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    overflow-y: auto;
}

/* Enhanced Main Header */
.d-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-blue) 60%, var(--brand-purple) 100%);
    box-shadow: 0 8px 30px rgba(19, 32, 61, 0.32);
    transition: all var(--transition-normal);
}

.d-header::before {
    display: none;
}

/* Header Button Style */
.d-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: white;
    background: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.d-header-btn:hover {
    background: var(--brand-blue-strong);
    border-color: var(--brand-blue-strong);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 156, 213, 0.28);
}

.d-header-btn:active {
    transform: translateY(0);
}

.d-header-btn.with-text {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

/* POS Button - Special Accent */
.d-header-btn-pos {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-purple) 100%);
    border-color: transparent;
    box-shadow: 0 10px 28px rgba(0, 156, 213, 0.35);
}

.d-header-btn-pos:hover {
    background: linear-gradient(135deg, var(--brand-blue-strong) 0%, var(--brand-purple) 100%);
    box-shadow: 0 12px 32px rgba(138, 96, 194, 0.35);
    transform: translateY(-2px);
}

/* Page loader */
#daraja_page_loader {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    background: transparent;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    will-change: opacity;
    color: var(--d-text-inverse);
}

#daraja_page_loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.daraja-loader-grid {
    width: auto;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.daraja-loader-icon {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto;
}

.daraja-loader-icon img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.14));
}

.daraja-loader-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.08);
    border-top-color: var(--d-primary-400);
    border-right-color: var(--d-accent-400);
    animation: darajaLoaderSpin 0.9s linear infinite;
    filter: drop-shadow(0 0 8px rgba(0, 156, 213, 0.22));
}

.daraja-loader-text {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(15, 23, 42, 0.76);
    text-transform: uppercase;
    font-size: 0.74rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

.daraja-loader-progress {
    display: none;
}

@keyframes darajaLoaderSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Hide redundant search button (exposed via header) */
.daraja-header-center,
.d-header-btn[data-d-cmdk-open] {
    display: none !important;
}

/* Header Date Display */
.d-header-date {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: rgba(255, 255, 255, 0.92);
    background: var(--brand-slate);
    border: 1px solid var(--brand-slate);
    border-radius: var(--radius-lg);
}

/* Header Dropdown */
.d-header-dropdown {
    position: relative;
    display: inline-block;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.d-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    background: var(--d-bg-card, #ffffff);
    border-right: 1px solid var(--d-border-light, #e5e7eb);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.d-sidebar-menu {
    scrollbar-width: thin;
}

.d-sidebar-menu::-webkit-scrollbar {
    width: 8px;
}

.d-sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.25);
    border-radius: 999px;
}

.d-sidebar-link,
.d-sidebar-sublink {
    position: relative;
    border: 1px solid transparent;
}

.d-sidebar-link i,
.d-sidebar-link svg,
.d-sidebar-sublink i,
.d-sidebar-sublink svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

.d-sidebar-link.is-active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-purple) 100%);
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(0, 156, 213, 0.25);
}

.d-sidebar-link.is-active .svg {
    color: #ffffff;
}

.d-sidebar-link.is-open {
    background: rgba(0, 156, 213, 0.12);
    color: var(--brand-blue-strong);
    border-color: rgba(0, 156, 213, 0.2);
}

.d-sidebar-sublink.is-active {
    color: var(--brand-blue-strong) !important;
    position: relative;
}

.d-sidebar-sublink.is-active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand-blue-strong);
    transform: translateY(-50%);
}

body.sidebar-collapse .d-sidebar {
    width: 84px;
}

body.sidebar-collapse .d-sidebar .side-bar-heading,
body.sidebar-collapse .d-sidebar .d-sidebar-footer,
body.sidebar-collapse .d-sidebar .d-sidebar-support {
    display: none !important;
}

body.sidebar-collapse .d-sidebar .d-sidebar-menu {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body.sidebar-collapse .d-sidebar-link,
body.sidebar-collapse .d-sidebar-sublink {
    justify-content: center;
}

body.sidebar-collapse .d-sidebar-link span,
body.sidebar-collapse .d-sidebar-sublink span,
body.sidebar-collapse .d-sidebar-link .svg {
    display: none !important;
}

body.sidebar-collapse .d-sidebar .chiled {
    display: none !important;
}

/* ============================================
   COMMAND PALETTE
   ============================================ */
.d-cmdk {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: start center;
    padding: max(12px, 4vh) 12px 12px;
}

.d-cmdk-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
}

.d-cmdk-dialog {
    position: relative;
    width: min(720px, 100%);
    background: var(--d-bg-card);
    border: 1px solid var(--d-border-light);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.d-cmdk-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--d-border-light);
    background: var(--d-bg-hover);
}

.d-cmdk-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.d-cmdk-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--d-text-tertiary);
}

.d-cmdk-close {
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--d-border-light);
    background: var(--d-bg-card);
    color: var(--d-text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.d-cmdk-close:hover {
    background: var(--d-bg-hover);
    color: var(--d-text-primary);
}

.d-cmdk-body {
    padding: 16px 20px 20px;
}

.d-cmdk-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--d-border-default);
    background: var(--d-bg-card);
    color: var(--d-text-primary);
    font-size: 14px;
}

.d-cmdk-input::placeholder {
    color: var(--d-text-muted);
}

.d-cmdk-input:focus {
    outline: none;
    border-color: var(--d-primary-500);
    box-shadow: 0 0 0 3px rgba(0, 156, 213, 0.2);
}

.d-cmdk-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    max-height: min(420px, 50vh);
    overflow: auto;
    border: 1px solid var(--d-border-light);
    border-radius: 16px;
}

.d-cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    text-decoration: none;
    color: var(--d-text-primary);
    border-bottom: 1px solid var(--d-border-light);
}

.d-cmdk-item:last-child {
    border-bottom: none;
}

.d-cmdk-item:hover,
.d-cmdk-item.is-active {
    background: var(--d-bg-hover);
}

.d-cmdk-item-meta {
    margin-left: auto;
    color: var(--d-text-muted);
    font-size: 12px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

/* ============================================
   FLOATING WHATSAPP SUPPORT BUTTON
   ============================================ */
.d-whatsapp-fab {
    position: fixed;
    right: 16px;
    bottom: 24px;
    /* Above AdminLTE content-wrapper (z-index: 800) but below modals (1050) */
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 196px;
    padding: 12px 16px 12px 12px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 42%),
        linear-gradient(135deg, #0f9f55 0%, #18b15f 52%, #22c55e 100%);
    color: var(--d-text-inverse);
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.d-whatsapp-fab:hover {
    color: var(--d-text-inverse);
    text-decoration: none;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.28);
    filter: saturate(1.05);
}

.d-whatsapp-fab:active {
    transform: translateY(0);
}

.d-whatsapp-fab:focus-visible {
    outline: 2px solid rgba(0, 156, 213, 0.7);
    outline-offset: 2px;
}

.d-whatsapp-fab__icon {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    font-size: 26px;
}

.d-whatsapp-fab__icon::after {
    content: '';
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #dcfce7;
    border: 2px solid rgba(15, 23, 42, 0.16);
}

.d-whatsapp-fab__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.d-whatsapp-fab__eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.1;
    text-transform: uppercase;
    color: rgba(240, 253, 244, 0.82);
}

.d-whatsapp-fab__label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.d-whatsapp-fab__number {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: rgba(240, 253, 244, 0.94);
}

.d-whatsapp-fab--icon-only {
    min-width: 0;
    width: 60px;
    height: 60px;
    padding: 0;
    gap: 0;
    border-radius: 999px;
    justify-content: center;
}

.d-whatsapp-fab--icon-only .d-whatsapp-fab__content {
    display: none;
}

.d-whatsapp-fab--icon-only .d-whatsapp-fab__icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
}

.d-whatsapp-fab--pos-offset {
    bottom: 92px;
}

@media (max-width: 767.98px) {
    .d-whatsapp-fab {
        min-width: 0;
        bottom: 96px;
        right: 12px;
        padding: 10px 12px 10px 10px;
        gap: 10px;
        border-radius: 18px;
    }

    .d-whatsapp-fab__icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
        border-radius: 14px;
    }

    .d-whatsapp-fab__eyebrow {
        font-size: 9px;
    }

    .d-whatsapp-fab__label {
        font-size: 13px;
    }

    .d-whatsapp-fab__number {
        font-size: 12px;
    }

    .d-whatsapp-fab--icon-only {
        width: 56px;
        height: 56px;
        padding: 0;
    }

    .d-whatsapp-fab--icon-only .d-whatsapp-fab__icon {
        width: 48px;
        height: 48px;
    }

    .d-whatsapp-fab--pos-offset {
        bottom: 108px;
    }
}

html[dir="rtl"] .d-whatsapp-fab {
    right: auto;
    left: 16px;
}

html[dir="rtl"] .d-whatsapp-fab__icon::after {
    right: auto;
    left: 6px;
}

.d-header-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    list-style: none;
}

.d-header-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.d-header-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.d-header-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    min-width: 200px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.d-header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    transition: all var(--transition-fast);
    text-decoration: none;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.d-header-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.d-header-dropdown-item svg,
.d-header-dropdown-item i {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.d-header-dropdown-item:hover svg,
.d-header-dropdown-item:hover i {
    color: var(--primary-500);
}

.d-header-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.5rem 0;
}

/* User Profile Dropdown */
.d-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.d-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-400), var(--primary-500));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.d-user-info {
    display: none;
}

@media (min-width: 768px) {
    .d-user-info {
        display: flex;
        flex-direction: column;
    }
}

.d-user-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.d-user-role {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   THEMED CALCULATOR (Header Popover)
   ============================================ */
.pos-calculator {
    background: var(--d-bg-card);
    border: 1px solid var(--d-border-light);
    border-radius: var(--d-radius-2xl);
    padding: 14px;
    width: 260px;
    box-shadow: var(--d-shadow-lg);
    color: var(--d-text-primary);
    font-family: var(--d-font-sans);
}

.pos-calculator-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.pos-calculator-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pos-calculator-title {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--d-text-primary);
}

.pos-calculator-sub {
    font-size: 11px;
    color: var(--d-text-tertiary);
}

.pos-calculator-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--d-border-light);
    background: var(--d-gray-100);
    color: var(--d-text-secondary);
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pos-calculator-close:hover {
    background: var(--d-gray-200);
    box-shadow: var(--d-shadow-sm);
    transform: translateY(-1px);
}

.pos-calculator-close:active {
    transform: translateY(0);
}

.pos-calculator-close:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

.pos-calculator-display {
    margin-bottom: 12px;
}

.pos-calculator .screen {
    width: 100%;
    border: 1px solid var(--d-border-default);
    border-radius: var(--d-radius-xl);
    padding: 12px;
    background: var(--d-gray-50);
    color: var(--d-text-primary);
    font-weight: 800;
    font-size: 20px;
    box-shadow: var(--d-shadow-inner);
    text-align: right;
}

.pos-calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.pos-calculator button.btn {
    border: 1px solid var(--d-border-light);
    border-radius: var(--d-radius-xl);
    background: var(--d-gray-100);
    color: var(--d-text-primary);
    font-weight: 700;
    font-size: 16px;
    height: 44px;
    padding: 0;
    box-shadow: var(--d-shadow-sm);
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pos-calculator button.btn:hover {
    transform: translateY(-1px);
    background: var(--d-gray-200);
    box-shadow: var(--d-shadow-md);
}

.pos-calculator button.btn:active {
    transform: translateY(0);
}

.pos-calculator button.btn:focus-visible {
    outline: 2px solid var(--d-primary-500);
    outline-offset: 2px;
}

.pos-calculator .btn.operator {
    background: var(--brand-purple);
    color: var(--d-text-inverse);
    border-color: var(--d-accent-600);
}

.pos-calculator .btn.operator:hover {
    background: var(--d-accent-600);
}

.pos-calculator .btn.utility {
    background: var(--d-gray-200);
    border-color: var(--d-border-default);
    color: var(--d-text-secondary);
}

.pos-calculator .btn.utility.warning {
    background: var(--brand-lilac);
    color: var(--d-text-inverse);
    border-color: var(--d-accent-500);
}

.pos-calculator .btn.utility.danger {
    background: var(--brand-navy);
    color: var(--d-text-inverse);
    border-color: var(--brand-ink);
}

.pos-calculator .btn.number {
    background: var(--d-bg-card);
}

.pos-calculator .btn.zero {
    grid-column: span 2;
}

.pos-calculator .btn.equals {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-strong) 100%);
    color: var(--d-text-inverse);
    border-color: var(--brand-blue-strong);
}

.pos-calculator .btn.equals:hover {
    background: linear-gradient(135deg, var(--brand-blue-strong) 0%, var(--brand-purple) 100%);
}

.popover {
    max-width: none !important;
    border: 0 !important;
    background: transparent !important;
}

.popover .popover-body {
    padding: 0 !important;
}

.popover #calculator.pos-calculator {
    width: 260px;
    max-width: calc(100vw - 24px);
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

/* Enhanced Sidebar */
.d-sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    position: relative;
    z-index: 50;
}

/* Collapsed State */
.sidebar-collapse .d-sidebar {
    width: 70px;
}

.sidebar-collapse .d-sidebar .d-sidebar-logo-text,
.sidebar-collapse .d-sidebar .side-bar-heading,
.sidebar-collapse .d-sidebar .d-nav-text,
.sidebar-collapse .d-sidebar .chiled {
    display: none;
}

.sidebar-collapse .d-sidebar .d-nav-icon {
    margin-right: 0;
}

/* Sidebar Logo Area */
.d-sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    padding: 0 1rem;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    flex-shrink: 0;
}

.d-sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.d-sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-sidebar-logo-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.d-sidebar-logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.d-sidebar-logo-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.d-sidebar-logo-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success-400);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Sidebar Navigation */
.d-sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
.d-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.d-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.d-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.d-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Navigation Item */
.d-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    margin-bottom: 0.25rem;
    position: relative;
}

.d-nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.d-nav-item.active {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    font-weight: 600;
}

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

.d-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.d-nav-item:hover .d-nav-icon,
.d-nav-item.active .d-nav-icon {
    opacity: 1;
}

.d-nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Arrow */
.d-nav-arrow {
    width: 1rem;
    height: 1rem;
    color: var(--gray-400);
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

.d-nav-item.expanded .d-nav-arrow {
    transform: rotate(90deg);
}

/* Module accents */
.d-nav-item,
#side-bar a {
    --module-accent: var(--d-primary-500);
    --module-soft-bg: rgba(0, 156, 213, 0.12);
    --module-soft-bg-strong: rgba(0, 156, 213, 0.2);
    --module-soft-border: rgba(0, 156, 213, 0.28);
    --module-soft-shadow: rgba(0, 156, 213, 0.18);
}

.d-nav-item[data-module="manufacturing"],
#side-bar a[data-module="manufacturing"] {
    --module-accent: #f59e0b;
    --module-soft-bg: rgba(245, 158, 11, 0.14);
    --module-soft-bg-strong: rgba(245, 158, 11, 0.24);
    --module-soft-border: rgba(245, 158, 11, 0.3);
    --module-soft-shadow: rgba(245, 158, 11, 0.18);
}

.d-nav-item[data-module="hrm"],
#side-bar a[data-module="hrm"] {
    --module-accent: #38bdf8;
    --module-soft-bg: rgba(56, 189, 248, 0.14);
    --module-soft-bg-strong: rgba(56, 189, 248, 0.24);
    --module-soft-border: rgba(56, 189, 248, 0.28);
    --module-soft-shadow: rgba(56, 189, 248, 0.2);
}

.d-nav-item[data-module="superadmin"],
#side-bar a[data-module="superadmin"] {
    --module-accent: #a855f7;
    --module-soft-bg: rgba(168, 85, 247, 0.14);
    --module-soft-bg-strong: rgba(168, 85, 247, 0.24);
    --module-soft-border: rgba(168, 85, 247, 0.28);
    --module-soft-shadow: rgba(168, 85, 247, 0.2);
}

.d-nav-item[data-module="essentials"],
#side-bar a[data-module="essentials"] {
    --module-accent: #10b981;
    --module-soft-bg: rgba(16, 185, 129, 0.14);
    --module-soft-bg-strong: rgba(16, 185, 129, 0.24);
    --module-soft-border: rgba(16, 185, 129, 0.28);
    --module-soft-shadow: rgba(16, 185, 129, 0.2);
}

.d-nav-item[data-module] {
    border-left: 3px solid var(--module-accent);
    padding-left: calc(1rem - 3px);
}

/* Sub Navigation */
.d-nav-submenu {
    display: none;
    margin-top: 0.25rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--gray-200);
}

.d-nav-submenu.open {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.d-nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: 0.125rem;
}

.d-nav-subitem:hover {
    color: var(--gray-900);
    background: var(--gray-50);
}

.d-nav-subitem.active {
    color: var(--primary-600);
    font-weight: 600;
}

/* Navigation Section Divider */
.d-nav-section {
    padding: 0.75rem 1rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Navigation Badge */
.d-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    background: var(--primary-500);
    border-radius: 9999px;
    margin-left: auto;
}

.d-nav-badge.warning {
    background: var(--warning-500);
}

.d-nav-badge.danger {
    background: var(--danger-500);
}

.d-nav-badge.success {
    background: var(--success-500);
}

/* ============================================
   NOTIFICATION BELL
   ============================================ */

.d-notification-bell {
    position: relative;
}

.d-notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: var(--danger-500);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-700);
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ============================================
   MOBILE SIDEBAR OVERLAY
   ============================================ */

.d-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.d-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar */
@media (max-width: 1023px) {
    .d-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 50;
        box-shadow: var(--shadow-2xl);
    }

    .d-sidebar.open {
        left: 0;
    }
}

/* ============================================
   SEARCH BAR (Header)
   ============================================ */

.d-header-search {
    position: relative;
    max-width: 400px;
    flex: 1;
    display: none;
}

@media (min-width: 768px) {
    .d-header-search {
        display: block;
    }
}

.d-header-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    font-size: var(--text-sm);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.d-header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.d-header-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.d-header-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   BREADCRUMB STYLES
   ============================================ */

.d-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.d-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.d-breadcrumb-item a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.d-breadcrumb-item a:hover {
    color: var(--primary-500);
}

.d-breadcrumb-item.active {
    color: var(--gray-900);
    font-weight: 500;
}

.d-breadcrumb-separator {
    color: var(--gray-300);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.d-page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

@media (min-width: 768px) {
    .d-page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.d-page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.d-page-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.d-page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   QUICK ACTION FLOATING BUTTON
   ============================================ */

.d-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.d-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.d-fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.d-fab-btn svg {
    width: 24px;
    height: 24px;
}

/* Hide FAB on smaller screens if mobile menu exists */
@media (max-width: 767px) {
    .d-fab {
        bottom: 1rem;
        right: 1rem;
    }
    
    .d-fab-btn {
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   EXISTING LAYOUT ENHANCEMENTS
   ============================================ */

/* Enhance existing sidebar styles */
.side-bar {
    --sidebar-bg: var(--d-brand-navy);
    --sidebar-text: rgba(234, 240, 247, 0.9);
    --sidebar-muted: rgba(234, 240, 247, 0.6);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-text) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    box-shadow: 0 16px 40px rgba(19, 32, 61, 0.22);
    transition: width var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
    width: 18rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    align-self: flex-start;
}

.side-bar > .d-sidebar-brand {
    background: transparent !important;
    border-right-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 5rem;
}

.d-sidebar-brand {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.8rem;
    min-height: 4.35rem;
    padding: 0.78rem 0.85rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(10, 24, 48, 0.98) 0%, rgba(2, 80, 124, 0.82) 52%, rgba(78, 46, 126, 0.78) 100%);
    box-shadow: 0 12px 26px rgba(4, 18, 35, 0.28);
    overflow: hidden;
}

.d-sidebar-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%);
    opacity: 0.9;
    pointer-events: none;
}

.d-sidebar-brand::after {
    content: "";
    position: absolute;
    right: -2.25rem;
    top: -2.25rem;
    width: 7rem;
    height: 7rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}

.d-sidebar-brand:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 18px 30px rgba(4, 18, 35, 0.34);
}

.d-sidebar-brand-icon {
    position: relative;
    z-index: 1;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
        linear-gradient(135deg, rgba(0, 156, 213, 0.5), rgba(138, 96, 194, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 14px 28px rgba(4, 18, 35, 0.22);
}

.d-sidebar-brand-icon img {
    width: 1.7rem;
    height: 1.7rem;
}

.d-sidebar-brand-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.22rem;
    min-width: 0;
    padding-top: 0.02rem;
}

.d-sidebar-brand-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    min-width: 0;
    flex-wrap: wrap;
}

.d-sidebar-brand-eyebrow {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.d-sidebar-brand-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.2rem;
    padding: 0 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: white;
}

.d-sidebar-brand-title {
    margin: 0;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: white;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.d-sidebar-brand-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex-wrap: wrap;
}

.d-sidebar-brand-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.28rem;
    padding: 0 0.48rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.66rem;
    font-weight: 700;
    color: white;
}

.d-sidebar-brand-live-dot {
    width: 0.36rem;
    height: 0.36rem;
    border-radius: 999px;
}

.d-sidebar-brand-meta-text {
    font-size: 0.67rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.66);
}

.d-live-dot {
    background: var(--d-success-500);
    box-shadow: 0 0 9px rgba(16, 185, 129, 0.55);
}

.side-bar .side-bar-heading {
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: var(--d-text-inverse) !important;
}

.d-sidebar-business-shell,
.d-sidebar-search-shell,
.d-sidebar-footer-card {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 14px 34px rgba(4, 18, 35, 0.16);
}

.d-sidebar-business-shell {
    padding: 1rem;
}

.d-sidebar-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.d-sidebar-eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.d-sidebar-section-copy {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.68);
}

.d-sidebar-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.d-sidebar-search-shell {
    padding: 0.9rem;
}

.d-sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.9rem;
    padding: 0 0.95rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.72);
}

.d-sidebar-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: white;
    font-size: 0.88rem;
    font-weight: 500;
}

.d-sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.d-sidebar-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.d-sidebar-search-clear:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.04);
}

.d-sidebar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.56);
    letter-spacing: 0.03em;
}

/* Enhanced sidebar navigation wrapper */
#side-bar {
    padding: 0.75rem 1rem 1.5rem !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

.d-sidebar-menu-header {
    padding: 0 0.25rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.d-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.d-sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 3.55rem;
    padding: 0.5rem 0.65rem;
    border-radius: 22px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--sidebar-text) !important;
    overflow: hidden;
    transition: transform var(--transition-normal), background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), color var(--transition-normal);
}

.d-sidebar-link::before {
    content: "";
    position: absolute;
    left: 0.3rem;
    top: 16%;
    width: 3px;
    height: 68%;
    border-radius: 999px;
    background: transparent;
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.d-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.08);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(4, 18, 35, 0.14);
}

.d-sidebar-link:hover::before,
.d-sidebar-link.is-open::before,
.d-sidebar-link.is-active::before {
    background: var(--module-accent);
    opacity: 1;
}

.d-sidebar-link.is-active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
    border-color: rgba(255, 255, 255, 0.16);
    color: white !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.d-sidebar-link.is-open {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: white !important;
}

#side-bar .d-sidebar-link[data-module] {
    background: linear-gradient(135deg, var(--module-soft-bg) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: var(--module-soft-border);
}

#side-bar .d-sidebar-link[data-module]:hover,
#side-bar .d-sidebar-link[data-module].is-open,
#side-bar .d-sidebar-link[data-module].is-active {
    border-color: var(--module-soft-border);
    box-shadow: 0 16px 30px var(--module-soft-shadow);
}

#side-bar .d-sidebar-link[data-module].is-open,
#side-bar .d-sidebar-link[data-module].is-active {
    background: linear-gradient(135deg, var(--module-soft-bg-strong) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.d-sidebar-icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.d-sidebar-link:hover .d-sidebar-icon-shell,
.d-sidebar-link.is-active .d-sidebar-icon-shell,
.d-sidebar-link.is-open .d-sidebar-icon-shell {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
}

#side-bar .d-sidebar-link[data-module] .d-sidebar-icon-shell {
    background: linear-gradient(135deg, var(--module-soft-bg-strong) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: var(--module-soft-border);
    color: var(--module-accent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 22px var(--module-soft-shadow);
}

.d-sidebar-link i,
.d-sidebar-link svg {
    width: 1.1rem !important;
    height: 1.1rem !important;
    opacity: 1 !important;
    color: inherit;
}

.d-sidebar-link-copy {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.d-sidebar-link-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.d-sidebar-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
}

.d-sidebar-group.is-open .d-sidebar-chevron,
.d-sidebar-link:hover .d-sidebar-chevron {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#side-bar .d-sidebar-link[data-module] .d-sidebar-chevron {
    background: var(--module-soft-bg);
    border: 1px solid var(--module-soft-border);
    color: var(--module-accent);
}

.d-sidebar-chevron .svg {
    width: 1rem !important;
    height: 1rem !important;
}

.d-sidebar-footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
    border-top: 1px solid var(--sidebar-border) !important;
    color: var(--sidebar-text) !important;
    padding: 0.8rem !important;
}

.d-sidebar-footer-card {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
}

.d-sidebar-footer-top {
    display: flex;
    align-items: center;
}

.d-sidebar-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.d-sidebar-footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    flex-shrink: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 156, 213, 0.28), rgba(138, 96, 194, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.d-sidebar-footer-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 0.08rem;
}

.d-sidebar-footer-title-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.d-sidebar-footer-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: white;
}

.d-sidebar-footer-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.1rem;
    padding: 0 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.d-sidebar-footer-subtitle {
    display: none;
}

.d-sidebar-footer-company {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.56);
}

.d-sidebar-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.d-sidebar-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.1rem;
    padding: 0.45rem 0.55rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.d-sidebar-footer-link:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(4, 18, 35, 0.16);
}

.d-sidebar-footer-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: transparent;
    color: white;
}

.d-sidebar-footer-link-copy {
    min-width: 0;
    flex: 0 1 auto;
    display: block;
}

.d-sidebar-footer-link-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.d-sidebar-footer-link-meta {
    display: none;
}

.d-sidebar-support-panel {
    display: block;
}

.d-sidebar-support-panel summary::-webkit-details-marker {
    display: none;
}

.d-sidebar-support-panel summary::marker {
    content: "";
}

.d-sidebar-support-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.d-sidebar-support-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.d-sidebar-support-panel[open] .d-sidebar-support-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.d-sidebar-support-toggle-copy {
    min-width: 0;
    display: grid;
    gap: 0;
    text-align: left;
}

.d-sidebar-support-toggle-title {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.d-sidebar-support-toggle-meta {
    display: none;
}

.d-sidebar-support-toggle-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.d-sidebar-support-panel[open] .d-sidebar-support-toggle-chevron {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    transform: rotate(180deg);
}

.d-sidebar-support {
    margin-top: 0.45rem;
}

.d-sidebar-support-list {
    display: grid;
    gap: 0.4rem;
}

.d-sidebar-support-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.d-sidebar-support-item:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(2px);
    box-shadow: 0 12px 24px rgba(4, 18, 35, 0.16);
}

.d-sidebar-support-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.d-sidebar-support-item-copy {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.d-sidebar-support-item-title {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.15;
    color: white;
    word-break: break-word;
}

.d-sidebar-support-item-meta {
    display: block;
    font-size: 0.64rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.56);
}

.d-sidebar-empty {
    padding: 0 1rem 1.25rem;
}

.d-sidebar-empty-card {
    padding: 1.25rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    text-align: center;
}

.d-sidebar-empty-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.d-sidebar-empty-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: white;
}

.d-sidebar-empty-copy {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.6);
}

.d-sidebar-footer a {
    color: inherit;
    text-decoration: none;
}

.d-sidebar-footer p,
.d-sidebar-footer span {
    color: inherit;
}

/* Dropdown children */
#side-bar .chiled {
    position: relative;
    margin: 0 0 0.3rem 0 !important;
    padding-left: 1rem !important;
}

.d-sidebar-group-line {
    position: absolute;
    left: 1.4rem;
    top: 0.15rem;
    bottom: 0.15rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
}

.d-sidebar-group-items {
    display: grid;
    gap: 0.35rem;
    padding-left: 0.8rem;
}

.d-sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.6rem;
    padding: 0 0.95rem;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--sidebar-muted) !important;
    transition: background var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal), transform var(--transition-normal);
}

.d-sidebar-sublink:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: white !important;
    transform: translateX(2px);
}

#side-bar .d-sidebar-sublink[data-module]:hover,
#side-bar .d-sidebar-sublink[data-module].is-active {
    border-color: var(--module-soft-border);
    background: linear-gradient(135deg, var(--module-soft-bg) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.d-sidebar-sublink-dot {
    width: 0.45rem;
    height: 0.45rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

#side-bar .d-sidebar-sublink[data-module] .d-sidebar-sublink-dot {
    background: var(--module-accent);
    box-shadow: 0 0 0 4px var(--module-soft-bg);
}

.d-sidebar-sublink-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.d-sidebar-sublink.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: white !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.d-sidebar-sublink.is-active .d-sidebar-sublink-dot {
    background: var(--module-accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04), 0 0 14px rgba(255, 255, 255, 0.18);
}

/* Collapsed sidebar adjustments */
.sidebar-collapse .side-bar {
    width: 4.6rem !important;
}

.sidebar-collapse .side-bar > .d-sidebar-brand {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    min-height: auto;
    padding: 0.8rem !important;
}

.sidebar-collapse .side-bar .side-bar-heading,
.sidebar-collapse .side-bar .d-sidebar-business-selector,
.sidebar-collapse .side-bar .d-sidebar-search-panel,
.sidebar-collapse .side-bar .chiled,
.sidebar-collapse .side-bar .side-bar-meta,
.sidebar-collapse .side-bar .tw-flex.tw-items-center.tw-gap-1\\.5,
.sidebar-collapse .side-bar .d-sidebar-empty {
    display: none !important;
}

.sidebar-collapse #side-bar {
    padding: 1rem 0.6rem !important;
    align-items: center;
}

.sidebar-collapse .d-sidebar-footer {
    display: none !important;
}

.sidebar-collapse #side-bar a {
    justify-content: center !important;
    padding: 0.45rem !important;
    width: 100%;
    overflow: hidden;
}

.sidebar-collapse #side-bar a[title] {
    position: relative;
}

.sidebar-collapse #side-bar a[title]:hover::after,
.sidebar-collapse #side-bar a[title]:focus-visible::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-radius: var(--radius-md);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

/* Hide only textual content in collapsed mode */
.sidebar-collapse #side-bar .d-sidebar-link-copy,
.sidebar-collapse #side-bar .d-sidebar-chevron,
.sidebar-collapse #side-bar .d-sidebar-menu-header,
.sidebar-collapse #side-bar .d-sidebar-group-line,
.sidebar-collapse #side-bar .d-sidebar-group-items,
.sidebar-collapse #side-bar .d-sidebar-sublink-label,
.sidebar-collapse #side-bar .d-sidebar-sublink-dot {
    display: none !important;
}

.sidebar-collapse #side-bar .d-sidebar-link {
    min-height: 3.15rem;
    padding: 0.35rem !important;
}

.sidebar-collapse #side-bar .d-sidebar-icon-shell {
    margin: 0 auto;
}

/* Focus states for accessibility */
#side-bar a:focus-visible {
    outline: 2px solid var(--d-primary-500);
    outline-offset: 2px;
    background: rgba(0, 156, 213, 0.12) !important;
}

/* Footer enhancement */
.main-footer {
    background: white !important;
    border-top: 1px solid var(--gray-200) !important;
    padding: 1rem 1.5rem !important;
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .side-bar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 1050 !important;
        box-shadow: var(--shadow-2xl) !important;
        transition: left var(--transition-normal) !important;
    }
    
    .side-bar.open,
    body:not(.sidebar-collapse) .side-bar.mobile-open {
        left: 0 !important;
    }
}

/* Print styles */
@media print {
    .d-header,
    .d-sidebar,
    .side-bar,
    .no-print {
        display: none !important;
    }
}
