/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Header ===== */
.main-header {
    background: linear-gradient(135deg, #1a237e, #283593);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1260px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-user {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-right: 8px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
}

.nav-logout {
    border-color: rgba(255,100,100,0.5);
}

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

/* ===== Main Content ===== */
.main-content {
    max-width: 1260px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 130px);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 20px;
}

/* ===== Footer ===== */
.main-footer {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 0.8rem;
    border-top: 1px solid #e0e0e0;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #ccc;
}

.stat-card.stat-ja { border-left-color: #2e7d32; }
.stat-card.stat-teil { border-left-color: #f57f17; }
.stat-card.stat-offen { border-left-color: #9e9e9e; }
.stat-card.stat-total { border-left-color: #333; }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-ja .stat-number { color: #2e7d32; }
.stat-teil .stat-number { color: #f57f17; }
.stat-offen .stat-number { color: #9e9e9e; }
.stat-total .stat-number { color: #333; }

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* ===== Progress Bar ===== */
.progress-section {
    margin-bottom: 20px;
}

.progress-label {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
}

.progress-bar-bg {
    background: #e0e0e0;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #2e7d32, #43a047);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
    min-width: 0;
}

/* ===== Badge Section ===== */
.badge-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.section-badge {
    font-size: 0.8rem;
    font-weight: 400;
    color: #999;
    margin-left: 8px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dozent-badge {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 160px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.dozent-badge:hover {
    border-color: #1a237e;
    box-shadow: 0 2px 8px rgba(26,35,126,0.15);
    transform: translateY(-1px);
}

.dozent-badge.badge-active {
    border-color: #1a237e;
    background: #e8eaf6;
}

.badge-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 6px;
}

.badge-stats {
    font-size: 1.1rem;
    font-weight: 600;
}

.badge-zugewiesen { color: #2e7d32; }
.badge-eingetragen { color: #1565c0; }
.badge-unique { color: #e65100; }
.badge-sep { color: #ccc; margin: 0 2px; }

.badge-legend {
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.badge-scores {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.badge-score {
    font-size: 0.75rem;
    color: #666;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== Filter Bar ===== */
.filter-bar {
    margin-bottom: 16px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    color: #333;
}

.filter-input {
    min-width: 180px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 2px rgba(26,35,126,0.15);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: #1a237e;
    color: white;
}

.btn-primary:hover {
    background: #283593;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #bdbdbd;
}

.btn-danger {
    background: #c62828;
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.btn-assign {
    background: #1565c0;
    color: white;
}

.btn-assign:hover {
    background: #0d47a1;
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    margin-bottom: 16px;
}

.lp-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lp-table thead {
    background: #f5f5f5;
}

.lp-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.lp-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    vertical-align: top;
}

.lp-table tbody tr:hover {
    background: rgba(26,35,126,0.03);
}

.lp-table tbody tr.row-ja {
    background: rgba(46,125,50,0.06);
}

.lp-table tbody tr.row-ja:hover {
    background: rgba(46,125,50,0.1);
}

.col-lp { width: 80px; white-space: nowrap; }
.col-thema { min-width: 200px; }
.col-taxonomie { width: 100px; }
.col-status { width: 90px; }
.col-checkbox { width: 70px; text-align: center; }
.col-interessenten { min-width: 140px; }
.col-zuordnung { min-width: 150px; }

.detail-text {
    color: #888;
    font-size: 0.78rem;
    display: block;
    margin-top: 2px;
}

/* ===== Badges (Taxonomie / Status) ===== */
.taxonomie-badge,
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Status badges */
.status-JA, .status-badge.status-JA { background: #c8e6c9; color: #2e7d32; }
.status-TEIL, .status-badge.status-TEIL { background: #fff9c4; color: #f57f17; }
.status-OFFEN, .status-badge.status-OFFEN { background: #f5f5f5; color: #9e9e9e; }

/* Taxonomie badges */
.tax-WISSEN { background: #fff9c4; color: #f57f17; }
.tax-VERSTEHEN { background: #ffe0b2; color: #e65100; }
.tax-ANWENDEN { background: #ffcdd2; color: #c62828; }

/* Invite status badges */
.status-aktiv { background: #c8e6c9; color: #2e7d32; }
.status-verwendet { background: #e0e0e0; color: #666; }
.status-abgelaufen { background: #ffcdd2; color: #c62828; }

/* Role badges */
.role-DOZENT { background: #e3f2fd; color: #1565c0; }
.role-GL { background: #f3e5f5; color: #6a1b9a; }
.role-ADMIN { background: #fce4ec; color: #c62828; }

/* Selbstarbeit tag */
.tag-selbstarbeit {
    display: inline-block;
    background: #e8eaf6;
    color: #3949ab;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ===== Interessent badges ===== */
.interessent-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    margin: 1px 2px;
}

.no-interesse {
    color: #ccc;
    font-size: 0.8rem;
}

/* Zugewiesen badge */
.zugewiesen-badge {
    display: inline-block;
    background: #c8e6c9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 6px;
}

.zuordnung-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== Checkbox ===== */
.interesse-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a237e;
}

.checkbox-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    z-index: 50;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 150px;
    top: 100%;
    left: 0;
    margin-top: 4px;
}

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

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.83rem;
    color: #333;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #e8eaf6;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
}

/* ===== Block Coverage ===== */
.coverage-section {
    margin-bottom: 20px;
}

.block-coverage-item {
    margin-bottom: 12px;
}

.coverage-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.block-indicator {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
    min-width: 60px;
    text-align: center;
}

.block-1 { background: #1565c0; }
.block-2 { background: #00838f; }
.block-3 { background: #2e7d32; }
.block-4 { background: #e65100; }
.block-5 { background: #6a1b9a; }

.block-fill-1 { background: #1565c0; }
.block-fill-2 { background: #00838f; }
.block-fill-3 { background: #2e7d32; }
.block-fill-4 { background: #e65100; }
.block-fill-5 { background: #6a1b9a; }

.coverage-numbers {
    color: #666;
    flex: 1;
}

.coverage-percent {
    font-weight: 600;
    color: #333;
}

/* ===== Uncovered List ===== */
.uncovered-list {
    max-height: 300px;
    overflow-y: auto;
}

.uncovered-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.83rem;
}

.uncovered-lp {
    font-weight: 600;
    color: #1a237e;
    min-width: 60px;
}

.uncovered-thema {
    flex: 1;
    color: #555;
}

/* ===== Login Page ===== */
.login-body {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-title {
    text-align: center;
    color: #1a237e;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #666;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 28px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26,35,126,0.12);
}

.input-readonly {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #1a237e;
    text-decoration: none;
    font-size: 0.85rem;
}

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

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* ===== Invite Page ===== */
.invite-card {
    margin-bottom: 20px;
}

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

.invite-form .form-group {
    flex: 1;
    min-width: 180px;
}

.form-group-btn {
    flex: 0 0 auto !important;
    min-width: auto !important;
}

.generated-link-card {
    border-left: 4px solid #2e7d32;
}

.link-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: monospace;
    background: #f9f9f9;
}

.link-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

/* ===== Misc ===== */
.result-count {
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 8px;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-select,
    .filter-input {
        width: 100%;
    }

    .badge-row {
        flex-direction: column;
    }

    .dozent-badge {
        min-width: auto;
    }

    .invite-form .form-row {
        flex-direction: column;
    }
}
