/* Ritter Energie – unified application stylesheet */
@import url('https://use.typekit.net/gtz0btc.css');

:root {
    color-scheme: light;
    --print-page-height: 1122;
    --print-header-margin-top: 12;
    --print-header-margin-x: 24;
    --brand: #003e66;
    --brand-dark: #002f4d;
    --brand-soft: #eaf2f7;
    --accent: #ffe200;
    --accent-soft: #fff4d6;
    --content-max-width: 1200px;
    --bg: #ffffff;
    --card: #ffffff;
    --text: #003e66;
    --muted: #58666D;
    --border: #949fa6;
    --error: #b91c1c;
    --error-bg: #fff1f0;
    --ok-bg: #eef8f2;
    --font-family: 'rotunda-variable', Arial, sans-serif;
    --font-size: 14px;
}

/* === Base === */

* { box-sizing: border-box; }

html {
    background: var(--bg);
}

body {
    font-size: var(--font-size);
    font-weight: 400;
    margin: 0;
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
}

h1, h2 { margin: 0.75rem 0 1rem; color: var(--brand); }
h3 { margin: 1.25rem 0 1rem; color: var(--brand); }
p { margin: 0; color: var(--muted); }

/* === Layout === */

.wrap {
    display: block;
    width: min(var(--content-max-width), 100%);
    margin: 0 auto;
    min-height: auto;
    padding: 1.4rem 1rem 0;
    place-items: initial;
}

/* === Header === */

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 62, 102, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    width: min(var(--content-max-width), 100%);
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-sizing: border-box;
}

.site-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--brand);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.site-brand img {
    width: 190px;
    height: auto;
    display: block;
}

.site-brand span {
    border-left: 1px solid var(--brand);
    padding-left: 0.75rem;
}

/* === Workflow === */

.workflow {
    width: min(var(--content-max-width), 100%);
    margin: 0 auto 1rem;
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 0.5rem;
    box-sizing: border-box;
}

.workflow-step {
    align-items: center;
    --workflow-optical-shift: 0.08em;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--brand);
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 62, 102, 0.05);
}

.workflow-step.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 62, 102, 0.12);
}

.workflow-step.done {
    border-color: rgba(25, 135, 84, 0.35);
    background: #f0fbf5;
}

.workflow-index {
    background: var(--brand);
    border-radius: 999px;
    color: #ffffff;
    display: flex;
    font-size: 0.82rem;
    font-weight: 800;
    height: 1.55rem;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 1.55rem;
}

.workflow-index-text {
    display: block;
    line-height: 1;
    transform: translateY(var(--workflow-optical-shift));
}

.workflow-step.done .workflow-index {
    background: #198754;
}

.workflow-label {
    display: flex;
    align-items: center;
    font-weight: 800;
    line-height: 1;
    transform: translateY(var(--workflow-optical-shift));
}

.workflow-status {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* === Cards & Panels === */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 62, 102, 0.08);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.panel {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: var(--bg);
    box-shadow: 0 12px 30px rgba(0, 62, 102, 0.08);
}

.panel strong { display: block; margin-bottom: 0.35rem; color: var(--brand); }
.panel a { color: var(--brand); text-decoration: none; font-weight: 600; }
.panel a:hover { text-decoration: underline; }

/* === Forms === */

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--brand);
    letter-spacing: 0.01em;
}

.form-legend {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--brand);
    letter-spacing: 0.01em;
    padding: 0;
}

.grid + .form-legend {
    margin-top: 1rem;
}

info {     
    display: inline-block;     
    color: var(--text);     
    cursor: help; 
}

input, select {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid #b9c8d2;
    background: #fff;
    color: var(--text);
    min-height: 2.45rem;
    box-shadow: inset 0 1px 2px rgba(0, 62, 102, 0.04);
}

input:focus,
select:focus {
    outline: 3px solid rgba(246, 168, 0, 0.28);
    border-color: var(--brand);
}

