/* Lesson-Plans-Übersicht — an demo-router.cfm angeglichen */

.lp-home-shell {
    --lp-tone-bio: #3d9b53;
    --lp-tone-chem: #2f79c7;
    --lp-tone-lang: #e0922a;
    --lp-tone-phys: #7b61c9;
    --lp-tone-geo: #2f9a9a;
    --lp-tone-tech: #5c6bc0;
    --lp-tone-default: #64748b;
}

.lp-home-layout {
    grid-template-columns: minmax(260px, var(--scilmi-menu-width, 320px)) minmax(0, 1fr);
}

.lp-home-layout .scilmi-router-menu {
    max-height: calc(100vh - 140px);
}

.lp-home-layout .scilmi-menu-resizer {
    pointer-events: none;
    cursor: default;
}

.lp-home-layout .scilmi-menu-panel {
    padding-bottom: 1rem;
}

.lp-filter-block {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.lp-filter-collapsible:last-of-type {
    border-bottom: 0;
}

.lp-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.lp-filter-toggle:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.lp-filter-toggle-label {
    flex: 1;
    min-width: 0;
}

.lp-filter-collapsible[data-filter-group="source"] .lp-filter-toggle,
.lp-filter-collapsible[data-filter-group="uploadReady"] .lp-filter-toggle {
    color: #6b7280;
    font-weight: 500;
}

.lp-filter-toggle-icon {
    flex: none;
    width: 1rem;
    color: #64748b;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.lp-filter-toggle-icon::before {
    content: "+";
}

.lp-filter-collapsible--expanded .lp-filter-toggle-icon::before {
    content: "\2212";
}

.lp-filter-panel {
    margin-top: 0.45rem;
}

.lp-filter-panel[hidden] {
    display: none !important;
}

.lp-filter-options {
    display: flex;
    flex-direction: column;
}

.lp-filter-block:last-of-type {
    border-bottom: 0;
}

.lp-filter-block .scilmi-language-label {
    margin-bottom: 0.45rem;
}

.lp-filter-option {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    margin: 0.28rem 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #334155;
    cursor: pointer;
}

.lp-filter-option input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.lp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
}

.lp-chip-row .lp-filter-option {
    align-items: center;
    margin: 0;
    white-space: nowrap;
}

.lp-filter-select {
    width: 100%;
    font-size: 0.9rem;
}

.lp-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.lp-home-shell .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #005575;
    --bs-btn-border-color: #005575;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #eb9929;
    --bs-btn-hover-border-color: #eb9929;
    --bs-btn-focus-shadow-rgb: 235, 153, 41;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #d48924;
    --bs-btn-active-border-color: #d48924;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #94a3b8;
    --bs-btn-disabled-border-color: #94a3b8;
}

/* Top filter bar (?filtertop=1) */
.lp-home-layout--filtertop {
    grid-template-columns: minmax(0, 1fr);
}

.lp-filtertop-mode .scilmi-router-content {
    max-height: none;
    overflow: visible;
}

.lp-filtertop-mode .lp-filter-top-wrap {
    position: sticky;
    top: 0;
    z-index: 40;
    margin-bottom: 1rem;
    padding: 0.5rem 0 0.75rem;
    background: var(--bs-light, #f8f9fa);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.lp-filtertop-mode .lp-filter-top-item.is-open {
    z-index: 41;
}

.lp-filtertop-mode .lp-filter-top-panel {
    z-index: 42;
}

.lp-filter-top-wrap {
    margin-bottom: 1rem;
}

.lp-filter-top-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.lp-filter-top-item {
    position: relative;
    margin: 0;
    padding: 0;
    border: 0;
}

.lp-filter-top-control {
    display: flex;
    align-items: stretch;
    min-height: 2.35rem;
    border-radius: 0;
    overflow: hidden;
}

.lp-filter-top-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid #c5d4e3;
    border-radius: 0;
    background: #e4ebf1;
    color: #556790;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.lp-filter-top-item.is-active .lp-filter-top-trigger,
.lp-filter-top-item.is-open .lp-filter-top-trigger {
    border-right: 0;
}

.lp-filter-top-trigger-text {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lp-filter-top-trigger-label {
    flex: none;
}

.lp-filter-top-item[data-filter-group="source"] .lp-filter-top-trigger-label,
.lp-filter-top-item[data-filter-group="uploadReady"] .lp-filter-top-trigger-label {
    color: #6b7280;
    font-weight: 500;
}

.lp-filter-top-item[data-filter-group="source"] .lp-filter-top-panel-title,
.lp-filter-top-item[data-filter-group="uploadReady"] .lp-filter-top-panel-title {
    color: #6b7280;
}

.lp-filter-top-trigger-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.lp-filter-top-chevron {
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
    position: relative;
}

.lp-filter-top-chevron::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -65%) rotate(45deg);
}

.lp-filter-top-item.is-open .lp-filter-top-chevron::before {
    transform: translate(-50%, -35%) rotate(-135deg);
}

