﻿/* =========================================================
   Root / Variables
   ========================================================= */
:root {
    --sidebar-width: 280px;
    --sidebar-dock-width: 70px;
    --header-height: 56px;
    /* Pastell Grün / Mint */
    --sidebar-bg-top: #e9f6f1;
    --sidebar-bg-bottom: #dff1ea;
    --sidebar-border: rgba(0,0,0,.06);
    --sidebar-hover: rgba(0,0,0,.04);
    --sidebar-active-bg: rgba(120,200,170,.35);
    --sidebar-active-accent: #6fbfa5;
    /* Text */
    --text-primary: #4f6b63;
    --text-secondary: #4f6b63;
    --text-muted: #7a9a90;
}

/* =========================================================
   App Grid Layout
   ========================================================= */
.app-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    height: 100vh;
    overflow: hidden;
}

/* =========================================================
   Syncfusion AppBar Styling
   ========================================================= */
.e-appbar.app-appbar {
    grid-area: header;
    height: var(--header-height);
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

.e-appbar.app-appbar .e-btn.e-inherit {
    color: var(--text-primary);
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.e-appbar.app-appbar .e-btn.e-inherit i,
.e-appbar.app-appbar .e-btn.e-inherit .fas {
    font-size: 1.1rem;
}

.e-appbar.app-appbar .e-btn.e-inherit .e-icons {
    font-size: 1.4rem;
}

.e-appbar.app-appbar .e-btn.e-inherit:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0d6efd;
}

.e-appbar.app-appbar .e-btn.e-inherit.text-danger {
    color: #dc3545 !important;
}

.e-appbar.app-appbar .e-btn.e-inherit.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333 !important;
}

/* Visually Hidden für Screen Reader */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.header-toggle-btn {
    margin-right: 0.75rem;
}

.header-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-right: auto;
}

.header-user {
    font-size: .9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =========================================================
   Syncfusion Sidebar Styling
   ========================================================= */
.e-sidebar.custom-sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 8px rgba(0,0,0,.08);
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.e-sidebar.custom-sidebar.e-open {
    width: var(--sidebar-width) !important;
}

.e-sidebar.custom-sidebar.e-dock {
    width: var(--sidebar-dock-width) !important;
}

.sidebar-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 70px;
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-logo-full {
    max-height: 40px;
    width: auto;
    transition: opacity 0.2s ease;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--sidebar-active-accent);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

/* =========================================================
   Nav Menu Styling
   ========================================================= */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.nav-menu .nav-link {
    color: var(--text-primary);
    background: transparent;
    border-radius: 10px;
    padding: .75rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu .nav-link i,
.nav-menu .nav-link .fas {
    font-size: 1.2rem;
    color: #4f766b;
    min-width: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.nav-menu .nav-link span {
    font-size: .95rem;
    transition: opacity 0.2s ease;
}

.nav-menu .nav-link:hover {
    background: rgba(255,255,255,.8);
    transform: translateX(2px);
}

.nav-menu .nav-link:hover i,
.nav-menu .nav-link:hover .fas {
    color: #0d6efd;
    transform: scale(1.1);
}

.nav-menu .nav-link.active {
    background: linear-gradient(90deg, rgba(120,200,170,.65), rgba(120,200,170,.35));
    box-shadow: 0 2px 8px rgba(120,200,170,.3);
}

.nav-menu .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--sidebar-active-accent);
}

.nav-menu .nav-link.active i,
.nav-menu .nav-link.active .fas {
    color: var(--text-primary);
}

/* =========================================================
   Docked Menu Styling mit Tooltips
   ========================================================= */
.nav-menu.nav-menu-docked {
    padding: 1rem 0.25rem;
}

.nav-menu.nav-menu-docked .nav-link {
    justify-content: center;
    padding: .75rem .5rem;
}

.nav-menu.nav-menu-docked .nav-link i,
.nav-menu.nav-menu-docked .nav-link .fas {
    margin: 0;
    font-size: 1.3rem;
}

/* Tooltip für gedockte Sidebar */
.nav-menu.nav-menu-docked .nav-link::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1100;
}

.nav-menu.nav-menu-docked .nav-link:hover::after {
    opacity: 1;
}

/* Tooltip Arrow */
.nav-menu.nav-menu-docked .nav-link::before {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.25rem;
    border: 5px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1100;
}

.nav-menu.nav-menu-docked .nav-link:hover::before {
    opacity: 1;
}

.nav-menu.nav-menu-docked .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--sidebar-active-accent);
    border: none;
    margin: 0;
    opacity: 1;
}

/* =========================================================
   Main Content
   ========================================================= */
.app-main {
    grid-area: main;
    min-height: 0;
    overflow-y: auto;
    background-color: #f5f6f8;
    position: relative;
    z-index: 1;
}

.app-content {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

.app-content.fullscreen {
    padding: 0;
}

/* =========================================================
   Mobile / Responsive
   ========================================================= */
@media (max-width: 991.98px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    .header-logo {
        display: block !important;
    }

    .e-sidebar.custom-sidebar {
        position: fixed !important;
        top: var(--header-height);
        height: calc(100vh - var(--header-height)) !important;
    }

    .e-sidebar.custom-sidebar.e-close {
        transform: translateX(-100%);
    }

    /* Tooltips auf Mobile deaktivieren */
    .nav-menu.nav-menu-docked .nav-link::after,
    .nav-menu.nav-menu-docked .nav-link::before {
        display: none;
    }
}

/* =========================================================
   Cards
   ========================================================= */
.card {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    background-color: #ffffff;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
    border-bottom: 1px solid rgba(0,0,0,.06);
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-text {
    color: var(--text-secondary);
}

.card .card .card-header {
    background: linear-gradient(180deg, rgba(120,200,170,.25), rgba(120,200,170,.10));
    color: var(--text-primary);
    font-size: .95rem;
}