.input-with-unit {
    position: relative;
}

.input-with-unit input,
.input-with-unit select {
    padding-right: 3.2rem;
}

.input-with-unit select {
    padding-right: 4.8rem;
}

.input-with-unit select + .input-unit {
    right: 1.5rem;
}

.grid + .grid {
    margin-top: 1rem;
}

.length-slider {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.15rem;
    min-height: 2.45rem;
    align-content: center;
    padding-top: 0;
    --slider-label-left: 0px;
}

.length-slider--floating {
    overflow: visible;
}

.length-slider input[type="range"] {
    width: 100%;
    min-height: auto;
    padding: 0;
    margin: 0;
    accent-color: var(--brand);
    box-shadow: none;
}

.length-slider-value {
    position: absolute;
    top: calc(100% + 0.1rem);
    left: var(--slider-label-left);
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand);
    line-height: 1;
}

.profile-slider {
    display: grid;
    grid-template-rows: auto auto;
    align-content: center;
    min-height: 2.45rem;
    gap: 0.18rem;
    padding: 0.18rem 0;
}

.profile-slider input[type="range"] {
    width: 100%;
    min-height: auto;
    padding: 0;
    margin: 0;
    accent-color: var(--brand);
    box-shadow: none;
}

.profile-slider-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    line-height: 1;
    color: var(--muted);
}

.profile-slider-scale span {
    text-align: center;
    min-width: max-content;
}

.profile-slider-scale span.is-active {
    color: var(--brand);
    font-weight: 700;
}

.profile-slider-current {
    color: var(--brand);
    font-weight: 700;
    font-size: 0.85rem;
}

.input-unit {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
}

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

.form-help,
.field-error {
    font-size: 0.88rem;
    line-height: 1.45;
}

.form-help {
    background: var(--brand-soft);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    margin: 0.15rem 0 0.9rem;
    padding: 0.65rem 0.8rem;
}

.field-invalid {
    border-color: #b91c1c !important;
    outline: 3px solid rgba(185, 28, 28, 0.12);
}

.field-error {
    color: #b91c1c;
    font-weight: 700;
    margin: 0.35rem 0 0;
}

form h3 {
    border-bottom: 2px solid var(--brand-soft);
    padding-bottom: 0.4rem;
}

form h3.section-gap-top {
    margin-top: 2.25rem;
}

/* === Segmented Control === */

.segmented-control {
    box-shadow: 0 12px 30px rgba(0, 62, 102, 0.08);
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.segmented-control.field-invalid {
    border-color: #b91c1c !important;
    outline: 3px solid rgba(185, 28, 28, 0.12);
}

.segmented-control + .grid {
    margin-top: 1rem;
}

#ownComponentsFields {
    margin-top: 1rem;
}

.SegmentedControlItem__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.SegmentedControlItem__label {
    flex: 1;
    padding: 0.65rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
    background: white;
    border-right: 1px solid var(--border);
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand);
}

.SegmentedControlItem__label i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    transform: translateY(-0.04em);
}

.SegmentedControlItem__label:last-of-type {
    border-right: none;
}

.SegmentedControlItem__input:checked + .SegmentedControlItem__label {
    background: var(--accent);
    color: var(--brand);
}

.SegmentedControlItem__label:hover {
    background: var(--brand-soft);
}

.SegmentedControlItem__input:checked + .SegmentedControlItem__label:hover {
    background: var(--accent);
}

.SegmentedControlItem__label:focus-visible,
.SegmentedControlItem__input:focus-visible + .SegmentedControlItem__label {
    outline: 3px solid rgba(246, 168, 0, 0.36);
    outline-offset: -3px;
}