.lp-filter-top-clear {
    flex: none;
    width: 2.35rem;
    margin: 0;
    padding: 0;
    border: 1px solid #c5d4e3;
    border-left: 0;
    border-radius: 0;
    background: #d7e2ed;
    color: #556790;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.lp-filter-top-clear[hidden] {
    display: none;
}

.lp-filter-top-clear:hover,
.lp-filter-top-trigger:hover {
    filter: brightness(0.97);
}

.lp-filter-top-item.is-active .lp-filter-top-trigger,
.lp-filter-top-item.is-open .lp-filter-top-trigger {
    background: #556790;
    border-color: #556790;
    color: #fff;
}

.lp-filter-top-item.is-active .lp-filter-top-clear,
.lp-filter-top-item.is-open .lp-filter-top-clear {
    background: #465a78;
    border-color: #465a78;
    color: #fff;
}

.lp-filter-top-trigger:focus-visible,
.lp-filter-top-clear:focus-visible,
.lp-filter-top-panel-close:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.lp-filter-top-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 30;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(24rem, calc(100vh - 12rem));
    display: flex;
    flex-direction: column;
    border: 1px solid #c5d4e3;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.lp-filter-top-panel[hidden] {
    display: none !important;
}

.lp-filter-top-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.lp-filter-top-panel-title {
    font-size: 0.92rem;
    color: #334155;
}

.lp-filter-top-panel-close {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.lp-filter-top-panel-body {
    padding: 0.65rem 0.75rem;
    overflow: auto;
}

.lp-filter-option-search {
    margin-bottom: 0.55rem;
}

.lp-filter-option-search-input {
    width: 100%;
    font-size: 0.88rem;
    border-radius: 0;
}

.lp-chip-row--searchable {
    max-height: 14rem;
    overflow: auto;
}

.lp-filter-option.is-filter-hidden {
    display: none !important;
}

.lp-filter-top-panel-foot {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.lp-filter-top-panel-foot .btn {
    width: 100%;
    border-radius: 0;
}

.lp-filter-top-actions {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.lp-filter-top-actions .btn {
    border-radius: 0;
}

.lp-search-block {
    margin-bottom: 0.85rem;
}

.lp-search-box {
    position: relative;
}

.lp-search-box input {
    width: 100%;
    font-size: 0.9rem;
    padding-right: 2rem;
    border-radius: 0;
}

.lp-search-icon {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8b8;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.95rem;
    height: 0.95rem;
    line-height: 1;
}

.lp-search-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.lp-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 1.5rem;
    row-gap: 0.75rem;
    margin-bottom: 1rem;
}

.lp-count {
    grid-column: 1;
    min-width: 0;
    font-size: 0.95rem;
    color: #334155;
    font-weight: 600;
}

.lp-toolbar-right {
    display: contents;
}

.lp-sort {
    grid-column: 2;
    justify-self: end;
    flex-shrink: 0;
}

.lp-sort label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.lp-sort label span {
    white-space: nowrap;
}

.lp-sort select {
    font-size: 0.9rem;
    width: 10.5rem;
    max-width: 10.5rem;
    flex-shrink: 0;
}

.lp-legend {
    grid-column: 3;
    justify-self: end;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.35rem 0.75rem;
    flex-shrink: 0;
}

.lp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.2;
    color: #64748b;
    white-space: nowrap;
}

.lp-legend-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.lp-legend-bio { background: var(--lp-tone-bio); }
.lp-legend-chem { background: var(--lp-tone-chem); }
.lp-legend-lang { background: var(--lp-tone-lang); }
.lp-legend-phys { background: var(--lp-tone-phys); }
.lp-legend-geo { background: var(--lp-tone-geo); }
.lp-legend-tech { background: var(--lp-tone-tech); }
.lp-legend-default { background: var(--lp-tone-default); }

.lp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.lp-card {
    --lp-card-strip-segments: 1;
    display: block;
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 0.95rem 2.2rem calc(var(--lp-card-strip-segments) * 5px + 0.85rem);
    min-height: 150px;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: box-shadow 120ms ease, transform 120ms ease;
    overflow: hidden;
}

.lp-card--subject-count-2 { --lp-card-strip-segments: 2; }
.lp-card--subject-count-3 { --lp-card-strip-segments: 3; }
.lp-card--subject-count-4 { --lp-card-strip-segments: 4; }
.lp-card--subject-count-5 { --lp-card-strip-segments: 5; }
.lp-card--subject-count-6 { --lp-card-strip-segments: 6; }

.lp-card-subject-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    z-index: 1;
}

.lp-card-subject-segment {
    flex: 0 0 5px;
    width: 5px;
    min-height: 100%;
}

