:root {
    --sidebar-width: 250px;
    --navbar-height: 60px;
    --primary-blue: #2b5a91;
    --light-bg: #f4f7f6;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
    --card-radius: 12px;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: var(--light-bg);
}

/* Fixed Top Navbar */
.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-fixed h3 {
    margin: 0;
    font-size: 1.25rem;
    flex-grow: 1;
}

/* Hamburger Toggle Button - Fixed in Navbar */
.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* User Info in Navbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Page Wrapper - padding-top für fixed navbar */
.page-wrapper {
    padding-top: var(--navbar-height);
    height: 100vh;
    box-sizing: border-box;
}

/* Flexbox Layout für Sidebar und Content */
.page {
    display: flex;
    flex-direction: row;
    height: calc(100vh - var(--navbar-height));
    width: 100%;
    position: relative;
}

/* Sidebar - unter der Navbar */
.sidebar {
    background-color: white;
    width: var(--sidebar-width);
    height: 100%;
    padding: 20px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1000;
}

/* Desktop: Sidebar collapsed */
@media (min-width: 768px) {
    .sidebar.collapsed {
        width: 0;
        padding: 0;
        min-width: 0;
    }
}

/* Mobile: Sidebar als Overlay */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        height: calc(100vh - var(--navbar-height));
        z-index: 1045;
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }
}

/* Main Content */
main {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

/* Content Area */
.content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    background: var(--light-bg);
}

/* MudBlazor Main Content - ensure scrolling works */
.mud-main-content {
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 767px) {
    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    .navbar-fixed h3 {
        font-size: 1rem;
    }

    .user-info span {
        display: none;
    }
}

.nav-item {
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: pointer;
}

.nav-item:hover {
    background-color: #e0e0e0;
}

.nav-item.active {
    background-color: var(--primary-blue);
    color: white;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #1f4369;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}


.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    opacity: 0.9;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
    margin: 0;
}

/* Headings */
h1 {
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h2 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table-borderless th,
.table-borderless td {
    border: none;
}

.table th {
    background-color: transparent;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 12px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #e6f2ff;
}

.email-cell {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.action-cell {
    white-space: nowrap;
}

.action-cell .btn {
    margin-right: 8px;
}

.action-cell .btn:last-child {
    margin-right: 0;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: #16a34a;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}
