:root[data-bs-theme="dark"] {
    --wc-bg-main: #0f172a;
    --wc-bg-card: #1e293b;
    --wc-border: #334155;
    --wc-primary: #0ea5e9;
}

:root[data-bs-theme="light"] {
    --wc-bg-main: #f1f5f9;
    --wc-bg-card: #ffffff;
    --wc-border: #cbd5e1;
    --wc-primary: #0284c7;
}

/* Sidebar bleibt bewusst immer dunkel (Marken-Chrome), unabhängig vom
   Dark-/Light-Toggle des Hauptinhalts – analog zur weclapp-Optik. */
:root {
    --wc-sidebar-bg: #0b1220;
    --wc-sidebar-border: #1e293b;
    --wc-sidebar-text: #94a3b8;
    --wc-sidebar-text-active: #f8fafc;
    --wc-sidebar-width: 240px;
}

body {
    background-color: var(--wc-bg-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--wc-sidebar-width);
    flex-shrink: 0;
    background-color: var(--wc-sidebar-bg);
    border-right: 1px solid var(--wc-sidebar-border);
    display: flex;
    flex-direction: column;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--wc-sidebar-border);
}

.app-sidebar-logo {
    max-width: 100%;
    height: 32px;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.25rem;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--wc-sidebar-text);
    text-decoration: none;
    font-size: 0.925rem;
}

.app-sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--wc-sidebar-text-active);
}

.app-sidebar-link.active {
    background-color: var(--wc-primary);
    color: #ffffff;
    font-weight: 600;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--wc-bg-card);
    border-bottom: 1px solid var(--wc-border);
}

.app-content {
    padding-top: 1.5rem;
}

.widget-card {
    background-color: var(--wc-bg-card);
    border: 1px solid var(--wc-border);
}

.widget-icon {
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.widget-clickable:hover {
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: auto;
    right: 100%;
    margin-top: -0.25rem;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu.show > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-toggle::after {
    transform: rotate(90deg);
}

.border-dashed {
    border-style: dashed !important;
}

.widget-slot[draggable="true"] {
    cursor: grab;
}

.widget-slot.dragging {
    opacity: 0.4;
}

.widget-slot.widget-hidden {
    opacity: 0.45;
}

.widget-slot.widget-hidden .widget-card {
    border-style: dashed;
}

.widget-config-bar {
    cursor: grab;
}

.login-body {
    background-color: var(--wc-bg-main);
}

body.incognito-mode .widget-card {
    filter: blur(6px);
    transition: filter 0.15s ease;
}

body.incognito-mode .widget-card.incognito-reveal {
    filter: none;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background-color: var(--wc-bg-card);
    border-color: var(--wc-border);
}

.login-logo-weclapp {
    height: 32px;
    width: auto;
}

.login-logo-comserro {
    height: 22px;
    width: auto;
}

.app-sidebar-backdrop {
    display: none;
}

/* Ab hier: Sidebar wird auf schmalen Screens (< Bootstrap "lg", 992px) zum
   Off-Canvas-Burgermenü statt permanent Platz vom Hauptinhalt wegzunehmen. */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .app-sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 0 0 32px rgba(0, 0, 0, 0.5);
    }

    .app-sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .app-topbar {
        padding: 0.75rem 1rem;
    }
}

/* Kontierungsvorschläge: einfaches Autocomplete-Dropdown unter dem
   jeweiligen Eingabefeld, ohne externe Library. */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    z-index: 1060;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    max-height: 260px;
    overflow-y: auto;
    background-color: var(--wc-bg-card);
    border: 1px solid var(--wc-border);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    color: inherit;
    font-size: 0.875rem;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--bs-primary-bg-subtle);
}

/* Allgemeine Kontierungshinweise: leichter Leucht-Effekt beim Hover zur
   besseren Fokus-Visualisierung, analog zum Bootstrap-Fokusring. */
.kontierung-hint-tile {
    background-color: var(--wc-bg-card);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.kontierung-hint-tile:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.6);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Mitarbeiter-Simulation: auffällige Leiste oberhalb der Kopfzeile */
.simulation-banner {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    background-color: #ffc107;
    color: #212529;
    border-bottom: 2px solid #b58900;
}

.simulation-toast-container {
    z-index: 1100;
    margin-top: 3rem;
}

.simulation-user-list {
    max-height: 45vh;
    overflow-y: auto;
}
