:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-vfl: #0055a5; /* Blau für VfL */
    --accent-wbo: #e67e22; /* Orange für WBO */
    --success-color: #27ae60;
    --danger-color: #c0392b;
    --warning-color: #f1c40f;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --text-color: #333;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Navigation */
.main-nav {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, background 0.3s;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-secondary { background-color: #95a5a6; color: var(--white); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.9rem; }
.btn-lg { padding: 15px 30px; font-size: 1.1rem; }

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 25px;
    border-radius: var(--border-radius);
    color: var(--white);
    box-shadow: var(--shadow);
}

.stat-card.vfl { background-color: var(--accent-vfl); }
.stat-card.wbo { background-color: var(--accent-wbo); }
.stat-card.tasks { background-color: var(--secondary-color); }

.stat-icon { font-size: 3rem; opacity: 0.3; margin-right: 20px; }
.stat-number { font-size: 2rem; font-weight: bold; }
.stat-link { color: var(--white); text-decoration: underline; font-size: 0.9rem; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th { background-color: #f8f9fa; }

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-vfl { background-color: var(--accent-vfl); color: white; }
.badge-wbo { background-color: var(--accent-wbo); color: white; }
.badge-draft { background-color: #bdc3c7; color: white; }
.badge-published { background-color: var(--success-color); color: white; }
.badge-archived { background-color: #7f8c8d; color: white; }
.badge-pending { background-color: var(--warning-color); color: black; }
.badge-completed { background-color: var(--success-color); color: white; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        padding: 20px;
    }
    
    .nav-links.active { display: flex; }
    .nav-toggle { display: block; }
    
    .grid-2 { grid-template-columns: 1fr; }
    
    .responsive-table thead { display: none; }
    .responsive-table tr { display: block; margin-bottom: 15px; border: 1px solid #ddd; }
    .responsive-table td { display: block; text-align: right; padding-left: 50%; position: relative; }
    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }
}

/* =============================================
   UTILITIES
   ============================================= */

.text-center  { text-align: center; }
.text-danger  { color: var(--danger-color); }
.text-muted   { color: #888; font-size: 0.85rem; }
.font-bold    { font-weight: bold; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-3  { padding: 16px; }

.card-body { padding: 16px; }

/* =============================================
   ALERTS
   ============================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-weight: 500;
    transition: opacity 0.5s;
}
.alert-danger  { background: #fde8e8; color: var(--danger-color); border-left: 4px solid var(--danger-color); }
.alert-success { background: #e8f8ee; color: var(--success-color); border-left: 4px solid var(--success-color); }

/* =============================================
   PAGE HEADER
   ============================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.6rem;
    color: var(--primary-color);
}

/* =============================================
   DASHBOARD
   ============================================= */

.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

.dashboard-section {}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.stat-info {}
.stat-info h3 { font-size: 0.9rem; opacity: 0.85; margin-bottom: 4px; }

/* =============================================
   NAVIGATION — Ergänzungen
   ============================================= */

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 0.9rem;
}

.logout-btn {
    color: var(--white) !important;
    opacity: 0.7;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}
.logout-btn:hover { opacity: 1 !important; }

/* =============================================
   BUTTONS — Ergänzungen
   ============================================= */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: var(--primary-color);
    background: var(--light-bg);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-icon:hover { background: var(--primary-color); color: var(--white); }
.btn-icon.text-danger { color: var(--danger-color); }
.btn-icon.text-danger:hover { background: var(--danger-color); color: var(--white); }

.actions { display: flex; gap: 6px; }

/* =============================================
   FILTER BAR & TABS
   ============================================= */

.filter-bar { margin-bottom: 20px; }

.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group { flex: 1; min-width: 160px; }
.filter-group input,
.filter-group select { margin: 0; }

.filter-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 8px 18px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px 4px 0 0;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.2s;
}

.tab:hover { background: #eee; }

.tab.active {
    background: var(--white);
    border-color: #ddd #ddd var(--white);
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: -2px;
    border-bottom: 2px solid var(--white);
}

/* =============================================
   TASKS
   ============================================= */

.task-list { list-style: none; padding: 0; }

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.task-status { font-size: 1.1rem; color: #bbb; padding-top: 2px; }

.task-details { flex: 1; }

.task-title { display: block; font-weight: 600; }

.task-meta {
    display: block;
    font-size: 0.82rem;
    color: #888;
    margin-top: 2px;
}

.task-row td { vertical-align: middle; }

.task-row.completed td { opacity: 0.55; text-decoration: line-through; }
.task-row.completed .task-check { accent-color: var(--success-color); }

.task-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--success-color); }

/* =============================================
   PROTOKOLL-FORMULAR / EDITOR
   ============================================= */

.protocol-form .card-body { padding: 20px; }

.editor-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    padding: 6px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.editor-toolbar button {
    padding: 4px 10px;
    border: 1px solid #ccc;
    background: var(--white);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.editor-toolbar button:hover { background: #e0e0e0; }

.rich-editor {
    border-radius: 0 0 4px 4px !important;
    font-family: monospace;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px 20px;
}

/* =============================================
   LOGIN
   ============================================= */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

/* =============================================
   MODAL
   ============================================= */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 28px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content h2 { margin-bottom: 16px; }

/* =============================================
   PAGINATION
   ============================================= */

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid #ddd;
    font-weight: 500;
    transition: background 0.2s;
}

.pagination a:hover { background: var(--light-bg); }
.pagination a.active { background: var(--primary-color); color: var(--white); border-color: var(--primary-color); }

/* =============================================
   PROTOKOLL-ANSICHT
   ============================================= */

.protocol-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--light-bg);
}

.protocol-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.protocol-logo {
    height: 80px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    flex-shrink: 0;
}

.protocol-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.protocol-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.protocol-section h3 i {
    margin-right: 6px;
}

.content-box {
    background: var(--light-bg);
    border-radius: 4px;
    padding: 14px 16px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.content-box.highlight {
    background: #fff9e6;
    border-left: 4px solid var(--warning-color);
}

.content-box.rich-content {
    white-space: normal;
}

.protocol-footer {
    margin-top: 24px;
    font-size: 0.85rem;
    color: #888;
}

.view-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.view-actions .right-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.upload-list {
    list-style: none;
    padding: 0;
}

.upload-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.upload-list a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-list a:hover {
    text-decoration: underline;
}

/* =============================================
   PRINT — Professionelles Protokolldokument
   ============================================= */
@media print {
    /* Alles ausblenden was nicht gedruckt werden soll */
    .no-print,
    .main-nav,
    .main-footer,
    .btn,
    .filter-bar,
    .view-actions,
    .upload-form,
    .pagination { display: none !important; }

    /* Seite */
    @page {
        size: A4 portrait;
        margin: 20mm 18mm 22mm 18mm;
    }

    html, body {
        background: white !important;
        font-size: 11pt;
        line-height: 1.5;
        color: #000;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    main.container {
        padding: 0 !important;
    }

    /* Karte ohne Schatten */
    .card, .protocol-view {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Protokoll-Header: Org-Name links, Logo rechts */
    .protocol-header-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 10px !important;
    }

    .protocol-logo {
        height: 60px !important;
        max-width: 140px !important;
        object-fit: contain !important;
    }

    .org-badge {
        font-size: 10pt;
        padding: 3px 8px;
        border-radius: 3px;
        font-weight: bold;
    }

    .org-badge.vfl { background-color: var(--accent-vfl) !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .org-badge.wbo { background-color: var(--accent-wbo) !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Titel */
    .protocol-view h1 {
        font-size: 18pt;
        margin: 8px 0 6px;
        border-bottom: 2px solid #000;
        padding-bottom: 6px;
    }

    /* Meta-Zeile */
    .protocol-meta-top {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        font-size: 9.5pt;
        color: #444;
        margin-bottom: 14px;
    }

    /* Abschnitte */
    .protocol-section {
        margin-bottom: 14px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #ccc !important;
        page-break-inside: avoid;
    }

    .protocol-section h3 {
        font-size: 10pt !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        color: #333 !important;
        margin-bottom: 6px !important;
        border-bottom: 1px solid #ddd;
        padding-bottom: 3px;
    }

    .content-box {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
        padding: 8px 10px !important;
        font-size: 10.5pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .content-box.highlight {
        background: #fffbe8 !important;
        border-left: 3px solid #e6a817 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Tabellen */
    .table th {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .table th, .table td {
        padding: 6px 8px !important;
        font-size: 10pt !important;
    }

    /* Grid */
    .grid-2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }

    /* Footer */
    .protocol-footer {
        margin-top: 16px;
        font-size: 8pt;
        color: #666;
        border-top: 1px solid #ccc;
        padding-top: 8px;
    }

    /* Seitenzahl */
    .protocol-view::after {
        content: "";
        display: block;
    }
}
