/* Floating Buttons Panel */
.floating-buttons {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 100;
    transition: all var(--transition-base);
}

.floating-buttons.active {
    right: 400px;
}

/* Floating Button Container */
.floating-button__container {
    display: flex;
    justify-content: flex-start;
    width: 40px;
}

.floating-button__container:hover,
.floating-button__container.active {
    justify-content: flex-end;
}

.floating-button__container:hover .floating-btn__label,
.floating-button__container.active .floating-btn__label {
    opacity: 1;
}

.floating-button__container.active .floating-btn {
    background-color: var(--neutral-800);
}


/* Floating Button */
.floating-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    height: 40px;
    width: auto;
    padding: 0 var(--spacing-md);
    border: none;
    /* border-radius: 4px 0 0 4px; */
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-family-primary);
    font-size: var(--font-body-md-size);
    font-weight: var(--font-weight-medium);
}

/* On the icon's corner: the button's right end, where the label slides in, is off-screen while the rail is collapsed. */
.floating-btn .app-badge--count {
    top: 2px;
    left: calc(var(--spacing-md) + var(--icon-size-lg) - 12px);
    right: auto;
}

.floating-btn .sym {
    flex-shrink: 0;
    font-size: var(--icon-size-lg);
    font-variation-settings: 'FILL' 1;
}

.floating-btn__label {
    opacity: 0;
    transition: opacity var(--transition-fast) 50ms;
}

/* Button Color Variants */
.floating-btn--settings,
.floating-btn--account,
.floating-btn--notifications,
.floating-btn--history,
.floating-btn--client_manager,
.floating-btn--help {
    background-color: var(--neutral-700);
    color: white;
}

.floating-btn--settings:hover,
.floating-btn--account:hover,
.floating-btn--notifications:hover,
.floating-btn--history:hover,
.floating-btn--client_manager:hover,
.floating-btn--help:hover {
    background-color: var(--neutral-600);
}

.floating-btn--briox-ai {
    background-color: var(--accent);
    color: white;
}

.floating-btn--briox-ai:hover {
    background-color: var(--accent-dark);
}

.floating-button__container--briox-ai {
    margin-top: var(--spacing-sm);
}

/* Dark mode overrides */
html[data-theme="dark"] .floating-btn--settings,
html[data-theme="dark"] .floating-btn--account,
html[data-theme="dark"] .floating-btn--notifications,
html[data-theme="dark"] .floating-btn--history,
html[data-theme="dark"] .floating-btn--client_manager,
html[data-theme="dark"] .floating-btn--help {
    background-color: var(--neutral-700);
}

html[data-theme="dark"] .floating-btn--settings:hover,
html[data-theme="dark"] .floating-btn--account:hover,
html[data-theme="dark"] .floating-btn--notifications:hover,
html[data-theme="dark"] .floating-btn--history:hover,
html[data-theme="dark"] .floating-btn--client_manager:hover,
html[data-theme="dark"] .floating-btn--help:hover {
    background-color: var(--neutral-600);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 99;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Right Panel */
.right-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.075);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 101;
    display: flex;
    flex-direction: column;
    border-left: 1.5px solid var(--border-primary);
}

.right-panel.active {
    transform: translateX(0);
}

.right-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
	padding-right:var(--spacing-md) ;
    flex-shrink: 0;
}

/* Same typography as a section heading (.text-body-lg + .font-medium): the panel title reads as
   a section title alongside "Kunder & Detaljer", not as a display heading. */
.right-panel__title {
    font-family: var(--font-family-primary);
    font-size: var(--font-body-lg-size);
    line-height: var(--font-body-lg-line-height);
    letter-spacing: var(--font-body-lg-letter-spacing);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin: 0;
}

