/*
 * Rubix4 application shell
 * Presentation only: menu permissions, routes, and module hooks remain server-driven.
 */

:root {
    --shell-sidebar-width: 280px;
    --shell-sidebar-collapsed-width: 82px;
    --shell-topbar-height: 72px;
    --shell-sidebar-bg: #0f172a;
    --shell-sidebar-bg-soft: #172033;
    --shell-border: #e6eaf0;
    --shell-text: #111827;
    --shell-muted: #64748b;
    --shell-radius: 12px;
    --shell-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.app-shell {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background: #f4f7fb;
}

.app-shell > main {
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--theme-700) 5%, transparent), transparent 30rem),
        #f4f7fb;
}

.accounting-shell-content.content-wrapper {
    min-height: calc(100vh - var(--shell-topbar-height));
    margin-inline: 0 !important;
    background: transparent;
}

/* Sidebar */
.app-sidebar.side-bar {
    position: relative;
    z-index: 50;
    flex-direction: column;
    width: var(--shell-sidebar-width);
    min-width: var(--shell-sidebar-width);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: #d7deea;
    background: var(--shell-sidebar-bg);
    background-image:
        radial-gradient(circle at 18% 0, color-mix(in srgb, var(--theme-700) 42%, transparent), transparent 22rem),
        linear-gradient(180deg, color-mix(in srgb, var(--theme-900) 35%, #0f172a), #0b1220 70%);
    border: 0;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
    transition: width 220ms ease, min-width 220ms ease, transform 220ms ease;
}

.app-sidebar__brand {
    position: relative;
    display: flex;
    align-items: center;
    min-height: var(--shell-topbar-height);
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.app-sidebar__brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
    color: #fff;
    text-decoration: none !important;
}

.app-sidebar__brand-link:hover,
.app-sidebar__brand-link:focus {
    color: #fff;
}

.app-sidebar__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.app-sidebar__brand-copy {
    min-width: 0;
    line-height: 1.2;
}

.app-sidebar__brand-name {
    display: block;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar__brand-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-sidebar__online-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.13);
}

.app-sidebar__mobile-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-inline-start: auto;
    color: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar__search-wrap {
    flex: 0 0 auto;
    padding: 14px 14px 8px;
}

.app-sidebar__search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.app-sidebar__search:focus-within {
    border-color: color-mix(in srgb, var(--theme-700) 70%, #fff);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-700) 24%, transparent);
}

.app-sidebar__search svg,
.app-sidebar__search button {
    color: #94a3b8;
}

.app-sidebar__search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: #fff;
    border: 0 !important;
    outline: 0;
    background: transparent;
    box-shadow: none !important;
    font-size: 13px;
}

.app-sidebar__search input::placeholder {
    color: #8491a5;
}

#side-bar.app-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 10px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    scrollbar-width: thin;
}

#side-bar.app-nav::-webkit-scrollbar {
    width: 5px;
}

#side-bar.app-nav::-webkit-scrollbar-track {
    background: transparent;
}

#side-bar.app-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

#side-bar .app-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    margin: 2px 0;
    padding: 8px 11px;
    color: #b8c3d4;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none !important;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#side-bar .app-nav__link:hover,
#side-bar .app-nav__link:focus-visible {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.075);
    outline: none;
}

#side-bar .app-nav__link:hover {
    transform: translateX(2px);
}

[dir='rtl'] #side-bar .app-nav__link:hover {
    transform: translateX(-2px);
}

#side-bar .app-nav__link > svg:first-child,
#side-bar .app-nav__link > i:first-child {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: #8190a7;
    font-size: 17px;
    line-height: 20px;
    text-align: center;
    transition: color 160ms ease;
}

#side-bar .app-nav__link:hover > svg:first-child,
#side-bar .app-nav__link:hover > i:first-child,
#side-bar .app-nav__link:focus-visible > svg:first-child,
#side-bar .app-nav__link:focus-visible > i:first-child {
    color: #dfe7f2;
}

#side-bar .app-nav__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#side-bar .theme-sidebar-active {
    color: #fff;
    border-color: color-mix(in srgb, var(--theme-700) 42%, rgba(255, 255, 255, 0.12));
    background: color-mix(in srgb, var(--theme-700) 30%, rgba(255, 255, 255, 0.07));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-900) 22%, transparent), inset 3px 0 0 color-mix(in srgb, var(--theme-700) 60%, #fff);
}

