/*
 * Neutrales Black Dark Mode — Floating Shell, Sidebar-only Chrome
 */

:root,
.dark,
.fi-body,
.fi-panel-admin {
    --bot-bg: #0a0a0a;
    --bot-surface: #111111;
    --bot-elevated: #171717;
    --bot-hover: #1f1f1f;
    --bot-border: rgba(255, 255, 255, 0.08);
    --bot-text: #fafafa;
    --bot-muted: #a3a3a3;
    --bot-float-radius: 1rem;
    --bot-float-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --bot-shell-pad: 0.85rem;
}

.fi-body,
.fi-main-ctn,
.fi-simple-page {
    background: var(--bot-bg) !important;
    color: var(--bot-text);
}

.fi-main,
.fi-page {
    background: transparent !important;
}

/* Topbar aus — nur noch Layout-Toggle auf Mobile */
.fi-topbar {
    display: none !important;
}

.fi-layout-sidebar-toggle-btn-ctn {
    padding: var(--bot-shell-pad) !important;
}

/* ── Floating Layout + Sidebar-Card ── */
@media (min-width: 1024px) {
    .fi-layout {
        gap: var(--bot-shell-pad) !important;
        padding: var(--bot-shell-pad) !important;
        align-items: stretch !important;
        box-sizing: border-box !important;
        min-height: 100dvh !important;
    }

    .fi-sidebar,
    .fi-sidebar.fi-sidebar-open {
        position: sticky !important;
        top: var(--bot-shell-pad) !important;
        height: calc(100dvh - (2 * var(--bot-shell-pad))) !important;
        max-height: calc(100dvh - (2 * var(--bot-shell-pad))) !important;
        border-radius: var(--bot-float-radius) !important;
        border: 1px solid var(--bot-border) !important;
        background: var(--bot-elevated) !important;
        box-shadow: var(--bot-float-shadow) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        --tw-ring-shadow: 0 0 #0000 !important;
    }

    .fi-sidebar-nav {
        background: transparent !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .fi-main {
        padding-inline: 0.35rem 0.5rem !important;
        padding-top: 0.15rem !important;
    }

    .fi-main.fi-width-full {
        max-width: 100% !important;
        padding-inline: 0.5rem 0.75rem !important;
    }

    .fi-page-header-main-ctn {
        padding-inline: 0.15rem !important;
        padding-top: 0.5rem !important;
    }
}

/* Brand oben in der Sidebar */
.fi-sidebar-header-ctn {
    flex-shrink: 0 !important;
}

.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
    justify-content: flex-start !important;
    min-height: 3.5rem !important;
    height: auto !important;
    padding: 0.85rem 1.1rem !important;
    border-bottom: 1px solid var(--bot-border) !important;
}

.fi-sidebar-header-logo-ctn {
    width: 100% !important;
}

.fi-sidebar .fi-logo {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: var(--bot-text) !important;
}

/* Profil unten: Avatar + Name | Logout-Icon — ohne Extra-Fläche/Divider */
.fi-sidebar-footer,
.bot-sidebar-profile {
    flex-shrink: 0 !important;
}

.bot-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.55rem 0.85rem 0.85rem;
    border-top: 0;
    background: transparent;
}

.bot-sidebar-profile-user {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 0.65rem;
}

.bot-sidebar-profile-avatar,
.bot-sidebar-profile .fi-user-avatar,
.bot-sidebar-profile .fi-avatar {
    width: 2rem !important;
    height: 2rem !important;
    flex-shrink: 0 !important;
}

.bot-sidebar-profile-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bot-text);
}

.bot-sidebar-profile-logout-form {
    flex-shrink: 0;
    margin-inline-start: auto;
}

.bot-sidebar-profile-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.5rem;
    padding: 0;
    background: transparent;
    color: #a3a3a3;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
}

.bot-sidebar-profile-logout:hover {
    background: var(--bot-hover);
    color: #fff;
}

.bot-sidebar-profile-logout .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bot-sidebar-profile-logout-icon {
    display: block !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0;
    color: inherit;
    fill: currentColor;
}

/* Mobile: Sidebar Overlay */
@media (max-width: 1023px) {
    .fi-sidebar {
        background: var(--bot-elevated) !important;
        border-inline-end: 1px solid var(--bot-border) !important;
    }

    .fi-main {
        padding-inline: 1rem !important;
    }
}

.fi-sidebar-item-btn:hover {
    background: var(--bot-hover) !important;
}

.fi-sidebar-item-btn.fi-active,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--bot-hover) !important;
}

.fi-section,
.fi-section-content-ctn,
.fi-modal-window {
    background: var(--bot-elevated) !important;
    border-color: var(--bot-border) !important;
}

.fi-input-wrp,
.fi-select-input-wrp,
.fi-ta-ctn,
.fi-fo-textarea {
    background: #222222 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.fi-input-wrp:focus-within,
.fi-select-input-wrp:focus-within {
    border-color: rgba(255, 255, 255, 0.22) !important;
    background: #262626 !important;
}

/* Full-width Add-Button in Floating-Liste */
.tk-float-list-footer {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.55rem 0.65rem 0.7rem !important;
}

.tk-float-add-btn {
    display: inline-flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    min-height: 2.5rem !important;
    padding: 0.55rem 0.85rem !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 0.65rem !important;
    background: #222 !important;
    color: #f5f5f5 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.tk-float-add-btn:hover {
    background: #2c2c2c !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}