.right-panel__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.right-panel__action,
.right-panel__close {
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.right-panel__action:hover,
.right-panel__close:hover {
    background-color: var(--color-hover-bg);
    color: var(--text-primary);
}

.right-panel__action .sym,
.right-panel__close .sym {
    font-size: var(--icon-size-lg);
}

.right-panel__content {
    flex: 1;
    overflow: hidden;
    color: var(--text-primary);
	padding: var(--spacing-xl);
}

.right-panel__content .sidebar_pane {

}

/* Responsive Design */
@media (max-width: 1024px) {
    .right-panel {
        width: 320px;
    }

    .floating-buttons.active {
        right: 320px;
    }
}

@media (max-width: 640px) {
    .floating-buttons {
        display: none;
    }

    .right-panel {
        width: 100%;
    }
}

/* Pane visibility inside the drawer (only the active pane shows) */
.right-panel__content .sidebar_pane {
    display: none;
}

.right-panel__content .sidebar_pane.sidebar_pane_active {
    display: block;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.right-panel__content .sidebar_pane.sidebar_pane_active:hover {
    scrollbar-color: var(--border-tertiary) transparent;
}

/* Webkit scrollbar for sidebar panes */
.right-panel__content .sidebar_pane.sidebar_pane_active::-webkit-scrollbar {
    width: 4px;
}

.right-panel__content .sidebar_pane.sidebar_pane_active::-webkit-scrollbar-track {
    background: transparent;
}

.right-panel__content .sidebar_pane.sidebar_pane_active::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: var(--radius-full, 9999px);
    transition: background 0.3s ease;
}

.right-panel__content .sidebar_pane.sidebar_pane_active:hover::-webkit-scrollbar-thumb {
    background: var(--border-tertiary);
}

.right-panel__content .sidebar_pane.sidebar_pane_active::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

/* --- Profile Block --- */

.profile-block {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    /* border-bottom: 2px solid var(--border-secondary); */
}

.profile-block__avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-primary);
    font-size: var(--font-display-sm-size);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-transform: uppercase;
}

.profile-block__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-block__name,
.profile-block__company,
.profile-block__account {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-block__name {
    color: var(--text-primary);
}

.profile-block__company {
	color: var(--text-secondary);
	top: -4px;
	position: relative;
}

.profile-block__account {
    color: var(--text-tertiary);
}

/* Account pane is a flex column; preserve that when active */
.right-panel__content .sidebar_pane_account.sidebar_pane_active {
    display: flex;
    flex-direction: column;
}

/* Override global fieldset margin for sidebar groups */
.right-panel fieldset.sidebar_group {
    margin: 0;
}

.right-panel .sidebar_group_content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Non-expandable sidebar links: match togglelegend layout with blank icon spacer */
.right-panel .sidebar_pane_subheading.settings_menu_link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-body-md-size);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.right-panel .sidebar_pane_subheading.settings_menu_link::before {
    content: '';
    display: inline-flex;
    width: var(--icon-size-lg);
    flex-shrink: 0;
}

/* Submenu child links: match font face and weight */
.right-panel .sidebar_button.settings_menu_link {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
}

/* Their size is set, not inherited: report pages drop the body to 8pt, which shrank them to 10.7px.
   Scoped to the submenu so the top-level links keep their body-md size. */
.right-panel .settings_menu_submenu .sidebar_button.settings_menu_link {
    font-size: var(--font-body-sm-size);
}

/* Hover states for right panel interactive items */
.right-panel .sidebar_button:hover,
.right-panel .sidebar_pane_subheading:hover {
    color: var(--accent);
}

/* Keyboard focus: match hover style instead of solid accent background */
[data-focus-source='keyboard'] .right-panel .sidebar_button:focus {
    background: transparent;
    color: var(--accent);
}

/* ── Notifications ─────────────────────────────────────────── */

.right-panel .notifications_history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.right-panel .notification_launcher {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.right-panel .notification_launcher:hover {
    background-color: var(--bg-tertiary);
}

.right-panel .notification_button.notification_launcher_button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: var(--font-family-primary);
}

.right-panel .notification_launcher_message {
    display: block;
    font-size: var(--font-body-sm-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: var(--font-body-sm-line-height);
}

.right-panel .notification_launcher_date {
    display: block;
    font-size: var(--font-body-sm-size);
    font-weight: var(--font-weight-semibold);
    color: var(--neutral-400);
    margin-top: var(--spacing-xs);
    opacity: 1;
}

.right-panel .notification_launcher.greyed_out {
    filter: none;
}

.right-panel .notification_launcher.greyed_out .notification_launcher_message {
    color: var(--text-primary);
}

.right-panel .unread_notification_badge {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: var(--radius-full);
    background: var(--accent);
    margin-top: var(--spacing-sm);
}

.right-panel .sidebar_pane_notifications .novus_action_link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: none;
    margin: 0 0 var(--spacing-md) auto;
}