[dir='rtl'] #side-bar .theme-sidebar-active {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-900) 22%, transparent), inset -3px 0 0 color-mix(in srgb, var(--theme-700) 60%, #fff);
}

#side-bar .theme-sidebar-active > svg:first-child,
#side-bar .theme-sidebar-active > i:first-child {
    color: #fff;
}

#side-bar .app-nav__chevron {
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
    color: #718096;
    transition: transform 180ms ease, color 180ms ease;
}

#side-bar .drop_down[aria-expanded='true'] .app-nav__chevron {
    color: #fff;
    transform: rotate(90deg);
}

[dir='rtl'] #side-bar .drop_down[aria-expanded='true'] .app-nav__chevron {
    transform: rotate(-90deg);
}

#side-bar .app-nav__children {
    position: relative;
    margin: 2px 0 8px;
    padding: 2px 6px 2px 39px;
}

[dir='rtl'] #side-bar .app-nav__children {
    padding: 2px 39px 2px 6px;
}

#side-bar .app-nav__children::before {
    position: absolute;
    top: 2px;
    bottom: 4px;
    left: 21px;
    width: 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    content: '';
}

[dir='rtl'] #side-bar .app-nav__children::before {
    right: 21px;
    left: auto;
}

#side-bar .app-nav__child-link {
    position: relative;
    display: block;
    padding: 7px 9px;
    overflow: hidden;
    color: #92a0b4;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 150ms ease, background 150ms ease;
}

#side-bar .app-nav__child-link:hover,
#side-bar .app-nav__child-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.065);
    outline: none;
}

#side-bar .theme-sidebar-child-active {
    color: #fff;
    background: color-mix(in srgb, var(--theme-700) 22%, transparent);
}

#side-bar .app-nav__header {
    padding: 18px 11px 6px;
    overflow: hidden;
    color: #65748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

#side-bar .app-nav__divider {
    height: 1px;
    margin: 10px 11px;
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar__empty {
    padding: 16px;
    color: #91a0b6;
    font-size: 12px;
    text-align: center;
}

/* White tenant theme: light navigation surfaces with dark, accessible text. */
body[data-ui-theme='white'] .app-sidebar.side-bar {
    color: #111827;
    background: #fff;
    background-image:
        radial-gradient(circle at 18% 0, rgba(15, 23, 42, 0.035), transparent 22rem),
        linear-gradient(180deg, #fff, #f8fafc 74%);
    border-inline-end: 1px solid #e2e8f0;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.07);
}

body[data-ui-theme='white'] .app-sidebar__brand {
    border-bottom-color: #e5e7eb;
}

body[data-ui-theme='white'] .app-sidebar__brand-link,
body[data-ui-theme='white'] .app-sidebar__brand-link:hover,
body[data-ui-theme='white'] .app-sidebar__brand-link:focus {
    color: #111827;
}

body[data-ui-theme='white'] .app-sidebar__brand-mark {
    color: #111827;
    border-color: #d1d5db;
    background: #f3f4f6;
    box-shadow: inset 0 1px 0 #fff;
}

body[data-ui-theme='white'] .app-sidebar__brand-meta {
    color: #64748b;
}

body[data-ui-theme='white'] .app-sidebar__mobile-close {
    color: #111827;
    border-color: #d1d5db;
    background: #f8fafc;
}

body[data-ui-theme='white'] .app-sidebar__search {
    border-color: #d1d5db;
    background: #f8fafc;
}

body[data-ui-theme='white'] .app-sidebar__search:focus-within {
    border-color: #64748b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

body[data-ui-theme='white'] .app-sidebar__search svg,
body[data-ui-theme='white'] .app-sidebar__search button,
body[data-ui-theme='white'] .app-sidebar__search input {
    color: #111827;
}

body[data-ui-theme='white'] .app-sidebar__search input::placeholder {
    color: #6b7280;
}

body[data-ui-theme='white'] #side-bar.app-nav {
    scrollbar-color: #cbd5e1 transparent;
}

body[data-ui-theme='white'] #side-bar.app-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body[data-ui-theme='white'] #side-bar .app-nav__link {
    color: #111827;
}

