﻿/* =========================================================
   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;
    
    /* Buttons & Inputs - Abgeleitet von Sidebar-Farben */
    --primary-color: #6fbfa5;
    --primary-hover: #5fa895;
    --primary-active: #4f9885;
    --primary-light: rgba(120,200,170,.15);
    
    /* Feedback Colors */
    --success-color: #6fbfa5;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #ffc107;
    --info-color: #0d6efd;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f5f6f8;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4f566b;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07);
    --shadow-lg: 0 6px 20px rgba(0,0,0,.06);
    --shadow-xl: 0 20px 25px rgba(0,0,0,.1);
    
    /* Z-Index */
    --z-dropdown: 1000;
    --z-sidebar: 1000;
    --z-header: 1001;
    --z-modal: 1050;
    --z-tooltip: 1100;
}

/* =========================================================
   FontAwesome Icon Support - CRITICAL FIX
   ========================================================= */

/* Ensure FontAwesome icons are visible in all contexts */
i.fas,
i.far,
i.fab,
i.fa {
    display: inline-block !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

/* Icons in buttons */
.e-btn i,
btn i,
button i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Icon spacing */
i + span,
i + .visually-hidden {
    margin-left: 0.35rem;
}

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

/* =========================================================
   App Grid Layout
   ========================================================= */
.app-layout {
    display: grid;
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Desktop: Fixed sidebar layout */
@media (min-width: 992px) {
    .app-layout {
        grid-template-columns: 280px 1fr;
        grid-template-areas:
            "sidebar header"
            "sidebar main";
    }
}

/* Mobile: Overlay sidebar layout */
@media (max-width: 991.98px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }
}

/* =========================================================
   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;
}

/* Desktop: Fixed sidebar, always visible */
@media (min-width: 992px) {
    .e-sidebar.custom-sidebar {
        position: relative !important;
        width: 280px !important;
        height: 100% !important;
        transform: none !important;
        visibility: visible !important;
    }
    
    /* No overlay on desktop */
    .e-sidebar-overlay {
        display: none !important;
    }
}

/* Mobile: Overlay sidebar */
@media (max-width: 991.98px) {
    .e-sidebar.custom-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh !important;
        width: 280px !important;
        transition: transform 0.3s ease;
    }
    
    .e-sidebar.custom-sidebar.e-close {
        transform: translateX(-100%);
    }
    
    .e-sidebar.custom-sidebar.e-open {
        transform: translateX(0);
    }
}

.sidebar-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 80px;
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-logo-full {
    max-width: 180px;
    height: auto;
    display: block;
}

.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);
}

/* =========================================================
   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) {
    .header-logo {
        display: block !important;
    }
}

/* =========================================================
   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;
}