.segmented-control.segmented-control--binary {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.segmented-control.segmented-control--binary .SegmentedControlItem__label {
    color: var(--brand);
    border-right-color: rgba(0, 62, 102, 0.35);
}

.segmented-control.segmented-control--binary .SegmentedControlItem__label:hover {
    background: rgba(0, 62, 102, 0.18);
}

.segmented-control.segmented-control--binary .SegmentedControlItem__input:checked + .SegmentedControlItem__label,
.segmented-control.segmented-control--binary .SegmentedControlItem__input:checked + .SegmentedControlItem__label:hover {
    background: var(--brand);
    color: #ffffff;
}


/* === Buttons === */

.button,
.btn-re-primary,
.btn-primary {
    background-color: var(--accent);
    color: var(--brand);
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover,
.button:focus,
.btn-re-primary:hover,
.btn-re-primary:focus,
.btn-primary:hover,
.btn-primary:focus {
    background-color: #e6cb00;
    color: var(--brand);
}

.button.secondary,
.btn-re-secondary,
.btn-secondary {
    background-color: var(--brand);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.button.secondary:hover,
.button.secondary:focus,
.btn-re-secondary:hover,
.btn-re-secondary:focus,
.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--brand-dark);
    color: #ffffff;
}

.button.secondary:disabled,
.btn-re-secondary:disabled,
.btn-secondary:disabled {
    background-color: var(--brand-dark);
    color: rgba(255, 255, 255, 0.75);
    cursor: not-allowed;
    opacity: 0.65;
}

.button.tertiary,
.btn-re-tertiary,
.btn.tertiary {
    background-color: #D4D9DB;
    color: var(--muted);
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.button.tertiary:hover,
.button.tertiary:focus,
.btn-re-tertiary:hover,
.btn-re-tertiary:focus,
.btn.tertiary:hover,
.btn.tertiary:focus {
    background-color: #EAECED;
    color: var(--muted);
}

.button.tertiary:disabled,
.btn-re-tertiary:disabled,
.btn.tertiary:disabled {
    background-color: #EAECED;
    color: rgba(88, 102, 109, 0.65);
    cursor: not-allowed;
    opacity: 0.7;
}

/* === Grid & Metrics === */

.grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    margin-top: 1rem;
}

.metric {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem;
    background: #fcfdff;
    box-shadow: 0 12px 30px rgba(0, 62, 102, 0.08);
}

.metric .k { display: block; font-size: 0.8rem; color: var(--muted); }
.metric .v { font-size: 1.05rem; font-weight: 700; color: var(--brand); }
.metric .v span { margin-left: 0.25rem; }

.metric.primary {
    background: linear-gradient(180deg, #ffffff 0%, var(--brand-soft) 100%);
    border-color: rgba(0, 62, 102, 0.22);
}

.metric.status-positive {
    background: #f0fbf5;
    border-color: rgba(25, 135, 84, 0.38);
}

.metric.status-negative {
    background: #fff1f0;
    border-color: rgba(185, 28, 28, 0.38);
}

.metrics + h3 { margin-top: 1.5rem; }

/* === Status === */

.status { border-radius: 10px; padding: 0.7rem 0.85rem; margin-bottom: 1rem; font-weight: 600; }
.status.error { color: var(--error); background: var(--error-bg); border: 1px solid #f3b5ad; }
.status.ok { color: #065f46; background: var(--ok-bg); border: 1px solid #bbf7d0; }
.status-positive { border-color: #bbf7d0; background: var(--ok-bg); }
.status-negative { border-color: #fecaca; background: var(--error-bg); }

/* === Badges === */

.badge {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid rgba(0, 62, 102, 0.18);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* === Table === */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    overflow: hidden;
    border-radius: 12px;
}

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

th:last-child, td:last-child { text-align: right; }

th {
    color: var(--brand);
    background: var(--brand-soft);
}

tbody tr:nth-child(even) {
    background: rgba(234, 242, 247, 0.38);
}

/* === Navigation & Toolbars === */

.hint { margin-bottom: 1rem; color: var(--muted); }
.placeholder { color: var(--muted); font-style: italic; }

.nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.top-nav { margin-bottom: 0.8rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.nav,
.top-nav,
.toolbar,
.row-actions {
    align-items: center;
}

.nav,
.top-nav,
.toolbar {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(216, 225, 231, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 62, 102, 0.07);
    padding: 0.55rem;
    backdrop-filter: blur(8px);
}

/* === Section Titles === */

.section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    font-weight: 800;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.section-title::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.sub-title { font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-bottom: 0.5rem; }
table + .section-title { margin-top: 1.5rem; }
table + .sub-title { margin-top: 1.25rem; }

/* === Dashboard === */

.dashboard-summary,
.dashboard-grid {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.dashboard-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.status-tile,
.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(0, 62, 102, 0.06);
}

.status-tile.done,
.dashboard-card.done {
    border-color: rgba(25, 135, 84, 0.35);
    background: #f5fcf7;
}

.status-tile.open,
.dashboard-card.open {
    border-color: rgba(246, 168, 0, 0.45);
}

.status-label,
.dashboard-card-status {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-card h3 {
    margin-top: 0.35rem;
}

.chart-wrapper {
    max-width: 70%;
    margin: 0 auto;
}

/* === Report === */

.report-document {
    background: #ffffff;
}



.report-document .headline h1,
.report-document > .card:first-of-type h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.headline {
    gap: 1rem;
}

.headline > div:last-child {
    background: var(--brand-soft);
    border: 1px solid rgba(0, 62, 102, 0.12);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

/* === Responsive === */

@media (max-width: 720px) {
    .site-header {
        position: static;
    }

    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .site-header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .site-header-actions .button {
        width: auto;
    }

    .site-brand img {
        width: 165px;
    }

    .site-brand span {
        font-size: 0.92rem;
    }

    .site-nav {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 0.1rem;
    }

    .site-nav-link {
        background: #ffffff;
        border: 1px solid var(--border);
        flex: 0 0 auto;
    }

    .wrap {
        padding: 1rem 0.75rem 2rem;
    }

    .workflow {
        grid-template-columns: 1fr 1fr;
        padding-inline: 0.75rem;
    }

    .card {
        border-radius: 14px;
        padding: 1rem;
    }

    .nav,
    .top-nav,
    .toolbar,
    .row-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .button {
        width: 100%;
        text-align: center;
    }

    h1 {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* === Print === */

@media print {
    body {
        background: #ffffff;
        color: #000000;
    }

    .site-header {
        position: static;
        box-shadow: none;
        border-bottom: 2px solid var(--accent);
        margin: calc(var(--print-header-margin-top) * 1px) calc(var(--print-header-margin-x) * 1px) 0;
    }

    .site-header-inner {
        padding: 0 0 0.75rem;
        width: 100%;
    }

    .site-brand img {
        width: 180px;
    }

    .site-brand span {
        order: 1;
        border-left: none;
        padding-left: 0;
        font-size: clamp(1.8rem, 4vw, 2.4rem);
        font-weight: 800;
        line-height: 1.1;
        text-align: left;
    }

    .site-brand {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .site-brand img {
        order: 2;
    }

    .site-nav,
    .site-footer,
    .workflow {
        display: none;
    }

    .toolbar { display: none; }
    .no-print { display: none; }
    .wrap { width: 100%; padding: 0 1.5rem; }

    .card,
    .panel,
    .metric {
        box-shadow: none;
        border: none;
        break-inside: auto;
        padding: 0.5rem 0;
        margin-bottom: 0.25rem;
    }

    .button:hover {
        transform: none;
    }

    .nav,
    .top-nav,
    .toolbar {
        box-shadow: none;
    }

    tbody tr:nth-child(even) {
        background: transparent;
    }

    /* Chart sizing for print */
    .chart-wrapper {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    canvas {
        max-width: 100%;
        height: auto;
        display: block;
    }

    * {
        color: #000000 !important;
    }
}
