/* ==========================================================================
   Admin-Backend: zentrale Styles
   Bootstrap 5.3 wird per CDN geladen; hier stehen nur die Anpassungen.
   Dark Mode laeuft ueber das Attribut [data-bs-theme="dark"] am <html>.
   ========================================================================== */

:root { --sidebar-width: 260px; }

body { background-color: var(--bs-body-bg); color: var(--bs-body-color); }

/* --------------------------------------------------------------------------
   Sidebar (links, fix)
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: #cbd5e1;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: .3px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand a { color: #fff; text-decoration: none; }

.sidebar-nav { padding: 1rem .75rem; flex: 1 1 auto; overflow-y: auto; }
.sidebar-nav .nav-link {
    color: #cbd5e1;
    border-radius: .5rem;
    padding: .6rem .85rem;
    margin-bottom: .25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav .nav-link.active { background: #2563eb; color: #fff; }
.sidebar-nav .nav-link .dot {
    width: .5rem; height: .5rem; border-radius: 50%;
    background: currentColor; opacity: .55; flex: 0 0 auto;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-user { margin-bottom: .75rem; line-height: 1.2; }
.sidebar-user .name { color: #fff; font-weight: 600; font-size: .95rem; }
.sidebar-user a.name { display: inline-block; text-decoration: none; }
.sidebar-user a.name:hover { text-decoration: underline; }
.sidebar-user .role { color: #94a3b8; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }

/* --------------------------------------------------------------------------
   Inhalt
   -------------------------------------------------------------------------- */
.app-content { margin-left: var(--sidebar-width); min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1035;
    display: none;
}

/* --------------------------------------------------------------------------
   Login / nicht angemeldet
   -------------------------------------------------------------------------- */
.login-content { min-height: 100vh; display: flex; align-items: center; }

.table td, .table th { vertical-align: middle; }
.table > thead th {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}
.badge-type { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* --------------------------------------------------------------------------
   Hell/Dunkel-Umschalter
   -------------------------------------------------------------------------- */
.theme-toggle-floating {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}
.theme-icon-dark { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-dark { display: inline; }

/* --------------------------------------------------------------------------
   Responsiv: Sidebar als Off-Canvas unterhalb von lg
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-content { margin-left: 0; }
}
