/* Verwaltung — Sidebar-Layout, Bootstrap 5 als Basis */

:root {
    --vw-primary:        #2563eb;
    --vw-primary-hover:  #1d4ed8;
    --sidebar-bg:        #1f2937;
    --sidebar-bg-hover:  #374151;
    --sidebar-fg:        #d1d5db;
    --sidebar-fg-muted:  #9ca3af;
    --sidebar-fg-active: #ffffff;
    --sidebar-width:     280px;
    --topbar-height:     56px;
}

body { background-color: #f6f7f9; }

/* ---- Login-Seite (kein Sidebar) ---- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-main  { width: 100%; }

/* ---- App-Shell mit Sidebar ---- */
.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand a { color: var(--sidebar-fg-active); text-decoration: none; line-height: 1.15; display: block; }
.sidebar-brand .brand-line-1 { display: block; font-size: .95rem; font-weight: 600; letter-spacing: .04em; }
.sidebar-brand .brand-line-2 { display: block; font-size: .8rem;  font-weight: 500; color: var(--sidebar-fg-muted); letter-spacing: .04em; }

.sidebar-logo {
    display: block;
    max-width: 220px;
    max-height: 60px;
    height: auto;
    background: #ffffff;
    padding: 8px 10px;
    border-radius: 6px;
    box-sizing: content-box;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
    display: flex;
    flex-direction: column;
}
.sidebar-nav a, .sidebar-footer a, .sidebar-logout {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1.25rem;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: .92rem;
    border-left: 3px solid transparent;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
    background: transparent;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    text-align: left;
}
.sidebar-nav a:hover, .sidebar-footer a:hover, .sidebar-logout:hover {
    background: var(--sidebar-bg-hover);
    color: var(--sidebar-fg-active);
}
.sidebar-nav a.active, .sidebar-footer a.active {
    background: rgba(37, 99, 235, .15);
    color: var(--sidebar-fg-active);
    border-left-color: var(--vw-primary);
    font-weight: 500;
}
.sidebar-nav a i, .sidebar-footer a i, .sidebar-logout i {
    width: 18px;
    font-size: 1rem;
    text-align: center;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: .5rem 0;
}
.sidebar-logout {
    cursor: pointer;
    font-family: inherit;
}

/* ---- Hauptbereich ---- */
.app-main {
    flex: 1;
    min-width: 0;
}
.app-main .container-fluid { max-width: 1280px; }

/* ---- Topbar (mobile) ---- */
.app-topbar { display: none; }
.app-sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .app-shell { flex-direction: column; }
    .app-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 30px rgba(0,0,0,.25);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-sidebar-backdrop {
        display: block;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0; visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 1030;
    }
    .app-sidebar-backdrop.show { opacity: 1; visibility: visible; }

    .app-topbar {
        display: flex;
        align-items: center;
        gap: .75rem;
        height: var(--topbar-height);
        padding: 0 1rem;
        background: var(--sidebar-bg);
        color: var(--sidebar-fg-active);
        position: sticky; top: 0;
        z-index: 1020;
    }
    .topbar-toggle {
        background: transparent;
        border: 0;
        color: var(--sidebar-fg-active);
        font-size: 1.5rem;
        line-height: 1;
        padding: .25rem .5rem;
        cursor: pointer;
    }
    .topbar-title { font-weight: 600; font-size: .95rem; letter-spacing: .03em; }
    .app-main .container-fluid { padding-left: 1rem; padding-right: 1rem; }
}

/* ---- Karten / Inhalte ---- */
.card { border: 1px solid rgba(0,0,0,.06); }
.card-header {
    background: #fafbfc;
    font-weight: 600;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
}

.table > :not(caption) > * > * { padding: .85rem .75rem; }

.btn-primary {
    background-color: var(--vw-primary);
    border-color: var(--vw-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--vw-primary-hover);
    border-color: var(--vw-primary-hover);
}

/* Druck-Layout für Belege im Browser */
@media print {
    .app-sidebar, .app-topbar, .app-sidebar-backdrop, footer, .no-print { display: none !important; }
    .app-main { margin: 0 !important; padding: 0 !important; }
}
