@font-face {
    font-family: Inter;
    src: url("/static/InterVariable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}
:root {
    /* Text */
    --ink: #292229;
    --ink-soft: #62565f;
    --muted: #6f6468;
    /* Surfaces & lines */
    --paper: #fff;
    --surface-soft: #fcf8fa;
    --line: #e3e3e3;
    --line-strong: #aebbb4;
    --fill: #f0ebee;
    /* Brand */
    --primary: #87004b;
    --primary-dark: #67003a;
    --primary-soft: #f9eaf2;
    --primary-shadow: rgba(93, 0, 51, 0.04);
    --primary-shadow-strong: rgba(93, 0, 51, 0.08);
    --primary-shadow-heaviest: rgba(93, 0, 51, 0.18);
    --focus: #ad4b7c;
    --gold: #ecac00;
    /* Status */
    --amber: #87551a;
    --amber-bg: #fff5e9;
    --amber-line: #efd9bb;
    --danger: #984538;
    --danger-bg: #fdf0eb;
    --danger-line: #f1d5c8;
    /* Type scale */
    --fs-2xs: 11px;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-md: 14px;
    --fs-lg: 17px;
    --fs-xl: 20px;
    --fs-2xl: 26px;
    --fs-3xl: 32px;
    /* Elevation */
    --shadow: 0 10px 30px var(--primary-shadow);
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, sans-serif;
    font-size: var(--fs-md);
    line-height: 1.5;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1,
h2 {
    font-family: Inter, sans-serif;
}
h1 {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.18;
    margin-bottom: 8px;
}
h2 {
    font-size: var(--fs-xl);
    margin-bottom: 0;
}
button,
input,
select,
textarea {
    font: inherit;
}
button {
    cursor: pointer;
}
.muted {
    color: var(--muted);
}
.small {
    font-size: var(--fs-xs);
}
.sr-only {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.sidebar {
    width: 246px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.brand {
    height: 89px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}
.brand-mark {
    font: 800 var(--fs-3xl) / 1 Inter, sans-serif;
    letter-spacing: -0.1em;
    color: var(--primary);
}
.brand-mark span {
    color: var(--gold);
}
.brand strong,
.sidebar-footer strong,
.sidebar-footer small {
    display: block;
}
.brand strong {
    font: 800 var(--fs-md) Inter, sans-serif;
}
.sidebar-footer small {
    color: var(--muted);
    font-size: var(--fs-2xs);
}
.nav-label {
    font-size: var(--fs-2xs);
    color: var(--muted);
    font-weight: 800;
    margin: 27px 24px 10px;
}
.sidebar nav > a {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 3px 10px;
    padding: 10px 15px;
    color: var(--ink-soft);
    border-radius: 9px;
    font-weight: 600;
}
.sidebar nav > a span {
    font-size: var(--fs-xl);
    width: 20px;
    text-align: center;
    font-weight: 400;
}
.sidebar nav > a[aria-current],
.sidebar nav > a:hover {
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    height: 36px;
    width: 36px;
    font-size: var(--fs-2xs);
    font-weight: 800;
}
.sidebar-footer form {
    margin-left: auto;
}
.logout {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: var(--fs-xl);
}
.mobile-header {
    display: none;
}
.main {
    margin-left: 246px;
    padding: 42px clamp(26px, 4vw, 72px) 100px;
    max-width: 1800px;
}
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 35px;
}
.page-head .muted {
    margin-bottom: 0;
}
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 36px 0 16px;
}
.section-heading > a {
    font-size: var(--fs-sm);
    font-weight: 700;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    border-radius: 8px;
    padding: 10px 15px;
    min-height: 41px;
    font-weight: 700;
    font-size: var(--fs-sm);
    box-shadow: var(--shadow);
}
.button:hover {
    text-decoration: none;
    border-color: var(--line-strong);
}
.button.primary {
    background: var(--primary);
    color: var(--paper);
    border-color: var(--primary);
}
.button.primary:hover {
    background: var(--primary-dark);
}
.button.subtle {
    border-style: dashed;
    color: var(--primary);
    box-shadow: none;
}
.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}
.metric,
.panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.metric {
    min-height: 155px;
    padding: 23px;
    display: flex;
    flex-direction: column;
}
.metric strong {
    font: 800 var(--fs-3xl) / 1.2 Inter, sans-serif;
    margin: 13px 0 0;
}
.metric-label {
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--muted);
}
.metric .money-value {
    font-size: var(--fs-2xl);
}
.metric .muted {
    font-size: var(--fs-xs);
    margin-top: 9px;
}
.table-wrap {
    overflow-x: auto;
}
table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}
th {
    font-size: var(--fs-xs);
    color: var(--ink);
    background: var(--fill);
    white-space: nowrap;
}
th,
td {
    padding: 15px 21px;
    border-bottom: 1px solid var(--line);
}
tbody tr:last-child td {
    border-bottom: 0;
}

