.data-table {
    max-height: 500px;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1;
}

.editable-cell {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1px 3px;
    min-width: 80px;
    font-size: 11px;
    height: 20px;
    line-height: 1;
    margin: 0;
}

.editable-cell:focus {
    background: #fff;
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, .25);
}

.table-compact {
    margin-bottom: 0;
    border-collapse: collapse;
}

.table-compact th,
.table-compact td {
    min-width: 120px;
    white-space: nowrap;
    padding: 1px 4px;
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
    margin: 0;
    border-width: 1px;
}

.table-compact tbody tr {
    height: 22px;
}

.table-compact th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: 24px;
    padding: 2px 4px;
}

.table-compact tbody tr td {
    border-top-width: 0px;
}

.table-compact tbody tr:first-child td {
    border-top-width: 1px;
}

.table-compact input.editable-cell {
    box-sizing: border-box;
    width: 100%;
    height: 18px;
    padding: 0px 2px;
    margin: 0;
    border-radius: 0px;
    background-color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
}

.table.table-compact thead th {
    font-size: 1.0rem;
    font-family: var(--bs-body-font-family);
    background-color: #ff8383 !important;
    text-transform: none !important;
    letter-spacing: normal;
}

.table.table-compact thead {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.resizable-table th,
.resizable-table td {
    min-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.col-resize-handle:hover {
    background: rgba(0, 0, 0, .06);
}

.warning-item {
    cursor: pointer;
    padding: 12px;
    margin: 8px 0;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.warning-item:hover {
    background: #ffeaa7;
    transform: translateY(-1px);
}

.plot-container {
    margin: 20px 0;
    border: 0px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.plot-container-group {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.schema-mapping {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.mapping-card {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 1rem;
    background: #f8f9fa;
}

.unit-info {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.detected-unit {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
}

.progress-step {
    padding: 0px;
    margin: 0px 0;
    background: #f8f9fa;
    border-radius: 4px;
}

.progress-step.completed {
    background: #fff;
}

.table-container {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.upload-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .05);
    overflow: hidden;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-light);
}

.upload-body {
    padding: 1rem;
}

.upload-subtitle {
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: .75rem;
}

.file-upload-area {
    border: 1px dashed var(--bs-border-color);
    border-radius: .5rem;
    background: var(--bs-body-bg);
    padding: 1.25rem;
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle, rgba(13, 110, 253, .05));
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .08);
}

.file-upload-area i {
    font-size: 1.5rem;
    color: var(--bs-secondary);
    display: block;
    margin-bottom: .25rem;
}

.file-upload-area h5,
.file-upload-area p {
    margin: 0;
    color: var(--bs-body-color);
    font-weight: 500;
}

.section-spacing {
    margin-bottom: 2rem;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.card {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    border: 1px solid var(--bs-border-color);
}

.card-header {
    background-color: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
}

.progress-horizontal {
    position: relative;
}

.progress-step-indicator {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.progress-step-indicator:hover {
    transform: translateY(-2px);
}

.progress-connection-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    transition: background-color 0.5s ease;
}

.progress-step-text {
    min-width: 80px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .progress-step-indicator {
        margin-bottom: 1rem;
    }

    .progress-connection-line {
        display: none;
    }

    .progress-step-text {
        min-width: 60px;
        font-size: 0.75rem;
    }

    .progress-horizontal .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
}

.progress-step-indicator .rounded-circle {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step-indicator.animate-in {
    animation: stepActivate 0.6s ease-out;
}

@keyframes stepActivate {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.progress-step-link {
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-step-link:hover {
    transform: translateY(-3px);
    text-decoration: none !important;
}

.progress-step-link:hover .rounded-circle {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.progress-step-active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

html {
    scroll-behavior: smooth;
}

.step-section {
    scroll-margin-top: 100px;
}

.admin-stats-tabs {
    padding-left: 0;
    margin: 0;
}

.admin-stats-tabs .nav-link {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    box-shadow: none;
}

/* Primäre Buttons im Orange des Headers (#ec632b) statt Bootstrap-Blau */
.btn-primary {
    --bs-btn-bg: #ec632b;
    --bs-btn-border-color: #ec632b;
    --bs-btn-hover-bg: #d4571f;
    --bs-btn-hover-border-color: #c9531d;
    --bs-btn-active-bg: #c9531d;
    --bs-btn-active-border-color: #bd4e1b;
    --bs-btn-disabled-bg: #ec632b;
    --bs-btn-disabled-border-color: #ec632b;
    --bs-btn-focus-shadow-rgb: 236, 99, 43;
}

/* ── Startseite Sanierungs-Tracker ─────────────────────────────────────── */

.st-page {
    --st-accent: #ec632b;
    --st-accent-soft: #fdf3ef;
    max-width: 1760px;
    margin: 0 auto;
}

/* Einstieg */
.st-hero {
    background: linear-gradient(135deg, var(--st-accent-soft) 0%, #fffaf8 60%, var(--st-accent-soft) 100%);
    border-radius: 1.5rem;
    padding: 3rem;
    margin-bottom: 3rem;
}

.st-hero-title {
    font-size: calc(1.6rem + 1.2vw);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.st-hero-img {
    width: 100%;
    max-width: 440px;
    height: auto;
    border-radius: 1.25rem;
    box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, .15);
}

.st-checklist {
    list-style: none;
    padding: 0;
}

.st-checklist li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .6rem;
}

.st-check {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: .1rem;
    border-radius: 50%;
    background: var(--st-accent);
    color: #fff;
    font-size: .75rem;
}

.st-hero-claim {
    font-weight: 600;
    color: var(--st-accent);
}

/* Schritte */
/* schmaler als der Einstiegsbereich, damit dieser breiter hervorsteht */
.st-workflow {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 3rem;
}

.st-steps {
    position: relative;
}

.st-step {
    position: relative;
    display: flex;
    gap: 1.5rem;
    padding-bottom: 2.5rem;
}

/* Verbindungslinie zwischen den Schritt-Nummern */
.st-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 1.25rem;
    top: 2.75rem;
    bottom: .25rem;
    width: 2px;
    background: var(--st-accent-soft);
    transform: translateX(-50%);
}

.st-step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--st-accent);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 .4rem var(--st-accent-soft);
}

.st-step-body {
    flex: 1;
    min-width: 0;
    padding-top: .35rem;
}

.st-step-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.st-step-text {
    display: block;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 1rem;
}

.st-plz-input {
    max-width: 22rem;
}

.st-plz-input .form-control,
.st-plz-input .input-group-text {
    margin-bottom: 0;
    height: auto;
}

.st-page .file-upload-area {
    padding: 2rem 1.25rem;
    border-width: 2px;
    border-radius: 1rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.st-page .file-upload-area i {
    font-size: 2rem;
    color: var(--st-accent);
    margin-bottom: .5rem;
}

.st-page .btn.st-submit {
    width: auto;
    border-radius: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Hinweis */
.st-note {
    display: flex;
    gap: 1rem;
    margin: .5rem 0 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-secondary-color, #6c757d);
}

.st-note-icon {
    font-size: 1.25rem;
    color: var(--st-accent);
    margin-top: .15rem;
}

@media (max-width: 768px) {
    .st-hero {
        padding: 1.5rem;
        border-radius: 1rem;
    }

    .st-workflow {
        padding: 0;
    }

    .st-step {
        gap: 1rem;
    }
}

/* ── Gemeinsame Bausteine für weitere Seiten ───────────────────────────── */

.st-hero-compact {
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
}

.st-hero-compact .st-hero-title {
    font-size: 1.6rem;
    margin-bottom: .25rem;
}

.st-hero-compact .lead {
    font-size: 1rem;
    color: var(--bs-secondary-color, #6c757d);
}

.st-hero-compact .st-hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.4rem;
    box-shadow: 0 .4rem 1rem rgba(236, 99, 43, .12);
}

.st-hero-icon {
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: #fff;
    color: var(--st-accent);
    font-size: 2.25rem;
    box-shadow: 0 .75rem 1.5rem rgba(236, 99, 43, .15);
}

.st-section {
    margin-bottom: 3.5rem;
}

.st-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.st-panel {
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.st-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 .5rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: center;
    font-size: .875rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* Über das Projekt */
.st-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem 2rem;
}

.st-feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.st-feature-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    background: #fff;
    color: var(--st-accent);
    font-size: 1.1rem;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
}

.st-partner-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.st-partner-list li {
    padding: .85rem 0 .85rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    position: relative;
}

.st-partner-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.45rem;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--st-accent);
}

.st-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .4rem 1rem;
    margin: 0;
}

.st-facts dt {
    font-weight: 600;
}

.st-facts dd {
    margin: 0;
}

.st-funder-logo {
    height: 110px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* Quickstart & FAQ */
.st-faq {
    border-top: 1px solid var(--bs-border-color);
}

.st-page details.st-faq-item {
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    border-radius: 0;
}

.st-page details.st-faq-item > summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.4;
    padding: 1.1rem 3rem 1.1rem 0;
    margin: 0;
    color: var(--bs-body-color);
    transition: color .15s;
}

.st-page details.st-faq-item > summary::-webkit-details-marker {
    display: none;
}

/* eigener Pfeil statt Browser- bzw. Pico-Standard */
.st-page details.st-faq-item > summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: .5rem;
    top: 50%;
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bs-tertiary-bg, #f8f9fa);
    background-image: none;
    color: var(--st-accent);
    font-size: .8rem;
    transform: none;
    transition: transform .2s, background-color .15s;
}

.st-page details.st-faq-item > summary:hover {
    color: var(--st-accent);
}

.st-page details.st-faq-item[open] > summary::after {
    transform: rotate(180deg);
    background-color: var(--st-accent-soft);
}

.st-page details.st-faq-item[open] {
    padding-bottom: 1.25rem;
}

.st-page details.st-faq-item > :not(summary) {
    margin-left: 0;
}

/* Zählerdatenkonverter: Karten als offene Abschnitte statt Kacheln */
.st-converter .card {
    border: 0;
    box-shadow: none;
    background: transparent;
    margin-bottom: 2.5rem !important;
}

.st-converter .card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 0 .9rem;
    background: transparent !important;
    border: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

.st-converter .card-header::before {
    content: "";
    flex-shrink: 0;
    width: 4px;
    height: 1.4rem;
    border-radius: 2px;
    background: var(--st-accent);
}

.st-converter .card-header h5,
.st-converter .card-header h6 {
    font-size: 1.25rem;
    font-weight: 600;
}

.st-converter .card-body {
    padding: 0;
}

.st-converter .list-group {
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.st-converter .list-group-item {
    background: transparent;
    border-color: rgba(0, 0, 0, .06);
}

.st-converter .data-table,
.st-converter .table-responsive {
    border-radius: 1rem;
}

.st-converter .mapping-card {
    border: 0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 0 1.5rem 1.5rem 0;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.st-converter .plot-container-group {
    border-radius: 1rem;
}

.st-converter .btn {
    width: auto;
    border-radius: 2rem;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

@media (max-width: 768px) {
    .st-hero-compact {
        padding: 1rem 1.25rem;
    }

    .st-converter .mapping-card {
        margin-right: 0;
    }
}

/* Feinschliff */
.st-converter .card.shadow-sm {
    box-shadow: none !important;
}

.st-converter .card > .btn {
    align-self: flex-start;
}

.st-partner-list li {
    list-style: none;
}

.st-page details.st-faq-item[open] > summary {
    color: var(--bs-body-color);
}

@media (min-width: 768px) {
    .st-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Titled() legt ein Pico-"main.container" (max. 1280px) um den Inhalt –
   für Seiten im neuen Layout bestimmt .st-page die Breite */
main.container:has(> .st-page),
main.container:has(> div > .st-page) {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}
