:root {
    --bg: #f7f4ed;
    --surface: #fffdf8;
    --surface-strong: #fffaf0;
    --text: #1f2933;
    --muted: #5a6b7b;
    --line: #d9d1c3;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(31, 41, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 9%, transparent), transparent 25%),
        linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

a {
    color: inherit;
}

.page-shell {
    min-height: 100vh;
}

.topbar {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(217, 209, 195, 0.8);
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
}

.topbar__inner,
.content {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand__title {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.brand__subtitle {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.content {
    padding: 2rem 0 3rem;
}

.hero,
.panel,
.empty-state {
    background: var(--surface);
    border: 1px solid rgba(217, 209, 195, 0.9);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.hero__title,
.section-title {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.hero__text,
.section-copy,
.empty-state p,
.help-text {
    color: var(--muted);
    line-height: 1.6;
}

.panel {
    padding: 1.5rem;
}

.panel + .panel {
    margin-top: 1.5rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button,
.button-secondary,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.button {
    background: var(--accent);
    color: #fff;
}

.button:hover,
.button:focus-visible {
    background: var(--accent-strong);
}

.button-secondary,
.link-button {
    background: var(--surface-strong);
    border-color: var(--line);
    color: var(--text);
}

.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--danger);
    cursor: pointer;
}

.button-danger:hover,
.button-danger:focus-visible {
    background: var(--danger);
    color: #fff;
}

.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.5rem;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}

.status-banner {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent-strong);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.table-wrapper {
    overflow-x: auto;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
}

.article-table th,
.article-table td {
    padding: 1rem 0.85rem;
    border-bottom: 1px solid rgba(217, 209, 195, 0.8);
    text-align: left;
    vertical-align: top;
}

.article-table th {
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.article-name {
    font-weight: 700;
    margin: 0;
}

.article-category {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    font-weight: 700;
}

.field input,
.field select,
.field textarea,
.quantity-input {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font: inherit;
}

.field textarea {
    resize: vertical;
}

.field input[type="checkbox"] {
    width: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.letterhead {
    padding: 1.5rem;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.letterhead__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.letterhead__name {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.letterhead__line {
    margin: 0.15rem 0;
}

.letterhead__logo {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

.letterhead__rule {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.letterhead--branded .letterhead__rule {
    border-top: 3px solid var(--accent);
}

.letterhead--branded .letterhead__name {
    color: var(--accent-strong);
}

.brand__logo {
    max-height: 44px;
    max-width: 140px;
    object-fit: contain;
    margin-right: 0.75rem;
}

.brand__lead {
    display: flex;
    align-items: center;
}

.letterhead__footer {
    color: var(--muted);
    font-size: 0.9rem;
}

.quantity-input {
    max-width: 7rem;
}

.field input:focus,
.field select:focus,
.quantity-input:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.badge--requested { background: #fff4d6; }
.badge--confirmed { background: #dcefff; }
.badge--prepared { background: #e6e1ff; }
.badge--picked_up { background: #e3f6e8; }
.badge--partially_returned { background: #fde7d3; }
.badge--returned { background: #ececec; }
.badge--cancelled { background: #f6d9d6; text-decoration: line-through; }
.badge--overdue { background: var(--danger); color: #fff; border-color: var(--danger); }
.badge--inspection-pending { background: #fde7d3; }
.badge--inspection-completed { background: #e3f6e8; }

.customer-picker__box { position: relative; }
.suggestions {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    max-height: 18rem;
    overflow-y: auto;
}
.suggestions[hidden] { display: none; }
.suggestions__item { padding: 0.6rem 0.75rem; border-radius: 10px; cursor: pointer; }
.suggestions__item:hover,
.suggestions__item--active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.inline-customer { margin-top: 0.5rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); }
.inline-customer summary { cursor: pointer; font-weight: 700; }

.status-banner--error {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.25);
}

.status-banner--warning {
    background: #fff4d6;
    color: #6b4a00;
    border-color: #e8c76b;
}

.badge--sensitive { background: #f6d9d6; color: var(--danger); border-color: rgba(180, 35, 24, 0.25); }

.badge--cond-ok { background: #e3f6e8; }
.badge--cond-damaged { background: #fde7d3; }
.badge--cond-missing { background: #f6d9d6; }

.return-line {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
}

.return-line legend {
    padding: 0 0.4rem;
    font-weight: 700;
}

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.photo-grid img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.history-list {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.export-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.export-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
}

.export-list p {
    margin: 0.25rem 0 0;
}

.mode-box {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.mode-box--danger {
    border-color: var(--danger);
}

.field-error {
    color: var(--danger);
    font-size: 0.95rem;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 760px) {
    .brand,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .article-table thead {
        display: none;
    }

    .article-table,
    .article-table tbody,
    .article-table tr,
    .article-table td {
        display: block;
        width: 100%;
    }

    .article-table tr {
        padding: 1rem 0;
        border-bottom: 1px solid rgba(217, 209, 195, 0.8);
    }

    .article-table td {
        padding: 0.4rem 0;
        border: 0;
    }

    .article-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 0.15rem;
    }
}
/* ---- Artikelbilder ---- */
.article-cell { display: flex; align-items: center; gap: 0.75rem; }
.article-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-strong); flex: none; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.image-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); }
.image-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; display: block; background: #fff; }

/* ---- Verfuegbarkeit im Formular ---- */
.avail-status { font-size: 0.9rem; font-weight: 600; margin-top: 0.25rem; }
.avail-status--ok { color: #15692f; }
.avail-status--partial { color: #8a5a00; }
.avail-status--none { color: var(--danger); }
.avail-status--loading { color: var(--muted); font-weight: 400; }
.avail-warning { padding: 0.85rem 1rem; border-radius: 12px; border: 1px solid #f1b8b2; background: #fdecea; color: #7a1a12; font-weight: 600; }
.avail-warning[hidden], .avail-loading[hidden], .avail-calendar[hidden] { display: none; }
.avail-loading { color: var(--muted); font-size: 0.9rem; }

/* ---- Verfuegbarkeitskalender ---- */
.avail-calendar { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: var(--surface); display: grid; gap: 0.75rem; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; justify-content: space-between; }
.cal-head select { min-width: 0; max-width: 100%; }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-nav button { min-width: 44px; min-height: 44px; }
.cal-title { font-weight: 700; min-width: 8rem; text-align: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.85rem; }
.cal-legend span::before { content: ""; display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; margin-right: 0.35rem; vertical-align: -2px; border: 1px solid rgba(0,0,0,0.15); }
.cal-legend .lg-free::before { background: #d7f2de; }
.cal-legend .lg-part::before { background: #ffe9b3; }
.cal-legend .lg-none::before { background: #f8c9c4; }
.cal-legend .lg-sel::before { background: #fff; outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 0.75rem; color: var(--muted); text-align: center; }
.cal-day { min-height: 3.4rem; padding: 0.25rem; border-radius: 8px; border: 1px solid rgba(0,0,0,0.08); font-size: 0.75rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cal-day strong { font-size: 0.85rem; }
.cal-day--empty { border: 0; background: transparent; }
.cal-day--free { background: #d7f2de; }
.cal-day--partial { background: #ffe9b3; }
.cal-day--none { background: #f8c9c4; }
.cal-day--selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.cal-list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.cal-note { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 600px) {
    .cal-day { min-height: 2.9rem; font-size: 0.68rem; padding: 0.15rem; }
    .cal-day strong { font-size: 0.8rem; }
    .cal-grid { gap: 3px; }
    .cal-head select, .cal-nav { width: 100%; }
    .cal-nav { justify-content: space-between; }
}
@media (max-width: 600px) {
    .cal-day .cal-res {
        display: block;
        font-size: 0.55rem;
        line-height: 1.1;
        white-space: nowrap;
    }
}

/* ---- Gemeinsame Oberflaeche ---- */
:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-strong: #f6f9fb;
    --text: #172733;
    --muted: #526575;
    --line: #dce5eb;
    --danger: #a52822;
    --shadow: 0 12px 36px rgba(24, 43, 56, 0.07);
    color-scheme: light;
}

body {
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    text-underline-offset: 0.18em;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    transform: translateY(-160%);
    padding: 0.7rem 1rem;
    border-radius: 0.7rem;
    background: var(--text);
    color: #fff;
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    z-index: 40;
    padding: 0.85rem 1.5rem 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 18px rgba(24, 43, 56, 0.035);
}

.topbar__inner,
.content {
    width: min(1440px, calc(100% - 3rem));
}

.topbar__inner {
    display: grid;
    gap: 0.75rem;
}

.topbar__masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.5rem;
}

.brand__lead {
    min-width: 0;
    gap: 0.8rem;
}

.brand__logo {
    max-width: 150px;
    max-height: 48px;
    margin: 0;
}

.brand__subtitle {
    margin: 0 0 0.12rem;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.brand__title {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: clamp(1.12rem, 2vw, 1.35rem);
    font-weight: 760;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.masthead-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.masthead-actions form {
    margin: 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    max-width: 14rem;
    overflow: hidden;
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    border-top: 1px solid #edf1f4;
}

.nav-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.nav-group--admin {
    padding-left: 1rem;
    border-left: 1px solid var(--line);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.55rem 0.8rem;
    border-bottom: 2px solid transparent;
    color: #425666;
    font-size: 0.91rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav-link:hover {
    border-radius: 0.55rem 0.55rem 0 0;
    background: var(--surface-strong);
    color: var(--text);
}

.nav-link[aria-current="page"] {
    border-bottom-color: var(--accent);
    color: var(--accent-strong);
    font-weight: 760;
}

.content {
    padding: 2rem 0 3.5rem;
}

.hero,
.panel,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero {
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.25rem;
}

.hero__title,
.section-title {
    color: var(--text);
    font-size: clamp(1.28rem, 2vw, 1.75rem);
    font-weight: 760;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.hero__text,
.section-copy,
.empty-state p,
.help-text {
    color: var(--muted);
}

.hero__text {
    max-width: 64rem;
    margin: 0.55rem 0 0;
}

.panel {
    padding: clamp(1rem, 2.5vw, 1.5rem);
}

.panel + .panel {
    margin-top: 1.25rem;
}

.section-copy {
    margin: 0.45rem 0 0;
    line-height: 1.6;
}

.actions {
    align-items: center;
    gap: 0.6rem;
}

.button,
.button-secondary,
.button-danger,
.link-button,
.button-quiet {
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.7rem;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1.25;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.button:hover,
.button:focus-visible {
    background: var(--accent-strong);
}

.button-secondary,
.link-button {
    background: #fff;
    border-color: #cdd9e0;
    color: #314654;
}

.button-secondary:hover,
.link-button:hover {
    background: #f2f6f8;
    border-color: #aebfc9;
}

.button-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.button-quiet:hover {
    background: var(--surface-strong);
    color: var(--text);
}

.button-danger {
    padding: 0.65rem 1rem;
    border-radius: 0.7rem;
    background: #fff;
}

.button-danger:hover,
.button-danger:focus-visible {
    background: var(--danger);
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 40%, #ffffff);
    outline-offset: 2px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
select,
textarea {
    min-height: 2.8rem;
    padding: 0.68rem 0.82rem;
    border: 1px solid #cbd8e0;
    border-radius: 0.65rem;
    background: #fff;
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.45;
}

textarea {
    min-height: 5rem;
}

input[type="file"] {
    max-width: 100%;
    padding: 0.45rem;
    background: var(--surface-strong);
}

.field {
    gap: 0.42rem;
}

.field label {
    color: #283d4c;
    font-size: 0.93rem;
    font-weight: 700;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.quantity-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid color-mix(in srgb, var(--accent) 20%, #ffffff);
    outline-offset: 1px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.08rem;
    height: 1.08rem;
    accent-color: var(--accent);
}

.checkbox-label,
.row {
    color: var(--text);
    line-height: 1.45;
}

.field-error {
    font-size: 0.88rem;
    font-weight: 650;
}

.help-text {
    font-size: 0.9rem;
    line-height: 1.55;
}

.status-banner {
    padding: 0.9rem 1rem;
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--accent) 10%, #ffffff);
    border-color: color-mix(in srgb, var(--accent) 24%, #ffffff);
    color: var(--accent-strong);
    line-height: 1.55;
}

.status-banner--error {
    background: #fff2f0;
    border-color: #edc0bb;
    color: #8c211b;
}

.status-banner--warning {
    background: #fff8e8;
    border-color: #e8d49b;
    color: #604c18;
}

.table-wrapper {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: #fff;
}

.article-table {
    border-collapse: separate;
    border-spacing: 0;
}

.article-table th,
.article-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e8eef2;
}

.article-table th {
    background: #f6f9fb;
    color: #4b5e6d;
    font-size: 0.76rem;
    font-weight: 760;
    letter-spacing: 0.055em;
}

.article-table tbody tr:last-child td {
    border-bottom: 0;
}

.article-table tbody tr:hover {
    background: #fbfcfd;
}

.article-name {
    color: var(--text);
}

.article-name a,
.article-table td > a {
    color: var(--accent-strong);
    font-weight: 700;
}

.badge {
    padding: 0.25rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 720;
    line-height: 1.35;
}

.badge--requested { background: #fff2cd; color: #694d0d; }
.badge--confirmed { background: #e5f2ff; color: #20517b; }
.badge--prepared { background: #eeeaff; color: #4e3c8d; }
.badge--picked_up { background: #e5f5e9; color: #1c6232; }
.badge--partially_returned { background: #fff0e1; color: #7b4818; }
.badge--returned { background: #eef1f3; color: #41515c; }
.badge--cancelled { background: #f8e9e7; color: #7c3934; }
.badge--inspection-pending { background: #fff0e1; color: #7b4818; }
.badge--inspection-completed { background: #e5f5e9; color: #1c6232; }
.badge--cond-ok { background: #e5f5e9; color: #1c6232; }
.badge--cond-damaged { background: #fff0e1; color: #7b4818; }
.badge--cond-missing { background: #f8e9e7; color: #7c2620; }

.empty-state {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.detail-list {
    gap: 0.7rem 1.75rem;
}

.return-line,
.inline-customer,
.mode-box {
    border-color: var(--line);
    border-radius: 0.85rem;
    background: var(--surface-strong);
}

.return-line {
    padding: 1.15rem;
}

.return-line legend {
    color: var(--text);
    font-size: 1.03rem;
}

.photo-grid img {
    width: 112px;
    height: 112px;
    border-radius: 0.7rem;
}

.image-card {
    border-color: var(--line);
    border-radius: 0.85rem;
    background: #fff;
}

.image-card img {
    border-radius: 0.65rem;
}

.article-thumb {
    width: 60px;
    height: 60px;
    border-radius: 0.7rem;
}

.export-list li {
    border-color: var(--line);
    border-radius: 0.85rem;
    background: var(--surface-strong);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    background:
        radial-gradient(ellipse at 8% 8%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 35%),
        linear-gradient(145deg, #e9eff2 0%, #f5f7f8 52%, #e8eef1 100%);
}

.login-card {
    flex: 0 1 460px;
    width: 100%;
    max-width: 460px;
    min-width: 0;
    margin: 0;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid #dce5eb;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 24px 64px rgba(25, 47, 61, 0.14);
    color: var(--text);
}

.login-card__intro {
    margin-bottom: 1.65rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 780;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.login-lead {
    margin: 0.75rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 1.05rem;
}

.login-form .row {
    margin: 0;
    color: var(--muted);
}

.login-button {
    width: 100%;
    min-height: 3rem;
    margin-top: 0.2rem;
}

.login-hint {
    margin: 1.35rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #e8eef2;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.login-footer {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.site-footer {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0 0 1.5rem;
    color: var(--muted);
    text-align: right;
}

.site-footer a,
.login-footer a {
    text-underline-offset: 0.2em;
}

.impressum-page {
    width: min(760px, calc(100% - 2rem));
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2.5rem) 0;
}

.impressum-card {
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid rgba(217, 209, 195, 0.9);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.impressum-card h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.impressum-card h2 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.15rem;
}

.impressum-card p,
.impressum-card address {
    margin: 0;
    line-height: 1.7;
}

.impressum-card address {
    font-style: normal;
}

.impressum-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--muted);
}

@media (min-width: 761px) {
    .topbar {
        position: sticky;
        top: 0;
    }
}

@media (max-width: 760px) {
    .topbar {
        position: relative;
        padding: 0.8rem 0.65rem 0;
    }

    .topbar__inner,
    .content {
        width: min(100%, calc(100% - 1rem));
    }

    .topbar__inner {
        gap: 0.7rem;
    }

    .topbar__masthead {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }

    .masthead-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        width: 100%;
    }

    .user-chip {
        max-width: min(14rem, 45vw);
    }

    .primary-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .nav-group {
        width: 100%;
        gap: 0.1rem;
    }

    .nav-group--admin {
        padding: 0;
        border: 0;
        border-top: 1px solid #edf1f4;
    }

    .nav-link {
        min-height: 2.55rem;
        padding: 0.45rem 0.62rem;
        font-size: 0.86rem;
    }

    .content {
        padding: 1.1rem 0 2rem;
    }

    .hero {
        margin-bottom: 0.85rem;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar > .button,
    .toolbar > .button-secondary {
        align-self: flex-start;
    }

    .panel + .panel {
        margin-top: 0.85rem;
    }

    .article-table tr {
        margin: 0.6rem;
        padding: 0.75rem 0.85rem;
        border: 1px solid var(--line);
        border-radius: 0.75rem;
        background: #fff;
    }

    .article-table tr:last-child {
        border-bottom: 1px solid var(--line);
    }

    .article-table td {
        padding: 0.48rem 0;
    }

    .article-table td::before {
        margin-bottom: 0.12rem;
        color: #647584;
        font-size: 0.7rem;
        font-weight: 760;
        letter-spacing: 0.045em;
    }

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

    .detail-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
    }

    .detail-list dd {
        margin-bottom: 0.65rem;
    }

    .actions > * {
        max-width: 100%;
    }

    .export-list li {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .brand__subtitle {
        font-size: 0.62rem;
    }

    .masthead-actions .button {
        flex: 1 1 auto;
    }

    .button,
    .button-secondary,
    .button-danger,
    .link-button {
        padding-right: 0.78rem;
        padding-left: 0.78rem;
    }

    .login-card {
        border-radius: 1rem;
    }
}

.has-first-run-dialog {
    overflow: hidden;
}

.setup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: clamp(0.75rem, 3vw, 1.5rem);
    background: rgba(20, 28, 35, 0.62);
}

.setup-dialog {
    width: min(100%, 36rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.setup-dialog__header {
    margin-bottom: 1.25rem;
}

.setup-dialog__eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-strong);
    font-family: Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.setup-dialog__fields {
    display: grid;
    gap: 1rem;
}

.setup-dialog input[type="color"] {
    width: 5rem;
    height: 2.75rem;
    padding: 0.2rem;
}

.setup-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.setup-dialog__actions form {
    display: flex;
}

.setup-dialog__actions button {
    min-height: 2.9rem;
}

@media (max-width: 520px) {
    .setup-overlay {
        align-items: end;
        padding: 0;
    }

    .setup-dialog {
        width: 100%;
        max-height: 100dvh;
        padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 1.4rem 1.4rem 0 0;
    }

    .setup-dialog__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .setup-dialog__actions form,
    .setup-dialog__actions button {
        width: 100%;
    }
}

.nav-count {
    display: inline-flex;
    min-width: 1.5rem;
    min-height: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font: 700 0.75rem/1 Arial, sans-serif;
}

.feedback-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #e8c76b;
    border-radius: 0.9rem;
    background: #fff4d6;
    color: #604c18;
}

.feedback-alert p {
    margin: 0;
    font-weight: 700;
}

.feedback-list {
    display: grid;
    gap: 1rem;
}

.feedback-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.feedback-card__author,
.feedback-card__date {
    margin: 0;
}

.feedback-card__author {
    font-size: 1.05rem;
}

.feedback-card__date {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.feedback-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 1.8rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    font: 700 0.78rem/1.2 Arial, sans-serif;
}

.feedback-status--new {
    border-color: #e8c76b;
    background: #fff4d6;
    color: #604c18;
}

.feedback-status--completed {
    border-color: #a8d4c5;
    background: #e8f5ef;
    color: #145a42;
}

.feedback-card__message {
    margin: 1.25rem 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.feedback-status-form {
    display: grid;
    grid-template-columns: minmax(12rem, 22rem) auto;
    align-items: end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.feedback-status-form button {
    min-height: 2.8rem;
}

@media (max-width: 600px) {
    .feedback-alert,
    .feedback-card__header {
        align-items: stretch;
        flex-direction: column;
    }

    .feedback-alert .button-secondary {
        width: 100%;
    }

    .feedback-status-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .feedback-status-form button {
        width: 100%;
    }
}