.lp-segment-bio { background: var(--lp-tone-bio); }
.lp-segment-chem { background: var(--lp-tone-chem); }
.lp-segment-lang { background: var(--lp-tone-lang); }
.lp-segment-phys { background: var(--lp-tone-phys); }
.lp-segment-geo { background: var(--lp-tone-geo); }
.lp-segment-tech { background: var(--lp-tone-tech); }
.lp-segment-default { background: var(--lp-tone-default); }

.lp-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.lp-card-link:hover {
    color: inherit;
}

.lp-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.lp-card.is-hidden {
    display: none;
}

.lp-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
}

.lp-card-seq {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-card-pos {
    flex-shrink: 0;
    opacity: 0.85;
}

.lp-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
}

.lp-card-desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lp-card.is-expanded {
    min-height: auto;
}

.lp-card.is-expanded .lp-card-desc {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.lp-card-more {
    position: absolute;
    right: 0.75rem;
    bottom: 0.55rem;
    width: 1.45rem;
    height: 1.45rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.lp-card-more:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.lp-card-more:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.lp-card-footer {
    position: absolute;
    left: calc(var(--lp-card-strip-segments) * 5px + 0.85rem);
    bottom: 0.6rem;
    display: flex;
    justify-content: flex-start;
}

.lp-card-lp-link {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #64748b;
    text-decoration: none;
}

.lp-card-lp-link:hover {
    color: #6d28d9;
    text-decoration: underline;
}

.lp-tone-bio .lp-card-title { color: var(--lp-tone-bio); }
.lp-tone-chem .lp-card-title { color: var(--lp-tone-chem); }
.lp-tone-lang .lp-card-title { color: var(--lp-tone-lang); }
.lp-tone-phys .lp-card-title { color: var(--lp-tone-phys); }
.lp-tone-geo .lp-card-title { color: var(--lp-tone-geo); }
.lp-tone-tech .lp-card-title { color: var(--lp-tone-tech); }
.lp-tone-default .lp-card-title { color: var(--lp-tone-default); }

.lp-card--multi-subject .lp-card-title {
    color: #005575;
}

.lp-empty {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

.lp-empty.is-hidden {
    display: none;
}

/* Detailansicht (?plan=…) */

/* Buttons & Dropdowns: eckig */
.lp-home-shell .btn,
.lp-detail-page .btn,
.lp-home-shell .form-select,
.lp-detail-page .form-select,
.lp-detail-page .lp-detail-select-label select,
.lp-home-shell .lp-card-more,
.lp-home-shell .lp-search-box input,
.lp-home-shell .lp-activity-collapsible-toggle,
.lp-detail-page .lp-activity-collapsible-toggle {
    border-radius: 0 !important;
}

.lp-detail-page {
    font-family: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, Oxygen, sans-serif;
    color: #1e293b;
}

.lp-detail-shell {
    max-width: 1650px;
}

.lp-detail-nav {
    margin-bottom: 1rem;
    padding: 1rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.lp-detail-nav-inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.lp-detail-nav-left,
.lp-detail-nav-right {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    min-width: 0;
}

.lp-detail-nav-left {
    flex: 1 1 auto;
    overflow: hidden;
}

.lp-detail-nav-right {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.lp-detail-nav-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: 25px;
    flex-shrink: 0;
}

.lp-detail-select-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.lp-detail-select-label > span {
    white-space: nowrap;
    flex-shrink: 0;
}

.lp-detail-select-label select {
    min-width: 0;
    width: clamp(8rem, 16vw, 18rem);
    max-width: 100%;
    flex: 1 1 auto;
}

.lp-detail-nav-right .lp-detail-print-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.lp-detail-counter {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.lp-detail-nav a.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.lp-detail-shell > article {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

.lp-detail-shell .cSXAT {
    font-family: inherit;
    color: #1e293b;
}

@media (max-width: 1100px) {
    .lp-filter-top-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 900px) {
    .lp-toolbar {
        grid-template-columns: 1fr;
    }

    .lp-count,
    .lp-sort,
    .lp-legend {
        grid-column: 1;
        justify-self: start;
    }

    .lp-legend {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .lp-home-layout {
        grid-template-columns: 1fr;
    }

    .lp-home-layout .scilmi-router-menu {
        max-height: none;
        position: static;
    }

    .lp-filter-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 520px) {
    .lp-filter-top-grid {
        grid-template-columns: 1fr;
    }
}

.lp-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.lp-language-switch {
    display: flex;
    align-items: center;
    margin: 0;
}

.lp-language-select {
    min-width: 8.5rem;
    max-width: 100%;
}

.lp-detail-nav-actions .lp-language-select {
    min-width: 7rem;
    width: auto;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .lp-detail-nav-inner {
        flex-wrap: wrap;
    }

    .lp-detail-nav-left,
    .lp-detail-nav-right {
        flex: 1 1 100%;
    }

    .lp-detail-nav-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .lp-detail-nav-actions {
        margin-left: 0;
    }

    .lp-detail-select-label select {
        width: clamp(8rem, 40vw, 100%);
    }
}