td strong,
.row-title {
    color: var(--ink);
}
.subline {
    display: block;
    color: var(--muted);
    font-size: var(--fs-2xs);
    margin-top: 2px;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.empty {
    text-align: center;
    padding: 48px;
    color: var(--muted);
}
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 100px;
    padding: 4px 10px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    background: var(--fill);
    color: var(--ink-soft);
    white-space: nowrap;
}
.badge.Offerte,
.badge.Option {
    background: var(--amber-bg);
    color: var(--amber);
}
.badge.Bestätigt,
.badge.active {
    background: var(--primary-soft);
    color: var(--primary);
}
.badge.Abgesagt,
.badge.inactive {
    background: var(--fill);
    color: var(--muted);
}
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.filters input {
    flex: 1;
}
.filters select {
    width: 190px;
}
input:not([type="checkbox"]),
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    min-height: 41px;
    padding: 9px 11px;
    color: var(--ink);
    outline: 0;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--focus);
}
textarea {
    resize: vertical;
    min-height: 75px;
}
label {
    display: block;
    font-weight: 700;
    font-size: var(--fs-xs);
    color: var(--ink);
}
label input,
label select,
label textarea {
    display: block;
    margin-top: 7px;
    font-weight: 400;
}
label em {
    font-style: normal;
    color: var(--amber);
}
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: var(--fs-xs);
    margin-bottom: 23px;
}
.detail-head {
    margin-bottom: 27px;
}
.head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 19px;
    align-items: start;
}
.detail-main {
    display: grid;
    gap: 17px;
}
.form-section {
    padding: 25px;
}
.panel-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}
.step {
    display: grid;
    place-items: center;
    flex: none;
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: var(--fs-2xs);
    font-weight: 800;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.wide {
    grid-column: 1/-1;
}
.segment {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 17px;
    margin-bottom: 13px;
}
.segment-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
}
.segment-top strong {
    font-size: var(--fs-xs);
}
.segment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}
.text-button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--amber);
    font-size: var(--fs-xs);
    font-weight: 700;
}
.text-button:hover {
    text-decoration: underline;
}
.summary {
    padding: 23px;
    position: sticky;
    top: 22px;
}
.summary h2 {
    margin-bottom: 23px;
}
.summary-row,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-xs);
}
.summary-row span {
    color: var(--muted);
}
.summary-total {
    padding-top: 19px;
    border: 0;
    font-size: var(--fs-sm);
}
.summary-total strong {
    font: 800 var(--fs-lg) Inter, sans-serif;
    color: var(--primary);
    white-space: nowrap;
}
.summary p:last-child {
    margin: 14px 0 0;
}
.save-bar,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.items-panel {
    margin-top: 20px;
    padding-top: 24px;
}
.items-panel .panel-heading {
    padding: 0 25px;
}
.item-add {
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    align-items: end;
    gap: 10px;
    padding: 19px 25px;
}
.draft-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 120px auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
}
.draft-item label {
    min-width: 0;
}
.draft-price {
    min-height: 41px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-weight: 700;
}
.draft-item .remove-item {
    min-height: 41px;
}
.items-total {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    padding: 19px 25px;
    background: var(--surface-soft);
    border-radius: 0 0 12px 12px;
}
.items-total strong {
    font: 800 var(--fs-xl) Inter, sans-serif;
    color: var(--primary);
}
.warning,
.alert {
    padding: 13px 16px;
    border: 1px solid var(--amber-line);
    background: var(--amber-bg);
    color: var(--amber);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: var(--fs-sm);
}
.alert {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-line);
}
.narrow {
    max-width: 780px;
}
.form-actions {
    justify-content: flex-end;
    margin-top: 25px;
}
.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
}
.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.login-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background:
        radial-gradient(circle at 80% 15%, var(--primary-soft), transparent 33%),
        linear-gradient(135deg, var(--primary-soft), var(--surface-soft));
}
.login-card {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 42px;
    width: min(100%, 420px);
    border-radius: 16px;
    box-shadow: 0 20px 65px var(--primary-shadow-strong);
}
.login-card .brand-mark {
    margin-bottom: 30px;
}
.login-card h1 {
    font-size: 28px;
}
.login-card .muted {
    margin-bottom: 28px;
}
.stack {
    display: grid;
    gap: 17px;
}
.stack button {
    margin-top: 10px;
    justify-content: space-between;
}
@media (max-width: 1050px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .summary {
        position: static;
    }
    .detail-side {
        grid-row: 1;
    }
    .metrics {
        gap: 9px;
    }
    .main {
        padding: 32px 24px 70px;
    }
}
@media (max-width: 720px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .menu-open .sidebar {
        transform: translateX(0);
        box-shadow: 20px 0 70px var(--primary-shadow-heaviest);
    }
    .mobile-header {
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 18px;
        border-bottom: 1px solid var(--line);
        background: var(--paper);
    }
    .mobile-header a {
        font-weight: 800;
        font-family: Inter, sans-serif;
    }
    .mobile-header button {
        background: none;
        border: 0;
        font-size: var(--fs-xl);
    }
    .main {
        margin: 0;
        padding: 27px 16px 60px;
    }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }
    .metrics {
        grid-template-columns: 1fr;
    }
    .metric {
        min-height: 120px;
    }
    .form-grid,
    .segment-grid {
        grid-template-columns: 1fr 1fr;
    }
    .filters {
        flex-wrap: wrap;
    }
    .filters input {
        flex-basis: 100%;
    }
    .filters select {
        flex: 1;
    }
    .item-add {
        grid-template-columns: 1fr 90px;
    }
    .draft-item {
        grid-template-columns: minmax(0, 1fr) 90px;
    }
    .item-add button {
        grid-column: 1/-1;
    }
    .save-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .head-actions {
        width: 100%;
        justify-content: space-between;
    }
    .form-section {
        padding: 18px;
    }
}
@media (max-width: 420px) {
    .form-grid,
    .segment-grid {
        grid-template-columns: 1fr;
    }
    .detail-head .head-actions {
        flex-wrap: wrap;
    }
    .item-add {
        grid-template-columns: 1fr;
    }
    .item-add button {
        grid-column: auto;
    }
}
.document-list {
    margin-top: 12px;
    padding: 20px 23px;
}
.document-list h3 {
    font-size: var(--fs-sm);
    letter-spacing: 0;
    margin-bottom: 12px;
}
.document-list a {
    display: block;
    padding: 8px 0;
    font-size: var(--fs-xs);
    font-weight: 700;
    border-top: 1px solid var(--line);
}