body[data-ui-theme='white'] #side-bar .app-nav__link > svg:first-child,
body[data-ui-theme='white'] #side-bar .app-nav__link > i:first-child,
body[data-ui-theme='white'] #side-bar .app-nav__chevron {
    color: #374151;
}

body[data-ui-theme='white'] #side-bar .app-nav__link:hover,
body[data-ui-theme='white'] #side-bar .app-nav__link:focus-visible {
    color: #000;
    border-color: #dbe1e8;
    background: #f1f5f9;
}

body[data-ui-theme='white'] #side-bar .app-nav__link:hover > svg:first-child,
body[data-ui-theme='white'] #side-bar .app-nav__link:hover > i:first-child,
body[data-ui-theme='white'] #side-bar .app-nav__link:focus-visible > svg:first-child,
body[data-ui-theme='white'] #side-bar .app-nav__link:focus-visible > i:first-child,
body[data-ui-theme='white'] #side-bar .drop_down[aria-expanded='true'] .app-nav__chevron {
    color: #000;
}

body[data-ui-theme='white'] #side-bar .theme-sidebar-active {
    color: #000;
    border-color: #cbd5e1;
    background: #e9eef4;
    box-shadow: inset 3px 0 0 #111827;
}

[dir='rtl'] body[data-ui-theme='white'] #side-bar .theme-sidebar-active {
    box-shadow: inset -3px 0 0 #111827;
}

body[data-ui-theme='white'] #side-bar .theme-sidebar-active > svg:first-child,
body[data-ui-theme='white'] #side-bar .theme-sidebar-active > i:first-child {
    color: #000;
}

body[data-ui-theme='white'] #side-bar .app-nav__children::before,
body[data-ui-theme='white'] #side-bar .app-nav__divider {
    background: #d1d5db;
}

body[data-ui-theme='white'] #side-bar .app-nav__child-link {
    color: #374151;
}

body[data-ui-theme='white'] #side-bar .app-nav__child-link:hover,
body[data-ui-theme='white'] #side-bar .app-nav__child-link:focus-visible,
body[data-ui-theme='white'] #side-bar .theme-sidebar-child-active {
    color: #000;
    background: #e9eef4;
}

body[data-ui-theme='white'] #side-bar .app-nav__header,
body[data-ui-theme='white'] .app-sidebar__empty {
    color: #4b5563;
}

body[data-ui-theme='white'] .shell-primary-action {
    color: #111827;
    border-color: #d1d5db;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body[data-ui-theme='white'] .shell-primary-action:hover,
body[data-ui-theme='white'] .shell-primary-action:focus-visible {
    color: #000;
    border-color: #9ca3af;
    background: #f3f4f6;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

body[data-ui-theme='white'] .shell-user-button__avatar {
    color: #111827;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
}

body[data-ui-theme='white'] .theme-btn-bg {
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
}

body[data-ui-theme='white'] .theme-btn-bg:hover,
body[data-ui-theme='white'] .theme-btn-bg:focus,
body[data-ui-theme='white'] .theme-btn-bg:focus-visible,
body[data-ui-theme='white'] .theme-btn-bg:active {
    color: #000 !important;
    border-color: #9ca3af !important;
    background: #f3f4f6 !important;
}

body[data-ui-theme='white'] .theme-logo-bg {
    color: #111827 !important;
    background: #f3f4f6 !important;
}

body[data-ui-theme='white'] .theme-picker__preview-sidebar {
    border-inline-end: 1px solid #d1d5db;
    background: linear-gradient(180deg, #fff, #f1f5f9);
}

body[data-ui-theme='white'] .theme-picker__preview-header {
    border-bottom-color: #9ca3af;
}

/* Theme compatibility for CRM/contact portals that retain the AdminLTE shell. */
.main-sidebar #side-bar a svg,
.main-sidebar #side-bar a i {
    color: #9ca3af;
}

.main-sidebar #side-bar a:hover svg,
.main-sidebar #side-bar a:hover i,
.main-sidebar #side-bar a.theme-sidebar-active svg,
.main-sidebar #side-bar a.theme-sidebar-active i {
    color: var(--theme-700);
}

.main-sidebar #side-bar .theme-sidebar-hover:hover,
.main-sidebar #side-bar .theme-sidebar-hover:focus,
.main-sidebar #side-bar .theme-sidebar-active {
    color: var(--theme-700);
    background-color: color-mix(in srgb, var(--theme-700) 12%, transparent);
    outline: none;
}

