:root {
    --header-height: 80px;
    --sidebar-width: 250px;
    --primary-color: #2980b9;          /* Dunkleres Blau */
    --secondary-color: #2c3e50;        /* Dunkles Blaugrau */
    --background-color: #ecf0f1;       /* Hellgrauer Hintergrund */
    --header-bg: #34495e;              /* Dunkler Header */
    --card-bg: #fff;                   /* Weiße Cards */
    --text-color: #2c3e50;             /* Dunkle Textfarbe */
    --text-light: #fff;                /* Weiße Textfarbe */
}

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

body {
    font-family: Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

/* Header Navigation Styles */
header nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

.left-nav, .right-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.left-nav {
    flex: 1;
}

.right-nav {
    margin-left: auto;
}

.immobilien-select {
    background: rgba(255,255,255,0.1);
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 0.5rem;
    min-width: 200px;
}

.immobilien-select option {
    background: var(--header-bg);
    color: var(--text-light);
}

.user-info {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.button-logout {
    background: rgba(255,255,255,0.1);
    transition: background-color 0.3s;
}

.button-logout:hover {
    background: rgba(255,255,255,0.2);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.button {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #2980b9;
}

.button-secondary {
    background-color: #95a5a6;
}

.button-secondary:hover {
    background-color: #7f8c8d;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

.table-container {
    overflow-x: auto;
    padding: 1rem;
}

select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}

.content {
    margin-bottom: 100px;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-weight: 600;
    color: #2c3e50;
}

.info-item span {
    color: #555;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-vermietet {
    background-color: #2ecc71;
    color: white;
}

.status-frei {
    background-color: #e74c3c;
    color: white;
}

/* Formular-Sektionen */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Pflichtfeld-Markierung */
label[for]::after {
    content: " *";
    color: #e74c3c;
}

label[for]:not([required])::after {
    content: "";
}

/* Formular-Validierung */
input:invalid,
select:invalid {
    border-color: #e74c3c;
}

input:focus:invalid,
select:focus:invalid {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        padding: 0 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Logout Button Styling */
.logout-button {
    margin-left: auto;
}

.button-logout {
    background-color: #e74c3c;
}

.button-logout:hover {
    background-color: #c0392b;
}

/* User Info Styling */
.user-info {
    margin-left: auto;
    color: white;
    padding: 0.5rem 1rem;
}

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

.logout-button {
    margin-left: 1rem;
}

/* Für mobile Ansicht */
@media (max-width: 768px) {
    .user-info {
        margin-left: 0;
        text-align: center;
    }
    
    .logout-button {
        margin-left: 0;
    }
}

/* Abrechnungs-Status Badges */
.status-erstellt {
    background-color: #f39c12;
}

.status-versendet {
    background-color: #3498db;
}

.status-bezahlt {
    background-color: #2ecc71;
}

.status-offen {
    background-color: #95a5a6;
}

/* Filter Form */
.filter-form {
    margin-bottom: 2rem;
}

.filter-form .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Header Formular Styling */
.header-form {
    margin: 0;
    padding: 0;
}

.immobilien-selector select {
    background-color: white;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    min-width: 200px;
}

/* Dokumente Grid */
.dokumente-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.dokument-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dokument-preview {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.dokument-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dokument-preview i {
    font-size: 4rem;
    color: #6c757d;
}

.dokument-info {
    padding: 1rem;
}

.dokument-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.kategorie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.kategorie-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
}

.kategorie-button.active {
    background: #3498db;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    margin: 40px auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    margin-bottom: 100px;
}

.modal-header {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal .close {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal .close:hover {
    color: #333;
}

.kategorien-liste table {
    margin-bottom: 60px;
}

.kategorie-form {
    margin-bottom: 2rem;
}

textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

/* Dokument Meta Informationen */
.dokument-meta {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kategorie-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
}

.upload-info {
    font-style: italic;
}

/* Responsive Anpassungen */
@media (max-height: 600px) {
    .modal-content {
        margin: 20px auto;
    }
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    margin: 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert i {
    font-size: 1.2rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Document Viewer Modal */
.document-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.document-viewer {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

.document-viewer-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-viewer-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.document-viewer iframe {
    border: none;
    width: 100%;
    height: calc(90vh - 70px);
    border-radius: 0 0 8px 8px;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Login Page Styles */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Abrechnungen Styles */
.abrechnungen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.abrechnung-position {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.position-betrag {
    font-weight: bold;
    color: var(--secondary-color);
}

.summe-box {
    background: var(--secondary-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive Ergänzungen */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .abrechnungen-grid {
        grid-template-columns: 1fr;
    }
}

/* Header Navigation Links */
header nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-light);
}

.header-logo {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo:hover {
    color: var(--text-light);
}

/* Verbesserte Responsive Navigation */
@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    header nav {
        flex-direction: column;
        padding: 1rem 0;
    }

    .left-nav, .right-nav {
        flex-direction: column;
        width: 100%;
    }

    .right-nav {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .immobilien-select {
        width: 100%;
        min-width: unset;
    }
}

/* Buchungskonten Grid */
.buchungskonten-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.grid-header {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-weight: bold;
}

.grid-row {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.grid-row:hover {
    background-color: #f8f9fa;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-error {
    background-color: #dc3545;
    color: white;
}

/* Button Group in Grid */
.grid-row .button-group {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.button-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid-header, .grid-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .grid-header div:nth-child(3),
    .grid-row div:nth-child(3) {
        grid-column: 1 / -1;
    }
}

/* Checkbox Group Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
}

.help-text {
    font-size: 0.875rem;
    color: #666;
    margin-left: 0.5rem;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--header-bg);
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background: rgba(255,255,255,0.1);
} 