:root {
    /* Ensure theme variables are preserved -> Prüfen, ob wirklich gebraucht */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.app-logo i {
    font-size: 2rem;
}

.app-user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.app-content-wrapper {
    display: flex;
    flex: 1;
}

.app-sidebar {
    width: 250px;
    background: var(--surface-100);
    border-right: 1px solid var(--surface-300);
    padding: 1rem 0;
}

.menu-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: var(--text-color);
}

.menu-item:hover {
    background: var(--surface-200);
}

.menu-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid var(--primary-dark-color);
}

.menu-item i {
    font-size: 1.25rem;
    width: 1.5rem;
}

.app-main-content {
    flex: 1;
    padding: 2rem;
    background: var(--surface-50);
    overflow-y: auto;
}

.app-footer {
    background: var(--surface-100);
    border-top: 1px solid var(--surface-300);
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    margin-top: 0.5rem;
}

.content-section {
    background: white;
    border-radius: 6px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.content-section h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-sidebar {
        width: 200px;
    }

    .app-topbar {
        padding: 1rem;
    }

    .app-main-content {
        padding: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.p-datatable .even-row {
    background-color: var(--surface-50);
}

.p-datatable .odd-row {
    background-color: white;
}

.p-rowexpansion > td {
    padding: 1.5rem !important;
    background-color: var(--surface-100);
}

.ui-editable-column .p-cell-editor-input {
    width: 100%;
}

/* Better focus states for editable cells */
.ui-editable-column:hover {
    background-color: var(--primary-50) !important;
}

/*Logo*/
.app-logo-image {
    height: 40px;
    width: auto;
    margin-right: 12px;
    vertical-align: middle;
}

/* For high-DPI screens */
@media (-webkit-mi-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .app-logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-logo-image {
        height: 32px;
    }

    .app-logo span {
        display: none; /* Hide app name on mobile if needed */
    }
}

/*Migrated css*/

/* DataTable auto-sizing columns */
.p-datatable table {
    table-layout: auto !important;
}

/* SelectOneMenu dropdown height limit (if still needed) */
.p-selectonemenu-panel {
    max-height: 400px !important; /* Use fixed pixel value instead of percentage */
}

/* Ensure dropdown items are scrollable (usually not needed) */
.p-selectonemenu-items-wrapper {
    max-height: 100%;
    overflow-y: auto;
}

/*noBorders not used until now*/
/* Utility class to remove borders and backgrounds from tables */
.noBorders tr,
.noBorders td,
.noBorders th {
    background: none !important;
    border: none !important;
}

/* Optional: Also target PrimeFaces 10 specific elements */
.noBorders .p-datatable-tbody > tr,
.noBorders .p-datatable-tbody > tr > td {
    background: none !important;
    border: none !important;
}

/*Login view*/
.login-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

/* Menu items auto width based on content*/
.ui-menubar .ui-menu-child {
    width: max-content !important;
    min-width: 200px;
    max-width: 500px; /* Prevent extremely wide menus */
}

.ui-menubar .ui-menuitem {
    white-space: nowrap;
}

/* Style the entire cell based on grade */
/*.p-datatable td.grade-excellent {
    background-color: #c8e6c9 !important;  Light green 
}*/

.ui-datatable .cell-highlightable {
    display: block;
    margin: -0.571rem 0rem;
    padding: 0.571rem 0rem;
}

.ui-datatable .cell-highlightable.grade-pending {
    /*background-color: var(--yellow-100) !important;*/
    background-color: #ffe0b2 !important;
}

.ui-datatable .cell-highlightable.grade-poor {
    color: red !important;
}

.ui-datatable .cell-readonly {
    cursor: not-allowed;
    filter: grayscale(40%) brightness(95%);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.03) 10px,
        rgba(0, 0, 0, 0.03) 20px
        );
}

.ui-datatable .cell-editable {
    cursor: pointer;
}

.ui-datatable .cell-editable:hover {
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.report-notes-panel {
    height: 700px;
}

.grades-column {
    text-align: center; 
    min-width: 5rem;
}