.main-sidebar #side-bar .theme-sidebar-child-hover:hover,
.main-sidebar #side-bar .theme-sidebar-child-hover:focus,
.main-sidebar #side-bar .theme-sidebar-child-active {
    color: var(--theme-700);
    outline: none;
}

/* Desktop collapsed rail */
@media (min-width: 1024px) {
    .app-sidebar.side-bar {
        display: flex !important;
    }

    body.sidebar-collapse .app-sidebar.side-bar {
        width: var(--shell-sidebar-collapsed-width);
        min-width: var(--shell-sidebar-collapsed-width);
    }

    body.sidebar-collapse .app-sidebar__brand {
        padding-inline: 12px;
    }

    body.sidebar-collapse .app-sidebar__brand-link {
        justify-content: center;
    }

    body.sidebar-collapse .app-sidebar__brand-copy,
    body.sidebar-collapse .app-sidebar__search input,
    body.sidebar-collapse .app-sidebar__search button,
    body.sidebar-collapse #side-bar .app-nav__label,
    body.sidebar-collapse #side-bar .app-nav__chevron,
    body.sidebar-collapse #side-bar .app-nav__header,
    body.sidebar-collapse #side-bar .app-nav__children {
        display: none !important;
    }

    body.sidebar-collapse .app-sidebar__search-wrap {
        padding-inline: 15px;
    }

    body.sidebar-collapse .app-sidebar__search {
        justify-content: center;
        padding: 0;
    }

    body.sidebar-collapse #side-bar.app-nav {
        padding-inline: 12px;
    }

    body.sidebar-collapse #side-bar .app-nav__link {
        justify-content: center;
        padding-inline: 0;
    }

    body.sidebar-collapse #side-bar .app-nav__link:hover {
        transform: none;
    }
}

/* Top navigation */
.app-topbar {
    position: relative;
    z-index: 30;
    flex: 0 0 auto;
    min-height: var(--shell-topbar-height);
    border-bottom: 1px solid var(--shell-border);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.app-topbar::before {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--theme-700), var(--theme-800), transparent 60%);
    opacity: 0.42;
    content: '';
}

[dir='rtl'] .app-topbar::before {
    background: linear-gradient(-90deg, var(--theme-700), var(--theme-800), transparent 60%);
}

.app-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--shell-topbar-height);
    padding: 10px 20px;
    gap: 14px;
}

.app-topbar__start,
.app-topbar__actions,
.app-topbar__context {
    display: flex;
    align-items: center;
}

.app-topbar__start {
    min-width: 0;
    gap: 12px;
}

.app-topbar__actions {
    justify-content: flex-end;
    gap: 8px;
}

.app-topbar__context {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.app-topbar__eyebrow {
    color: var(--shell-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-topbar__workspace {
    max-width: 260px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--shell-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-icon-button,
.shell-user-button,
.shell-date,
.shell-primary-action,
.app-topbar .notifications-menu > a.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    color: #475569;
    border: 1px solid #dfe4eb;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none !important;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.shell-icon-button,
.app-topbar .notifications-menu > a.dropdown-toggle {
    width: 38px;
    padding: 0;
}

/* Explicit shell-control visibility; these rules load after Tailwind utilities. */
#mobile-sidebar-toggle {
    display: inline-flex !important;
}

#desktop-sidebar-toggle {
    display: none !important;
}

@media (min-width: 1024px) {
    #mobile-sidebar-toggle {
        display: none !important;
    }

    #desktop-sidebar-toggle {
        display: inline-flex !important;
    }
}

.shell-icon-button:hover,
.shell-icon-button:focus-visible,
.shell-user-button:hover,
.shell-user-button:focus-visible,
.shell-date:hover,
.shell-date:focus-visible,
.app-topbar .notifications-menu > a.dropdown-toggle:hover,
.app-topbar .notifications-menu > a.dropdown-toggle:focus-visible {
    color: var(--theme-700);
    border-color: color-mix(in srgb, var(--theme-700) 34%, #dfe4eb);
    background: color-mix(in srgb, var(--theme-700) 5%, #fff);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--theme-900) 10%, transparent);
    outline: none;
}

.shell-icon-button:active,
.shell-user-button:active,
.shell-primary-action:active {
    transform: scale(0.97);
}

.shell-icon-button svg,
.shell-primary-action svg,
.shell-user-button svg,
.app-topbar .notifications-menu svg {
    width: 19px;
    height: 19px;
}

.shell-primary-action {
    gap: 8px;
    padding: 0 14px;
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--theme-700), var(--theme-900));
    box-shadow: 0 7px 16px color-mix(in srgb, var(--theme-900) 20%, transparent);
}

.shell-primary-action:hover,
.shell-primary-action:focus-visible {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-700) 88%, #fff), var(--theme-800));
    box-shadow: 0 9px 22px color-mix(in srgb, var(--theme-900) 28%, transparent);
    outline: none;
}

.shell-date {
    padding: 0 12px;
    color: #64748b;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
}

.shell-user-button {
    gap: 9px;
    padding: 4px 9px 4px 5px;
    cursor: pointer;
}

[dir='rtl'] .shell-user-button {
    padding: 4px 5px 4px 9px;
}

.shell-user-button__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    color: #fff;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--theme-700), var(--theme-900));
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.shell-user-button__name {
    max-width: 130px;
    overflow: hidden;
    color: #334155;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-dropdown {
    width: 220px;
    margin-top: 9px;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.15);
}

.shell-dropdown--user {
    width: 240px;
}

.shell-dropdown__header {
    margin: 0 2px 6px;
    padding: 10px 11px;
    border-radius: 10px;
    background: #f8fafc;
}

.shell-dropdown__eyebrow {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.shell-dropdown__title {
    margin-top: 4px;
    overflow: hidden;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    color: #526176;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 550;
    text-decoration: none !important;
    transition: color 140ms ease, background 140ms ease;
}

.shell-dropdown__item:hover,
.shell-dropdown__item:focus-visible {
    color: var(--theme-700);
    background: color-mix(in srgb, var(--theme-700) 7%, #fff);
    outline: none;
}

.shell-dropdown__item svg,
.shell-dropdown__item i {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.app-topbar summary {
    list-style: none;
}

.app-topbar summary::-webkit-details-marker {
    display: none;
}

.app-topbar details[open] > summary {
    color: var(--theme-700);
    border-color: color-mix(in srgb, var(--theme-700) 38%, #dfe4eb);
    background: color-mix(in srgb, var(--theme-700) 6%, #fff);
}

.app-topbar .notifications-menu {
    position: relative;
}

.app-topbar .notifications-menu .notifications_count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444 !important;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.app-topbar .notifications-menu .dropdown-menu {
    max-height: min(72vh, 620px) !important;
    margin-top: 9px !important;
    padding: 8px !important;
    overflow-y: auto !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.15) !important;
}

.app-topbar__subscription {
    color: #64748b;
}

.app-topbar__subscription > i {
    margin: 0 !important;
    color: var(--theme-700) !important;
}

.app-topbar__notice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.app-topbar .clock_in_btn,
.app-topbar .clock_out_btn,
.app-topbar a.btn-success {
    width: 38px;
    min-height: 38px;
    margin: 0 !important;
    padding: 9px !important;
    border: 0 !important;
    border-radius: 11px !important;
    box-shadow: none;
}

.app-topbar a.btn-success strong {
    display: none;
}

/* Mobile drawer */
.shell-drawer-toggle {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

#mobile-sidebar-toggle,
.app-sidebar__mobile-close,
#app-sidebar-overlay {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.overlay {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(2, 6, 23, 0.56);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.overlay.is-visible {
    display: block !important;
}

body.sidebar-drawer-open {
    overflow: hidden;
}

@supports selector(body:has(*)) {
    body:has(.shell-drawer-toggle:checked) {
        overflow: hidden;
    }
}

@media (max-width: 1023px) {
    .app-sidebar.side-bar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        width: min(88vw, 310px);
        min-width: min(88vw, 310px);
        visibility: hidden;
        transform: translateX(-105%);
        box-shadow: 18px 0 55px rgba(2, 6, 23, 0.32);
        transition: transform 220ms ease, visibility 220ms ease;
    }

    [dir='rtl'] .app-sidebar.side-bar {
        right: 0;
        left: auto;
        transform: translateX(105%);
    }

    .app-sidebar.side-bar.small-view-side-active,
    .app-sidebar.side-bar.is-mobile-open,
    .shell-drawer-toggle:checked ~ .app-sidebar.side-bar {
        visibility: visible;
        transform: translateX(0);
    }

    .shell-drawer-toggle:checked ~ .overlay {
        display: block !important;
    }

    .app-sidebar__mobile-close {
        display: inline-flex;
    }

    .app-topbar__inner {
        min-height: 64px;
        padding: 9px 12px;
    }

    .app-topbar__workspace {
        max-width: 180px;
    }

    .app-topbar__subscription,
    .shell-date {
        display: none;
    }
}

@media (max-width: 767px) {
    .app-topbar__context {
        display: none;
    }

    .app-topbar__actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .shell-user-button {
        width: 38px;
        padding: 4px;
    }

    .shell-user-button__name,
    .shell-user-button > svg,
    .shell-primary-action span {
        display: none;
    }

    .shell-primary-action {
        width: 38px;
        padding: 0;
    }

    .shell-dropdown {
        position: fixed !important;
        top: 62px;
        right: 10px !important;
        left: 10px !important;
        width: auto;
    }

    .app-topbar .notifications-menu .dropdown-menu {
        position: fixed !important;
        top: 62px;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
    }
}

/* Theme selector in Business Settings */
.theme-picker {
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid #e3e8ef;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f8fafc);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.theme-picker__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.theme-picker__title {
    margin: 0;
    color: #172033;
    font-size: 16px;
    font-weight: 750;
}

.theme-picker__description {
    max-width: 620px;
    margin: 5px 0 0;
    color: #718096;
    font-size: 12px;
    line-height: 1.55;
}

.theme-picker__preview {
    display: flex;
    width: 120px;
    height: 70px;
    flex: 0 0 120px;
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 11px;
    background: #f3f6fa;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

.theme-picker__preview-sidebar {
    width: 34px;
    background: linear-gradient(180deg, var(--theme-800), var(--theme-900));
}

.theme-picker__preview-content {
    flex: 1;
}

.theme-picker__preview-header {
    height: 15px;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-700) 40%, transparent);
    background: #fff;
}

.theme-picker__preview-lines {
    padding: 10px 8px;
}

.theme-picker__preview-lines span {
    display: block;
    height: 5px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: #dfe5ec;
}

.theme-picker__preview-lines span:first-child {
    width: 70%;
    background: color-mix(in srgb, var(--theme-700) 30%, #e7ebf1);
}

.theme-picker__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.theme-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.theme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.theme-option__card {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 10px;
    color: #526176;
    border: 1px solid #e0e6ed;
    border-radius: 11px;
    background: #fff;
    font-size: 12px;
    font-weight: 650;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, color 150ms ease;
}

.theme-option:hover .theme-option__card {
    color: #1e293b;
    border-color: #bcc6d3;
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.07);
}

.theme-option input:focus-visible + .theme-option__card {
    outline: 3px solid color-mix(in srgb, var(--theme-700) 25%, transparent);
    outline-offset: 2px;
}

.theme-option input:checked + .theme-option__card {
    color: var(--theme-700);
    border-color: color-mix(in srgb, var(--theme-700) 65%, #fff);
    background: color-mix(in srgb, var(--theme-700) 5%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-700) 16%, transparent);
}

.theme-option__swatches {
    display: flex;
    flex: 0 0 auto;
}

.theme-option__new {
    margin-inline-start: auto;
    padding: 3px 5px;
    color: var(--theme-700);
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-700) 9%, #fff);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.theme-option__swatches span {
    width: 13px;
    height: 26px;
    border: 2px solid #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.theme-option__swatches span + span {
    margin-left: -6px;
}

[dir='rtl'] .theme-option__swatches span + span {
    margin-right: -6px;
    margin-left: 0;
}

@media (max-width: 1399px) {
    .theme-picker__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .theme-picker__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .theme-picker {
        padding: 16px;
    }

    .theme-picker__preview {
        display: none;
    }

    .theme-picker__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar.side-bar,
    #side-bar .app-nav__link,
    #side-bar .app-nav__chevron,
    .shell-icon-button,
    .shell-user-button,
    .shell-primary-action,
    .theme-option__card {
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .overlay {
        display: none !important;
    }
}
